CN117333219A - Transaction electric quantity prediction method, device, equipment and storage medium - Google Patents

Transaction electric quantity prediction method, device, equipment and storage medium Download PDF

Info

Publication number
CN117333219A
CN117333219A CN202311629465.9A CN202311629465A CN117333219A CN 117333219 A CN117333219 A CN 117333219A CN 202311629465 A CN202311629465 A CN 202311629465A CN 117333219 A CN117333219 A CN 117333219A
Authority
CN
China
Prior art keywords
transaction
historical
data
price
correlation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311629465.9A
Other languages
Chinese (zh)
Other versions
CN117333219B (en
Inventor
叶吉超
章寒冰
徐永海
黄慧
胡鑫威
丁宁
张程翔
赵汉鹰
王笑棠
吴晓刚
李乃一
朱利锋
吴新华
季奥颖
潘昭光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Zhejiang Electric Power Co Ltd
Lishui Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
State Grid Zhejiang Electric Power Co Ltd
Lishui Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Zhejiang Electric Power Co Ltd, Lishui Power Supply Co of State Grid Zhejiang Electric Power Co Ltd filed Critical State Grid Zhejiang Electric Power Co Ltd
Priority to CN202311629465.9A priority Critical patent/CN117333219B/en
Publication of CN117333219A publication Critical patent/CN117333219A/en
Application granted granted Critical
Publication of CN117333219B publication Critical patent/CN117333219B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J3/00Circuit arrangements for ac mains or ac distribution networks
    • H02J3/004Generation forecast, e.g. methods or systems for forecasting future energy generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0206Price or cost determination based on market factors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J2203/00Indexing scheme relating to details of circuit arrangements for AC mains or AC distribution networks
    • H02J2203/20Simulating, e g planning, reliability check, modelling or computer assisted design [CAD]

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Theoretical Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Game Theory and Decision Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Public Health (AREA)
  • Human Resources & Organizations (AREA)
  • Primary Health Care (AREA)
  • Tourism & Hospitality (AREA)
  • Artificial Intelligence (AREA)
  • Water Supply & Treatment (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Power Engineering (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a transaction electric quantity prediction method, a device, equipment and a storage medium, wherein a plurality of historical transaction electric quantity data of a user are collected, wherein the historical transaction electric quantity data comprise historical transaction electric quantity, historical transaction price and historical weather data; the historical transaction price is input into a transaction price prediction model to obtain a predicted transaction price, and the historical weather data is input into a weather data prediction model to obtain predicted weather data; calculating a first correlation quantity of a transaction price datum line and a predicted transaction price and a second correlation quantity of a weather data datum line and predicted weather data, and inputting correlation quantity data pairs obtained by correlating the first correlation quantity and the second correlation quantity into a transaction electric quantity prediction model to obtain predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs related to historical transaction electric quantity and historical related quantity data pairs; compared with the prior art, the technical scheme of the invention improves the prediction efficiency and the prediction accuracy of the transaction electric quantity.

Description

Transaction electric quantity prediction method, device, equipment and storage medium
Technical Field
The present invention relates to the field of power grid application technologies, and in particular, to a transaction electric quantity prediction method, device, equipment, and storage medium.
Background
The user transaction electric quantity refers to the quantity of electric quantity transaction carried out among users in an electric power market, and in the electric power market, the users can independently transact electric quantity according to own needs and supply conditions so as to meet own electricity consumption needs or obtain economic benefits; through predicting the electric quantity of the user transaction, market participants can better adjust the electric power supply and demand balance, optimize the market scheduling and operation, and formulate corresponding electric power transaction strategies so as to improve the market efficiency and economic benefit.
The operation of the electric power market is affected by various factors including weather, seasons, economic factors and the like, and the conventional transaction electric quantity prediction method often cannot fully consider the complex nonlinear relations, so that the accuracy of the transaction electric quantity prediction is low; in addition, when the conventional transaction electric quantity prediction method predicts the transaction electric quantity, a large amount of historical transaction electric quantity data is often subjected to data processing based on a single prediction model, so that the data processing amount of the prediction model is large, and the prediction efficiency is low.
Disclosure of Invention
The invention aims to solve the technical problems that: provided are a transaction electric quantity prediction method, a device, equipment and a storage medium, which can improve the prediction efficiency and the prediction accuracy of the transaction electric quantity.
In order to solve the technical problems, the invention provides a transaction electric quantity prediction method, which comprises the following steps:
collecting a plurality of historical transaction electricity quantity data of a user, wherein each historical transaction electricity quantity data comprises historical transaction electricity quantity, historical transaction price and historical weather data;
inputting the historical transaction price into a pre-trained transaction price prediction model so that the transaction price prediction model outputs a predicted transaction price, and inputting the historical weather data into a pre-trained weather data prediction model so that the weather data prediction model outputs predicted weather data;
acquiring a pre-generated transaction price datum line and a weather data datum line, calculating a first correlation quantity between the transaction price datum line and the predicted transaction price, calculating a second correlation quantity between the weather data datum line and the predicted weather data, and correlating the first correlation quantity with the second correlation quantity to obtain a correlation quantity data pair;
Inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model so that the transaction electric quantity prediction model outputs predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs which are related to historical transaction electric quantity and historical related quantity data pairs.
In one possible implementation manner, the transaction electric quantity prediction model is trained by a plurality of sample key value pairs associated with historical transaction electric quantity and historical related quantity data pairs, and specifically includes:
automatically inputting the collected multiple historical transaction electric quantity data into a preset historical transaction electric quantity table, and performing graphic conversion on the historical transaction electric quantity table to obtain a historical transaction price line graph and a historical weather data line graph;
acquiring a pre-generated trade price datum line, and calculating a first historical correlation quantity between each historical trade price in the historical trade price datum line and the trade price datum line;
acquiring a pre-generated weather data datum line, and calculating a second historical correlation quantity between each historical weather data in the historical weather data datum line diagram and the weather data datum line;
generating a history related quantity data pair based on the first history related quantity and the second history related quantity, and correlating the history related quantity data pair with corresponding history transaction electric quantity to obtain a plurality of sample key value pairs;
And taking the historical related quantity data pairs in the plurality of key value pairs as model input, taking the historical transaction electric quantity in the plurality of key value pairs as model output, and carrying out model training on an initial transaction electric quantity prediction model to obtain a transaction electric quantity prediction model.
In one possible implementation manner, acquiring a pre-generated transaction price reference line specifically includes:
acquiring historical year transaction electricity quantity data, wherein the historical year transaction electricity quantity data comprises a historical year transaction price set;
storing the historical year transaction price set into a historical year transaction price form, detecting whether the historical year transaction price form has data missing, acquiring two adjacent transaction prices of first missing data when the historical year transaction price form is determined to have the data missing, calculating a transaction price average value of the adjacent transaction prices, and carrying out data complement processing on the first missing data based on the transaction price average value to obtain a complete historical year transaction price form;
acquiring the transaction price median in the historical year transaction price complete form, and carrying out data division processing on all data in the historical year transaction price complete form based on the transaction price median to obtain a low transaction price set and a high transaction price set;
Counting a first quantity corresponding to the low transaction price set and a second quantity corresponding to the high transaction price set, calculating a first duty ratio of first data to the total data in the complete form of historical annual transaction price, calculating a second duty ratio of second data to the total data in the complete form of historical annual transaction price, and simultaneously acquiring a low transaction price median corresponding to the low transaction price set and a high transaction price median corresponding to the high transaction price set;
substituting the low trade price median, the high trade price median, the first duty ratio and the second duty ratio into a preset trade price reference calculation formula to obtain a trade price reference value, and determining a trade price reference line based on the trade price reference value.
In one possible implementation, the preset transaction price benchmark calculation formula is as follows:
;
in the method, in the process of the invention,for the trade price reference value, N is the total data in the complete form of the trade price in the history year, ++>For high trade price median->Is a low trade price median->For a first duty cycle->For a second duty cycle->For the first quantity->A second number.
In one possible implementation manner, calculating a first correlation amount between the transaction price datum and the predicted transaction price, and calculating a second correlation amount between the weather data datum and the predicted weather data specifically includes:
generating a transaction price reference line graph based on the transaction price reference line, and acquiring a first coordinate position of the predicted transaction price on the transaction price reference line graph;
calculating a first distance between the transaction price datum line and the predicted transaction price according to the first coordinate position, and determining a first correlation quantity according to the first distance;
setting the first correlation amount to be a first positive correlation amount when the first coordinate position is determined to be located above the transaction price reference line;
setting the first correlation amount to be a first negative correlation amount when the first coordinate position is determined to be located below the transaction price reference line;
setting the first correlation quantity as a first flat correlation quantity when the first coordinate position is determined to be coincident with the transaction price datum line;
generating a weather data reference line graph based on the weather data reference line, and acquiring a second coordinate position of the predicted weather data on the weather data reference line graph;
Calculating a second distance between the weather data datum line and the predicted weather data according to the second coordinate position, and determining a second correlation quantity according to the second distance;
setting the second correlation amount to be a second positive correlation amount when the second coordinate position is determined to be located above the weather data reference line;
setting the second correlation amount to be a second negative correlation amount when the second coordinate position is determined to be located below the weather data reference line;
and setting the second correlation amount as a second flat correlation amount when the second coordinate position is determined to be coincident with the weather data reference line.
In one possible implementation manner, after the transaction electric quantity prediction model outputs the predicted transaction electric quantity, the method further includes:
performing data correction processing on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity;
the data correction processing is performed on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity, which specifically includes:
determining a first type of the first correlation quantity according to the first correlation quantity, wherein the first type comprises a first positive correlation quantity, a first negative correlation quantity and a first positive correlation quantity;
Determining a second type of the second correlation quantity according to the second correlation quantity, wherein the second type comprises a second positive correlation quantity, a second negative correlation quantity and a second positive correlation quantity;
and according to the first type and the second type, a first weight value is matched from a preset weight table, and data correction processing is carried out on the predicted transaction electric quantity based on the first weight value, so that the optimal predicted transaction electric quantity is obtained.
In one possible implementation manner, the relevant quantity data pair is input into a pre-trained transaction electric quantity prediction model, so that the transaction electric quantity prediction model outputs predicted transaction electric quantity, and specifically includes:
inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model, so that the transaction electric quantity prediction model calculates first matching degrees between the related quantity data pair and all sample key value pairs, and extracting all first sample key value pairs, of which the first matching degrees meet a preset matching degree threshold, from all sample key value pairs based on the first matching degrees; and extracting all first historical transaction electric quantity from all first sample key value pairs, calculating a first historical transaction electric quantity average value corresponding to all first historical transaction electric quantity, taking the first historical transaction electric quantity average value as predicted transaction electric quantity, and outputting the predicted transaction electric quantity.
The invention also provides a transaction electric quantity prediction device, which comprises: the system comprises a historical transaction electric quantity data acquisition module, a transaction electric quantity related data prediction module, a related amount calculation module and a transaction electric quantity prediction module;
the historical transaction electric quantity data acquisition module is used for acquiring a plurality of historical transaction electric quantity data of a user, wherein each historical transaction electric quantity data comprises historical transaction electric quantity, historical transaction price and historical weather data;
the transaction electric quantity related data prediction module is used for inputting the historical transaction price into a pre-trained transaction price prediction model so that the transaction price prediction model outputs a predicted transaction price, and inputting the historical weather data into the pre-trained weather data prediction model so that the weather data prediction model outputs predicted weather data;
the correlation calculation module is used for acquiring a pre-generated transaction price datum line and a weather data datum line, calculating a first correlation between the transaction price datum line and the predicted transaction price, calculating a second correlation between the weather data datum line and the predicted weather data, and correlating the first correlation with the second correlation to obtain a correlation data pair;
The transaction electric quantity prediction module is used for inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model so that the transaction electric quantity prediction model outputs predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs which are related to historical transaction electric quantity and historical related quantity data pairs.
In one possible implementation manner, the transaction electricity quantity prediction model in the transaction electricity quantity prediction module is trained by a plurality of sample key value pairs associated with historical transaction electricity quantity and historical related quantity data pairs, and specifically includes:
automatically inputting the collected multiple historical transaction electric quantity data into a preset historical transaction electric quantity table, and performing graphic conversion on the historical transaction electric quantity table to obtain a historical transaction price line graph and a historical weather data line graph;
acquiring a pre-generated trade price datum line, and calculating a first historical correlation quantity between each historical trade price in the historical trade price datum line and the trade price datum line;
acquiring a pre-generated weather data datum line, and calculating a second historical correlation quantity between each historical weather data in the historical weather data datum line diagram and the weather data datum line;
Generating a history related quantity data pair based on the first history related quantity and the second history related quantity, and correlating the history related quantity data pair with corresponding history transaction electric quantity to obtain a plurality of sample key value pairs;
and taking the historical related quantity data pairs in the plurality of key value pairs as model input, taking the historical transaction electric quantity in the plurality of key value pairs as model output, and carrying out model training on an initial transaction electric quantity prediction model to obtain a transaction electric quantity prediction model.
In one possible implementation manner, the correlation amount calculating module is configured to obtain a pre-generated transaction price reference line, and specifically includes:
acquiring historical year transaction electricity quantity data, wherein the historical year transaction electricity quantity data comprises a historical year transaction price set;
storing the historical year transaction price set into a historical year transaction price form, detecting whether the historical year transaction price form has data missing, acquiring two adjacent transaction prices of first missing data when the historical year transaction price form is determined to have the data missing, calculating a transaction price average value of the adjacent transaction prices, and carrying out data complement processing on the first missing data based on the transaction price average value to obtain a complete historical year transaction price form;
Acquiring the transaction price median in the historical year transaction price complete form, and carrying out data division processing on all data in the historical year transaction price complete form based on the transaction price median to obtain a low transaction price set and a high transaction price set;
counting a first quantity corresponding to the low transaction price set and a second quantity corresponding to the high transaction price set, calculating a first duty ratio of first data to the total data in the complete form of historical annual transaction price, calculating a second duty ratio of second data to the total data in the complete form of historical annual transaction price, and simultaneously acquiring a low transaction price median corresponding to the low transaction price set and a high transaction price median corresponding to the high transaction price set;
substituting the low trade price median, the high trade price median, the first duty ratio and the second duty ratio into a preset trade price reference calculation formula to obtain a trade price reference value, and determining a trade price reference line based on the trade price reference value.
In one possible implementation, the preset transaction price benchmark calculation formula is as follows:
;
In the method, in the process of the invention,for the trade price reference value, N is the total data in the complete form of the trade price in the history year, ++>For high trade price median->Is a low trade price median->For a first duty cycle->For a second duty cycle->For the first quantity->A second number.
In one possible implementation manner, the correlation amount calculating module is configured to calculate a first correlation amount between the transaction price datum and the predicted transaction price, and calculate a second correlation amount between the weather data datum and the predicted weather data, and specifically includes:
generating a transaction price reference line graph based on the transaction price reference line, and acquiring a first coordinate position of the predicted transaction price on the transaction price reference line graph;
calculating a first distance between the transaction price datum line and the predicted transaction price according to the first coordinate position, and determining a first correlation quantity according to the first distance;
setting the first correlation amount to be a first positive correlation amount when the first coordinate position is determined to be located above the transaction price reference line;
setting the first correlation amount to be a first negative correlation amount when the first coordinate position is determined to be located below the transaction price reference line;
Setting the first correlation quantity as a first flat correlation quantity when the first coordinate position is determined to be coincident with the transaction price datum line;
generating a weather data reference line graph based on the weather data reference line, and acquiring a second coordinate position of the predicted weather data on the weather data reference line graph;
calculating a second distance between the weather data datum line and the predicted weather data according to the second coordinate position, and determining a second correlation quantity according to the second distance;
setting the second correlation amount to be a second positive correlation amount when the second coordinate position is determined to be located above the weather data reference line;
setting the second correlation amount to be a second negative correlation amount when the second coordinate position is determined to be located below the weather data reference line;
and setting the second correlation amount as a second flat correlation amount when the second coordinate position is determined to be coincident with the weather data reference line.
The invention provides a transaction electric quantity prediction device, which further comprises: a predictive transaction power correction module;
the predicted transaction electric quantity correction module is used for carrying out data correction processing on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity;
The data correction processing is performed on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity, which specifically includes:
determining a first type of the first correlation quantity according to the first correlation quantity, wherein the first type comprises a first positive correlation quantity, a first negative correlation quantity and a first positive correlation quantity;
determining a second type of the second correlation quantity according to the second correlation quantity, wherein the second type comprises a second positive correlation quantity, a second negative correlation quantity and a second positive correlation quantity;
and according to the first type and the second type, a first weight value is matched from a preset weight table, and data correction processing is carried out on the predicted transaction electric quantity based on the first weight value, so that the optimal predicted transaction electric quantity is obtained.
In one possible implementation manner, the transaction electricity quantity prediction module is configured to input the related quantity data pair into a pre-trained transaction electricity quantity prediction model, so that the transaction electricity quantity prediction model outputs a predicted transaction electricity quantity, and specifically includes:
inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model, so that the transaction electric quantity prediction model calculates first matching degrees between the related quantity data pair and all sample key value pairs, and extracting all first sample key value pairs, of which the first matching degrees meet a preset matching degree threshold, from all sample key value pairs based on the first matching degrees;
And extracting all first historical transaction electric quantity from all first sample key value pairs, calculating a first historical transaction electric quantity average value corresponding to all first historical transaction electric quantity, taking the first historical transaction electric quantity average value as predicted transaction electric quantity, and outputting the predicted transaction electric quantity.
The invention also provides a terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the transaction electricity quantity prediction method according to any one of the above when executing the computer program.
The invention also provides a computer readable storage medium, which comprises a stored computer program, wherein the computer program is used for controlling a device where the computer readable storage medium is located to execute the transaction electric quantity prediction method according to any one of the above.
Compared with the prior art, the transaction electric quantity prediction method, the device, the equipment and the storage medium have the following beneficial effects:
collecting a plurality of historical transaction electric quantity data of a user, wherein each historical transaction electric quantity data comprises historical transaction electric quantity, historical transaction price and historical weather data; inputting the historical transaction price into a pre-trained transaction price prediction model so that the transaction price prediction model outputs a predicted transaction price, and inputting the historical weather data into a pre-trained weather data prediction model so that the weather data prediction model outputs predicted weather data; acquiring a pre-generated transaction price datum line and a weather data datum line, calculating a first correlation quantity between the transaction price datum line and the predicted transaction price, calculating a second correlation quantity between the weather data datum line and the predicted weather data, and correlating the first correlation quantity with the second correlation quantity to obtain a correlation quantity data pair; inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model so that the transaction electric quantity prediction model outputs predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs related to historical transaction electric quantity and historical related quantity data pairs; compared with the prior art, the technical scheme of the invention also considers transaction price and weather data when collecting historical transaction electric quantity data, can more comprehensively analyze influence factors on the transaction electric quantity, and improves the accuracy of subsequent prediction; the pre-trained transaction price prediction model and weather data prediction model are adopted, different data prediction processing is executed, the processing of a large amount of data based on a single prediction model is avoided, and the prediction efficiency of the subsequent transaction electric quantity prediction model can be further improved; meanwhile, in the process of predicting the transaction electric quantity, the correlation quantity data are input into the transaction electric quantity prediction model by calculating the correlation quantity of different influence factors, so that the correlation between historical data can be better utilized, and the accuracy and the stability of the transaction electric quantity prediction are improved.
Drawings
FIG. 1 is a flow chart of an embodiment of a transaction electricity prediction method according to the present invention;
fig. 2 is a schematic structural diagram of an embodiment of a transaction electricity prediction device according to the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment 1, referring to fig. 1, fig. 1 is a flow chart of an embodiment of a transaction electricity prediction method provided by the present invention, as shown in fig. 1, the method includes steps 101 to 104, specifically as follows:
step 101: a plurality of historical transaction power data of a user is collected, wherein each historical transaction power data includes a historical transaction power, a historical transaction price, and historical weather data.
In one embodiment, based on the data collection tool, historical transaction electricity, historical transaction price and historical weather data are obtained from a transaction electricity system storing historical transaction electricity data through a data interface.
In one embodiment, the historical transaction electricity data further includes historical transaction time; for each historical transaction time, the associated historical transaction electric quantity, historical transaction price and historical weather data are provided, wherein the historical transaction price is electric price data corresponding to the historical transaction time, and the historical weather data is temperature data corresponding to the historical transaction time.
In one embodiment, after collecting a plurality of historical transaction electric quantity data of the user, data preprocessing is further performed on the historical transaction electric quantity data to obtain preprocessed historical transaction electric quantity data.
Specifically, when the historical transaction electric quantity data is subjected to data preprocessing, the historical transaction price and the historical weather data are respectively subjected to data preprocessing.
Specifically, the historical transaction prices are firstly ordered according to the order from small to large to obtain a historical transaction price sequence, a first historical transaction price quartile corresponding to the historical transaction price sequence is calculated based on a first quartile calculation formula, and a second historical transaction price quartile corresponding to the historical transaction price sequence is calculated based on a second quartile calculation formula; calculating historical transaction price quartile distances according to the first historical transaction price quartile and the second historical transaction price quartile, determining historical transaction price upper limit values and historical transaction price lower limit values based on the calculated historical transaction price quartile distances, the first historical transaction price quartile and the second historical transaction price quartile data, detecting abnormal values of all historical transaction prices according to the historical transaction price upper limit values and the historical transaction price lower limit values, and adjusting the detected abnormal values.
Specifically, the first quartile calculation formula is as follows:
in the method, in the process of the invention,for the first quartile,/->For the number of historical transaction price sequences.
Specifically, the second quartile calculation formula is as follows:
in the method, in the process of the invention,for the second quartile,/->For the number of historical transaction price sequences.
Specifically, when calculating the historical transaction price quartile distance according to the first historical transaction price quartile and the second historical transaction price quartile, calculating the difference between the second historical transaction price quartile and the first historical transaction price quartile, and taking the difference as the historical transaction price quartile distance.
Specifically, when determining an upper historical transaction price limit and a lower historical transaction price limit based on the calculated historical transaction price quartile distance, the first historical transaction price quartile and the second historical transaction price quartile data, substituting the second historical transaction price quartile and the historical transaction price quartile distance into a preset upper limit calculation formula to obtain an upper historical transaction price limit, and substituting the first historical transaction price quartile and the historical transaction price quartile distance into a preset lower limit calculation formula to obtain an upper historical transaction price limit, wherein the upper limit calculation formula is as follows:
Wherein k is a preset multiple,for historical trade price upper limit,/->Price quartile distance for historical transactions.
The lower limit value calculation formula is as follows:
wherein k is a preset multiple,for historical trade price lower limit,/->Price quartile distance for historical transactions.
Specifically, according to the historical transaction price upper limit value and the historical transaction price lower limit value, detecting abnormal values of all historical transaction prices, judging whether a first historical transaction price exceeding the historical transaction price upper limit value exists in all the historical transaction prices when the detected abnormal values are subjected to data adjustment, if so, adjusting the first historical transaction price to be the historical transaction price upper limit value, judging whether a second historical transaction price exceeding the historical transaction price lower limit value exists in all the historical transaction prices, and if so, adjusting the second historical transaction price to be the historical transaction price lower limit value.
Specifically, the historical weather data are firstly sequenced from small to large to obtain a historical weather data sequence, a first quartile calculation formula based on the historical weather data sequence is calculated, and a second historical weather data quartile corresponding to the historical weather data sequence is calculated based on a second quartile calculation formula; according to the first historical weather data quartile and the second historical weather data quartile, calculating historical weather data quartile distances, determining historical weather data upper limit values and historical weather data lower limit values based on the calculated historical weather data quartile distances, the first historical weather data quartile and the second historical weather data quartile, detecting abnormal values of all the historical weather data according to the historical weather data upper limit values and the historical weather data lower limit values, and carrying out data adjustment on the detected abnormal values.
Specifically, when calculating the historical weather data quartile distance according to the first historical weather data quartile and the second historical weather data quartile, calculating a difference between the second historical weather data quartile and the first historical weather data quartile, and taking the difference as the historical weather data quartile distance.
Specifically, when determining the historical weather data upper limit value and the historical weather data lower limit value based on the calculated historical weather data quartile distance, the first historical weather data quartile and the second historical weather data quartile, substituting the second historical weather data quartile and the historical weather data quartile distance into a preset upper limit value calculation formula to obtain the historical weather data upper limit value, and substituting the first historical weather data quartile and the historical weather data quartile distance into a preset lower limit value calculation formula to obtain the historical weather data upper limit value.
Specifically, according to the historical weather data upper limit value and the historical weather data lower limit value, detecting abnormal values of all the historical weather data, judging whether first historical weather data exceeding the historical weather data upper limit value exists in all the historical weather data when the detected abnormal values are subjected to data adjustment, if so, adjusting the first historical weather data into the historical weather data upper limit value, judging whether second historical weather data exceeding the historical weather data lower limit value exists in all the historical weather data, and if so, adjusting the second historical weather data into the historical weather data lower limit value.
Step 102: and inputting the historical transaction price into a pre-trained transaction price prediction model so that the transaction price prediction model outputs a predicted transaction price, and inputting the historical weather data into a pre-trained weather data prediction model so that the weather data prediction model outputs predicted weather data.
In one embodiment, the historical transaction price is converted into historical transaction price time series data, wherein the historical transaction price time series data is the historical transaction price data arranged according to time sequence, and the data is ensured to contain a time stamp and a corresponding historical transaction price, and the time stamp corresponds to the historical transaction time.
In an embodiment, feature engineering extraction is performed on the historical transaction price time series data, and a first target feature corresponding to the historical transaction price time series data is determined, wherein the first target feature comprises a first hysteresis value, a first moving average value and a first technical index.
In one embodiment, model training is performed on the selected time series model based on the historical transaction price time series data and the first target feature to obtain a transaction price prediction model.
In one embodiment, after the transaction price prediction model is obtained, transaction price time series data is updated based on a preset time interval, and based on the updated transaction price time series data, iterative optimization processing is performed on the transaction price prediction model, so that dynamic update processing of the transaction price prediction model is realized.
In one embodiment, the historical transaction price preprocessed in step 101 is input into a pre-trained transaction price prediction model, so that the transaction price prediction model outputs a predicted transaction price.
In one embodiment, the historical weather data is converted into historical weather data time series data, wherein the historical weather data time series data is the historical weather data arranged according to time sequence, and the data is ensured to contain a time stamp and corresponding historical weather data, and the time stamp corresponds to historical transaction time.
In an embodiment, feature engineering extraction is performed on the historical weather data time series data, and a second target feature corresponding to the historical weather data time series data is determined, where the second target feature includes a second hysteresis value, a second moving average value and a second technical index.
In an embodiment, model training is performed on the selected time series model based on the historical weather data time series data and the second target feature to obtain a weather data prediction model.
In an embodiment, after the weather data prediction model is obtained, the weather data time sequence data is updated based on a preset time interval, and based on the updated weather data time sequence data, iterative optimization processing is performed on the weather data prediction model, so that dynamic update processing of the weather data prediction model is realized.
In one embodiment, the historical weather data preprocessed in step 101 is input into a pre-trained weather data prediction model, so that the weather data prediction model outputs predicted weather data.
Step 103: and acquiring a pre-generated transaction price datum line and a weather data datum line, calculating a first correlation quantity between the transaction price datum line and the predicted transaction price, calculating a second correlation quantity between the weather data datum line and the predicted weather data, and correlating the first correlation quantity with the second correlation quantity to obtain a correlation quantity data pair.
In one embodiment, historical year transaction electricity quantity data is obtained, wherein the historical year transaction electricity quantity data comprises a historical year transaction price set and a historical year weather data set.
In an embodiment, the historical year transaction price set is stored in a historical year transaction price form, whether data loss exists in the historical year transaction price form is detected, when the data loss exists in the historical year transaction price form is determined, two adjacent transaction prices of first missing data are obtained, the transaction price average value of the adjacent transaction prices is calculated, and data complement processing is conducted on the first missing data based on the transaction price average value, so that a complete historical year transaction price form is obtained.
Specifically, when detecting whether the historical year transaction price form has data missing, converting the historical year transaction price form into a transaction price image, extracting RIO (information input/output) areas of the transaction price image so as to extract transaction price data areas, performing binarization processing on the transaction price data areas to obtain first pixel values corresponding to each pixel point in the transaction price data areas, determining a plurality of first connection areas in the transaction price data areas based on the first pixel values by using a connection area analysis algorithm, and determining that the historical year transaction price form has data missing when detecting that the first connection areas larger than a preset maximum connection area threshold value exist in the plurality of first connection areas.
In an embodiment, a transaction price median in the historical transaction price complete form is obtained, and data division processing is performed on all data in the historical transaction price complete form based on the transaction price median to obtain a low transaction price set and a high transaction price set.
Specifically, dividing all historical year transaction prices smaller than the transaction price median in the historical year transaction price complete form into low transaction prices, and generating a low transaction price set; dividing all historical year transaction prices which are not less than the median of the transaction prices in the complete historical year transaction price form into high transaction prices, and generating a high transaction price set.
In one embodiment, a first number corresponding to the low transaction price set and a second number corresponding to the high transaction price set are counted, a first ratio of the first data to the total number of data in the complete form of historical annual transaction price is calculated, a second ratio of the second data to the total number of data in the complete form of historical annual transaction price is calculated, and meanwhile, a low transaction price median corresponding to the low transaction price set and a high transaction price median corresponding to the high transaction price set are obtained.
In one embodiment, the low trade price median, the high trade price median, the first duty ratio and the second duty ratio are substituted into a preset trade price reference calculation formula to obtain a trade price reference value, and a trade price reference line is determined based on the trade price reference value.
In one embodiment, the preset transaction price benchmark calculation formula is as follows:
;
in the method, in the process of the invention,for the trade price reference value, N is the total data in the complete form of the trade price in the history year, ++>For high trade price median->Is a low trade price median->For a first duty cycle->For a second duty cycle->For the first quantity->A second number.
In one embodiment, historical year transaction power data is obtained, wherein the historical year transaction power data includes a historical year weather dataset.
In an embodiment, the historical annual weather data set is stored in a historical annual weather data form, whether the historical annual weather data form has data missing is detected, when the historical annual weather data form is determined to have the data missing, two adjacent weather data of second missing data are obtained, the weather data average value of the adjacent weather data is calculated, and data complement processing is carried out on the second missing data based on the weather data average value, so that a complete historical annual weather data form is obtained.
Specifically, when whether the historical weather data form is missing or not is detected, the historical weather data form is converted into a weather data image, RIO region extraction is conducted on the weather data image so that a weather data region is extracted, binarization processing is conducted on the weather data region to obtain a second pixel value corresponding to each pixel point in the weather data region, a plurality of second connected regions in the weather data region are determined based on the second pixel values by using a connected region analysis algorithm, and when the fact that a second connected region larger than a preset maximum connected region threshold exists in the plurality of second connected regions is detected, the fact that the data is missing in the historical weather data form is determined.
In an embodiment, a weather data median in the historical year weather data complete form is obtained, and data division processing is performed on all data in the historical year weather data complete form based on the weather data median to obtain a low weather data set and a high weather data set.
Specifically, dividing all historical year weather data smaller than the median of the weather data in the complete form of the historical year weather data into low weather data, and generating a low weather data set; and dividing all the historical year weather data which are not less than the median of the weather data in the complete form of the historical year weather data into high weather data, and generating a high weather data set.
In an embodiment, a third number corresponding to the low weather data set and a fourth number corresponding to the high weather data set are counted, a third duty ratio of the third data to the total number of data in the complete form of the historical annual weather data is calculated, a fourth duty ratio of the fourth data to the total number of data in the complete form of the historical annual weather data is calculated, and meanwhile, a median value of the low weather data corresponding to the low weather data set is obtained, and a median value of the high weather data corresponding to the high weather data set is obtained.
In an embodiment, the low weather data median, the high weather data median, the third duty ratio and the fourth duty ratio are substituted into a preset weather data reference calculation formula to obtain a weather data reference value, and the weather data reference line is determined based on the weather data reference value.
In an embodiment, the preset weather data reference calculation formula is as follows:
;
in the method, in the process of the invention,for the weather data reference value, n is the total number of data in the complete form of the historical weather data, ++>For high weather data median +.>Is the median of low weather data,/->For a third duty cycle->For a fourth duty cycle->For the third quantity- >A fourth number.
In one embodiment, a transaction price reference line graph is generated based on the transaction price reference line, and a first coordinate position of the predicted transaction price on the transaction price reference line graph is obtained; and calculating a first distance between the transaction price datum line and the predicted transaction price according to the first coordinate position, and determining a first correlation quantity according to the first distance.
Specifically, a first minimum distance from the first coordinate position to the transaction price reference line is calculated through a Euclidean distance calculation formula, the first minimum distance is set to be a first distance between the transaction price reference line and the predicted transaction price, and the first distance is set to be a first correlation quantity.
In an embodiment, the first correlation amount is set to a first positive correlation amount when it is determined that the first coordinate position is located above the transaction price reference line.
In one embodiment, the first correlation is set to be a first negative correlation when the first coordinate position is determined to be below the transaction price reference line.
In one embodiment, the first correlation is set to be a first flat correlation when the first coordinate position is determined to be coincident with the transaction price reference line.
In one embodiment, a weather data reference line diagram is generated based on the weather data reference line, and a second coordinate position of the predicted weather data on the weather data reference line diagram is obtained; and calculating a second distance between the weather data datum line and the predicted weather data according to the second coordinate position, and determining a second correlation quantity according to the second distance.
Specifically, a second minimum distance from the second coordinate position to the weather data reference line is calculated through a Euclidean distance calculation formula, the second minimum distance is set to be a first distance between the weather data reference line and the predicted weather data, and the second distance is set to be a second correlation quantity.
In an embodiment, the second correlation amount is set to a second positive correlation amount when it is determined that the second coordinate position is located above the weather data reference line.
In an embodiment, the second correlation amount is set to be a second negative correlation amount when it is determined that the second coordinate position is located below the weather data reference line.
In an embodiment, the second correlation amount is set to be a second flat correlation amount when it is determined that the second coordinate position coincides with the weather data reference line.
In an embodiment, the first correlation amount and the second correlation amount are correlated to obtain a correlation amount data pair.
Step 104: inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model so that the transaction electric quantity prediction model outputs predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs which are related to historical transaction electric quantity and historical related quantity data pairs.
In an embodiment, the collected plurality of historical transaction electric quantity data are automatically input into a preset historical transaction electric quantity table, and the historical transaction electric quantity table is subjected to graphic conversion to obtain a historical transaction price line graph and a historical weather data line graph.
Specifically, based on the historical transaction time corresponding to the collected historical transaction electric quantity data, the historical transaction data are sequentially input into a predicted historical transaction electric quantity table according to the sequence from the morning to the evening, wherein the historical transaction electric quantity table comprises a historical transaction price attribute column, a historical weather data attribute column, a historical transaction time attribute column and a historical transaction electric quantity attribute column.
Specifically, all data in the historical transaction price attribute column are acquired, and a historical transaction price line graph is generated; and acquiring all data in the historical weather data attribute column, and generating a historical weather data line graph.
In one embodiment, a pre-generated trade price benchmark is obtained, and a first historical correlation quantity between each historical trade price in the historical trade price benchmark and the trade price benchmark is calculated.
In one embodiment, a pre-generated weather data baseline is obtained, and a second historical correlation amount between each historical weather data and the weather data baseline in the historical weather data line graph is calculated.
In one embodiment, based on the first historical correlation quantity and the second historical correlation quantity, a historical correlation quantity data pair is generated, and the historical correlation quantity data pair is associated with corresponding historical transaction electric quantity to obtain a plurality of sample key value pairs; and each sample key value pair takes the historical transaction electric quantity as a key name and the historical related quantity data pair as a key value.
In an embodiment, the historical related quantity data pairs in the plurality of key value pairs are used as model input, the historical transaction electric quantity in the plurality of key value pairs is used as model output, and model training is performed on an initial transaction electric quantity prediction model to obtain a transaction electric quantity prediction model.
In an embodiment, after the transaction electric quantity prediction model is obtained, a sample key value pair is updated based on a preset time interval, and based on the updated sample key value pair, iterative optimization processing is performed on the transaction electric quantity prediction model, so that dynamic update processing of the transaction electric quantity prediction model is realized.
In one embodiment, the correlation quantity data pair is input into a pre-trained transaction electric quantity prediction model, so that the transaction electric quantity prediction model calculates first matching degrees between the correlation quantity data pair and all sample key value pairs, and all first sample key value pairs, of which the first matching degrees meet a preset matching degree threshold, are extracted from all sample key value pairs based on the first matching degrees; and extracting all first historical transaction electric quantity from all first sample key value pairs, calculating a first historical transaction electric quantity average value corresponding to all first historical transaction electric quantity, taking the first historical transaction electric quantity average value as predicted transaction electric quantity, and outputting the predicted transaction electric quantity.
In one embodiment, after the transaction electric quantity prediction model outputs the predicted transaction electric quantity, the method further includes: and carrying out data correction processing on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain the optimal predicted transaction electric quantity.
In an embodiment, when the data correction processing is performed on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity, a first type of the first correlation quantity is determined according to the first correlation quantity, where the first type includes a first positive correlation quantity, a first negative correlation quantity and a first positive correlation quantity; determining a second type of the second correlation quantity according to the second correlation quantity, wherein the second type comprises a second positive correlation quantity, a second negative correlation quantity and a second positive correlation quantity; and according to the first type and the second type, a first weight value is matched from a preset weight table, and data correction processing is carried out on the predicted transaction electric quantity based on the first weight value, so that the optimal predicted transaction electric quantity is obtained.
Embodiment 2 referring to fig. 2, fig. 2 is a schematic structural diagram of an embodiment of a transaction electricity quantity predicting device provided by the present invention, and as shown in fig. 2, the device includes a historical transaction electricity quantity data acquisition module 201, a transaction electricity quantity related data predicting module 202, a related calculating module 203 and a transaction electricity quantity predicting module 204, specifically as follows:
the historical transaction electricity quantity data collection module 201 is configured to collect a plurality of historical transaction electricity quantity data of a user, where each of the historical transaction electricity quantity data includes a historical transaction electricity quantity, a historical transaction price and historical weather data.
The transaction electricity related data prediction module 202 is configured to input the historical transaction price into a pre-trained transaction price prediction model, so that the transaction price prediction model outputs a predicted transaction price, and input the historical weather data into a pre-trained weather data prediction model, so that the weather data prediction model outputs predicted weather data.
The related quantity calculating module 203 is configured to obtain a pre-generated transaction price reference line and a weather data reference line, calculate a first related quantity between the transaction price reference line and the predicted transaction price, calculate a second related quantity between the weather data reference line and the predicted weather data, and correlate the first related quantity and the second related quantity to obtain a related quantity data pair.
The transaction electricity quantity prediction module 204 is configured to input the correlation quantity data pair into a pre-trained transaction electricity quantity prediction model, so that the transaction electricity quantity prediction model outputs a predicted transaction electricity quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs which are related to historical transaction electric quantity and historical related quantity data pairs.
In one embodiment, the transaction electricity prediction model in the transaction electricity prediction module 204 is trained by a plurality of sample key value pairs associated with a plurality of historical transaction electricity and historical related quantity data pairs, and specifically includes: automatically inputting the collected multiple historical transaction electric quantity data into a preset historical transaction electric quantity table, and performing graphic conversion on the historical transaction electric quantity table to obtain a historical transaction price line graph and a historical weather data line graph; acquiring a pre-generated trade price datum line, and calculating a first historical correlation quantity between each historical trade price in the historical trade price datum line and the trade price datum line; acquiring a pre-generated weather data datum line, and calculating a second historical correlation quantity between each historical weather data in the historical weather data datum line diagram and the weather data datum line; generating a history related quantity data pair based on the first history related quantity and the second history related quantity, and correlating the history related quantity data pair with corresponding history transaction electric quantity to obtain a plurality of sample key value pairs; and taking the historical related quantity data pairs in the plurality of key value pairs as model input, taking the historical transaction electric quantity in the plurality of key value pairs as model output, and carrying out model training on an initial transaction electric quantity prediction model to obtain a transaction electric quantity prediction model.
In one embodiment, the related quantity calculating module 203 is configured to obtain a pre-generated transaction price reference line, and specifically includes: acquiring historical year transaction electricity quantity data, wherein the historical year transaction electricity quantity data comprises a historical year transaction price set; storing the historical year transaction price set into a historical year transaction price form, detecting whether the historical year transaction price form has data missing, acquiring two adjacent transaction prices of first missing data when the historical year transaction price form is determined to have the data missing, calculating a transaction price average value of the adjacent transaction prices, and carrying out data complement processing on the first missing data based on the transaction price average value to obtain a complete historical year transaction price form; acquiring the transaction price median in the historical year transaction price complete form, and carrying out data division processing on all data in the historical year transaction price complete form based on the transaction price median to obtain a low transaction price set and a high transaction price set; counting a first quantity corresponding to the low transaction price set and a second quantity corresponding to the high transaction price set, calculating a first duty ratio of first data to the total data in the complete form of historical annual transaction price, calculating a second duty ratio of second data to the total data in the complete form of historical annual transaction price, and simultaneously acquiring a low transaction price median corresponding to the low transaction price set and a high transaction price median corresponding to the high transaction price set; substituting the low trade price median, the high trade price median, the first duty ratio and the second duty ratio into a preset trade price reference calculation formula to obtain a trade price reference value, and determining a trade price reference line based on the trade price reference value.
In one embodiment, the preset transaction price benchmark calculation formula is as follows:
;
in the method, in the process of the invention,for the trade price reference value, N is the total data in the complete form of the trade price in the history year, ++>For high trade price median->Is a low trade price median->For a first duty cycle->For a second duty cycle->For the first quantity->A second number.
In one embodiment, the correlation calculation module 203 is configured to calculate a first correlation between the transaction price reference line and the predicted transaction price, and calculate a second correlation between the weather data reference line and the predicted weather data, and specifically includes: generating a transaction price reference line graph based on the transaction price reference line, and acquiring a first coordinate position of the predicted transaction price on the transaction price reference line graph; calculating a first distance between the transaction price datum line and the predicted transaction price according to the first coordinate position, and determining a first correlation quantity according to the first distance; setting the first correlation amount to be a first positive correlation amount when the first coordinate position is determined to be located above the transaction price reference line; setting the first correlation amount to be a first negative correlation amount when the first coordinate position is determined to be located below the transaction price reference line; setting the first correlation quantity as a first flat correlation quantity when the first coordinate position is determined to be coincident with the transaction price datum line; generating a weather data reference line graph based on the weather data reference line, and acquiring a second coordinate position of the predicted weather data on the weather data reference line graph; calculating a second distance between the weather data datum line and the predicted weather data according to the second coordinate position, and determining a second correlation quantity according to the second distance; setting the second correlation amount to be a second positive correlation amount when the second coordinate position is determined to be located above the weather data reference line; setting the second correlation amount to be a second negative correlation amount when the second coordinate position is determined to be located below the weather data reference line; and setting the second correlation amount as a second flat correlation amount when the second coordinate position is determined to be coincident with the weather data reference line.
The transaction electric quantity prediction device provided in this embodiment further includes: and a predicted transaction power correction module.
In an embodiment, the predicted transaction electric quantity correction module is configured to perform data correction processing on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity, so as to obtain an optimal predicted transaction electric quantity.
In an embodiment, the performing data correction processing on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity specifically includes: determining a first type of the first correlation quantity according to the first correlation quantity, wherein the first type comprises a first positive correlation quantity, a first negative correlation quantity and a first positive correlation quantity; determining a second type of the second correlation quantity according to the second correlation quantity, wherein the second type comprises a second positive correlation quantity, a second negative correlation quantity and a second positive correlation quantity; and according to the first type and the second type, a first weight value is matched from a preset weight table, and data correction processing is carried out on the predicted transaction electric quantity based on the first weight value, so that the optimal predicted transaction electric quantity is obtained.
In one embodiment, the transaction electricity prediction module 204 is configured to input the correlation data pair into a pre-trained transaction electricity prediction model, so that the transaction electricity prediction model outputs a predicted transaction electricity, and specifically includes: inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model, so that the transaction electric quantity prediction model calculates first matching degrees between the related quantity data pair and all sample key value pairs, and extracting all first sample key value pairs, of which the first matching degrees meet a preset matching degree threshold, from all sample key value pairs based on the first matching degrees; and extracting all first historical transaction electric quantity from all first sample key value pairs, calculating a first historical transaction electric quantity average value corresponding to all first historical transaction electric quantity, taking the first historical transaction electric quantity average value as predicted transaction electric quantity, and outputting the predicted transaction electric quantity.
It will be clear to those skilled in the art that, for convenience and brevity of description, reference may be made to the corresponding process in the foregoing method embodiment for the specific working process of the above-described apparatus, which is not described in detail herein.
It should be noted that, the embodiment of the transaction electricity prediction device described above is merely illustrative, where the modules described as separate components may or may not be physically separated, and components displayed as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
On the basis of the embodiment of the transaction electricity quantity prediction method, another embodiment of the present invention provides a transaction electricity quantity prediction terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor executes the computer program to implement the transaction electricity quantity prediction method according to any one of the embodiments of the present invention.
Illustratively, in this embodiment the computer program may be partitioned into one or more modules, which are stored in the memory and executed by the processor to perform the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program in the transaction charge prediction terminal device.
The transaction electric quantity prediction terminal equipment can be computing equipment such as a desktop computer, a notebook computer, a palm computer and a cloud server. The transaction electricity prediction terminal device may include, but is not limited to, a processor, a memory.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center of the transaction electricity prediction terminal device, and various interfaces and lines are used to connect various parts of the entire transaction electricity prediction terminal device.
The memory may be used to store the computer program and/or module, and the processor may implement various functions of the transaction electricity prediction terminal device by running or executing the computer program and/or module stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the cellular phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
On the basis of the embodiment of the transaction electricity quantity prediction method, another embodiment of the invention provides a storage medium, which comprises a stored computer program, wherein when the computer program runs, a device where the storage medium is controlled to execute the transaction electricity quantity prediction method according to any embodiment of the invention.
In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, where the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form, and so on. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
In summary, the transaction electric quantity prediction method, device, equipment and storage medium provided by the invention collect a plurality of historical transaction electric quantity data of a user, including historical transaction electric quantity, historical transaction price and historical weather data; the historical transaction price is input into a transaction price prediction model to obtain a predicted transaction price, and the historical weather data is input into a weather data prediction model to obtain predicted weather data; calculating a first correlation quantity of a transaction price datum line and a predicted transaction price and a second correlation quantity of a weather data datum line and predicted weather data, and inputting correlation quantity data pairs obtained by correlating the first correlation quantity and the second correlation quantity into a transaction electric quantity prediction model to obtain predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs related to historical transaction electric quantity and historical related quantity data pairs; compared with the prior art, the technical scheme of the invention improves the prediction efficiency and the prediction accuracy of the transaction electric quantity.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and substitutions can be made by those skilled in the art without departing from the technical principles of the present invention, and these modifications and substitutions should also be considered as being within the scope of the present invention.

Claims (10)

1. A transaction electricity quantity prediction method, comprising:
collecting a plurality of historical transaction electricity quantity data of a user, wherein each historical transaction electricity quantity data comprises historical transaction electricity quantity, historical transaction price and historical weather data;
inputting the historical transaction price into a pre-trained transaction price prediction model so that the transaction price prediction model outputs a predicted transaction price, and inputting the historical weather data into a pre-trained weather data prediction model so that the weather data prediction model outputs predicted weather data;
acquiring a pre-generated transaction price datum line and a weather data datum line, calculating a first correlation quantity between the transaction price datum line and the predicted transaction price, calculating a second correlation quantity between the weather data datum line and the predicted weather data, and correlating the first correlation quantity with the second correlation quantity to obtain a correlation quantity data pair;
inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model so that the transaction electric quantity prediction model outputs predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs which are related to historical transaction electric quantity and historical related quantity data pairs.
2. The method of claim 1, wherein the transaction electricity prediction model is trained from a plurality of sample key value pairs associated with historical transaction electricity and historical correlation data pairs, and specifically comprises:
automatically inputting the collected multiple historical transaction electric quantity data into a preset historical transaction electric quantity table, and performing graphic conversion on the historical transaction electric quantity table to obtain a historical transaction price line graph and a historical weather data line graph;
acquiring a pre-generated trade price datum line, and calculating a first historical correlation quantity between each historical trade price in the historical trade price datum line and the trade price datum line;
acquiring a pre-generated weather data datum line, and calculating a second historical correlation quantity between each historical weather data in the historical weather data datum line diagram and the weather data datum line;
generating a history related quantity data pair based on the first history related quantity and the second history related quantity, and correlating the history related quantity data pair with corresponding history transaction electric quantity to obtain a plurality of sample key value pairs;
and taking the historical related quantity data pairs in the plurality of key value pairs as model input, taking the historical transaction electric quantity in the plurality of key value pairs as model output, and carrying out model training on an initial transaction electric quantity prediction model to obtain a transaction electric quantity prediction model.
3. The method for predicting transaction electricity according to claim 1, wherein obtaining a pre-generated transaction price reference line specifically comprises:
acquiring historical year transaction electricity quantity data, wherein the historical year transaction electricity quantity data comprises a historical year transaction price set;
storing the historical year transaction price set into a historical year transaction price form, detecting whether the historical year transaction price form has data missing, acquiring two adjacent transaction prices of first missing data when the historical year transaction price form is determined to have the data missing, calculating a transaction price average value of the adjacent transaction prices, and carrying out data complement processing on the first missing data based on the transaction price average value to obtain a complete historical year transaction price form;
acquiring the transaction price median in the historical year transaction price complete form, and carrying out data division processing on all data in the historical year transaction price complete form based on the transaction price median to obtain a low transaction price set and a high transaction price set;
counting a first quantity corresponding to the low transaction price set and a second quantity corresponding to the high transaction price set, calculating a first duty ratio of first data to the total data in the complete form of historical annual transaction price, calculating a second duty ratio of second data to the total data in the complete form of historical annual transaction price, and simultaneously acquiring a low transaction price median corresponding to the low transaction price set and a high transaction price median corresponding to the high transaction price set;
Substituting the low trade price median, the high trade price median, the first duty ratio and the second duty ratio into a preset trade price reference calculation formula to obtain a trade price reference value, and determining a trade price reference line based on the trade price reference value.
4. A transaction electricity prediction method according to claim 3, wherein the preset transaction price reference calculation formula is as follows:
;
in the method, in the process of the invention,for the trade price reference value, N is the total data in the complete form of the trade price in the history year, ++>For high trade price median->Is a low trade price median->For a first duty cycle->For a second duty cycle->For the first quantity->A second number.
5. The method of claim 1, wherein calculating a first amount of correlation between the transaction price baseline and the predicted transaction price and calculating a second amount of correlation between the weather data baseline and the predicted weather data, comprises:
generating a transaction price reference line graph based on the transaction price reference line, and acquiring a first coordinate position of the predicted transaction price on the transaction price reference line graph;
Calculating a first distance between the transaction price datum line and the predicted transaction price according to the first coordinate position, and determining a first correlation quantity according to the first distance;
setting the first correlation amount to be a first positive correlation amount when the first coordinate position is determined to be located above the transaction price reference line;
setting the first correlation amount to be a first negative correlation amount when the first coordinate position is determined to be located below the transaction price reference line;
setting the first correlation quantity as a first flat correlation quantity when the first coordinate position is determined to be coincident with the transaction price datum line;
generating a weather data reference line graph based on the weather data reference line, and acquiring a second coordinate position of the predicted weather data on the weather data reference line graph;
calculating a second distance between the weather data datum line and the predicted weather data according to the second coordinate position, and determining a second correlation quantity according to the second distance;
setting the second correlation amount to be a second positive correlation amount when the second coordinate position is determined to be located above the weather data reference line;
setting the second correlation amount to be a second negative correlation amount when the second coordinate position is determined to be located below the weather data reference line;
And setting the second correlation amount as a second flat correlation amount when the second coordinate position is determined to be coincident with the weather data reference line.
6. The method of claim 5, wherein after the transaction electricity prediction model outputs the predicted transaction electricity, further comprising:
performing data correction processing on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity;
the data correction processing is performed on the predicted transaction electric quantity based on the first correlation quantity and the second correlation quantity to obtain an optimal predicted transaction electric quantity, which specifically includes:
determining a first type of the first correlation quantity according to the first correlation quantity, wherein the first type comprises a first positive correlation quantity, a first negative correlation quantity and a first positive correlation quantity;
determining a second type of the second correlation quantity according to the second correlation quantity, wherein the second type comprises a second positive correlation quantity, a second negative correlation quantity and a second positive correlation quantity;
and according to the first type and the second type, a first weight value is matched from a preset weight table, and data correction processing is carried out on the predicted transaction electric quantity based on the first weight value, so that the optimal predicted transaction electric quantity is obtained.
7. The method of claim 1, wherein inputting the correlation data pair into a pre-trained transaction power prediction model to cause the transaction power prediction model to output a predicted transaction power, specifically comprising:
inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model, so that the transaction electric quantity prediction model calculates first matching degrees between the related quantity data pair and all sample key value pairs, and extracting all first sample key value pairs, of which the first matching degrees meet a preset matching degree threshold, from all sample key value pairs based on the first matching degrees; and extracting all first historical transaction electric quantity from all first sample key value pairs, calculating a first historical transaction electric quantity average value corresponding to all first historical transaction electric quantity, taking the first historical transaction electric quantity average value as predicted transaction electric quantity, and outputting the predicted transaction electric quantity.
8. A transaction electricity quantity prediction device, comprising: the system comprises a historical transaction electric quantity data acquisition module, a transaction electric quantity related data prediction module, a related amount calculation module and a transaction electric quantity prediction module;
The historical transaction electric quantity data acquisition module is used for acquiring a plurality of historical transaction electric quantity data of a user, wherein each historical transaction electric quantity data comprises historical transaction electric quantity, historical transaction price and historical weather data;
the transaction electric quantity related data prediction module is used for inputting the historical transaction price into a pre-trained transaction price prediction model so that the transaction price prediction model outputs a predicted transaction price, and inputting the historical weather data into the pre-trained weather data prediction model so that the weather data prediction model outputs predicted weather data;
the correlation calculation module is used for acquiring a pre-generated transaction price datum line and a weather data datum line, calculating a first correlation between the transaction price datum line and the predicted transaction price, calculating a second correlation between the weather data datum line and the predicted weather data, and correlating the first correlation with the second correlation to obtain a correlation data pair;
the transaction electric quantity prediction module is used for inputting the related quantity data pair into a pre-trained transaction electric quantity prediction model so that the transaction electric quantity prediction model outputs predicted transaction electric quantity; the transaction electric quantity prediction model is trained by a plurality of sample key value pairs which are related to historical transaction electric quantity and historical related quantity data pairs.
9. A terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the transaction charge prediction method according to any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the transaction amount prediction method according to any one of claims 1 to 7.
CN202311629465.9A 2023-12-01 2023-12-01 Transaction electric quantity prediction method, device, equipment and storage medium Active CN117333219B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311629465.9A CN117333219B (en) 2023-12-01 2023-12-01 Transaction electric quantity prediction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311629465.9A CN117333219B (en) 2023-12-01 2023-12-01 Transaction electric quantity prediction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117333219A true CN117333219A (en) 2024-01-02
CN117333219B CN117333219B (en) 2024-03-08

Family

ID=89277760

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311629465.9A Active CN117333219B (en) 2023-12-01 2023-12-01 Transaction electric quantity prediction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117333219B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016035719A (en) * 2014-08-04 2016-03-17 株式会社東芝 Electric power transaction support system, electric power transaction system, control method and control program
CN110991745A (en) * 2019-12-05 2020-04-10 新奥数能科技有限公司 Power load prediction method and device, readable medium and electronic equipment
WO2020252784A1 (en) * 2019-06-21 2020-12-24 西门子股份公司 Power load data prediction method and device, and storage medium
CN113781112A (en) * 2021-09-09 2021-12-10 江苏方天电力技术有限公司 Method and system for analyzing and predicting influence factors of electric power bidding transaction price
CN115392546A (en) * 2022-08-02 2022-11-25 国网福建省电力有限公司经济技术研究院 Method and device for predicting cooling electric quantity and managing demand side based on meteorological factors
JP2022184742A (en) * 2021-05-31 2022-12-13 出光興産株式会社 Program, power control method, and power control system
KR20230043547A (en) * 2021-09-24 2023-03-31 광운대학교 산학협력단 Method for learning of power transaction model based of deep reinforcement learning and method for transacting power using the power transaction model
CN116191398A (en) * 2022-12-06 2023-05-30 深圳供电局有限公司 Load prediction method, load prediction device, computer equipment and storage medium
CN116485443A (en) * 2023-01-05 2023-07-25 华能曲阜热电有限公司 Electric power spot market price information prediction optimization method and system
CN116865254A (en) * 2023-07-07 2023-10-10 四川中电启明星信息技术有限公司 Power load index prediction method, system, equipment and medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016035719A (en) * 2014-08-04 2016-03-17 株式会社東芝 Electric power transaction support system, electric power transaction system, control method and control program
WO2020252784A1 (en) * 2019-06-21 2020-12-24 西门子股份公司 Power load data prediction method and device, and storage medium
CN110991745A (en) * 2019-12-05 2020-04-10 新奥数能科技有限公司 Power load prediction method and device, readable medium and electronic equipment
JP2022184742A (en) * 2021-05-31 2022-12-13 出光興産株式会社 Program, power control method, and power control system
CN113781112A (en) * 2021-09-09 2021-12-10 江苏方天电力技术有限公司 Method and system for analyzing and predicting influence factors of electric power bidding transaction price
KR20230043547A (en) * 2021-09-24 2023-03-31 광운대학교 산학협력단 Method for learning of power transaction model based of deep reinforcement learning and method for transacting power using the power transaction model
CN115392546A (en) * 2022-08-02 2022-11-25 国网福建省电力有限公司经济技术研究院 Method and device for predicting cooling electric quantity and managing demand side based on meteorological factors
CN116191398A (en) * 2022-12-06 2023-05-30 深圳供电局有限公司 Load prediction method, load prediction device, computer equipment and storage medium
CN116485443A (en) * 2023-01-05 2023-07-25 华能曲阜热电有限公司 Electric power spot market price information prediction optimization method and system
CN116865254A (en) * 2023-07-07 2023-10-10 四川中电启明星信息技术有限公司 Power load index prediction method, system, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周保杰;徐鹏程;: "基于历史经验数据的短期发电量 预测数学模型的建立与应用", 企业研究, no. 24 *

Also Published As

Publication number Publication date
CN117333219B (en) 2024-03-08

Similar Documents

Publication Publication Date Title
CN110751326B (en) Photovoltaic day-ahead power prediction method and device and storage medium
CN113177366B (en) Comprehensive energy system planning method and device and terminal equipment
CN113705929B (en) Spring festival holiday load prediction method based on load characteristic curve and typical characteristic value fusion
CN112565422B (en) Method, system and storage medium for identifying fault data of power internet of things
CN113516275A (en) Power distribution network ultra-short term load prediction method and device and terminal equipment
CN115730605B (en) Data analysis method based on multidimensional information
CN114611738A (en) Load prediction method based on user electricity consumption behavior analysis
CN114912720A (en) Memory network-based power load prediction method, device, terminal and storage medium
CN113112099A (en) Power grid daily electric quantity prediction model training method and power grid daily electric quantity prediction method
CN110852346A (en) Energy consumption control method and device for communication equipment, computer equipment and storage medium
CN113268403A (en) Time series analysis and prediction method, device, equipment and storage medium
CN111260147A (en) Power generation capacity prediction method and device and terminal equipment
CN117333219B (en) Transaction electric quantity prediction method, device, equipment and storage medium
CN113222281A (en) Power distribution network short-term load prediction method and device based on improved AlexNet-GRU model
CN109344875B (en) Method and device for generating solar wind power output time sequence based on cluster analysis
CN116706884A (en) Photovoltaic power generation amount prediction method, device, terminal and storage medium
CN108830663B (en) Electric power customer value evaluation method and system and terminal equipment
CN114676931B (en) Electric quantity prediction system based on data center technology
CN114138743A (en) ETL task automatic configuration method and device based on machine learning
CN109241146A (en) Student's intelligence aid method and system under cluster environment
CN115130924A (en) Microgrid power equipment asset evaluation method and system under source grid storage background
CN114169923A (en) Photovoltaic power station power prediction method, system, terminal and storage medium
CN112614005A (en) Enterprise rework state processing method and device
CN112711913A (en) Cooling, heating and power short-term load prediction system and method based on granularity support vector machine
CN117436550B (en) Recommendation model training method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant