Charging pile data management method and system
By introducing a trusted execution environment and phase correlation technology at the charging pile end, combined with first-order Wasserstein energy reconciliation and a differentiable accounting state machine, the problems of data tampering and multi-source asynchronous data alignment in charging pile data management are solved, realizing the adaptability and verifiability of accounting calculation, and improving the security and reliability of charging pile data management.
Patent Information
- Application Number
- CN202511307637.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-14
- Publication Date
- 2025-12-16
AI Technical Summary
Existing charging pile data management methods lack effective authenticity assurance mechanisms, are susceptible to malicious tampering, struggle to handle timing alignment and loss tolerance errors of multi-source asynchronous data, lack flexibility and transparency in accounting calculations, and fail to guarantee the robustness of energy reconciliation and the verifiability of accounting models.
By employing a trusted execution environment, phase correlation and constrained dynamic time warping, first-order Wasserstein energy reconciliation, differentiable accounting state machine, and multi-dimensional consistency assessment technology, a complete process of trusted data acquisition, time sequence alignment, energy verification, and accounting settlement is achieved. Through methods such as generating session fingerprint identifiers, multi-channel record hashing, timestamp hashing, phase correlation analysis, unified time axis construction, energy sequence integration, and differentiable accounting state machine calibration, the tamper-proof nature of the data and the adaptability and verifiability of the accounting are ensured.
It effectively ensures the authenticity and tamper-proof nature of charging data, improves the accuracy and robustness of energy reconciliation, ensures the transparency and compliance of accounting calculations, realizes a reliable closed loop throughout the entire process from data collection to accounting settlement, and enhances the security and credibility of charging pile data management.
Smart Images

Figure CN121146602A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of charging pile data management technology, and in particular to a charging pile data management method and system. Background Technology
[0002] Currently, with the popularization of electric vehicles and the rapid construction of charging infrastructure, charging piles, as a key interface between the power system and the transportation system, undertake important functions of electricity collection, metering, and settlement. Existing technologies for charging pile data management mainly rely on data collection from devices such as meters, inverters, and communication modules, and calculate and store charging bills through a central system. However, these methods generally suffer from several problems: the data collection process lacks an effective authenticity guarantee mechanism, making it susceptible to malicious tampering, forgery, or replay attacks, leading to disputes over bill calculation and reconciliation results; in practical applications, charging piles often involve asynchronous data from multiple sources, including the meter side, inverter side, and control module side, and existing technologies have limited capabilities in handling time-series alignment and data loss tolerance, resulting in insufficient energy reconciliation accuracy and difficulty in coping with complex operating scenarios; in terms of billing calculation, existing methods mostly rely on fixed rate rules or centralized calculation logic, lacking flexible adaptability and failing to guarantee the transparency and verifiability of the billing model at the regulatory level, posing challenges to user trust and compliance review.
[0003] Existing accounting data is mostly stored in a centralized manner, lacking an off-chain trusted structure and tamper-proof mechanisms, making it difficult to provide traceable evidence in case of disputes. In energy reconciliation, traditional methods are mostly based on simple numerical comparisons, ignoring the dynamic characteristics under complex operating conditions and failing to guarantee robustness. In terms of anomaly detection and session diagnosis, existing systems often rely on manual review or single indicators, lacking the ability to integrate multiple dimensions and conduct intelligent evaluations. Existing charging pile data management methods have shortcomings in ensuring authenticity, the robustness of energy reconciliation, and the learning and verifiability of accounting settlement.
[0004] Therefore, how to provide a charging pile data management method and system is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a charging pile data management method and system. This invention fully utilizes a trusted execution environment, phase correlation and constrained dynamic time warping, first-order Wasserstein energy reconciliation, a differentiable accounting state machine, and multi-dimensional consistency evaluation technology. It details the complete process of achieving trusted data acquisition, time-series alignment, energy verification, and accounting settlement at the charging pile end. This invention effectively ensures the authenticity and tamper-proof nature of charging data, improves the robustness of energy reconciliation under multi-source asynchronous and packet loss conditions, and enables the accounting calculation process to be both adaptively calibrated and verifiable, thus possessing the advantages of high security, high verification accuracy, and strong settlement compliance.
[0006] A charging pile data management method according to an embodiment of the present invention includes: In the trusted execution environment at the charging pile end, a session fingerprint identifier is generated and a sampling jitter plan that only applies to the collection thread is generated. Multi-channel records are collected, and content hash and timestamp hash are generated for each channel record. The content hash and timestamp hash are written into the off-chain Merkle structure and the rate version identifier is recorded. Based on multi-channel recording, phase correlation is used to obtain the main delay window, and time alignment mapping is obtained within the main delay window by constrained dynamic time warping to form a unified time axis and output the alignment residual. Based on the time alignment mapping, the cumulative energy sequence of the meter and the energy sequence obtained by integrating the inverter power sequence are constructed. The first-order Wasserstein energy reconciliation distance is calculated, and the session energy consistency label is generated by combining the alignment residual. Configure time-sharing rules, tiered rules, service fee rules, and capping or minimum guarantee rules according to the unified time axis and rate version identifier. Compile them into a differentiable accounting state machine and calibrate it on historical sessions. In the inference phase, derive a discrete accounting state machine, apply time alignment mapping to multi-channel records to generate an alignment sequence, output the session theoretical bill and accounting state transition records, and calculate the accounting deviation index. The first-order Wasserstein energy reconciliation distance, alignment residual, and accounting deviation index are integrated into a session consistency score according to preset weights. Anomalies are determined based on the quantile threshold of the healthy session distribution, and session diagnosis results are output. Generate a compliance summary that includes a session fingerprint identifier and off-chain Merkel structure, session energy consistency tag, accounting deviation index and accounting state transition record, session consistency score and rate version identifier, perform signing and notarization on the compliance summary, and provide the session results to the operation and maintenance interface and settlement interface.
[0007] Optionally, the step of generating a session fingerprint identifier and generating a sampling jitter plan that only applies to the acquisition thread in the trusted execution environment at the charging pile end includes: In a trusted execution environment, a physically unclonable function is invoked. This physically unclonable function is a hardware characteristic function formed by the unavoidable physical micro-differences in the chip manufacturing process. The input is a challenge, and the output is a unique and unpredictable response. By performing hash and encoding operations on the response sequence, the session fingerprint identifier corresponding to the charging session is obtained. A pseudo-random number seed is derived from the session fingerprint identifier and input into the pseudo-random number generator to generate a time perturbation sequence that satisfies a preset statistical distribution. The time perturbation sequence is mapped to the trigger time of the acquisition thread to form a sampling jitter plan that only applies to the acquisition thread.
[0008] Optionally, the multi-channel recording specifically includes meter sampling channel recording, inverter sampling channel recording, and charging pile internal status channel recording.
[0009] Optionally, the step of generating a content hash and timestamp hash for each channel record, writing it into an off-chain Merkle structure, and recording the rate version identifier includes: Perform a hash operation on the raw data of each channel record to obtain the content hash value used for integrity verification; Perform a hash operation on the sampling timestamp corresponding to the channel record to obtain the timestamp hash value used for sequential consistency verification, and write the content hash value and the timestamp hash value together into the off-chain Merkle structure node; An off-chain Merkel structure is appended with a record of the rate version identifier corresponding to the current session, and an off-chain data integrity certificate is generated based on the root hash.
[0010] Optionally, forming a unified time axis and outputting aligned residuals includes: Using the meter sampling channel record as the time reference channel, the obtained multi-channel records are subjected to integrity verification and timestamp validity check. Missing or duplicate records are removed and the verified dataset is retained. One channel with sampling integrity and time continuity is selected from the multi-channel records as the reference channel, and the remaining channels are defined as non-reference channels. Phase correlation analysis is performed on the reference channel and each non-reference channel. The sampling sequences of the two channels are processed by frequency domain transformation, and the normalized cross-correlation results are calculated in the frequency domain to obtain the coarse delay where the correlation peak is located. The main delay window is determined around the coarse delay. Within the main delay window, constrained dynamic time warping is performed on the reference channel and each non-reference channel. Start and end boundary constraints, time order monotonic constraints, local slope continuity constraints, and diagonal bandwidth constraints are set. The registration path with the minimum cost is searched and the time alignment mapping is obtained. Apply time alignment mapping to each non-reference channel to generate an alignment sequence consistent with the reference channel. Construct a unified timeline using the reference channel timestamps and output the aligned multi-channel records. The alignment residual is calculated based on the aligned multi-channel records. The alignment residual is the set of differences between the mapped time and the original time of each non-reference channel on a unified time axis.
[0011] Optionally, the calculation of the first-order Wassstein energy reconciliation distance and the generation of session energy consistency labels by combining the alignment residuals include: Based on a unified time axis, the meter readings are reconstructed into a cumulative energy sequence of the meter in chronological order, and the inverter power is reconstructed into a cumulative energy sequence of the inverter by numerical integration of the time interval between adjacent time points. The ratio of energy increments in the meter's cumulative energy sequence and the inverter's cumulative energy sequence within each window is calculated using a fixed-length sliding window. The median of the energy increment ratio in each window is used as the proportional correction factor to proportionally correct the inverter's cumulative energy sequence. On a unified time axis, the two cumulative energy sequences are divided into several quantile slices according to equal energy portions. The time position when each quantile slice first reaches the corresponding energy share is recorded to form the meter-side quantile time series and the inverter-side quantile time series. Within a defined main delay window, a bandwidth-limited monotonic match is performed on the meter-side quantile time series and the inverter-side quantile time series. The bandwidth is set by the absolute maximum value of the alignment residuals of the output. The match is only allowed to be sequential and does not cross over, resulting in quantile-level time pairing results. Based on the quantile-level time pairing results, the time offset of each quantile is calculated, and a weighted time displacement vector is formed by accumulating the quantile energy share as the weight. The energy share of the unmatched quantile is accumulated as a gap penalty to obtain the first-order Wasserstein energy reconciliation distance. The first-order Wasserstein energy reconciliation distance and the output alignment residual are used together to determine session energy consistency and generate session energy consistency labels.
[0012] Optionally, the output session theoretical bill and accounting status transition record, and the calculation of accounting deviation indicators, include: Read the rate version identifier and unified timeline, parse the time-sharing rules, tiered rules, service fee rules, and capped or guaranteed rules, generate a rule table arranged by time slices, and complete the consistency verification of effective time, pricing unit and priority. A differentiable accounting state machine is constructed based on the rule table. Time-sharing, tiered, service fee, capped or guaranteed pricing states are defined respectively. Aligned sequences and session events on a unified time axis are used as inputs. Continuous gating is used to represent interval boundaries, thresholds and conditions, and state transition relationships and pricing nodes are established. Using the alignment sequence of historical sessions and the corresponding settlement results as calibration data, the interval boundaries, thresholds, rate coefficients and cost parameters of the differentiable accounting state machine are trained and calibrated. Monotonicity constraints, non-negativity constraints and capping and minimum consistency constraints are set and the rule consistency is solidified. During the inference phase, continuous gating is fixed as discrete thresholds, a discrete accounting state machine is derived, the rate version identifier and rule parameters are frozen, and the inference period accounting execution rule set is solidified for online settlement. Time alignment mapping is applied to multi-channel records to generate alignment sequences. The execution status transition and pricing accumulation of the accounting execution rule set during the inference period are driven by a unified time axis on a time-slice basis. At each time slice, the pricing item identifier, applicable rate parameters and pricing increment for this time slice are output, and the cumulative results form the theoretical bill for the session. At the same time, accounting status transition records are generated. The actual payment amount in the settlement event is extracted from the alignment sequence, and the difference is calculated with the session theory bill to obtain the accounting deviation index. The accounting deviation index and the accounting status transition record are then output together. Within the same time frame, adjudicate conflicts between time-sharing, tiered pricing, service fees, and capped or guaranteed pricing. Based on preset priorities and mutual exclusion relationships, retain only one effective pricing and write the adjudication result into the accounting status transfer record.
[0013] Optionally, the step of fusing the first-order Wasserstein energy reconciliation distance, alignment residual, and accounting deviation index into a session consistency score according to preset weights, and determining anomalies based on the quantile threshold of the healthy session distribution and outputting session diagnostic results includes: The scoring inputs were determined by using the first-order Wasserstein energy reconciliation distance, alignment residual statistics, and accounting deviation index as the three inputs for the session scoring. Based on the health conversation sample database, lower and upper bounds are determined for the three inputs respectively, and normalization is performed in a linear manner from the lower to the upper bound to unify the three inputs to the interval of zero to one. Three non-negative weights are set, and the sum of the three is equal to one. The normalized first-order Wasserstein energy reconciliation distance, alignment residual statistics and accounting deviation index are weighted and summarized according to the weights to obtain the session consistency score. The statistical distribution of the health session consistency score is used to determine the judgment threshold according to the preset quantile, and the judgment threshold is fixed for the session judgment of the corresponding period of the current rate version. When the session consistency score is higher than the decision threshold, an abnormal label is output and a session diagnosis result is generated. When the session consistency score is not higher than the decision threshold, a normal label is output. At the same time, the session consistency score, the three input quantities and their corresponding weights are recorded as the decision criteria.
[0014] A charging pile data management system according to an embodiment of the present invention includes the following modules: Fingerprint sampling module: used to generate session fingerprints, formulate sampling jitter plans, collect multi-channel records and calculate hashes, write them into an off-chain Merkle structure, and mark the rate version identifier; The time alignment module is used to perform phase correlation analysis and constrained dynamic time warping, generating a unified time axis, time alignment mapping, and alignment residuals. Energy verification module: used to calculate the energy sequence difference between the meter and the inverter, and generate first-order Wasserstein energy reconciliation distance and session energy consistency tag; Rule execution module: used to compile rate rules, build billing state machine, reason about bills and state transitions, and output billing deviation indicators; Anomaly scoring module: used to integrate reconciliation, residuals and accounting deviations to generate session consistency scores and identify anomalies; Results output module: Used to summarize diagnostic results and accounting information, generate compliance summary and output to the operation and maintenance and settlement interface.
[0015] The beneficial effects of this invention are: This invention introduces a trusted execution environment and physically unclonable functions at the charging pile end, achieving source trust and tamper-proof protection during data acquisition, effectively solving the problem of insufficient data authenticity in existing technologies. In multi-source asynchronous data processing, this invention utilizes phase correlation and constrained dynamic time warping to generate a unified time axis and outputs alignment residuals, enabling robust alignment of multi-channel data from meters and inverters under conditions of latency and packet loss, improving the accuracy and robustness of energy reconciliation. In the billing settlement stage, this invention constructs a differentiable billing state machine by compiling multi-dimensional rate rules such as time-of-use, tiered, service fee, and capped / guaranteed rates, and calibrates it on historical sessions. Then, a discrete billing state machine is derived during the inference stage, ensuring that billing calculations are both adaptable to different rate scenarios and transparent and verifiable. Combined with consistency scoring and anomaly detection mechanisms, this invention can perform multi-dimensional health diagnostics on charging sessions and generate compliance summaries, achieving a trusted closed loop throughout the entire process from data acquisition and energy verification to billing settlement. Compared with existing technologies, this invention not only improves the security and reliability of charging pile data management, but also enhances its adaptability to complex operating environments, further ensuring the fairness and traceability of settlement results. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a charging pile data management method proposed in this invention; Figure 2This is a schematic diagram of the structure of a charging pile data management system proposed in this invention. Detailed Implementation
[0017] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0018] refer to Figure 1 A charging pile data management method, comprising: In the trusted execution environment at the charging pile end, a session fingerprint identifier is generated and a sampling jitter plan that only applies to the collection thread is generated. Multi-channel records are collected, and content hash and timestamp hash are generated for each channel record. The content hash and timestamp hash are written into the off-chain Merkle structure and the rate version identifier is recorded. Based on multi-channel recording, phase correlation is used to obtain the main delay window, and time alignment mapping is obtained within the main delay window by constrained dynamic time warping to form a unified time axis and output the alignment residual. Based on the time alignment mapping, the cumulative energy sequence of the meter and the energy sequence obtained by integrating the inverter power sequence are constructed. The first-order Wasserstein energy reconciliation distance is calculated, and the session energy consistency label is generated by combining the alignment residual. Configure time-sharing rules, tiered rules, service fee rules, and capping or minimum guarantee rules according to the unified time axis and rate version identifier. Compile them into a differentiable accounting state machine and calibrate it on historical sessions. In the inference phase, derive a discrete accounting state machine, apply time alignment mapping to multi-channel records to generate an alignment sequence, output the session theoretical bill and accounting state transition records, and calculate the accounting deviation index. The first-order Wasserstein energy reconciliation distance, alignment residual, and accounting deviation index are integrated into a session consistency score according to preset weights. Anomalies are determined based on the quantile threshold of the healthy session distribution, and session diagnosis results are output. Generate a compliance summary that includes a session fingerprint identifier and off-chain Merkel structure, session energy consistency tag, accounting deviation index and accounting state transition record, session consistency score and rate version identifier, perform signing and notarization on the compliance summary, and provide the session results to the operation and maintenance interface and settlement interface.
[0019] In this embodiment, the step of generating a session fingerprint identifier and generating a sampling jitter plan that only applies to the acquisition thread in the trusted execution environment at the charging pile includes: In a trusted execution environment, a physically unclonable function is invoked. This physically unclonable function is a hardware characteristic function formed by the unavoidable physical micro-differences in the chip manufacturing process. The input is a challenge, and the output is a unique and unpredictable response. By performing hash and encoding operations on the response sequence, the session fingerprint identifier corresponding to the charging session is obtained. A pseudo-random number seed is derived from the session fingerprint identifier and input into the pseudo-random number generator to generate a time perturbation sequence that satisfies a preset statistical distribution. The time perturbation sequence is mapped to the trigger time of the acquisition thread to form a sampling jitter plan that only applies to the acquisition thread.
[0020] In this embodiment, the multi-channel recording specifically includes meter sampling channel recording, inverter sampling channel recording, and charging pile internal status channel recording.
[0021] In this embodiment, the step of generating content hashes and timestamp hashes for each channel record, writing them into an off-chain Merkle structure, and recording the rate version identifier includes: Perform a hash operation on the raw data of each channel record to obtain the content hash value used for integrity verification; Perform a hash operation on the sampling timestamp corresponding to the channel record to obtain the timestamp hash value used for sequential consistency verification, and write the content hash value and the timestamp hash value together into the off-chain Merkle structure node; An off-chain Merkel structure is appended with a record of the rate version identifier corresponding to the current session, and an off-chain data integrity certificate is generated based on the root hash.
[0022] In this embodiment, forming a unified time axis and outputting aligned residuals includes: Using the meter sampling channel record as the time reference channel, the obtained multi-channel records are subjected to integrity verification and timestamp validity check. Missing or duplicate records are removed and the verified dataset is retained. One channel with sampling integrity and time continuity is selected from the multi-channel records as the reference channel, and the remaining channels are defined as non-reference channels. Phase correlation analysis is performed on the reference channel and each non-reference channel separately. The sampled sequences of the two channels are processed by frequency domain transformation, and the normalized cross-correlation result is calculated in the frequency domain to obtain the coarse delay where the correlation peak is located. The main delay window is determined around the coarse delay. Specifically, the process of processing the sampled sequences of the two channels by frequency domain transformation and calculating the normalized cross-correlation result in the frequency domain is as follows: The sampled sequences of the reference channel and the non-reference channel are subjected to Fast Fourier Transform respectively to obtain their respective frequency domain representations; The cross-correlation function of the two channel spectra is calculated in the frequency domain, and the result is normalized to eliminate the influence of amplitude difference on correlation and obtain stable cross-correlation results. The cross-correlation function is obtained by converting the two sampled sequences to the frequency domain using fast Fourier transform, multiplying the complex conjugate of the spectrum of one signal with the spectrum of the other signal to obtain the cross power spectrum, and then converting the cross power spectrum back to the time domain through inverse Fourier transform to form the cross-correlation function of the two channels under various delays. Within the main delay window, constrained dynamic time warping is performed on the reference channel and each non-reference channel. This involves setting start-end boundary constraints, time sequence monotonicity constraints, local slope continuity constraints, and diagonal bandwidth constraints. The minimum registration path is searched to obtain the time alignment mapping. Specifically, the constrained dynamic time warping is performed as follows: Within the main delay window, the sampling sequences of the reference channel and the non-reference channel are constructed into a two-dimensional time matrix, and the set of feasible paths is limited based on the start-end boundary constraints, time order monotonic constraints, local slope continuity constraints, and diagonal bandwidth constraints. The cumulative matching cost is calculated within the set of feasible paths. Dynamic programming is used to search for the registration path with the minimum cost. The time point mapping relationship corresponding to the registration path is used as the final time alignment mapping result. Apply time alignment mapping to each non-reference channel to generate an alignment sequence consistent with the reference channel. Construct a unified timeline using the reference channel timestamps and output the aligned multi-channel records. The alignment residual is calculated based on the aligned multi-channel records. The alignment residual is the set of differences between the mapped time and the original time of each non-reference channel on a unified time axis.
[0023] This invention introduces a combined strategy of phase correlation and constrained dynamic time warping in the multi-channel data time alignment process, yielding significant benefits. By calculating normalized cross-correlation results in the frequency domain, interference caused by amplitude differences between different channels can be effectively eliminated, improving the accuracy and stability of coarse delay estimation and providing a reliable initial window for fine alignment. The dynamic time warping method, which incorporates start-end boundary constraints, time sequence monotonic constraints, local slope continuity constraints, and diagonal bandwidth constraints, not only avoids path overfitting problems in traditional dynamic time warping but also ensures the physical and logical rationality of the time alignment mapping results. The resulting unified time axis and alignment residuals not only enable comparison and analysis of multi-source asynchronous data within a unified reference framework but also provide a high-precision time base for energy reconciliation and accounting settlement. Compared to existing technologies, this invention significantly improves the robustness of heterogeneous device data under asynchronous and packet loss conditions, ensuring reliable alignment results and quantifiable alignment residuals, thereby enhancing the accuracy of energy consistency verification and the reliability of accounting processing in the charging data management process.
[0024] In this embodiment, the step of calculating the first-order Wassstein energy reconciliation distance and generating a session energy consistency label by combining the alignment residual includes: Based on a unified time axis, the meter readings are reconstructed into a cumulative energy sequence of the meter in chronological order, and the inverter power is reconstructed into a cumulative energy sequence of the inverter by numerical integration of the time interval between adjacent time points. The ratio of energy increments in the meter's cumulative energy sequence and the inverter's cumulative energy sequence within each window is calculated using a fixed-length sliding window. The median of the energy increment ratios in each window is used as a proportional correction factor to proportionally correct the inverter's cumulative energy sequence. Specifically, the calculation of the energy increment ratio in each window using a fixed-length sliding window involves: Within each sliding window, the starting and ending time readings of the meter's cumulative energy sequence and the inverter's cumulative energy sequence are obtained respectively. The meter's energy increment and the inverter's energy increment are obtained by subtracting the starting time reading from the ending time reading. Within each sliding window, the ratio of the meter's energy increment to the inverter's energy increment is calculated to obtain the corresponding window's energy increment ratio, and the energy increment ratios of all windows are summarized. On a unified time axis, the two cumulative energy sequences are divided into several quantile slices according to equal energy portions. The time position when each quantile slice first reaches the corresponding energy share is recorded to form the meter-side quantile time series and the inverter-side quantile time series. Within a defined main delay window, a bandwidth-limited monotonic match is performed on the meter-side quantile time series and the inverter-side quantile time series. The bandwidth is set by the absolute maximum value of the alignment residuals of the output. The match is only allowed to be sequential and does not cross over, resulting in quantile-level time pairing results. Based on the quantile-level time pairing results, the time offset of each quantile is calculated, and a weighted time displacement vector is formed by accumulating the quantile energy share as the weight. The energy share of unmatched quantiles is accumulated as a gap penalty to obtain the first-order Wasserstein energy reconciliation distance. The calculation of the time offset of each quantile is specifically as follows: Under a unified time axis, the time positions of the corresponding quantile points of the meter's cumulative energy sequence and the inverter's cumulative energy sequence are obtained respectively. The difference between the meter's quantile point time and the inverter's quantile point time is calculated, and the difference is used as the time offset of the quantile point. Perform difference calculations on all quantiles sequentially to form a set of quantile time offsets; The first-order Wasserstein energy reconciliation distance and the output alignment residual are used together for session energy consistency determination to generate a session energy consistency label. Specifically, the use of the first-order Wasserstein energy reconciliation distance and the output alignment residual for session energy consistency determination is as follows: The first-order Wasserstein energy reconciliation distance and alignment residual are compared with preset thresholds. When both indicators are less than or equal to the threshold, the session energy consistency is determined to be normal. When either the first-order Wasserstein energy reconciliation distance or the alignment residual exceeds the threshold, the session is determined to have an energy anomaly, and an inconsistency label is generated.
[0025] This invention effectively solves the problems of large differences in energy curves, difficult alignment, and low anomaly detection accuracy in traditional reconciliation methods by constructing the cumulative energy sequence of the meter and the cumulative energy sequence of the inverter under a unified time axis and introducing a sliding window proportional correction and quantile slice pairing method. By calculating the energy increment ratio through a fixed-length sliding window and using the median as the proportional correction factor, a stable energy ratio relationship can be maintained under different load fluctuations and metering noise conditions, improving the comparability of inverter energy sequences. Dividing the cumulative energy sequence into quantile slices and performing bandwidth-constrained monotonic matching based on the main delay window ensures that the alignment process not only guarantees the rationality of the time sequence but also suppresses overfitting under residual constraints, thus obtaining quantile-level pairing results that better reflect the actual physical process. A weighted time displacement vector is calculated based on the pairing results and a gap penalty is superimposed to form a first-order Wasserstein energy reconciliation distance, which can comprehensively reflect the consistency of energy transmission and gap distribution during the session. Combining the alignment residuals for dual-index judgment effectively improves the accuracy and robustness of anomaly detection. Compared with existing technologies, the method of the present invention has higher reconciliation accuracy, stronger anomaly identification capability, and can provide a reliable basis for bill verification and compliance evidence storage, and has strong feasibility and engineering application value.
[0026] In this embodiment, the output of the theoretical bill and accounting status transition record, and the calculation of the accounting deviation index, include: Read the rate version identifier and unified timeline, parse the time-sharing rules, tiered rules, service fee rules, and capped or guaranteed rules, generate a rule table arranged by time slices, and complete the consistency verification of effective time, pricing unit, and priority. Time-of-use pricing: refers to a pricing method that sets different electricity prices for different time periods to distinguish between peak, off-peak, and off-peak periods. Tiered pricing: This refers to setting electricity prices based on the user's electricity consumption, with billing increasing progressively as the accumulated electricity consumption increases; Service fee rules: These refer to additional fees incurred in addition to electricity costs, based on the charging service process, such as management fees or platform usage fees. Capped or guaranteed minimum rules: These refer to setting a maximum or minimum charge for a bill during the billing process to ensure the reasonableness of the upper and lower limits of user fees; A differentiable accounting state machine is constructed based on the rule table. Time-sharing, tiered, service fee, capped or guaranteed pricing states are defined respectively. Aligned sequences and session events on a unified time axis are used as inputs. Continuous gating is used to represent interval boundaries, thresholds and conditions, and state transition relationships and pricing nodes are established. Using the alignment sequence of historical sessions and the corresponding settlement results as calibration data, the interval boundaries, thresholds, rate coefficients and cost parameters of the differentiable accounting state machine are trained and calibrated. Monotonicity constraints, non-negativity constraints and capping and minimum consistency constraints are set and the rule consistency is solidified. During the inference phase, continuous gating is fixed as discrete thresholds, a discrete accounting state machine is derived, the rate version identifier and rule parameters are frozen, and the inference period accounting execution rule set is solidified for online settlement. Time alignment mapping is applied to multi-channel records to generate alignment sequences. The execution status transition and pricing accumulation of the accounting execution rule set during the inference period are driven by a unified time axis on a time-slice basis. At each time slice, the pricing item identifier, applicable rate parameters and pricing increment for this time slice are output, and the cumulative results form the theoretical bill for the session. At the same time, accounting status transition records are generated. The actual payment amount in the settlement event is extracted from the aligned sequence, and the difference is calculated with the session theory bill to obtain the accounting deviation index. The accounting deviation index is then output along with the accounting status transition record. Specifically, the accounting deviation index is calculated by comparing it with the session theory bill. Read the user's actual payment amount from the settlement events extracted from the alignment sequence, compare the user's actual payment amount with the session theoretical bill amount generated based on the rule table and the accounting state machine item by item, and calculate the corresponding difference; The corresponding differences of each settlement event are summed to obtain the overall accounting deviation index of the session, and then the index is bound to the accounting status transition record for output. Within the same time slice, conflicts between time-sharing pricing, tiered pricing, service fees, and capped or guaranteed pricing are adjudicated. Based on preset priorities and mutual exclusion relationships, only one effective pricing is retained, and the adjudication result is written into the accounting status transfer record. The adjudication of conflicts between time-sharing pricing, tiered pricing, service fees, and capped or guaranteed pricing within the same time slice refers to: Under a unified time slice, when time-sharing rules, tiered rules, service fee rules and capped or guaranteed rules overlap or are mutually exclusive, they are judged according to a pre-set priority order, and only one rule is allowed to enter the pricing execution. In conflict resolution, low-priority or conflicting rules are filtered out level by level according to priority and mutual exclusion, and the only rule that ultimately takes effect is retained. The decision is recorded in the accounting status transfer record to ensure the consistency and uniqueness of the pricing.
[0027] This invention introduces multi-dimensional fee rules, including time-sharing, tiered, service fee, and capped or guaranteed rates, under a unified time axis, and constructs a differentiable accounting state machine for dynamic modeling. This allows for parameter calibration based on historical session data, ensuring consistency and accuracy in rule execution. Compared to existing accounting methods that rely on a single fee rate or static configuration, this invention achieves flexible rule combination and efficient execution during the online inference phase. By fixing continuous gating to discrete thresholds during the inference phase, a set of accounting execution rules for the inference period is derived, ensuring not only the interpretability and stability of the computational logic but also avoiding multiple billing issues caused by rule conflicts. In particular, the priority and mutual exclusion adjudication mechanism within the same time slice ensures the uniqueness and rationality of time-sharing, tiered, service fee, and capped or guaranteed rate rules, thereby improving the reliability of bill generation. This invention significantly reduces the probability of user billing disputes, improves settlement transparency and verifiability, and facilitates direct use of accounting results by operation and maintenance and settlement interfaces, demonstrating good feasibility and widespread application value.
[0028] In this embodiment, the step of fusing the first-order Wassstein energy reconciliation distance, alignment residual, and accounting deviation index into a session consistency score according to preset weights, and determining anomalies based on the quantile threshold of the healthy session distribution and outputting session diagnostic results includes: The scoring inputs were determined by using the first-order Wasserstein energy reconciliation distance, alignment residual statistics, and accounting deviation index as the three inputs for the session scoring. Based on the health conversation sample database, lower and upper bounds are determined for the three inputs respectively, and normalization is performed in a linear manner from the lower to the upper bound to unify the three inputs to the interval of zero to one. Three non-negative weights are set, and the sum of the three is equal to one. The normalized first-order Wasserstein energy reconciliation distance, alignment residual statistics and accounting deviation index are weighted and summarized according to the weights to obtain the session consistency score. The statistical distribution of the health session consistency score is used to determine the judgment threshold according to the preset quantile, and the judgment threshold is fixed for the session judgment of the corresponding period of the current rate version. When the session consistency score is higher than the decision threshold, an abnormal label is output and a session diagnosis result is generated. When the session consistency score is not higher than the decision threshold, a normal label is output. At the same time, the session consistency score, the three input quantities and their corresponding weights are recorded as the decision criteria.
[0029] In this embodiment, the process of generating a compliance digest that includes a session fingerprint identifier and an off-chain Merkel structure, a session energy consistency tag, an accounting deviation index and an accounting state transition record, a session consistency score, and a fee version identifier, performing signature and notarization on the compliance digest, and providing the session results to the operation and maintenance interface and the settlement interface includes: The session fingerprint, off-chain Merkel structure root, session energy consistency label, accounting deviation index, accounting state transition record, session consistency score, and rate version identifier are extracted from the execution results of the unified timeline aligned sequence and the accounting state machine, and combined to form a compliance summary dataset. A hash operation is performed on the compliance digest dataset to generate a digest hash value, and the digest hash value is digitally signed using the private key in the trusted execution environment at the charging pile end to form a signed compliance digest; Write the signature compliance summary into the evidence storage medium, record the summary content and corresponding timestamp information, to ensure the tamper-proof and traceability of the compliance summary; Output the signature compliance summary and session diagnostic results to the operation and maintenance interface for device monitoring and operation and maintenance. Output the signature compliance summary and accounting status transfer record to the settlement interface for accounting settlement and reconciliation verification.
[0030] refer to Figure 2 A charging pile data management system includes the following modules: Fingerprint sampling module: used to generate session fingerprints, formulate sampling jitter plans, collect multi-channel records and calculate hashes, write them into an off-chain Merkle structure, and mark the rate version identifier; The time alignment module is used to perform phase correlation analysis and constrained dynamic time warping, generating a unified time axis, time alignment mapping, and alignment residuals. Energy verification module: used to calculate the energy sequence difference between the meter and the inverter, and generate first-order Wasserstein energy reconciliation distance and session energy consistency tag; Rule execution module: used to compile rate rules, build billing state machine, reason about bills and state transitions, and output billing deviation indicators; Anomaly scoring module: used to integrate reconciliation, residuals and accounting deviations to generate session consistency scores and identify anomalies; Results output module: Used to summarize diagnostic results and accounting information, generate compliance summary and output to the operation and maintenance and settlement interface.
[0031] Example 1: To verify the feasibility of this invention in practice, it was applied to an operational test of a charging pile. The operator selected five newly launched public charging piles for a comparative experiment to verify the effectiveness of the data management method proposed in the actual operating scenario. These charging piles were all equipped with electricity meters, inverters, and backend communication modules. Each pile had an average of 15 to 20 charging sessions per day, and the test lasted for 30 days, accumulating 2,200 session data entries.
[0032] In traditional data management methods, data from electricity meters and inverters are often uploaded asynchronously through different channels, leading to inconsistent sampling timing. This is especially problematic during peak hours when data traffic is high, resulting in more frequent delays and packet loss. For example, in a charging session at 7:00 PM, the meter recorded a total electricity consumption of 42.8 kWh, while the inverter calculated 41.6 kWh, a discrepancy of about 3%. Consequently, the final bill amount was higher than the amount the user actually owed, leading to user complaints. Similar situations occurred an average of 1 to 2 times per charging station per day during the testing period, causing accounting disputes and trust issues for the operator.
[0033] After adopting the method proposed in this invention, the charging pile first generates a unique fingerprint identifier for each session in a trusted execution environment, and introduces a sampling jitter plan in the acquisition thread to ensure that the data is tamper-proof and traceable. Subsequently, based on multi-channel recording, a phase correlation method is used to obtain the main delay window between the meter and the inverter, and constrained dynamic time warping is performed within the window to align multi-source data to a unified time axis. On this basis, this invention further calculates the first-order Wasserstein energy reconciliation distance by constructing the meter's cumulative energy sequence and the inverter's power integral sequence, and generates an energy consistency label by combining the alignment residual, thereby ensuring that energy verification not only stays at the level of numerical comparison, but also considers the data distribution characteristics.
[0034] During the billing calculation phase, this invention combines a unified timeline with rate version identifiers to automatically configure time-of-use pricing, tiered pricing, and service fee rules, and calibrates historical session data using a differentiable billing state machine. After generating discrete billing execution rules during the inference phase, it can output bills that more closely reflect actual energy consumption, along with billing state transition records. For abnormal situations, this invention generates a consistency score by fusing energy reconciliation distance, alignment residuals, and billing deviation indicators, and compares it with the normal session distribution, thereby enabling timely identification of risky sessions and anomaly diagnosis.
[0035] Table 1. Comparison Results of Charging Sessions
[0036] As can be seen from the data in Table 1, the method of this invention significantly outperforms the traditional method in several key indicators. First, under the premise of the same total number of test sessions, the average reconciliation error of the method of this invention is only 0.46%, which is significantly lower than the 1.85% of the traditional method. The maximum reconciliation error also decreased from 4.32% to 1.21%, indicating that the method of this invention can more accurately reflect the actual energy consumption in the data alignment and energy verification stages. Second, in terms of the ability to identify abnormal sessions, the method of this invention achieves a recognition rate of 94.3%, while the traditional method is only 70.2%, effectively improving the coverage of anomaly detection.
[0037] The method of this invention has a false alarm rate of only 5.2% for abnormal sessions, which is significantly lower than the 13.7% of the traditional method, demonstrating that it has stronger accuracy while maintaining a high detection rate.
[0038] Regarding bill verifiability, the method of this invention achieves 100% verifiable bill generation, a significant improvement over the traditional method's 76.5%, ensuring the advantages of compliance and transparency in accounting results. Overall, this invention not only improves the accuracy and reliability of charging pile data management but also demonstrates significant advantages in the fairness and traceability of accounting settlement.
[0039] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A charging pile data management method, characterized in that, include: In the trusted execution environment at the charging pile end, a session fingerprint identifier is generated and a sampling jitter plan that only applies to the collection thread is generated. Multi-channel records are collected, and content hash and timestamp hash are generated for each channel record. The content hash and timestamp hash are written into the off-chain Merkle structure and the rate version identifier is recorded. Based on multi-channel recording, phase correlation is used to obtain the main delay window, and time alignment mapping is obtained within the main delay window by constrained dynamic time warping to form a unified time axis and output the alignment residual. Based on the time alignment mapping, the cumulative energy sequence of the meter and the energy sequence obtained by integrating the inverter power sequence are constructed. The first-order Wasserstein energy reconciliation distance is calculated, and the session energy consistency label is generated by combining the alignment residual. Configure time-sharing rules, tiered rules, service fee rules, and capping or minimum guarantee rules according to the unified time axis and rate version identifier. Compile them into a differentiable accounting state machine and calibrate it on historical sessions. In the inference phase, derive a discrete accounting state machine, apply time alignment mapping to multi-channel records to generate an alignment sequence, output the session theoretical bill and accounting state transition records, and calculate the accounting deviation index. The first-order Wasserstein energy reconciliation distance, alignment residual, and accounting deviation index are integrated into a session consistency score according to preset weights. Anomalies are determined based on the quantile threshold of the healthy session distribution, and session diagnosis results are output. Generate a compliance summary that includes a session fingerprint identifier and off-chain Merkel structure, session energy consistency tag, accounting deviation index and accounting state transition record, session consistency score and rate version identifier, perform signing and notarization on the compliance summary, and provide the session results to the operation and maintenance interface and settlement interface.
2. The charging pile data management method according to claim 1, characterized in that, The process of generating a session fingerprint identifier and generating a sampling jitter plan that applies only to the acquisition thread within the trusted execution environment at the charging pile includes: In a trusted execution environment, a physically unclonable function is invoked. This physically unclonable function is a hardware characteristic function formed by the unavoidable physical micro-differences in the chip manufacturing process. The input is a challenge, and the output is a unique and unpredictable response. By performing hash and encoding operations on the response sequence, the session fingerprint identifier corresponding to the charging session is obtained. A pseudo-random number seed is derived from the session fingerprint identifier and input into the pseudo-random number generator to generate a time perturbation sequence that satisfies a preset statistical distribution. The time perturbation sequence is mapped to the trigger time of the acquisition thread to form a sampling jitter plan that only applies to the acquisition thread.
3. The charging pile data management method according to claim 1, characterized in that, The multi-channel recording specifically includes meter sampling channel recording, inverter sampling channel recording, and charging pile internal status channel recording.
4. The charging pile data management method according to claim 1, characterized in that, The process of generating content hashes and timestamp hashes for each channel record, writing them into an off-chain Merkle structure, and recording the rate version identifier includes: Perform a hash operation on the raw data of each channel record to obtain the content hash value used for integrity verification; Perform a hash operation on the sampling timestamp corresponding to the channel record to obtain the timestamp hash value used for sequential consistency verification, and write the content hash value and the timestamp hash value together into the off-chain Merkle structure node; An off-chain Merkel structure is appended with a record of the rate version identifier corresponding to the current session, and an off-chain data integrity certificate is generated based on the root hash.
5. The charging pile data management method according to claim 1, characterized in that, The process of forming a unified time axis and outputting aligned residuals includes: Using the meter sampling channel record as the time reference channel, the obtained multi-channel records are subjected to integrity verification and timestamp validity check. Missing or duplicate records are removed and the verified dataset is retained. One channel with sampling integrity and time continuity is selected from the multi-channel records as the reference channel, and the remaining channels are defined as non-reference channels. Phase correlation analysis is performed on the reference channel and each non-reference channel. The sampling sequences of the two channels are processed by frequency domain transformation, and the normalized cross-correlation results are calculated in the frequency domain to obtain the coarse delay where the correlation peak is located. The main delay window is determined around the coarse delay. Within the main delay window, constrained dynamic time warping is performed on the reference channel and each non-reference channel. Start and end boundary constraints, time order monotonic constraints, local slope continuity constraints, and diagonal bandwidth constraints are set. The registration path with the minimum cost is searched and the time alignment mapping is obtained. Apply time alignment mapping to each non-reference channel to generate an alignment sequence consistent with the reference channel. Construct a unified timeline using the reference channel timestamps and output the aligned multi-channel records. The alignment residual is calculated based on the aligned multi-channel records. The alignment residual is the set of differences between the mapped time and the original time of each non-reference channel on a unified time axis.
6. The charging pile data management method according to claim 1, characterized in that, The calculation of the first-order Wassstein energy reconciliation distance, combined with the alignment residual to generate a session energy consistency label, includes: Based on a unified time axis, the meter readings are reconstructed into a cumulative energy sequence of the meter in chronological order, and the inverter power is reconstructed into a cumulative energy sequence of the inverter by numerical integration of the time interval between adjacent time points. The ratio of energy increments in the meter's cumulative energy sequence and the inverter's cumulative energy sequence within each window is calculated using a fixed-length sliding window. The median of the energy increment ratio in each window is used as the proportional correction factor to proportionally correct the inverter's cumulative energy sequence. On a unified time axis, the two cumulative energy sequences are divided into several quantile slices according to equal energy portions. The time position when each quantile slice first reaches the corresponding energy share is recorded to form the meter-side quantile time series and the inverter-side quantile time series. Within a defined main delay window, a bandwidth-limited monotonic match is performed on the meter-side quantile time series and the inverter-side quantile time series. The bandwidth is set by the absolute maximum value of the alignment residuals of the output. The match is only allowed to be sequential and does not cross over, resulting in quantile-level time pairing results. Based on the quantile-level time pairing results, the time offset of each quantile is calculated, and a weighted time displacement vector is formed by accumulating the quantile energy share as the weight. The energy share of the unmatched quantile is accumulated as a gap penalty to obtain the first-order Wasserstein energy reconciliation distance. The first-order Wasserstein energy reconciliation distance and the output alignment residual are used together to determine session energy consistency and generate session energy consistency labels.
7. The charging pile data management method according to claim 1, characterized in that, The output session theoretical bill and accounting status transition record are recorded, and accounting deviation indicators are calculated, including: Read the rate version identifier and unified timeline, parse the time-sharing rules, tiered rules, service fee rules, and capped or guaranteed rules, generate a rule table arranged by time slices, and complete the consistency verification of effective time, pricing unit and priority. A differentiable accounting state machine is constructed based on the rule table. Time-sharing, tiered, service fee, capped or guaranteed pricing states are defined respectively. Aligned sequences and session events on a unified time axis are used as inputs. Continuous gating is used to represent interval boundaries, thresholds and conditions, and state transition relationships and pricing nodes are established. Using the alignment sequence of historical sessions and the corresponding settlement results as calibration data, the interval boundaries, thresholds, rate coefficients and cost parameters of the differentiable accounting state machine are trained and calibrated. Monotonicity constraints, non-negativity constraints and capping and minimum consistency constraints are set and the rule consistency is solidified. During the inference phase, continuous gating is fixed as discrete thresholds, a discrete accounting state machine is derived, the rate version identifier and rule parameters are frozen, and the inference period accounting execution rule set is solidified for online settlement. Time alignment mapping is applied to multi-channel records to generate alignment sequences. The execution status transition and pricing accumulation of the accounting execution rule set during the inference period are driven by a unified time axis on a time-slice basis. At each time slice, the pricing item identifier, applicable rate parameters and pricing increment for this time slice are output, and the cumulative results form the theoretical bill for the session. At the same time, accounting status transition records are generated. The actual payment amount in the settlement event is extracted from the alignment sequence, and the difference is calculated with the session theory bill to obtain the accounting deviation index. The accounting deviation index and the accounting status transition record are then output together. Within the same time frame, adjudicate conflicts between time-sharing, tiered pricing, service fees, and capped or guaranteed pricing. Based on preset priorities and mutual exclusion relationships, retain only one effective pricing and write the adjudication result into the accounting status transfer record.
8. The charging pile data management method according to claim 1, characterized in that, The process involves fusing the first-order Wassstein energy reconciliation distance, alignment residual, and accounting deviation index according to preset weights into a session consistency score. Anomalies are then determined based on the quantile threshold of the healthy session distribution, and session diagnostic results are output, including: The scoring inputs were determined by using the first-order Wasserstein energy reconciliation distance, alignment residual statistics, and accounting deviation index as the three inputs for the session scoring. Based on the health conversation sample database, lower and upper bounds are determined for the three inputs respectively, and normalization is performed in a linear manner from the lower to the upper bound to unify the three inputs to the interval of zero to one. Three non-negative weights are set, and the sum of the three is equal to one. The normalized first-order Wasserstein energy reconciliation distance, alignment residual statistics and accounting deviation index are weighted and summarized according to the weights to obtain the session consistency score. The statistical distribution of the health session consistency score is used to determine the judgment threshold according to the preset quantile, and the judgment threshold is fixed for the session judgment of the corresponding period of the current rate version. When the session consistency score is higher than the decision threshold, an abnormal label is output and a session diagnosis result is generated. When the session consistency score is not higher than the decision threshold, a normal label is output. At the same time, the session consistency score, the three input quantities and their corresponding weights are recorded as the decision criteria.
9. A charging pile data management system, comprising the charging pile data management method according to any one of claims 1 to 8, characterized in that, Includes the following modules: Fingerprint sampling module: used to generate session fingerprints, formulate sampling jitter plans, collect multi-channel records and calculate hashes, write them into an off-chain Merkle structure, and mark the rate version identifier; The time alignment module is used to perform phase correlation analysis and constrained dynamic time warping, generating a unified time axis, time alignment mapping, and alignment residuals. Energy verification module: used to calculate the energy sequence difference between the meter and the inverter, and generate first-order Wasserstein energy reconciliation distance and session energy consistency tag; Rule execution module: used to compile rate rules, build billing state machine, reason about bills and state transitions, and output billing deviation indicators; Anomaly scoring module: used to integrate reconciliation, residuals and accounting deviations to generate session consistency scores and identify anomalies; Results output module: Used to summarize diagnostic results and accounting information, generate compliance summary and output to the operation and maintenance and settlement interface.
Citation Information
Patent Citations
Calculation method and system for step tariff residual electric quantity of low-voltage user
CN119494753A
Charging pile fee payment method and device based on block chain, and storage medium
CN119809630A
Charging pile control system based on Internet of Things
CN120050310A
Charging station operation data management method and system
CN120181939A
Charging pile operation management method and system
CN120542630A
Cited By
Prepayment electricity meter settlement method and system
CN121481539A
General artificial intelligence application AP1 proxy charging system and charging method thereof
CN121923828A
