Power transaction data prediction and verification method and system based on DFT-KNNI-KMEANS algorithm

Through the DFT-KNNI-KMEANS algorithm, combined with linear fitting and improved K-MEANS clustering algorithm, the problem of inaccurate clustering number and center determination in power transaction data verification is solved, and high-precision verification of power transaction data is achieved.

CN115828124BActive Publication Date: 2025-08-22JIANGSU ELECTRIC POWER TRADING CENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211435623.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2025-08-22
Estimated Expiration
2042-11-16

AI Technical Summary

Technical Problem

The prior art cannot accurately determine the number of clusters and cluster centers in the verification of power transaction data, resulting in inaccurate verification of check values ​​and failure to effectively process the size, numerical size and data density of the data.

Method used

The DFT-KNNI-KMEANS algorithm is used to perform data fitting prediction through linear fitting method and KNNI nearest neighbor method. Combined with the improved K-MEANS clustering algorithm, the periodicity and local relationship of the data are described by Fourier transform and discrete Fourier transform, the weighted proportion and threshold judgment are adjusted, and outliers are screened out.

Benefits of technology

Accurate verification of power transaction data is achieved, especially when verification of data in large periods of cycles, which improves the accuracy and accuracy of data verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115828124B_ABST
    Figure CN115828124B_ABST
Patent Text Reader

Abstract

A method and system for predicting and verifying power transaction data based on the DFT-KNNI-KMEANS algorithm includes extracting historical power market transaction data to construct a power transaction dataset; using a linear fitting method and a KNNI nearest neighbor method to fit and predict the power transaction data, respectively, to obtain linear verification values ​​and KNNI verification values. The linear fitting method uses the least squares method combined with Fourier transform to obtain the linear verification value; linearly weighting the linear verification value and the KNNI verification value based on the verification range to obtain a verification data feature set; and verifying the obtained verification data feature set using an improved K-MEANS clustering algorithm. This method enables accurate prediction and verification of power transaction data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power transaction data management, and relates to a power transaction data prediction and verification method and system based on a DFT-KNNI-KMEANS algorithm. Background Art

[0002] The electricity market is rapidly developing, and the scale of market transactions is growing. The transaction volume of many companies has exceeded 100 billion yuan. This massive trading volume generates a particularly large amount of transaction data. Power trading data is a crucial resource in the trading process. Any errors in this data during the trading process can pose a security risk to market operations. Furthermore, with the further development of the power trading market, the application of data mining in power trading is becoming increasingly widespread. The accuracy of power trading data is becoming increasingly important. Verification of power trading data can prevent the potential risks caused by data errors and provide fundamental support for value-added services in power trading.

[0003] At present, existing research results on error data processing mainly include three methods: direct tuple deletion, data verification, and no processing. Although the direct tuple deletion method is relatively simple to operate, it will reduce the quality of the obtained data when the proportion of missing values ​​is large. At the same time, the deleted data may also hide important information, resulting in significant deviations in the final results. The second method is to verify the data, usually using the K-Nearest Neighbor Imputation Method (KNNI), various filling algorithms, and the K-MEANS algorithm, but it also faces the problem of inaccurate verification values. Finally, no processing is performed, and Bayesian and artificial neural algorithms are often used to directly mine data, but some data may still have a significant impact on the data mining process.

[0004] A comparative technical document (CN112598041A) discloses a data verification method for a distribution network cloud platform based on the K-MEANS algorithm, comprising: constructing a distribution network dataset based on the distribution network cloud platform data; calculating the distance between any two data objects in the distribution network dataset, and obtaining the first, second, and third initial cluster centers based on the distance between any two data objects; determining the number of initial cluster centers based on the first, second, and third initial cluster centers, and calculating the pairwise distance values ​​of the initial cluster centers, and determining a first threshold based on the pairwise distance values; clustering the distribution network dataset to be tested, and calculating the absolute value of the distance from each data object to each cluster center; using a first rule to judge the absolute value of the distance from each data object to each cluster center, and recalculating the cluster center after all objects in the dataset to be tested are classified; and judging the recalculated cluster center. However, the comparative technical document does not consider the scale, numerical value, and data density of the data when determining the cluster centers, and cannot accurately determine the number of clusters and cluster centers. Summary of the Invention

[0005] In order to address the deficiencies in the prior art, the present invention provides a method and system for predicting and verifying power transaction data based on the DFT-KNNI-KMEANS algorithm.

[0006] The present invention adopts the following technical solutions.

[0007] The beneficial effects of the present invention are as follows:

[0008] A method for predicting and verifying power transaction data based on the DFT-KNNI-KMEANS algorithm, the method comprising the following steps:

[0009] Step 1: Extract historical transaction data from the electricity market and construct an electricity transaction dataset;

[0010] Step 2: Use the linear fitting method and the KNNI nearest neighbor method to fit and predict the power transaction data, respectively, to obtain the linear verification value and the KNNI verification value; wherein the linear fitting method uses the least squares method combined with Fourier transform to obtain the linear verification value;

[0011] Step 3: linearly weight the linear check value and the KNNI check value according to the size of the check range to obtain the check data feature set;

[0012] Step 4: Verify the obtained verification data feature set based on the improved K-MEANS clustering algorithm.

[0013] The present invention also includes the following preferred embodiments:

[0014] Preferably, the electricity transaction data includes electricity price and load data.

[0015] Preferably, in step 2, the least squares method is specifically:

[0016] First, substitute the data into the data deviation function to obtain the fitting parameter value corresponding to the minimum value of the data deviation function, which is the optimal estimate of the fitting parameter by the least squares method; then fit the data according to the optimal estimate of the fitting parameter; then subtract the data fitting value from the original data set to obtain a new calibration value, which is the calibration value obtained by the least squares method.

[0017] Preferably, in step 2, discrete Fourier transform is used to perform periodic function fitting on the check value obtained by the least squares method to obtain a final linear check value.

[0018] Preferably, in step 2, the KNNI nearest neighbor method is used to perform fitting prediction on the power transaction data to obtain the KNNI verification value, which specifically includes:

[0019] Calculate the distance between the data point in the determined category dataset and the current data point in the power transaction dataset;

[0020] Arrange in ascending order according to the size of the distance;

[0021] Read the N data points with the smallest distance from the current data point;

[0022] Determine the frequency of occurrence of the categories of the first N data points;

[0023] The predicted classification of the current data point is recorded as the category with the highest frequency of the first K data points. After recording the category, the categories to which the K data points belong are compared. According to the principle of minority obeys majority, the sample test point is classified into the group with the highest frequency, thereby achieving data prediction.

[0024] Preferably, in step 3, the weighted ratio of the linear calibration value and the KNNI calibration value is adjusted according to whether the calibration range is a large-segment calibration or a single-point calibration, so as to obtain an accurate calibration data feature set;

[0025] If a large segment of data is to be verified, the weighted ratio of the Fu linear verification value is increased;

[0026] If it is a single-point data verification, the weighted ratio of the KNNI verification value should be increased.

[0027] Preferably, in step 4, firstly, the verification anomaly values ​​are screened out by combining threshold discrimination and horizontal comparison, and then the filtered data set is detected using the improved K-MEANS algorithm, the distance from each data to the cluster center is calculated, and compared with the distance threshold to screen out the final power market transaction anomaly verification value.

[0028] Preferably, the improved K-MEANS algorithm uses a single data point as the radiation radius, calculates the regional data set radiated by each data point, and then determines the cluster center.

[0029] Preferably, the improved K-MEANS algorithm adopts a cluster number traversal method to determine the number of clusters by data aggregation degree and point center distance.

[0030] The power transaction data prediction and verification system based on the DFT-KNNI-KMEANS algorithm includes:

[0031] The data set construction module is used to extract historical transaction data of the power market and construct a power transaction data set;

[0032] The data fitting and prediction module is used to fit and predict power transaction data using the linear fitting method and the KNNI nearest neighbor method, respectively, to obtain linear verification values ​​and KNNI verification values; the linear fitting method uses the least squares method combined with Fourier transform to obtain the linear verification value;

[0033] The data weighting module is used to linearly weight the linear check value and the KNNI check value according to the size of the check range to obtain the check data feature set;

[0034] The data verification module is used to verify the obtained verification data feature set based on the improved K-MEANS clustering algorithm.

[0035] A terminal includes a processor and a storage medium, wherein the storage medium is used to store instructions;

[0036] The processor is configured to operate according to the instructions to execute the steps of the method.

[0037] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.

[0038] The present invention is applied to the electric power field. In view of the characteristics of large-scale and data-intensive electricity price transaction data in the power market, the data is generally periodic but a small amount of data has uncertainty. The periodicity of large-scale intensive transaction data is fitted by Fourier transform and discrete Fourier transform. At the same time, the similarity and linear trend of adjacent data can be used to describe its local uncertainty relationship. Accurate data prediction is achieved through locality and periodicity weighting, especially accurate prediction of power transaction data.

[0039] Aiming at the situation where data collected in power trading needs to be verified, the present invention utilizes the similarity of adjacent data, the linear trend of data and the periodic law of data to realize the verification of partial data; based on the global relationship described by linear fitting of Fourier transform and discrete Fourier transform (DFT), the linear combination of local relationship described by KNNI nearest neighbor algorithm and improved K-MEANS algorithm, a data verification algorithm is invented, which can adjust the weighted ratio of KNNI algorithm and linear fitting algorithm according to the size of the verification data range to obtain data feature set, and at the same time, based on the improved K-MEANS clustering algorithm of setting threshold and horizontal data comparison, the data feature set is verified, which accurately grasps the intrinsic relationship law between data, and greatly improves the accuracy of power trading data verification; especially when verifying large periodic data, the verification advantage of the present invention is more obvious.

[0040] The improved K-MEANS algorithm of the present invention comprehensively considers the scale, numerical value and data density of the data. It takes a single data point as the radiation radius, calculates the regional data set radiated by each data, and then determines the cluster center. At the same time, when determining the number of clusters, a cluster number traversal method is proposed to determine the number of clusters by the data aggregation degree and the point center distance. Compared with the K-MEANS algorithm before the improvement, it can accurately obtain cluster K and determine the cluster center, especially when K=5, the verification effect on the predicted data is the best. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flow chart of the power transaction data prediction and verification method based on the DFT-KNNI-KMEANS algorithm;

[0042] Figure 2 Flowchart for the implementation of the power transaction data prediction and verification method based on the DFT-KNNI-KMEANS algorithm. DETAILED DESCRIPTION

[0043] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without making creative efforts are all within the scope of protection of the present invention.

[0044] like Figure 1-2 As shown, Example 1 of the present invention provides a method for predicting and verifying power transaction data based on the DFT-KNNI-KMEANS algorithm. In a preferred but non-limiting embodiment of the present invention, the method includes the following steps:

[0045] Step 1: Extract historical transaction data from the electricity market and construct an electricity transaction dataset;

[0046] In the specific implementation, the established power transaction data set is {f1, f2, ..., f n}, this data set includes but is not limited to transaction data such as electricity price and load.

[0047] Step 2: Use the linear fitting method and the KNNI nearest neighbor method to perform fitting prediction on the power transaction data, respectively, to obtain the linear verification value and the KNNI verification value; that is, the present invention first performs prediction based on historical data, and then verifies the predicted data.

[0048] 1. Use the linear fitting method to fit and predict the power transaction data to obtain the linear verification value, specifically:

[0049] First, substitute the data into the data deviation function to obtain the fitting parameter value corresponding to the minimum value of the data deviation function, which is the optimal estimate of the least squares fitting parameter; then fit the data according to the optimal estimate of the fitting parameter; then subtract the data fitting value from the original data set to obtain a new calibration value, which is the calibration value obtained by the least squares method. The details are as follows:

[0050] 1) Perform linear fitting using the least squares method to obtain the optimal parameter estimates a and b;

[0051] When using the least squares method to estimate parameters, the data y i The weighted square sum of the deviations △y is minimized. Taking the linear fitting of two parameters as an example, for the values ​​of the observed one-dimensional independent variables, the deviation value △y of the power transaction data can be minimized. The deviation value △y can be used to obtain the best estimate in the least squares method.

[0052] Based on the original data, the new calibration value is calculated by subtracting the fitted data. At this time, the average value of all time series data of the new calibration value is 0, and the linear fitting line is the x-axis itself. The details are as follows:

[0053] (1) Least squares method:

[0054] y=ax+b (1)

[0055] Where x is the electricity transaction set, y is the linear prediction value of the electricity transaction data, and a and b are the fitting parameters respectively.

[0056] (2) Electricity price deviation function:

[0057]

[0058] When △y is the minimum value, you can use y at this timei and x i Find the best estimates of the fitting parameters a and b The solution formula is as follows:

[0059] (3) Best estimate:

[0060]

[0061]

[0062] At the same time, in order to measure the degree of correlation after linear fitting, the corresponding correlation r is given. The specific expression is:

[0063]

[0064] in,

[0065] When |r|→1, the correlation between the fitted function is the highest, and when |r|→0, the fitted function and the original function are meaningless.

[0066] In summary, the algorithm logic of the least squares method in the present invention is: 1) Substitute the data set into formula (2) to obtain the a and b values ​​when y is minimized in (2). The obtained a and b values ​​are (3) and (4); 2) Then, using the a and b values ​​obtained in 1), substitute the data set into formula (1) to obtain the fitted value y; 3) Subtract the fitted value y from the data set to obtain a new calibration value. Formula (5) can also be used to determine the degree of fit of the formula (1) used for the data. The higher the degree of fit, the more accurate the data prediction.

[0067] Using the above method for fitting can not only achieve data prediction, but also eliminate the trend of data increase or decrease in the data set as a whole.

[0068] For example, there are n data in the original data set: {f1, f2, ..., f n}, where m data are missing data or data to be verified and cannot be used at this time, then the remaining nm values ​​(that is, nm data that do not need to be verified) can be used to perform linear fitting using the above formula (1) to obtain new fitting values, and the obtained fitting values ​​are m data;

[0069] At the same time, all discrete values ​​are subtracted from the fitting results in formula (1) (i.e., the least squares method is used to fit the remaining nm data, and the m data that need to be verified are obtained, and the other nm fitting data are added and subtracted from the original data set) to obtain the function value {g1, g2, ..., g nThis function value has a good mean of 0, indicating that the data at this time is more suitable for prediction using the Fourier transform. That is, in this set of function values, the values ​​of parameters a and b are both 0, making the Fourier transform operation more suitable than metadata.

[0070] 2) For the calibration value obtained by the least squares method in 1), the coefficient (amplitude) F corresponding to the sine function of different periods is obtained by fitting the periodic function of discrete Fourier transform. k , and find the most important cycles, that is, find its main spectrum W k ;

[0071] The obtained coefficients are used to complete the data prediction value into the function value of Fourier transform. The previous data prediction value is the data prediction value obtained under different k values. The completion is to select the appropriate k value to perform Fourier transform to obtain the appropriate data prediction value, which corresponds to formula (7);

[0072] Specifically: Discrete Fourier transform is used to select an appropriate k to approximate the value of the function to be calculated, and the data at the time point where the check value is located is converted into the function value of the inverse Fourier transform.

[0073] The discrete Fourier transform formula is:

[0074] y=∑nf(t i )sin(t i ) (6)

[0075] The formula used to select the Fourier transform for superposition into the final approximation function is the completion formula:

[0076]

[0077] in, is the fitting value, i.e. the final linear calibration value;

[0078] t is time;

[0079] F k is the amplitude of the Fourier function for different values ​​of k;

[0080] W k is the frequency at different k values ​​in Fourier transform;

[0081] The choice of k should be based on the actual situation of Fourier transform, and usually several frequencies with very significant periodicity, that is, relatively large amplitudes, are selected.

[0082] The above 1) and 2) fit the calibration data into periodic data with a linear trend based on the least squares method and discrete Fourier transform, which is the linear calibration value;

[0083] 3) Using the single-point calibration property of the KNNI algorithm, we perform a weighted average of the values ​​adjacent to the calibration value to obtain a set of calibration data, namely the fitted calibration value obtained by KNNI (KNNI calibration value). The specific steps are:

[0084] Calculate the distance between the data point in the determined category dataset and the current data point in the power transaction dataset;

[0085] Arrange in ascending order according to the size of the distance;

[0086] Read the N data points with the smallest distance from the current data point;

[0087] Determine the frequency of occurrence of the categories of the first N data points. Its function is to use the category with the highest frequency among the first k points as the predicted category of the test data;

[0088] The predicted classification of the current data point is recorded as the category with the highest frequency of the previous K data points. After recording the category, the KNN algorithm compares the categories of the K data points. The sample test point is the average of these K data points. According to the principle of minority obeys majority, the sample test point is classified into the group with the highest frequency, thus achieving data prediction. The sample test point is K samples taken near the current data point, and the sample test point is the average of these data points.

[0089] The above data categories can be selected by the user, which can be electricity price data or load data;

[0090] The size of the distance can be considered as the data difference;

[0091] The distance formula can be:

[0092]

[0093] Step 3: linearly weight the linear check value and the KNNI check value according to the size of the check range to obtain the check data feature set;

[0094] By determining whether it is a large segment data check or a single point data check, the linear check value and the KNNI check value are linearly weighted. The linear weighting formula is as follows:

[0095]

[0096] Where a is the weighted ratio of the linear calibration value, which is between 0 and 1;

[0097] is the synthetic checksum value, and They are linear calibration value and KNNI calibration value respectively.

[0098] If it is a large segment of data verification, the weighted ratio of the Fu linear verification value should be increased. If it is a single point data verification, the weighted ratio of the KNNI verification value should be increased to obtain a more accurate data feature set.

[0099] In view of the obvious periodicity and uncertainty of a small amount of data in electricity price data, as well as its strong global characteristics, the excellent local data verification algorithm is combined with the verification algorithm with global data processing capabilities, and applied to power data verification, which can achieve good data verification effects.

[0100] Step 4: Verify the obtained verification data feature set based on the improved K-MEANS clustering algorithm.

[0101] First, we combine threshold discrimination and horizontal comparison to filter out abnormal calibration values. Then, we use the improved K-MEANS algorithm for iterative clustering to detect abnormal calibration values ​​in power transactions. For example:

[0102] Assume that m abnormal data are identified through threshold screening and horizontal data comparison, then the abnormal data set M = {m1,m2,...,m m}, the verified data set is N={M1,M2,...M n}, the range that needs to be detected at this time is MN, and the improved K-MEANS algorithm is used to detect MN, calculate the distance from each data to the cluster center, and compare it with the distance threshold, screen out the final power transaction abnormality verification value, and achieve more accurate data verification. Especially when performing large-scale periodic data verification, the present invention can achieve more accurate data verification.

[0103] Further preferably, when using the improved K-MEANS algorithm to detect a data set, the cluster center of the improved K-MEANS algorithm is not randomly selected, but is determined by comprehensively considering the scale, numerical value and data density of the data, taking a single data point as the radiation radius, calculating the regional data set radiated by each data point, and then determining the cluster center. At the same time, when determining the number of clusters, a cluster number traversal method is proposed to determine the number of clusters by the data aggregation degree and the point center distance, and determine the cluster center and the number of clusters K value of the initial K-MEANS algorithm. Specifically:

[0104] Taking a single data point as the radiation radius, the cluster center is determined after calculating the regional data set radiated by each data point. The calculation formula used to calculate the radiated area is as follows:

[0105]

[0106] The cluster number traversal method is used to determine the number of clusters through data aggregation degree and point center distance.

[0107] The number of clusters, K, mentioned in the improved algorithm is determined based on the number of clusters, K, and the predicted dataset. According to the cluster number determination method described above, a sweep range for the number of clusters, K, is first given. Within this range, the sweep step size is adaptively selected to obtain a sweep set of K values. The improved K-means clustering algorithm is used to divide the power trading data into K categories. The data aggregation degree, D, and center distance, C, are calculated. The K value with the best clustering effect index is selected as the planned partition number to ensure the optimal number of clusters.

[0108] The definition of data aggregation is as follows:

[0109]

[0110] Where N is the number of data points, x j is the sampling point, m j The data aggregation degree can be regarded as the average value of the data in the region to the cluster center.

[0111] The point center distance is defined as follows:

[0112]

[0113] d(mi,mj) is the radiation range c i and c j The point center distance can be regarded as the minimum value of the cluster center.

[0114] When using the cluster number traversal method, it is necessary to determine the cluster center and the number of clusters K value according to the scale of the data, obtain the K value of the corresponding data scale, and obtain the optimal cluster center and number of clusters.

[0115] In the embodiment, when verifying the electricity price prediction data, by setting the electricity price traversal step to 1, the distance threshold to 80, and the K value to 5, the most accurate data verification effect is achieved.

[0116] The power transaction data prediction and verification system based on the DFT-KNNI-KMEANS algorithm includes:

[0117] The data set construction module is used to extract historical transaction data of the power market and construct a power transaction data set;

[0118] The data fitting and prediction module is used to fit and predict power transaction data using the linear fitting method and the KNNI nearest neighbor method, respectively, to obtain linear verification values ​​and KNNI verification values; the linear fitting method uses the least squares method combined with Fourier transform to obtain the linear verification value;

[0119] The data weighting module is used to linearly weight the linear check value and the KNNI check value according to the size of the check range to obtain the check data feature set;

[0120] The data verification module is used to verify the obtained verification data feature set based on the improved K-MEANS clustering algorithm.

[0121] A terminal includes a processor and a storage medium; the storage medium is used to store instructions;

[0122] The processor is configured to operate according to the instructions to execute the steps of the method.

[0123] A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.

[0124] The beneficial effects of the present invention are as follows:

[0125] The present invention is applied to the electric power field. In view of the characteristics of large-scale and data-intensive electricity price transaction data in the power market, the data is generally periodic but a small amount of data has uncertainty. The periodicity of large-scale intensive transaction data is fitted by Fourier transform and discrete Fourier transform. At the same time, the similarity and linear trend of adjacent data can be used to describe its local uncertainty relationship. Accurate data prediction is achieved through locality and periodicity weighting, especially accurate prediction of power transaction data.

[0126] Aiming at the situation where data collected in power trading needs to be verified, the present invention utilizes the similarity of adjacent data, the linear trend of data and the periodic law of data to realize the verification of partial data; based on the global relationship described by linear fitting of Fourier transform and discrete Fourier transform (DFT), the linear combination of local relationship described by KNNI nearest neighbor algorithm and improved K-MEANS algorithm, a data verification algorithm is invented, which can adjust the weighted ratio of KNNI algorithm and linear fitting algorithm according to the size of the verification data range to obtain data feature set, and at the same time, based on the improved K-MEANS clustering algorithm of setting threshold and horizontal data comparison, the data feature set is verified, which accurately grasps the intrinsic relationship law between data, and greatly improves the accuracy of power trading data verification; especially when verifying large periodic data, the verification advantage of the present invention is more obvious.

[0127] The improved K-MEANS algorithm of the present invention comprehensively considers the scale, numerical value and data density of the data. It takes a single data point as the radiation radius, calculates the regional data set radiated by each data, and then determines the cluster center. At the same time, when determining the number of clusters, a cluster number traversal method is proposed to determine the number of clusters by the data aggregation degree and the point center distance. Compared with the K-MEANS algorithm before the improvement, it can accurately obtain cluster K and determine the cluster center, especially when K=5, the verification effect on the predicted data is the best.

[0128] The present disclosure may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0129] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0130] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0131] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A power transaction data prediction and verification method based on the DFT-KNNI-KMEANS algorithm, characterized by: The method comprises the following steps: Step 1: Extract historical transaction data from the electricity market and construct an electricity transaction dataset, which includes electricity price and load data; Step 2: Use the linear fitting method and the KNNI nearest neighbor method to fit and predict the power transaction data, respectively, to obtain the linear verification value and the KNNI verification value; wherein the linear fitting method uses the least squares method combined with Fourier transform to obtain the linear verification value; The KNNI nearest neighbor method is used to fit and predict power transaction data to obtain the KNNI verification value, which specifically includes: Calculating the distance between a data point in a determined category data set and a current data point in a power transaction data set, wherein the calculated categories include electricity price data and load data; Arrange in ascending order according to the size of the distance; Read the N data points with the smallest distance from the current data point; Determine the frequency of occurrence of the categories of the first N data points; The prediction classification of the current data point is recorded as the category with the highest frequency of the previous K data points. After recording the category, the categories of the K data points are compared. According to the principle of minority obeys majority, the sample test point is classified into the group with the highest frequency, thus achieving data prediction; Step 3: linearly weight the linear check value and the KNNI check value according to the size of the check range to obtain the check data feature set; Step 4: Verify the obtained verification data feature set based on the improved K-MEANS clustering algorithm; The improved K-MEANS algorithm uses a single data point as the radiation radius, calculates the regional data set radiated by each data point, and then determines the cluster center; The improved K-MEANS algorithm uses the cluster number traversal method to determine the number of clusters through data aggregation degree and point center distance; The definition of data aggregation is as follows: Where N is the number of data points, x j is the sampling point, m i is the cluster center; The point center distance is defined as follows: d(m i ,m j' ) is the radiation range c i and c j' The cluster center m i and m j' The distance between the points is considered as the minimum value of the cluster center.

2. The power transaction data prediction and verification method based on the DFT-KNNI-KMEANS algorithm according to claim 1 is characterized by: In step 2, the least squares method is specifically as follows: First, substitute the data into the data deviation function to obtain the fitting parameter value corresponding to the minimum value of the data deviation function, which is the optimal estimate of the fitting parameter by the least squares method; then fit the data according to the optimal estimate of the fitting parameter; then subtract the data fitting value from the original data set to obtain a new calibration value, which is the calibration value obtained by the least squares method.

3. The power transaction data prediction and verification method based on the DFT-KNNI-KMEANS algorithm according to claim 2 is characterized by: In step 2, discrete Fourier transform is used to fit the calibration value obtained by the least squares method to a periodic function to obtain the final linear calibration value.

4. The power transaction data prediction and verification method based on the DFT-KNNI-KMEANS algorithm according to claim 1 is characterized by: In step 3, the weighted ratio of the linear calibration value and the KNNI calibration value is adjusted according to whether the calibration range is a large-scale calibration or a single-point calibration to obtain an accurate calibration data feature set; If a large segment of data is to be verified, the weighted ratio of the Fu linear verification value is increased; If it is a single-point data verification, the weighted ratio of the KNNI verification value should be increased.

5. The power transaction data prediction and verification method based on the DFT-KNNI-KMEANS algorithm according to claim 1 is characterized by: In step 4, first, the threshold discrimination and horizontal comparison are combined to screen out the verification anomalies, and then the improved K-MEANS algorithm is used to detect the filtered data set, calculate the distance from each data to the cluster center, and compare it with the distance threshold to screen out the final power market transaction anomaly verification value.

6. A power transaction data prediction and verification system based on the DFT-KNNI-KMEANS algorithm, used to implement the method according to any one of claims 1 to 5, characterized in that: The system comprises: The data set construction module is used to extract historical transaction data of the power market and construct a power transaction data set; The data fitting and prediction module is used to fit and predict power transaction data using the linear fitting method and the KNNI nearest neighbor method, respectively, to obtain linear verification values ​​and KNNI verification values; the linear fitting method uses the least squares method combined with Fourier transform to obtain the linear verification value; The data weighting module is used to linearly weight the linear check value and the KNNI check value according to the size of the check range to obtain the check data feature set; The data verification module is used to verify the obtained verification data feature set based on the improved K-MEANS clustering algorithm.

7. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Power distribution network cloud platform data verification method based on K-MEANS algorithm

    CN112598041A

  • Insider transaction identification method based on K-means clustering and KNN algorithm

    CN110189035A

  • Low-voltage power distribution network topology verification method and system based on improved k-value clustering algorithm

    CN111061821A