Intelligent electric energy representation numerical simulation method based on monte carlo simulation method
By using Monte Carlo simulation to perform state labeling and pattern decomposition on historical data of smart meters, separating steady-state and transient patterns, constructing an independent probability distribution model, and driving the operation of a digital twin model, the problem of deviation between simulation data and real electricity consumption patterns in existing technologies is solved, and high-fidelity simulation results and algorithm verification are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU WOYI DIGITAL TECH CO LTD
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-23
AI Technical Summary
Existing smart meter simulation methods cannot accurately reflect the continuity of steady-state processes and the suddenness of transient processes, resulting in discrepancies between simulation data and actual electricity consumption patterns in terms of statistical regularity. This makes it impossible to effectively verify the dynamic response of the meter's internal algorithm and the specific links that generate metering errors.
Based on the Monte Carlo simulation method, the historical data of smart energy meters are state-labeled and decomposed to separate steady-state mode components and transient mode components. Independent probability distribution models are constructed for each component, and random scenario parameter sequences are generated to drive the operation of the digital twin model. Virtual energy metering pulse flows are recorded, accumulated, and segmented into time periods to form multiple time-granularity simulated reading data blocks for statistical feature extraction and cross-validation.
It achieves a refined description of the inherent laws of electricity meter operation, and the generated random scenario parameters can more accurately reflect the real statistical laws. The simulation results are observable and verifiable, and can analyze the response characteristics of the electricity meter in transient processes and evaluate the performance of metering algorithms.
Smart Images

Figure CN121859592B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power metering simulation technology, specifically to a method for simulating intelligent power meter readings based on Monte Carlo simulation. Background Technology
[0002] In simulation testing of smart meters, Monte Carlo simulation based on historical data is a common method. Existing technologies typically perform overall statistical analysis on historical metering data to construct a single probabilistic model to generate random electricity consumption sequences. This method mixes data from different physical mechanisms. This results in the generated random sequences failing to accurately reflect the fundamental differences between the persistence of steady-state processes and the suddenness of transient processes, causing statistical discrepancies between the simulation data and real electricity consumption patterns, thus limiting the model's fidelity.
[0003] Another type of technology combines digital twin models for simulation, but its inputs are mostly preset or simplified operating parameters, and the output is directly the accumulated electricity value. This method bypasses the core physical process inside a real electricity meter that converts electricity into standard pulses for measurement. The simulation process essentially becomes a mathematical accumulator, failing to reproduce the complete metering chain from sensing electricity to generating pulses. This makes the simulation results difficult to use to verify the dynamic response of the meter's internal algorithm, and also makes it impossible to conduct in-depth analysis of the specific links that cause metering errors.
[0004] A method is needed to effectively distinguish and model patterns from historical data separately to address the distortion caused by mixed modeling. Simultaneously, a simulation framework is required to simulate the underlying pulse generation mechanism of electricity meters to resolve the disconnect between the simulation process and the physical process, thereby improving the credibility and application value of simulation data in algorithm verification and state assessment. Summary of the Invention
[0005] The purpose of this invention is to provide a method for simulating intelligent energy meter readings based on Monte Carlo simulation, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, this invention provides a method for simulating intelligent energy meter readings based on Monte Carlo simulation, the method comprising:
[0007] Extract raw metering data from the historical database of the target smart energy meter;
[0008] The original measurement segments are marked with status tags to form a set of segments with operating condition labels;
[0009] The set of segments with operating condition labels is subjected to mode decomposition to separate steady-state mode components and transient mode components.
[0010] Independent probability distribution models are constructed for the steady-state mode components and the transient mode components, respectively.
[0011] Based on the independent probability distribution model, a sequence of random scene parameters is generated for Monte Carlo simulation;
[0012] The digital twin model of the target smart energy meter is driven to run using the random scene parameter sequence;
[0013] Record the virtual power metering pulse flow generated during the operation of the digital twin model;
[0014] The virtual energy metering pulse stream is accumulated and segmented into time periods to form multiple analog reading data blocks with different time granularities;
[0015] Statistical feature extraction and cross-validation are performed on the multiple time-granularity analog reading data blocks;
[0016] Based on the cross-validation results, the final simulation reading sequence of the target smart energy meter is output.
[0017] Preferably, the step of marking the original measurement segments with status tags to form a set of segments with operating condition labels includes:
[0018] Read the environmental monitoring log corresponding to the timestamp of the original measurement segment;
[0019] The temperature, humidity, and electromagnetic field strength data were extracted from the environmental monitoring logs.
[0020] The temperature, humidity, and electromagnetic field strength data are compared point by point with the preset operating condition threshold range;
[0021] Based on the comparison results, a working condition label code is assigned to each sampling point of the original metering segment;
[0022] Summarize all sampling points carrying operating condition label codes and reassemble the segments according to time continuity;
[0023] During the fragment recombination process, interpolation smoothing is performed on the boundary points where the tag code changes;
[0024] After processing, a structured collection of fragments with working condition labels is generated.
[0025] Preferably, the step of performing mode decomposition on the set of segments with operating condition labels to separate steady-state mode components and transient mode components includes:
[0026] Based on the operating condition labels, the set of segments with operating condition labels is classified and clustered;
[0027] Within each segment, the mean, variance, and higher-order moment characteristics of its econometric data are calculated.
[0028] The local trends and periodic fluctuations of the measurement data were analyzed using a sliding time window.
[0029] The components exhibiting long-term stable statistical characteristics are identified as steady-state mode components;
[0030] The components exhibiting short-term abrupt changes, transient shocks, or periodic oscillations are identified as transient mode components;
[0031] A digital filter is used to separate the two identified components.
[0032] Output the separated steady-state mode component data stream and transient mode component data stream respectively.
[0033] Preferably, constructing independent probability distribution models for the steady-state mode components and transient mode components respectively includes:
[0034] For the steady-state mode components, the kernel density estimation method is used to fit the empirical probability density function of their metric values;
[0035] For the transient mode components, analyze the joint statistical laws of their occurrence time interval, duration, and amplitude changes;
[0036] Establish a Poisson process or update process model for the time interval of the transient mode components;
[0037] An asymmetric probability distribution model is established for the amplitude variation of the transient mode components;
[0038] The time interval model is coupled with the amplitude change model to construct a composite probability model for transient events;
[0039] Generate a set of probability distribution parameters describing the steady-state mode component and a set of probability distribution parameters describing the transient mode component, respectively.
[0040] Preferably, generating a sequence of random scene parameters for Monte Carlo simulation based on the independent probability distribution model includes:
[0041] Set the total number of rounds for the Monte Carlo simulation and the duration of each round;
[0042] For each round of simulation, random sampling is performed from the set of probability distribution parameters describing the steady-state mode components to generate the base load level parameters;
[0043] For the same round of simulation, a list of transient events that may occur within the duration of a single simulation is randomly generated based on the probability distribution parameter set describing the transient mode components.
[0044] The transient event list includes the trigger time, duration, and intensity parameters of each transient event;
[0045] Align and overlay the basic load level parameters with the transient event list on the time axis;
[0046] Synthesize a complete time-varying sequence of random scene parameters;
[0047] The process is repeated until multiple random scene parameter sequences are generated, equal to the total number of rounds.
[0048] Preferably, the step of using the random scenario parameter sequence to drive the digital twin model of the target smart energy meter to run includes:
[0049] Obtain the physical structure parameters and metering algorithm logic of the target smart energy meter;
[0050] Based on the physical structure parameters and metering algorithm logic, a high-fidelity digital twin model of the electricity meter is constructed.
[0051] The random scenario parameter sequence is used as input and fed into the virtual signal input terminal of the digital twin model of the electricity meter;
[0052] The digital twin model of the electricity meter converts the input parameters into virtual voltage and current waveforms based on its internal logic.
[0053] The digital twin model of the electricity meter calls its virtual metering chip to perform real-time integration calculations on the virtual voltage and current waveforms;
[0054] Throughout the simulation, the digital twin model of the electricity meter is continuously run, and the status of each virtual component within it is monitored.
[0055] Preferably, the recording of the virtual energy metering pulse flow generated during the operation of the digital twin model includes:
[0056] Monitor the pulse output pin of the virtual metering chip in the digital twin model of the energy meter;
[0057] The level changes of the pulse output pin are recorded at a preset high-frequency sampling rate;
[0058] Each transition from low to high level is recorded as a virtual energy metering pulse;
[0059] Each of the virtual energy metering pulses is given a precise analog timestamp;
[0060] Arrange all timestamped virtual energy metering pulses into a pulse event stream according to the simulated time sequence;
[0061] The pulse event stream is stored in a structured format to form a virtual energy metering pulse stream.
[0062] Preferably, the step of accumulating and segmenting the virtual energy metering pulse stream to form multiple analog reading data blocks with different time granularities includes:
[0063] Set multiple different statistical time granularities, including minute granularity, hourly granularity, and daily granularity;
[0064] Starting from the beginning of the virtual energy metering pulse stream, the number of pulses is converted into energy value according to the pulse equivalent;
[0065] For minute-level granularity, the continuously converted energy values are accumulated in a fixed time window to form minute-level energy consumption data blocks;
[0066] For hourly granularity, consecutive minute-level electricity consumption data blocks are accumulated twice to form hourly-level electricity consumption data blocks;
[0067] For daily granularity, consecutive hourly electricity consumption data blocks are accumulated three times to form a daily electricity consumption data block;
[0068] Add a corresponding simulated time period identifier to each block of electricity consumption data at each granularity;
[0069] All power consumption data blocks at all granularities are organized and stored in chronological order and according to granularity level.
[0070] Preferably, the step of performing statistical feature extraction and cross-validation on the multiple time-granularity analog reading data blocks includes:
[0071] For each time granularity of the simulated reading data block, calculate its mean, standard deviation, skewness, and kurtosis statistics;
[0072] Compare whether the statistics of electricity consumption data within the same simulated time period at different time granularities satisfy the scale consistency requirement;
[0073] Compare the distribution patterns of the indices during the same simulation period across multiple rounds of Monte Carlo simulations;
[0074] The cumulative sum at the minute level is compared with the corresponding data at the hour level to verify the correctness of the accumulation process;
[0075] Analyze the time series of the simulated reading data block to examine its autocorrelation and stationarity;
[0076] A cross-validation report is generated based on the results of all statistical feature extraction and comparison.
[0077] Preferably, the step of outputting the final simulation reading sequence of the target smart energy meter based on the cross-validation results includes:
[0078] Read the consistency evaluation conclusion from the cross-validation report;
[0079] If the consistency evaluation conclusion is passed, then data of a specified granularity is selected from multiple time-granularity analog reading data blocks as the baseline output;
[0080] If the consistency evaluation conclusion fails, then identify the main time granularity and simulation period that caused the inconsistency;
[0081] The simulation process for the main time granularity and simulation period is adjusted and re-simulated.
[0082] Repeat the statistical feature extraction and cross-validation steps until simulated data that passes the consistency evaluation are obtained;
[0083] The final simulated readings of the target smart energy meter are arranged in chronological order and encapsulated into a final simulated reading sequence.
[0084] Compared with the prior art, the beneficial effects of the present invention are:
[0085] By decomposing the original metering segments into steady-state and transient modes, and constructing independent probability distribution models for the separated steady-state and transient mode components, a refined description of the intrinsic laws governing the operation of electricity meters is achieved. This approach changes the traditional modeling method of treating historical data as a single population, decoupling the stable operating state from the physical source of data generation. Separate modeling allows the generated random scenario parameters to more accurately reflect the real statistical laws under the two different modes. The simulation driven by this approach has input random sequences that more closely resemble real electricity consumption scenarios in terms of statistical distribution, temporal correlation, and event sequence structure, improving the accuracy and structural realism of the simulated data source.
[0086] A sequence of random scenario parameters generated based on an independent probability model is used to drive the operation of a digital twin model of the target smart meter. The readings are accumulated by recording the virtual energy metering pulse stream generated by the model. The randomness of Monte Carlo simulation is reflected in the input driving of the high-fidelity twin model, rather than directly manipulating the output. The entire physical and information processing chain, from inputting electricity scenario parameters to processing the meter's internal algorithm and ultimately generating metering pulses, is fully reproduced. The generated virtual pulse stream is the direct raw output of the simulation process, making the simulation itself observable and verifiable. The underlying logic of the reading data block obtained from pulse accumulation is completely consistent with that of a real meter. Therefore, the simulation results not only provide the final readings but can also be used to analyze the meter's response characteristics during transient processes and evaluate the performance of the metering algorithm under different pulse densities, providing a real data foundation for in-depth verification. Attached Figure Description
[0087] Figure 1 This is a schematic diagram illustrating the working principle of the intelligent energy meter simulation method based on Monte Carlo simulation described in this invention.
[0088] Figure 2 Flowchart for generating status markers and operating condition labels;
[0089] Figure 3 A flowchart for constructing a probability distribution model;
[0090] Figure 4 A trend chart showing the number of pulses per minute and the 5-minute rolling average;
[0091] Figure 5 A comparison chart of the probability density distribution of hourly electricity consumption in multiple rounds in Monte Carlo. Detailed Implementation
[0092] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0093] Please see Figure 1This invention provides a simulation method for smart energy meter readings based on Monte Carlo simulation. The method includes: extracting original metering segments from the historical database of the target smart energy meter; marking these original metering segments with state labels to form a set of segments with operating condition tags; performing mode decomposition on the set of segments with operating condition tags to separate steady-state mode components and transient mode components; constructing independent probability distribution models for the steady-state mode components and transient mode components respectively; generating a random scenario parameter sequence for Monte Carlo simulation based on these independent probability distribution models; using the random scenario parameter sequence to drive the operation of a digital twin model of the target smart energy meter; recording the virtual energy metering pulse stream generated during the operation of the digital twin model; accumulating and segmenting the virtual energy metering pulse stream into time periods to form multiple time-granularity simulated reading data blocks; performing statistical feature extraction and cross-validation on these multiple time-granularity simulated reading data blocks; and outputting the final simulated reading sequence of the target smart energy meter based on the cross-validation results.
[0094] In one embodiment of the present invention, see [reference] Figure 2 The environmental monitoring logs corresponding to the timestamps of the original measurement segments are read. Temperature, humidity, and electromagnetic field strength data are parsed from the logs. These data are compared point-by-point with preset operating condition threshold ranges. Based on the comparison results, an operating condition label code is assigned to each sampling point of the original measurement segment. All sampling points carrying operating condition label codes are aggregated, and the segments are reassembled according to temporal continuity. During the segment reassembly process, interpolation smoothing is performed on boundary points where the label codes change. After processing, a structured set of segments with operating condition labels is generated. The set of segments with operating condition labels is classified and clustered according to the operating condition labels. Within each segment category, the mean, variance, and higher-order moment characteristics of the measurement data are calculated. A sliding time window is used to analyze the local trend and fluctuation periodicity of the measurement data. The parts exhibiting long-term stable statistical characteristics are identified as steady-state mode components, and the parts exhibiting short-term abrupt changes, transient shocks, or periodic oscillations are identified as transient mode components. A digital filter is used to separate the two identified components, and the separated steady-state mode component data stream and transient mode component data stream are output separately.
[0095] In practice, the environmental monitoring logs corresponding to the timestamps of the original measurement segments are read, and temperature, humidity, and electromagnetic field strength data are parsed from the environmental monitoring logs. The temperature, humidity, and electromagnetic field strength data are compared point by point with the preset operating condition threshold range. Based on the comparison results, an operating condition label code is assigned to each sampling point of the original measurement segment. All sampling points carrying operating condition label codes are summarized and reassembled according to time continuity. During the segment reassembly process, the boundary points where the label codes change are interpolated and smoothed. After the interpolation and smoothing process is completed, a structured set of segments with operating condition labels is generated. In some embodiments, the set of segments with operating condition labels is classified and clustered according to the operating condition labels. Within each segment, the mean, variance, and higher-order moment characteristics of the measurement data are calculated. A sliding time window is used to analyze the local trend and fluctuation periodicity of the measurement data. The part exhibiting long-term stable statistical characteristics is identified as a steady-state mode component, and the part exhibiting short-term mutations, transient shocks, or periodic oscillations is identified as a transient mode component. A digital filter is used to perform signal separation operation on the identified steady-state mode component and transient mode component. After the signal separation operation, the separated steady-state mode component data stream and the separated transient mode component data stream are output respectively.
[0096] Optionally, the skewness index can be calculated using the following formula when calculating higher-order moment characteristics:
[0097] ;
[0098] in: Indicates skewness, Represents a sequence of measurement data. Represents the mean of a series of measurement data. The standard deviation of a measurement data series This represents the expected operator. It can be understood that the selection of a digital filter depends on the frequency characteristics of the steady-state and transient mode components, and the parameters of the digital filter are adjusted according to the operating condition label classification.
[0099] In specific implementation, the interpolation smoothing process employs a linear interpolation method. This method inserts transitional label codes between adjacent sampling points where the label code changes. These transitional label codes ensure the continuity of fragment reconstruction. The operating condition label codes include normal operating condition codes, high-temperature operating condition codes, high-humidity operating condition codes, and strong electromagnetic interference operating condition codes, each corresponding to a different combination of threshold ranges. In some embodiments, the width of the sliding time window is determined based on the sampling frequency of the measurement data, and the moving step size of the sliding time window is set to one sampling interval. Local trends are characterized by the slope of the linear fit of the measurement data within the sliding time window, and the periodicity of fluctuations is obtained through autocorrelation function analysis of the measurement data within the sliding time window.
[0100] Optionally, a finite impulse response (FIR) filter is used as the digital filter. The cutoff frequency of the FIR filter is set based on the spectral analysis results of the steady-state mode components. The steady-state mode component data stream and the transient mode component data stream are stored in a time series format, which includes a timestamp field and a measurement value field. It can be understood that the set of segments with operating condition labels is stored in a database table, which includes a segment identifier field, a start time field, an end time field, and an operating condition label code sequence field. During the mode decomposition process, the time length of the steady-state mode component data stream and the transient mode component data stream remains consistent with the original measurement segments.
[0101] In one embodiment of the present invention, see [reference] Figure 3 For steady-state mode components, the kernel density estimation method is used to fit the empirical probability density function of their metric values. For transient mode components, the joint statistical law of their occurrence time interval, duration and amplitude changes is analyzed. A Poisson process or update process model is established for the time interval of transient mode components, and an asymmetric probability distribution model is established for the amplitude changes of transient mode components. The time interval model and the amplitude change model are coupled to construct a composite probability model of transient events, and probability distribution parameter sets describing steady-state mode components and transient mode components are generated respectively. The total number of Monte Carlo simulation rounds and the duration of each round are set. For each round, random sampling is performed from the probability distribution parameter set describing the steady-state mode components to generate the base load level parameters. For the same round, a list of transient events occurring within the simulation duration is randomly generated based on the probability distribution parameter set describing the transient mode components. This list of transient events includes the trigger time, duration, and intensity parameters of each transient event. The base load level parameters and the list of transient events are aligned and superimposed on the time axis to synthesize a complete, time-varying sequence of random scenario parameters for a round of simulation. This process is repeated until multiple random scenario parameter sequences equal to the total number of rounds are generated.
[0102] In practical implementation, for steady-state mode components, the kernel density estimation method is used to fit the empirical probability density function of the steady-state mode component's metric values. The kernel density estimation method uses a Gaussian kernel function, and the bandwidth of the kernel density estimation is determined by the Silverman rule. The sample set of the steady-state mode component's metric values is denoted as the steady-state sample set, and the empirical probability density function describes the probability density of the steady-state mode component's metric values near any point. For transient mode components, the joint statistical laws of the time interval, duration, and amplitude variation of the transient mode component are analyzed. The distribution laws of the time interval, duration, and amplitude variation are extracted separately. A Poisson process model or an update process model is established for the time interval of the transient mode component. The arrival rate parameter of the Poisson process model is obtained through maximum likelihood estimation, and the interval distribution of the update process model is fitted by an empirical distribution. An asymmetric probability distribution model is established for the amplitude variation of the transient mode component. The asymmetric probability distribution model adopts a generalized extreme value distribution or a log-normal distribution, and the parameters of the distribution model are calculated using the moment estimation method. In practical implementation, the moment estimation method involves calculating sample moment statistics, such as sample mean and sample variance, based on sample data of amplitude changes in transient mode components. These sample moments are then matched with the theoretical moments of the selected asymmetric probability distribution model to estimate the distribution parameters. For generalized extreme value distributions, parameter estimation involves the derivation of location, scale, and shape parameters; for log-normal distributions, it involves the derivation of mean and log-scale parameters. The moment estimation method ensures that the distribution model parameters accurately reflect the actual statistical laws governing the amplitude changes of transient mode components and are effectively coupled with the time interval and duration models of transient events. The time interval model is coupled with the amplitude change model to construct a composite probability model of the transient event. This composite probability model defines the random arrival characteristics of the transient event in the time dimension and its random distribution characteristics in the intensity dimension, generating probability distribution parameter sets describing the steady-state mode components and the transient mode components, respectively.
[0103] In some embodiments, the total number of Monte Carlo simulations and the duration of each simulation are set. The total number of simulations is set to 10,000, and the duration of each simulation is set to 24 hours. For each simulation, base load level parameters are generated by randomly sampling from the probability distribution parameter set describing the steady-state mode components. The base load level parameters are represented in time series form with a step size of 1 minute. For the same simulation, a list of transient events occurring within the simulation duration is randomly generated based on the probability distribution parameter set describing the transient mode components. The random generation process first samples the event arrival time sequence from the time interval model, then samples the intensity parameter of each event from the amplitude change model, and samples the duration of each event from the duration distribution. The transient event list includes the trigger time, duration, and intensity parameter of each transient event.
[0104] Optionally, the empirical probability density function fit for the kernel density estimate is expressed using the following formula:
[0105] ;
[0106] in: This represents the estimated probability density at point x. This represents the number of samples in the steady-state sample set. The bandwidth parameter represents the kernel density estimation. Represents the standard Gaussian kernel function. This represents the value of the i-th sample in the steady-state sample set. This represents the independent variable of the probability density function. It can be understood that the baseline load level parameters and the transient event list are aligned and superimposed on the time axis. The alignment operation uses the same simulation time axis as a reference, while the superposition operation is performed on the time series of the baseline load level parameters. At the trigger time of the transient event, the values of the baseline load level parameters are corrected according to the intensity and duration parameters, synthesizing a complete, time-varying sequence of random scenario parameters for one round of simulation. This random scenario parameter sequence is a comprehensive parameter sequence containing the effects of steady-state baseline fluctuations and discrete transient events. This process is repeated until multiple random scenario parameter sequences equal to the total number of rounds are generated.
[0107] In some embodiments, the set of probability distribution parameters describing the transient mode components includes the Poisson process arrival rate parameter of the time interval, the location parameter of the generalized extreme value distribution of amplitude variation, the scale parameter of the generalized extreme value distribution of amplitude variation, the shape parameter of the generalized extreme value distribution of amplitude variation, and the gamma distribution shape parameter and gamma distribution scale parameter of the duration. It can be understood that the generation of the base load level parameters involves inverse transformation sampling of the empirical probability density function of the steady-state mode components. Inverse transformation sampling ensures that the generated base load level parameter sequence is consistent with the statistical characteristics of the steady-state mode components. During the generation of the transient event list, the sampling of event trigger times uses a time interval recursion method based on an exponential distribution, and the sampling of intensity parameters uses the inverse cumulative distribution function method of the generalized extreme value distribution.
[0108] In one embodiment of the present invention, the physical structure parameters and metering algorithm logic of the target smart energy meter are acquired, and a high-fidelity digital twin model of the energy meter is constructed based on the physical structure parameters and metering algorithm logic. A random scene parameter sequence is fed into the virtual signal input terminal of the digital twin model of the energy meter as input. The digital twin model of the energy meter converts the input parameters into virtual voltage and current waveforms according to its internal logic. The digital twin model of the energy meter calls its virtual metering chip to perform real-time integration calculation on the virtual voltage and current waveforms. The digital twin model of the energy meter runs continuously throughout the simulation time and monitors the status of each virtual component inside it.
[0109] In practical implementation, the physical structure parameters and metering algorithm logic of the target smart energy meter are acquired. The physical structure parameters include the voltage divider ratio parameters of the voltage sampling circuit, the transformer ratio parameters of the current sampling circuit, the bit depth parameters of the analog-to-digital converter of the metering chip, the reference voltage value parameters of the metering chip, and the clock frequency parameters of the metering chip. The metering algorithm logic includes the active power calculation function, the reactive power calculation function, the energy integration algorithm, and the pulse output constant formula. A high-fidelity digital twin model of the energy meter is constructed based on the physical structure parameters and metering algorithm logic. The digital twin model includes a virtual signal sampling module, a virtual metering calculation module, and a virtual pulse generation module. The virtual signal sampling module simulates the signal transformation process of the voltage and current sampling circuits. The virtual metering calculation module accurately reproduces the digital signal processing flow and energy accumulation logic inside the metering chip. The virtual pulse generation module generates the corresponding pulse signal according to the pulse output constant formula based on the energy accumulation result. A random scenario parameter sequence is fed into the virtual signal input terminal of the digital twin model of the energy meter. This virtual signal input terminal corresponds to the analog signal injection point of the virtual signal sampling module. Each data point in the random scenario parameter sequence represents the load power value at a given simulation moment. The digital twin model of the energy meter converts the input parameters into virtual voltage and current waveforms based on its internal logic. This conversion process utilizes the voltage divider ratio and transformer ratio parameters in the physical structure parameters to inversely convert the load power value into virtual instantaneous voltage and current sample values. These virtual instantaneous voltage and current sample values constitute a discrete waveform sequence that varies over time. The digital twin model of the energy meter calls its virtual metering chip to perform real-time integration calculations on the virtual voltage and current waveforms. This real-time integration calculation is executed in the virtual metering calculation module, following the active power calculation function and energy integration algorithm in the metering algorithm logic.
[0110] In some embodiments, the high-fidelity digital twin model of the energy meter is implemented through software programming. The software programming employs an object-oriented modeling approach, encapsulating the voltage sampling circuit, current sampling circuit, metering chip, and pulse output circuit into classes with specific attributes and methods. The virtual signal sampling module receives instantaneous power values in watts at its analog signal injection point. Based on the voltage division ratio parameter and the transformer ratio parameter, the virtual signal sampling module decomposes the instantaneous power value into normalized virtual voltage sampling arrays and virtual current sampling arrays. The active power calculation function of the virtual metering calculation module is implemented based on the discrete point multiplication and summation of the virtual voltage sampling arrays and virtual current sampling arrays. The energy integration algorithm accumulates the calculated active power sequence. The energy meter digital twin model runs continuously throughout the simulation duration, monitoring the status of each virtual component within the model. The monitored status includes the real-time cumulative energy value of the virtual metering calculation module, the pulse count of the virtual pulse generation module, and whether the input / output range of the virtual signal sampling module exceeds its limits.
[0111] Optionally, the active power calculation of the virtual metering calculation module uses the following formula:
[0112] ;
[0113] in: This represents the average active power during the k-th calculation period. It is a dimension conversion coefficient. This represents the normalized virtual voltage sample value at the m-th point within the k-th calculation period. This represents the normalized virtual current sample value at the m-th point within the k-th calculation period. This represents the total number of sampling points within a calculation period.
[0114] In some embodiments, the status of each virtual component within the digital twin model of the electricity meter is monitored by a separate monitoring thread. This thread periodically reads key variables from each virtual module and records them to a log file to ensure the transparency and traceability of the simulation process. It can be understood that the virtual voltage and current waveforms are stored and transmitted in memory as discrete arrays, with each simulation step corresponding to an element in the array. The step size of the real-time integration operation is consistent with the time resolution of the random scenario parameter sequence.
[0115] In one embodiment of the present invention, the pulse output pin of the virtual metering chip in the digital twin model of the energy meter is monitored, and the level change of the pulse output pin is recorded at a preset high-frequency sampling rate. Each transition from low to high level is recorded as a virtual energy metering pulse. Each virtual energy metering pulse is given a precise analog timestamp. All the timestamped virtual energy metering pulses are arranged into a pulse event stream according to the analog time sequence. The pulse event stream is stored in a structured format to form a virtual energy metering pulse stream. Multiple different statistical time granularities are set, including minute, hour, and day granularities. Starting from the beginning of the virtual energy metering pulse stream, the number of pulses is converted into energy values according to the pulse equivalent. For minute granularity, the continuously converted energy values are accumulated in a fixed duration window to form minute-level energy consumption data blocks. For hourly granularity, consecutive minute-level energy consumption data blocks are accumulated twice to form hourly energy consumption data blocks. For daily granularity, consecutive hourly energy consumption data blocks are accumulated three times to form daily energy consumption data blocks. Each energy consumption data block of each granularity is attached with a corresponding simulated time period identifier. All energy consumption data blocks of all granularities are organized and stored in chronological order and granularity hierarchy.
[0116] In practical implementation, the pulse output pin of the virtual metering chip in the digital twin model of the energy meter is monitored, and the level changes of the pulse output pin are recorded at a preset high-frequency sampling rate. Each low-to-high level transition is recorded as a virtual energy metering pulse. Each virtual energy metering pulse is given a precise analog timestamp. All timestamped virtual energy metering pulses are arranged into a pulse event stream according to the analog time sequence. The pulse event stream is stored in a structured format to form a virtual energy metering pulse stream. In some embodiments, the high-frequency sampling rate is set to once every 1 microsecond, the accuracy of the analog timestamp reaches the nanosecond level, and the structured format of the pulse event stream includes a pulse sequence number field, a timestamp field, and a pulse type field. The pulse type field is used to distinguish between active and reactive pulses. Multiple statistical time granularities are defined, including minute, hourly, and daily granularities. Starting from the beginning of the virtual energy metering pulse stream, the number of pulses is converted into energy values according to the pulse equivalent. For the minute granularity, the continuously converted energy values are accumulated using a fixed-duration window to form minute-level energy consumption data blocks. For the hourly granularity, consecutive minute-level energy consumption data blocks are accumulated twice to form hourly energy consumption data blocks. For the daily granularity, consecutive hourly energy consumption data blocks are accumulated three times to form daily energy consumption data blocks. A corresponding simulated time period identifier is attached to each energy consumption data block of each granularity. All energy consumption data blocks of all granularities are organized and stored according to time order and granularity hierarchy. Optionally, the conversion of pulse count into energy value is calculated using the following formula:
[0117] ;
[0118] in: Indicates the cumulative electrical energy value. This indicates the number of virtual energy metering pulses recorded during the statistical period. This represents the pulse equivalent constant. It can be understood that the pulse equivalent constant... The unit is kilowatt-hours per pulse. The simulated time period identifier includes a start timestamp field and an end timestamp field. Minute-level, hourly-level, and daily-level electricity consumption data blocks are stored in a hierarchical index structure, which facilitates fast retrieval by time granularity and time range. See Table 1.
[0119] Table 1: Virtual Energy Metering Pulse Flow and Multi-Granularity Accumulation Table
[0120]
[0121] In practice, the recording process of the virtual energy metering pulse stream is synchronized with the operation of the digital twin model of the energy meter. Each time the digital twin model generates a virtual energy metering pulse, the recording thread captures the pulse and appends a simulated timestamp. The simulated timestamp comes from a simulation clock, and the clock's increment step size is consistent with the time resolution of the random scenario parameter sequence. The pulse event stream is arranged in ascending order of the simulated timestamps, and the storage format is a comma-separated value file, where each line represents a pulse event. In some embodiments, the pulse equivalent constant... The value is 0.001 kWh per pulse, meaning that each virtual energy metering pulse represents 0.001 kWh of energy consumption. The accumulation of minute-level energy consumption data blocks is achieved by multiplying the number of pulses within a one-minute window by the pulse equivalent constant. The accumulation of hourly-level energy consumption data blocks is achieved by summing the energy values of all minute-level energy consumption data blocks within an hourly window. The accumulation of daily-level energy consumption data blocks is achieved by summing the energy values of all hourly-level energy consumption data blocks within a daily window. Optionally, the simulated time period identifier adopts an international standard time format, which includes year, month, day, hour, minute, and second information. Hierarchical organization and storage utilize a database management system. The database management system establishes minute-level, hourly-level, and daily-level granularity tables, which are linked through foreign keys using time period identifiers.
[0122] See Figure 4 This figure presents the minute-level statistical results and smoothing trend of the virtual energy metering pulse flow during the operation of the target smart energy meter digital twin model. The purple curve represents the "minute-level pulse count," reflecting the virtual metering pulse count within each minute window; the orange curve represents the "5-minute rolling average," which smooths short-term fluctuations by averaging the pulse count over five consecutive minute windows. Specifically, the minute-level pulse count exhibits significant transient fluctuations (e.g., some windows have fewer than 60 pulses, while others approach 100), corresponding to transient load impacts during the virtual energy meter's operation. The 5-minute rolling average curve reflects the steady-state change trend of the base load, with a significantly smaller fluctuation amplitude than the original minute-level data, consistent with the statistical characteristics of the steady-state mode component. The time dimension (minute window number) of this figure covers 200 consecutive minute windows, fully demonstrating the "steady-state-transient" composite change pattern of the virtual pulse flow over a longer period, providing an intuitive basis for verifying the statistical characteristics of subsequent multi-granularity reading data blocks.
[0123] In one embodiment of the present invention, the mean, standard deviation, skewness, and kurtosis statistics of the simulated reading data block at each time granularity are calculated. The statistics of electricity consumption data within the same simulated period at different time granularities are compared to see if they meet the scale consistency. The distribution pattern of the reading data in the same simulated period is compared among the results of multiple rounds of Monte Carlo simulation. The cumulative sum at the minute granularity is checked against the corresponding data at the hour granularity to verify the correctness of the accumulation process. The time series of the simulated reading data block is analyzed to test its autocorrelation and stationarity. A cross-validation report is generated based on the results of all statistical feature extraction and comparison. The consistency evaluation conclusion in the cross-validation report is read. If the consistency evaluation conclusion is passed, data of a specified granularity is selected from multiple time-granularity simulated reading data blocks as the benchmark output. If the consistency evaluation conclusion is not passed, the main time granularity and simulation period that caused the inconsistency are located. The simulation process of these main time granularities and simulation periods is adjusted and re-simulated. The statistical feature extraction and cross-validation steps are repeated until simulated reading data that passes the consistency evaluation is obtained. The finally passed simulated reading data of the specified granularity is arranged in chronological order and packaged into the final simulation reading sequence of the target smart energy meter.
[0124] In practice, for each time granularity of the simulated reading data block, the mean, standard deviation, skewness, and kurtosis statistics of the simulated reading data block are calculated. The mean is calculated using the arithmetic mean method, the standard deviation is calculated using the sample standard deviation formula, and the skewness and kurtosis are calculated using the definitions of the third and fourth central moments, respectively. The statistical measures of electricity consumption data within the same simulated period at different time granularities are compared to see if they satisfy scale consistency. The scale consistency test involves comparing whether the hourly sum obtained by accumulating minute-level data is equal to the hourly electricity consumption calculated directly from hourly-level data, and whether the daily sum obtained by accumulating hourly-level data is equal to the daily electricity consumption calculated directly from daily-level data. Among the results of multiple rounds of Monte Carlo simulation, the distribution patterns of the reading data within the same simulated period are compared. Distribution pattern comparison is performed by plotting the probability density curves of electricity consumption in different rounds for the same period, and by calculating the maximum difference between the empirical distribution functions of electricity consumption in different rounds for the same period. The cumulative sums at the minute level are compared with the corresponding data at the hour level to verify the correctness of the accumulation process. This verification process is performed for each hour within the simulation period, calculating the absolute difference between the minute-level cumulative sums and the hour-level direct values. The time series of the simulated indicator data block is analyzed to examine its autocorrelation and stationarity. The autocorrelation test is performed by calculating the autocorrelation coefficients of the time series at different lag orders, and the stationarity test uses the unit root test method. A cross-validation report is generated based on all statistical feature extraction and comparison results. The cross-validation report records the values of each statistic at each time granularity, the conclusions of the scale consistency test, a chart index comparing multiple rounds of distribution patterns, the difference in the cumulative verification results, and the statistical values of the time series test.
[0125] In some embodiments, the consistency evaluation conclusion in the cross-validation report is read. The consistency evaluation conclusion includes a "pass" status and a "fail" status. The "pass" status requires that the errors of all test items are within a preset tolerance range. If the consistency evaluation conclusion is pass, data of a specified granularity is selected as the baseline output from multiple time-granularity simulated reading data blocks. The specified granularity is determined by user-configured parameters and can be minute-level, hourly-level, or daily-level. If the consistency evaluation conclusion is fail, the main time granularity and simulation period causing the inconsistency are located. The location process is achieved by analyzing the error ranking of each test result in the cross-validation report. The time granularity and simulation period involved in the test item with the largest error are determined as the main time granularity and simulation period of inconsistency. The simulation process of the main time granularity and simulation period is adjusted and re-simulated. Parameter adjustment involves adjusting the parameters of the probability distribution model in the Monte Carlo simulation or adjusting the integration step size of the digital twin model. Re-simulation is only performed on the simulation round in which the problem period is located. Repeat the statistical feature extraction and cross-validation steps until simulated reading data that passes the consistency evaluation is obtained. Repeat the process multiple times, generating a new cross-validation report after each iteration. Arrange the finally passed simulated reading data of specified granularity in chronological order and encapsulate it into the final simulation reading sequence of the target smart meter. The encapsulation format is a structured data file containing a timestamp field and reading fields.
[0126] Optionally, the formula for calculating the maximum difference between the empirical distribution functions of different rounds in the distribution pattern comparison is expressed as follows:
[0127] ;
[0128] in: Indicates the maximum difference value. This indicates the amount of electricity consumed. The empirical distribution function representing the simulated readings of cycle a over a specific time period. The empirical distribution function representing the electricity consumption of analog readings for cycle b within the same time period. This represents the total electricity consumption values. Take the maximum value.
[0129] It is understandable that the preset tolerance range of the scale consistency test is dynamically set according to the pulse equivalent constant and the simulation duration, the unit root test method adopts the enhanced Dickey-Fuller test, and the parameter adjustment is based on the sensitivity analysis results of the probability distribution parameter set or digital twin model parameters.
[0130] In some embodiments, the cross-validation report is presented in spreadsheet format, containing multiple worksheets corresponding to different validation items, and includes an automatically generated conclusion summary paragraph. It is understood that the process of locating the main time granularity and simulation period is automated. This automation is achieved by comparing the error values recorded in the cross-validation report with preset thresholds. When an error value exceeds its corresponding threshold, a location marker for the associated time period and granularity of that error is triggered. Resimulation only for the problem round means that Monte Carlo simulations for all rounds do not need to be performed. Resimulation utilizes previously generated, unaffected random scenario parameter sequences and adjusted model parameters to recalculate and simulate specific rounds. The final simulation result sequence is arranged chronologically according to a standard timeline, from the start time of the simulation to the end time. The structured data file can be a comma-separated value file or a database record table, facilitating subsequent reading and use by applications.
[0131] See Figure 5 In the cross-validation phase of the intelligent energy meter simulation based on Monte Carlo simulation, a comparison of the probability density curve distribution patterns of hourly electricity consumption during the same time period in multiple simulation rounds was presented. Specifically, the figure shows the characteristics of the electricity consumption probability density curves in rounds 1 to 5 within the target time period, with hourly electricity consumption as the horizontal axis and probability density as the vertical axis: the curves in each round all form a peak at approximately 48% of the electricity consumption, with the peak probability density of round 3 being significantly higher than that of other rounds, while the peak probability density of round 4 is relatively lower; the distribution patterns of the curves in different rounds differ, reflecting the volatility of the random scenario parameter sequence in the Monte Carlo simulation, while the curves are generally concentrated in the electricity consumption range of 46-51%, reflecting the statistical convergence of the simulation results. This figure, as a visual carrier for comparing the distribution patterns of multiple rounds, can be used to verify the consistency of electricity consumption distribution among different simulation rounds. It is the core chart support for the "multi-round distribution pattern comparison" test item in the cross-validation report, and the degree of difference in the curves can be further quantified and analyzed using the maximum difference value formula of the empirical distribution function.
[0132] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0133] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A simulation method for intelligent energy meter readings based on Monte Carlo simulation, characterized in that, The method includes: Extract raw metering data from the historical database of the target smart energy meter; The original measurement segments are marked with status tags to form a set of segments with operating condition labels; The set of segments with operating condition labels is subjected to mode decomposition to separate steady-state mode components and transient mode components. Independent probability distribution models are constructed for the steady-state mode components and the transient mode components, respectively. Based on the independent probability distribution model, a sequence of random scene parameters is generated for Monte Carlo simulation; The digital twin model of the target smart energy meter is driven to run using the random scene parameter sequence; Record the virtual power metering pulse flow generated during the operation of the digital twin model; The virtual energy metering pulse stream is accumulated and segmented into time periods to form multiple analog reading data blocks with different time granularities; Statistical feature extraction and cross-validation are performed on the multiple time-granularity analog reading data blocks; Based on the cross-validation results, the final simulation reading sequence of the target smart energy meter is output; The step of generating a sequence of random scene parameters for Monte Carlo simulation based on the independent probability distribution model includes: Set the total number of rounds for the Monte Carlo simulation and the duration of each round; For each round of simulation, random sampling is performed from the set of probability distribution parameters describing the steady-state mode components to generate the base load level parameters; For the same round of simulation, a list of transient events that may occur within the duration of a single simulation is randomly generated based on the probability distribution parameter set describing the transient mode components. The transient event list includes the trigger time, duration, and intensity parameters of each transient event; Align and overlay the basic load level parameters with the transient event list on the time axis; Synthesize a complete time-varying sequence of random scene parameters; The process is repeated until multiple random scene parameter sequences are generated, equal to the total number of rounds.
2. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 1, characterized in that, The step of marking the original measurement segments with status tags to form a set of segments with operating condition labels includes: Read the environmental monitoring log corresponding to the timestamp of the original measurement segment; The temperature, humidity, and electromagnetic field strength data were extracted from the environmental monitoring logs. The temperature, humidity, and electromagnetic field strength data are compared point by point with the preset operating condition threshold range; Based on the comparison results, a working condition label code is assigned to each sampling point of the original metering segment; Summarize all sampling points carrying operating condition label codes and reassemble the segments according to time continuity; During the fragment recombination process, interpolation smoothing is performed on the boundary points where the tag code changes; After processing, a structured collection of fragments with working condition labels is generated.
3. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 1, characterized in that, The process of performing mode decomposition on the set of segments labeled with operating conditions to separate steady-state mode components and transient mode components includes: Based on the operating condition labels, the set of segments with operating condition labels is classified and clustered; Within each segment, the mean, variance, and higher-order moment characteristics of its econometric data are calculated. The local trends and periodic fluctuations of the measurement data were analyzed using a sliding time window. The components exhibiting long-term stable statistical characteristics are identified as steady-state mode components; The components exhibiting short-term abrupt changes, transient shocks, or periodic oscillations are identified as transient mode components; A digital filter is used to separate the two identified components. Output the separated steady-state mode component data stream and transient mode component data stream respectively.
4. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 1, characterized in that, The step of constructing independent probability distribution models for the steady-state mode components and transient mode components respectively includes: For the steady-state mode components, the kernel density estimation method is used to fit the empirical probability density function of their metric values; For the transient mode components, analyze the joint statistical laws of their occurrence time interval, duration, and amplitude changes; Establish a Poisson process or update process model for the time interval of the transient mode components; An asymmetric probability distribution model is established for the amplitude variation of the transient mode components; The Poisson process or update process model is coupled with an asymmetric probability distribution model to construct a composite probability model for transient events. Generate a set of probability distribution parameters describing the steady-state mode component and a set of probability distribution parameters describing the transient mode component, respectively.
5. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 1, characterized in that, The process of using the random scenario parameter sequence to drive the digital twin model of the target smart energy meter includes: Obtain the physical structure parameters and metering algorithm logic of the target smart energy meter; Based on the physical structure parameters and metering algorithm logic, a high-fidelity digital twin model of the electricity meter is constructed. The random scenario parameter sequence is used as input and fed into the virtual signal input terminal of the digital twin model of the electricity meter; The digital twin model of the electricity meter converts the input parameters into virtual voltage and current waveforms based on its internal logic. The digital twin model of the electricity meter calls its virtual metering chip to perform real-time integration calculations on the virtual voltage and current waveforms; Throughout the simulation, the digital twin model of the electricity meter is continuously run, and the status of each virtual component within it is monitored.
6. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 1, characterized in that, The recording of the virtual energy metering pulse stream generated during the operation of the digital twin model includes: Monitor the pulse output pin of the virtual metering chip in the digital twin model of the energy meter; The level changes of the pulse output pin are recorded at a preset high-frequency sampling rate; Each transition from low to high level is recorded as a virtual energy metering pulse; Each of the virtual energy metering pulses is given a precise analog timestamp; Arrange all timestamped virtual energy metering pulses into a pulse event stream according to the simulated time sequence; The pulse event stream is stored in a structured format to form a virtual energy metering pulse stream.
7. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 1, characterized in that, The accumulation and time-segmentation of the virtual energy metering pulse stream to form multiple time-granularity analog reading data blocks includes: Set multiple different statistical time granularities, including minute granularity, hourly granularity, and daily granularity; Starting from the beginning of the virtual energy metering pulse stream, the number of pulses is converted into energy value according to the pulse equivalent; For minute-level granularity, the continuously converted energy values are accumulated in a fixed time window to form minute-level energy consumption data blocks; For hourly granularity, consecutive minute-level electricity consumption data blocks are accumulated twice to form hourly-level electricity consumption data blocks; For daily granularity, consecutive hourly electricity consumption data blocks are accumulated three times to form a daily electricity consumption data block; Add a corresponding simulated time period identifier to each block of electricity consumption data at each granularity; All power consumption data blocks at all granularities are organized and stored in chronological order and according to granularity level.
8. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 1, characterized in that, The step of performing statistical feature extraction and cross-validation on the simulated reading data blocks at multiple time granularities includes: For each time granularity of the simulated reading data block, calculate its mean, standard deviation, skewness, and kurtosis statistics; Compare whether the statistics of electricity consumption data within the same simulated time period at different time granularities satisfy the scale consistency requirement; Compare the distribution patterns of the indices during the same simulation period across multiple rounds of Monte Carlo simulations; The cumulative sum at the minute level is compared with the corresponding data at the hour level to verify the correctness of the accumulation process; Analyze the time series of the simulated reading data block to examine its autocorrelation and stationarity; A cross-validation report is generated based on the results of all statistical feature extraction and comparison.
9. The intelligent energy meter simulation method based on Monte Carlo simulation as described in claim 8, characterized in that, The step of outputting the final simulation reading sequence of the target smart energy meter based on the cross-validation results includes: Read the consistency evaluation conclusion from the cross-validation report; If the consistency evaluation conclusion is passed, then data of a specified granularity is selected from multiple time-granularity analog reading data blocks as the baseline output; If the consistency evaluation conclusion fails, then identify the main time granularity and simulation period that caused the inconsistency; The simulation process for the main time granularity and simulation period is adjusted and re-simulated. Repeat the statistical feature extraction and cross-validation steps until simulated data that passes the consistency evaluation are obtained; The final simulated readings of the target smart energy meter are arranged in chronological order and encapsulated into a final simulated reading sequence.