Charging gun metering error analysis method based on energy router
The 15-minute sampling data is processed through the sliding window algorithm and the isolated forest algorithm, and the line loss rate of the charging station is calculated and a linear model is constructed. The problem of insufficient resolution of the charging gun error coefficient in the existing technology is solved, and the accurate detection of abnormal charging guns is achieved and improve data credibility.
Patent Information
- Application Number
- CN202411381257.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-17
AI Technical Summary
The prior art has many zero values in the sampled data at 15 minutes intervals, which interferes with the accurate solution of the charging gun error coefficient, and the simple addition method is not perfect enough, resulting in insufficient accuracy of the error coefficient and it is difficult to accurately detect abnormal charging guns.
Using the charging gun measurement error analysis method based on energy router, the 15-minute sampled data is processed through sliding window algorithm and isolated forest algorithm, the line loss rate of the charging station is calculated, abnormal points are eliminated, and the window operation is slipped in a variable step size manner to build a linear model Solve the charging gun error coefficient.
The accuracy of solving the error coefficient of the charging gun is improved, the accurate detection of the abnormal charging gun is ensured, and the real-time and credibility of the data is enhanced.
Smart Images

Figure CN119322306A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric energy metering, and in particular to a charging gun metering error analysis method based on an energy router. Background Art
[0002] With the development of technology, the application scenarios of charging guns are constantly expanding, and their metering function is becoming more and more critical. Accurate metering of charging guns helps collect electricity bills and ensures fairness between power companies and users. In the new energy industry, charging guns need to be checked frequently to ensure their accurate and stable operation.
[0003] Sampling data at 15-minute intervals can monitor grid current, voltage, power and other information at a smaller time granularity, which helps to use big data analysis to troubleshoot abnormal power consumption by users. However, the 15-minute interval sampling data has small values and contains many zero values, which will interfere with the accurate solution of the charging gun error coefficient. To address this, a sliding window algorithm is used to accumulate and sum the 15-minute interval power data to improve data quality. Considering the real-time and credibility of power data, the existing method of simply adding each set of data is not perfect, and the accuracy of solving the charging gun error coefficient needs to be further improved. Summary of the invention
[0004] In view of the shortcomings and defects of the prior art, the present invention proposes a charging gun metering error analysis method based on an energy router. By performing a sliding window operation on the 15min sampling data with a variable step size, the real-time and reliability of the power data are taken into account, which is conducive to further improving the solution accuracy of the charging gun error coefficient and ensuring the accurate detection of abnormal charging guns.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A charging gun metering error analysis method based on an energy router comprises the following steps:
[0007] Step 1: Obtain the power data of the charging gun and energy router;
[0008] Step 2: Calculate the charging station line loss and line loss rate based on the power data of the charging gun and energy router;
[0009] Step 3: Identify abnormal points in line loss rate based on the isolation forest algorithm and remove the corresponding charging gun and energy router power data;
[0010] Step 4: Process the remaining power data based on the sliding window algorithm, add the data in the window, and traverse the data each time the sliding window to achieve data construction;
[0011] Step 5: Establish a linear model based on the constructed data, solve the charging gun error coefficient, and analyze the charging gun metering error.
[0012] Preferably, the calculation formula of the charging station line loss rate in step 2 is as follows:
[0013]
[0014] Among them, y i is the power data of the i-th sample energy router, 1≤i≤m0, m0 is the number of original samples of the charging station; x ij is the power data of the jth charging gun in the i-th sample, lr i is the line loss rate corresponding to the i-th sample, and n0 is the number of charging guns.
[0015] Preferably, the specific process of step 4 is:
[0016] B1, initialize the maximum window width window max , current sliding window round k = 1, step length step = 1;
[0017] B2, taking the kth energy router data as the sliding window starting point, intercepting a total of window max sample points as the observation area, the observation area range: [k, k+window max -1];
[0018] B3, calculate the load threshold load_threshold in the observation area:
[0019] load_threshold=ele min ×n0;
[0020] Among them, ele min The minimum power threshold is set according to the actual power consumption of the charging station;
[0021] B4, in the observation area, the peak position peak_pos set:
[0022] peak_pos=find(y i >load_threshold);
[0023] Among them, the find() function outputs the index value corresponding to the condition; y i is the power data of the i-th sample energy router;
[0024] B5, sum the data of each charging gun and energy router in the window:
[0025]
[0026] Among them, pos belongs to the index value in peak_pos; x pos-j is the data of the jth charging gun in the posth sample; y pos is the power data of the posth sample energy router; x′ kj is the jth charging gun data after addition; y′ k is the energy router data after summation; 1≤k≤m2, m2=m1-Window max +1, m2 is the final number of sample points after sliding window accumulation, and m1 is the number of charging station samples after removing abnormal points;
[0027] B6, k = k + step;
[0028] Jump to B2, and stop jumping until k=m2.
[0029] Preferably, window max =48.
[0030] Preferably, ele min Set to 0.02kWh.
[0031] Preferably, the specific process of step 5 is:
[0032] C1, calculate the line loss of the charging station
[0033]
[0034] C2, build a linear model:
[0035]
[0036] Where β is the error coefficient of the charging gun, the subscript is the charging gun number, ranging from 1 to n0; δ is other losses in the line; α is the measurement error coefficient of the energy router;
[0037] C3, solve the charging gun error coefficient β;
[0038] β=(X T X+λE) -1 X T Error;
[0039] Among them, the matrix x b ″ represents a column vector composed of all data of the bth charging gun, y″ represents a column vector composed of all data of the energy router, and 1″ represents a column vector composed of m2 numbers 1; λ is the regularization parameter.
[0040] Preferably, λ is 1.
[0041] Preferably, the specific process of step 3 is:
[0042] A1, calculate the harmonic number H(i):
[0043] H(i)=ln(i)+ξ;
[0044] Where i is the sample number; ξ is the Euler constant, which is approximately 0.5772156649;
[0045] A2, calculate the average path length c(m) under the current sample number m:
[0046] c(m)=2H(m-1)-2(m-1) / m;
[0047] A3, calculate line loss rate lr i The anomaly score s(lr i , m):
[0048]
[0049] Among them, h(lr i ) is point lr i The length of the path from the root node to the leaf node of the binary tree; E(h(lr i )) is the whole forest. i The average path length of
[0050] A4, according to s(lr i , m) to judge the abnormal point of line loss rate:
[0051]
[0052] Among them, when sgn(lr i )=1, it is identified as an abnormal point;
[0053] A5, based on the identified abnormal points, eliminate the corresponding charging gun and energy router power data.
[0054] The beneficial technical effects of the present invention are as follows: based on the 15-minute sampling data of the charging gun, the line loss rate of the charging station is calculated through the energy router and the charging gun data. After the line loss rate is processed as an outlier through the isolation forest, the original power data is accumulated and summed using a sliding window method. Taking into account the real-time and reliability of the power data, a variable step size method is used in the sliding window process to further improve the solution accuracy of the charging gun error coefficient and ensure the accurate detection of abnormal charging guns. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is the overall flow chart of the present invention.
[0056] Figure 2 This is a line loss rate abnormal point detection diagram in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not limit the present invention.
[0058] Example: Figure 1 As shown, a charging gun metering error analysis method based on an energy router includes the following steps:
[0059] Step 1: Obtain the power data of the charging gun and energy router at the charging station for 10 days;
[0060] Step 2: Calculate the line loss and line loss rate of the charging station based on the power data of the charging gun and the energy router;
[0061] The calculation formula of charging station line loss rate is:
[0062]
[0063] Among them, y i is the power data of the i-th sample energy router, 1≤i≤m0, m0 is the number of original samples of the charging station, which is 960 in the embodiment; ij is the power data of the jth charging gun in the i-th sample, lr i is the line loss rate corresponding to the i-th sample, and n0 is the number of charging guns, which is 8 in the embodiment.
[0064] Step 3: Identify abnormal points in line loss rate based on the isolation forest algorithm and remove the corresponding charging gun and energy router power data:
[0065] A1, calculate the harmonic number H(i):
[0066] H(i)=ln(i)+ξ;
[0067] Where i is the sample number; ξ is the Euler constant, which is approximately 0.5772156649;
[0068] A2, calculate the average path length c(m) when the current sample number m=960:
[0069] c(m)=2H(m-1)-2(m-1) / m;
[0070] A3, calculate line loss rate lr i The anomaly score s(lr i , m):
[0071]
[0072] Among them, h(lr i ) is point lr i The length of the path from the root node to the leaf node of the binary tree; E(h(lr i )) is the whole forest. i The average path length of
[0073] A4, according to s(lr i , m) to judge the abnormal point of line loss rate:
[0074]
[0075] Among them, when sgn(lr i )=1, it is identified as an abnormal point;
[0076] A5, based on the identified abnormal points, remove the corresponding charging gun and energy router power data, such as Figure 2 The position indicated by black*.
[0077] Step 4: Process the remaining power data based on the sliding window algorithm, add the data in the window, and traverse the data each time the sliding window is used to construct the data:
[0078] B1, initialize the maximum window width window max , current sliding window round k = 1, step length step = 1;
[0079] B2, taking the kth energy router data as the sliding window starting point, intercepting a total of window max =48 sample points as observation area, observation area range: [k,k+window max -1];
[0080] B3, calculate the load threshold load_threshold in the observation area:
[0081] load_threshold=ele min ×n0;
[0082] Among them, ele min The minimum power threshold is set according to the actual power consumption of the charging station, which is 0.02kWh;
[0083] B4, in the observation area, the peak position peak_pos set:
[0084] peak_pos=find(y i >load_threshold);
[0085] Among them, the find() function outputs the index value corresponding to the condition; y i is the power data of the i-th sample energy router;
[0086] B5, sum the data of each charging gun and energy router in the window:
[0087]
[0088] Among them, pos belongs to the index value in peak_pos; x pos-j is the data of the jth charging gun in the posth sample; y pos is the power data of the posth sample energy router; x′ kj is the jth charging gun data after addition; y′ k is the energy router data after summation; 1≤k≤m2, m2=m1-Window max +1, m2=220 is the final number of sample points after sliding window accumulation, and m1 is the number of charging station samples after removing abnormal points;
[0089] B6, k = k + step;
[0090] Jump to B2, and stop jumping until k=m2.
[0091] Step 5: Establish a linear model based on the constructed data, solve the charging gun error coefficient, and analyze the charging gun measurement error:
[0092] C1, calculate the line loss of the charging station
[0093]
[0094] C2, build a linear model:
[0095]
[0096] Where β is the error coefficient of the charging gun, the subscript is the charging gun number, ranging from 1 to n0; δ is other losses in the line; α is the measurement error coefficient of the energy router;
[0097] C3, solve the charging gun error coefficient β;
[0098] β=(X T X+λE) -1 X T Error;
[0099] Among them, the matrix x b″ represents a column vector composed of all data of the bth charging gun, y″ represents a column vector composed of all data of the energy router, and 1″ represents a column vector composed of m2 numbers 1; λ is the regularization parameter.
[0100] According to the solution results, the power data before and after the fixed-step and variable-step sliding windows are modeled and solved, and the solution results of the charging gun error coefficient are analyzed: the error coefficient of the fixed-step sliding window solution is deviated from the normal range of ±0.02, and even worse, false alarms occur; the error coefficient of the variable-step sliding window solution is distributed within the normal range of ±0.02, and the solution results are accurate and stable. Therefore, by sliding the window of the 15-minute sampling data of the charging gun with a variable step length, the solution accuracy of the charging gun error coefficient is further improved, ensuring the accurate detection of abnormal charging guns.
[0101] The above embodiments are descriptions of specific implementation methods of the present invention rather than limitations of the present invention. Technical personnel in the relevant technical field may make various changes and modifications to obtain corresponding equivalent technical solutions without departing from the spirit and scope of the present invention. Therefore, all equivalent technical solutions should be included in the patent protection scope of the present invention.
Claims
1. A charging gun metering error analysis method based on an energy router, characterized in that: The following steps are involved: Step 1: Obtain the power data of the charging gun and energy router; Step 2: Calculate the charging station line loss and line loss rate based on the power data of the charging gun and energy router; Step 3: Identify abnormal points in line loss rate based on the isolation forest algorithm and remove the corresponding charging gun and energy router power data; Step 4: Process the remaining power data based on the sliding window algorithm, add the data in the window, and traverse the data each time the sliding window to achieve data construction; Step 5: Establish a linear model based on the constructed data, solve the charging gun error coefficient, and analyze the charging gun metering error.
2. According to claim 1, a charging gun metering error analysis method based on an energy router is characterized in that: The calculation formula of the charging station line loss rate in step 2 is as follows: Among them, y i is the power data of the i-th sample energy router, 1≤i≤m, m is the number of original samples of the charging station; x ij is the power data of the jth charging gun in the i-th sample, lr i is the line loss rate corresponding to the i-th sample, and n0 is the number of charging guns.
3. According to claim 2, a charging gun metering error analysis method based on an energy router is characterized in that: The specific process of step 4 is as follows: B1, initialize the maximum window width window max , current sliding window round k = 1, step length step = 1; B2, taking the kth energy router data as the sliding window starting point, intercepting a total of window max sample points as the observation area, the observation area range: [k, k+window max -1]; B3, calculate the load threshold load_threshold in the observation area: load_threshold=ele min ×n0; Among them, ele min The minimum power threshold is set according to the actual power consumption of the charging station; B4, in the observation area, the peak position peak_pos set: peak_pos=find(y i >load_threshold); Among them, the find() function outputs the index value corresponding to the condition; y i is the power data of the i-th sample energy router; B5, sum the data of each charging gun and energy router in the window: Among them, pos belongs to the index value in peak_pos; x pos-j is the data of the jth charging gun in the posth sample; y pos is the power data of the posth sample energy router; x′ kj is the jth charging gun data after addition; y′ k is the energy router data after summation; 1≤k≤m2, m2=m1-Window max +1, m2 is the final number of sample points after sliding window accumulation, and m1 is the number of charging station samples after removing abnormal points; B6, k = k + step; Jump to B2, and stop jumping until k=m2.
4. According to claim 3, a charging gun metering error monitoring method based on an energy router is characterized in that: window max =48。 5. According to claim 3, a charging gun metering error monitoring method based on an energy router is characterized in that: ele min Set to 0.02kWh.
6. According to claim 3, a charging gun metering error analysis method based on an energy router is characterized in that: The specific process in step 5 is as follows: C1, calculate the line loss of the charging station C2, build a linear model: Where β is the error coefficient of the charging gun, the subscript is the charging gun number, ranging from 1 to n0; δ is other losses in the line; α is the measurement error coefficient of the energy router; C3, solve the charging gun error coefficient β; β=(X T X+λE) -1 X T Error; Among them, the matrix x b ″ represents a column vector composed of all data of the bth charging gun, y″ represents a column vector composed of all data of the energy router, and 1″ represents a column vector composed of m2 numbers 1; λ is the regularization parameter.
7. A charging gun metering error monitoring method based on an energy router according to claim 6, characterized in that: λ is 1.
8. According to claim 6, a charging gun metering error analysis method based on an energy router is characterized in that: The specific process of step 3 is as follows: A1, calculate the harmonic number H(i): H(i)=ln(i)+ξ; Where i is the sample number; ξ is the Euler constant, which is approximately 0.5772156649; A2, calculate the average path length c(m) under the current sample number m: c(m)=2H(m-1)-2(m-1) / m; A3, calculate line loss rate lr i The anomaly score s(lr i , m): Among them, h(lr i ) is point lr i The length of the path from the root node to the leaf node of the binary tree; E(h(lr i )) is the whole forest. i The average path length of A4, according to s(lr i , m) to judge the abnormal point of line loss rate: Among them, when sgn(lr i )=1, it is identified as an abnormal point; A5, based on the identified abnormal points, eliminate the corresponding charging gun and energy router power data.