A digital intelligent management method and system for purchasing and selling electricity
By introducing event bus, independent event listeners, database connection pools and aggregation management platforms into the power purchase and sales management system, we will dynamically find the optimal aggregation solution, which solves the problem of lack of quantitative support for management methods and difficulty in system expansion in the existing technology, and achieves efficient and flexible power purchase and sales management.
Patent Information
- Application Number
- CN202411446229.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-10-16
AI Technical Summary
现有的供电服务体系管理方法依赖定性分析,缺乏量化数据支持,导致决策难以准确评估成效和风险;关键业务转型提升成效未被量化,管理者难以衡量工作进展和效果;传统电力数据管理系统难以扩展和升级,限制了系统的应用范围和发展潜力。
A digital management method for purchasing and selling electricity is proposed, by establishing an event bus, configuring an independent event listener for the application system, pre-creating database connections and storing them into a connection pool, analyzing query requests through the aggregation management platform, and dynamically finding the optimal aggregation solution for data processing.
It realizes loose coupling and efficient cooperation between system components, improves the response speed of power purchase and sales service processing, and the flexibility and scalability of the system, improves the accuracy and efficiency of aggregation, and facilitates better management of power purchase and sales service.
Smart Images

Figure CN119379201B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power supply service systems, and in particular to a digital intelligent management method and system for purchasing and selling electricity. Background Art
[0002] With the rapid development and intelligent transformation of various industries, the planning, construction, management and operation of the power supply service system are also facing the challenges of transformation and upgrading. The existing planning and management methods of the power supply service system are still based on qualitative analysis and system research, which leads to a series of problems: first, the traditional method relies too much on qualitative analysis and lacks intuitive and quantitative data support, making it difficult for decision makers to accurately evaluate the actual results and potential risks of the power supply service system construction; second, in the process of power supply service system construction, the transformation and improvement results of key businesses have not been quantified, resulting in managers being unable to accurately measure the progress and effects of various tasks, making it difficult to formulate targeted improvement measures; third, traditional power data management systems are often difficult to smoothly expand and upgrade when facing new business needs and data volume growth, thus limiting the application scope and development potential of the system. Summary of the invention
[0003] Based on this, the purpose of the present invention is to propose a digital management method and system for purchasing and selling electricity to solve the above-mentioned problems.
[0004] According to a digital intelligent management method for electricity purchase and sale proposed in the present invention, the method includes:
[0005] Establish an event bus to receive and distribute various events in the power purchase and sales business, including data query, data source update and process execution;
[0006] An independent event listener is configured for each application system to capture events on the event bus in real time and trigger corresponding business logic processing. The application system includes an electricity purchase and sales fee analysis and display system and an electricity purchase and sales operation analysis and display system;
[0007] Creating an initial database connection for each data source, and storing the connection in a database connection pool, wherein the data source includes data sources such as user classification, quantity and fee budgeting, meter reading, electricity fee calculation, and charging account data;
[0008] When the application system initiates a data query request to the data source through an event-driven mechanism, it obtains a connection from the database connection pool and retrieves target data from the corresponding data source;
[0009] Receive data query requests from the application system through the aggregation management platform and parse out aggregation requirements;
[0010] Finding an optimal aggregation solution according to the aggregation requirement, and performing aggregation calculation on the target data according to the optimal aggregation solution to generate an aggregation result;
[0011] After the aggregation is completed, a data return event is triggered, and the aggregation result is distributed to the corresponding application system through the aggregation management platform for analysis and display through the application system.
[0012] Furthermore, the finding of the optimal aggregation solution according to the aggregation requirement includes:
[0013] According to the aggregation requirements, a fitness function is defined;
[0014] Combined with the fitness function, the optimal aggregation scheme is found through genetic algorithm, including determining the best aggregation algorithm and parameter combination.
[0015] Furthermore, the combination of the fitness function and the search for the optimal aggregation scheme through a genetic algorithm include:
[0016] Combined with the clustering algorithm, an initial population containing initial individuals with higher fitness is created, wherein each individual represents an aggregation scheme, and each aggregation scheme contains different aggregation algorithms and parameter combination settings;
[0017] According to the fitness function, the aggregation schemes in the population are ranked;
[0018] Select the aggregation scheme with higher fitness as the parent scheme;
[0019] Performing a crossover operation on the parent solution to generate a new child solution, wherein the child solution inherits part of the aggregation algorithm and parameters of the parent solution;
[0020] Mutate the offspring solutions to explore new aggregation algorithms and parameter combinations;
[0021] The selection, crossover and mutation operations are repeated until the iteration termination condition is met. After the iteration is terminated, the solution with the highest fitness is selected as the optimal aggregation solution.
[0022] Furthermore, the combined clustering algorithm creates an initial population containing initial individuals with higher fitness, including:
[0023] The clustering algorithm is used to perform pattern recognition on the aggregation schemes in the historical data to identify the aggregation algorithms and parameter ranges that are closely related to the high-quality solutions, and the aggregation algorithm and parameter combinations that are closely related to the high-quality solutions are defined as high-quality combinations;
[0024] According to the results of pattern recognition, a group of initial individuals with higher fitness are generated.
[0025] Furthermore, according to the result of pattern recognition, a group of initial individuals with higher fitness is generated, including:
[0026] For each of the high-quality aggregation algorithms and parameters, a value probability distribution is established according to the frequency or importance of the algorithm in the historical high-quality solutions;
[0027] Create an empty initial population list to store the generated individuals;
[0028] Traversing all aggregation algorithms and parameters, and for each aggregation algorithm and parameter, determining whether it is part of the high-quality combination;
[0029] If it is part of the high-quality combination, the value is generated according to the bias of its value probability distribution;
[0030] If it is not part of the high-quality combination, the value is generated according to the uniform distribution;
[0031] Combine the selected aggregation algorithm and parameter values into a complete individual;
[0032] The fitness of each generated individual is evaluated through the fitness function;
[0033] According to the fitness evaluation results, individuals with higher fitness are selected as part of the initial population;
[0034] Repeat the above steps until a sufficient number of initial individuals are generated to form a complete initial population.
[0035] Furthermore, the clustering algorithm is used to perform pattern recognition on the aggregation schemes in the historical data to identify the aggregation algorithms and parameter ranges closely related to the high-quality solutions, including:
[0036] Collect a large amount of historical data with different aggregation requirements. Each data sample includes the aggregated input data, aggregation results, the adopted aggregation scheme and its fitness value.
[0037] Extract key features from each data sample, including the type of aggregation algorithm, parameter settings, statistical characteristics of the input data, and the fitness value of the corresponding solution;
[0038] Based on the extracted features, a similarity metric is defined to measure the similarity or difference between different aggregation schemes in terms of aggregation requirements and fitness evaluation directions;
[0039] Performing cluster analysis on all historical data through a clustering algorithm. In the clustering process, clustering schemes with similar aggregation requirements and fitness are classified into one category according to the similarity metric, and a clustering label is assigned to data samples of the same category.
[0040] The aggregation scheme in the cluster with the highest fitness is extracted as a high-quality solution to the aggregation demand corresponding to the cluster.
[0041] Furthermore, the fitness function is defined according to the aggregation requirement, including:
[0042] If the aggregated demand is the proxy power purchase quantity forecast, and the aggregation target is determined to improve the accuracy of the forecast, the fitness function is defined as:
[0043] F P =w1*(1 / MSE)+w2*(1 / MAE),
[0044] Among them, F P It represents the fitness value of the proxy power purchase quantity forecast;
[0045] MSE is the mean square error of the purchased electricity, which is the mean of the sum of squares of the differences between the predicted value and the true value of the purchased electricity, and is used to measure the accuracy of the purchased electricity forecast;
[0046] MAE is the mean absolute error of electricity sales, which is the mean of the absolute values of the differences between the predicted value and the true value of electricity sales, and is used to measure the accuracy of electricity sales forecast;
[0047] w1 and w2 are weight coefficients used to balance the importance of the prediction accuracy of power purchase and power sales in the fitness function.
[0048] Furthermore, the step of defining a fitness function according to the aggregation requirement further includes:
[0049] If the aggregation demand is the performance evaluation of electricity purchase and sales, and the aggregation target is determined to be a comprehensive evaluation of the company's profitability, the fitness function is defined as:
[0050] F OE =w3*(PC) / T+w4*(1 / R1)+w5*R2-w6*R3,
[0051] Among them, F OE It represents the fitness value of the performance evaluation of electricity purchase and sales operation;
[0052] P is the net profit from electricity sales;
[0053] C is the total cost of purchasing electricity;
[0054] T is the revenue from electricity sales;
[0055] R1 is the cost-to-income ratio of the electricity purchase and sales business, that is, the ratio of the total cost to the total income of the electricity purchase and sales business;
[0056] R2 is the electricity cost recovery rate;
[0057] R3 is the loss rate of electricity purchase and sales business, including power transmission loss and unrecovered electricity charges;
[0058] w3, w4, w5 and w6 are weight coefficients used to balance the importance of different indicators in the fitness function.
[0059] The present invention also proposes a digital intelligent management system for purchasing and selling electricity, the system comprising:
[0060] Event bus module: used to establish an event bus for receiving and distributing various events in the power purchase and sales business, including data query, data source update and process execution;
[0061] Listening module: used to configure an independent event listener for each application system, used to capture events on the event bus in real time and trigger corresponding business logic processing. The application system includes the electricity purchase and sale fee analysis and display system and the electricity purchase and sale operation analysis and display system;
[0062] Data connection module: used to create an initial database connection for each data source and store the connection in a database connection pool. The data source includes data sources such as user classification, quantity and fee budgeting, meter reading, electricity fee calculation and charging account data;
[0063] Query request initiation module: when the application system initiates a data query request to the data source through an event-driven mechanism, it obtains a connection from the database connection pool and retrieves target data from the corresponding data source;
[0064] Query request receiving module: used to receive the data query request of the application system through the aggregation management platform and parse out the aggregation requirements;
[0065] Aggregation scheme module: used to find the optimal aggregation scheme according to the aggregation requirement, and perform aggregation calculation on the target data according to the optimal aggregation scheme to generate an aggregation result;
[0066] Display module: used to trigger a data return event after the aggregation is completed, and distribute the aggregation results to the corresponding application system through the aggregation management platform for analysis and display through the application system.
[0067] In summary, according to the above-mentioned digital management method for electricity purchase and sales, an efficient event bus system is constructed to receive and distribute various events in the electricity purchase and sales business in real time, so as to improve the response speed of electricity purchase and sales business processing; at the same time, an independent event listener is configured for each application system to ensure that events on the event bus can be captured and processed in real time, thereby triggering the corresponding business logic to enhance the flexibility and scalability of the system; a database connection is created for each data source in advance and stored in the connection pool to optimize the management of database connections and improve data query efficiency; in the process of data query and aggregation, the query request of the application system is parsed through the aggregation management platform, the aggregation requirements are identified, and the optimal aggregation solution is dynamically found for data processing to ensure the accuracy and efficiency of the aggregation results; after the aggregation is completed, the results are promptly distributed to the corresponding application system through the event-driven mechanism for data analysis and display.
[0068] The digital management method for electricity purchase and sale of the present invention realizes loose coupling and efficient collaboration between system components through event-driven, database connection pool, aggregation management and other mechanisms. This architecture makes the system more stable and reliable, and can also cope with various complex electricity purchase and sale business analysis scenarios. In aggregation management, the present invention can also dynamically explore the most suitable aggregation scheme according to aggregation needs, so that the system can flexibly adapt to data changes, greatly improving the accuracy and efficiency of aggregation, and facilitating power supply service companies to better manage electricity purchase and sale business, and improve business management analysis efficiency and decision-making level.
[0069] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or will be learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0071] Figure 1 This is a flow chart of a digital intelligent management method for electricity purchase and sale according to the first embodiment of the present invention;
[0072] Figure 2 This is another flow chart of a digital intelligent management method for electricity purchase and sale according to the first embodiment of the present invention;
[0073] Figure 3 This is a system block diagram of a digital management system for purchasing and selling electricity according to the second embodiment of the present invention. DETAILED DESCRIPTION
[0074] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0075] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0077] Embodiment 1
[0078] See also Figure 1 The present invention proposes a digital intelligent management method for electricity purchase and sale, which includes steps S101 to S107:
[0079] S101, establish an event bus for receiving and distributing various events in the power purchase and sales business, including data query, data source update and process execution.
[0080] Understandably, an event bus is established as the receiving and distribution center for various events in the power purchase and sales business. These events cover multiple aspects such as data query, data source update, and process execution. Through the unified management and scheduling of the event bus, it is ensured that each component in the system can obtain the required information in a timely and accurate manner, so as to work together to support the smooth operation of the power purchase and sales business.
[0081] The event bus achieves loose coupling between components by defining a unified event format and communication protocol. Components no longer directly depend on or call each other, but communicate indirectly through the event bus, which reduces complexity and improves the flexibility and scalability of the system.
[0082] In addition, the event bus can receive and distribute events in real time, improving the processing speed and efficiency of power purchase and sales business. At the same time, it also simplifies the development and maintenance of the power supply service system, reducing the development difficulty and maintenance cost.
[0083] S102, configuring an independent event listener for each application system to capture events on the event bus in real time and trigger corresponding business logic processing, the application system includes an electricity purchase and sale fee analysis and display system and an electricity purchase and sale operation analysis and display system.
[0084] Understandably, configuring an independent event listener for each application system can ensure that each application system can capture relevant events on the event bus in a timely and accurate manner. After capturing the event, the listener filters it according to the type and attributes of the event to determine whether the event belongs to the processing scope of the current application system. For events that belong to the processing scope, the listener needs to trigger the corresponding business logic processing to ensure timely response and efficient execution of the business.
[0085] By configuring independent event listeners for key application systems such as the electricity purchase and sales fee analysis and display system and the electricity purchase and sales business analysis and display system, it can be ensured that these systems can quickly respond to the corresponding business analysis and display requirements, and improve the efficiency and accuracy of business processing. Independent event listeners also make it easy to add or remove application systems without affecting the normal operation of other application systems. Each application system can handle its own business logic more flexibly without having to worry about the processing of other systems, which enhances the flexibility and scalability of the system.
[0086] S103, creating an initial database connection for each data source and storing the connection in a database connection pool, wherein the data source includes data sources including user classification, quantity and fee budgeting, meter reading collection, electricity fee calculation and charging account data.
[0087] Understandably, for each key data source involved in the electricity purchase and sales business (such as user classification, quantity and fee budgeting, meter reading, electricity fee calculation, and charging account data, etc.), create a corresponding database connection according to the type and configuration information of the database. Use database connection pool technology (such as HikariCP, C3P0, etc.), and configure the connection pool parameters according to system requirements, such as the maximum number of connections, the minimum number of connections, and the connection timeout. Store the created connection in the database connection pool, which is responsible for the life cycle management of the connection, including the creation, use, release, and recycling of the connection.
[0088] This embodiment can effectively reduce the connection establishment time for each data access by pre-establishing a database connection, thereby improving data access efficiency. At the same time, by using database connection pool technology, multiple connections can be efficiently managed, and connections can be dynamically allocated and released according to actual system needs, avoiding resource waste caused by too many connections. The centralized connection management method also makes the system maintenance and upgrade process easier. In addition, the connection pool also has the ability to handle concurrent access, ensuring that the system can still maintain stable operation under high load conditions.
[0089] S104, when the application system initiates a data query request to the data source through the event-driven mechanism, a connection is obtained from the database connection pool, and target data is retrieved from the corresponding data source;
[0090] It is understandable that when the event-driven mechanism triggers a data query request, the application system will use an available connection from the connection pool, send a query request to the corresponding data source (such as user classification data, quantity and fee budgeting data, meter reading data, etc.), and retrieve the required target data from the data source.
[0091] After obtaining the target data, fuzzy logic can be used to process the uncertainty in the target data, such as processing missing values, smoothing abnormal data, etc., to improve the accuracy and reliability of the data.
[0092] S105, receiving the data query request of the application system through the aggregation management platform, and parsing the aggregation requirements.
[0093] It can be understood that the aggregation management platform acts as an intermediary and is responsible for receiving data query requests from the application system. The requests may contain SQL queries, JSON or XML data in a specific format to describe the aggregation requirements. The platform parses these requests and can use intelligent parsing to extract key information, such as aggregation type (such as sum, average, maximum value, minimum value, grouping, etc.), aggregation fields, grouping conditions, and any special processing requirements.
[0094] S106, searching for an optimal aggregation solution according to the aggregation requirement, and performing aggregation calculation on the target data according to the optimal aggregation solution to generate an aggregation result.
[0095] It is understandable that after clarifying the aggregation requirements, we need to find an optimal aggregation solution to perform efficient and accurate aggregation calculations. The selection of an aggregation solution involves many aspects, including selecting appropriate data processing methods, algorithms or models, and determining how to organize and process data to obtain the most accurate results.
[0096] Use the optimal aggregation solution to perform actual aggregation calculations on the target data. This process may involve executing SQL queries or calling the API of the big data processing framework. After the calculation is completed, the aggregation results that meet the needs of the application system are generated. These results can be presented in the form of reports, charts, data files, etc. for viewing or further analysis.
[0097] S107, after the aggregation is completed, a data return event is triggered, and the aggregation result is distributed to the corresponding application system through the aggregation management platform for analysis and display through the application system.
[0098] Understandably, after the aggregation calculation is completed, the system will trigger a data return event, which marks the end of the aggregation process and indicates that the aggregation results are ready to be returned to the application system. The aggregation results are distributed to the corresponding application systems through the aggregation management platform. The application system further processes, analyzes and intuitively displays these aggregation results.
[0099] Among them, the electricity purchase and sales fee analysis and display system can display the full-process indicators such as the forecast of power purchase by agents, market-based procurement, and inter-provincial spot execution. These indicators usually involve the core business processes of the power supply service industry and are of great significance to the operation and decision-making of enterprises. The electricity purchase and sales business analysis and display system can display relevant data on the company's business conditions, such as quantity (such as power, power growth rate, etc.), price (such as electricity price, electricity price trend, etc.), fee (such as electricity fee, cost, etc.), loss (such as power transmission loss, unrecovered electricity fee, etc.). These data help enterprises to fully understand their own operating conditions and conduct effective cost control and profit analysis.
[0100] Based on steps S101 to S107, an efficient event bus system is constructed to receive and distribute various events in the power purchase and sales business in real time, so as to improve the response speed of the power purchase and sales business processing; at the same time, an independent event listener is configured for each application system to ensure that the events on the event bus can be captured and processed in real time, thereby triggering the corresponding business logic to enhance the flexibility and scalability of the system; a database connection is created for each data source in advance and stored in a connection pool to optimize the management of database connections and improve data query efficiency; in the process of data query and aggregation, the query request of the application system is parsed through the aggregation management platform, the aggregation requirements are identified, and the optimal aggregation solution is dynamically found for data processing to ensure the accuracy and efficiency of the aggregation results; after the aggregation is completed, the results are promptly distributed to the corresponding application system through the event-driven mechanism for data analysis and display.
[0101] The digital management method for electricity purchase and sale of the present invention realizes loose coupling and efficient collaboration between system components through event-driven, database connection pool, aggregation management and other mechanisms. This architecture makes the system more stable and reliable, and can also cope with various complex electricity purchase and sale business analysis scenarios. In aggregation management, the present invention can also dynamically explore the most suitable aggregation scheme according to aggregation needs, so that the system can flexibly adapt to data changes, greatly improving the accuracy and efficiency of aggregation, and facilitating power supply service companies to better manage electricity purchase and sale business, and improve business management analysis efficiency and decision-making level.
[0102] The following is a further detailed introduction to a digital intelligent management method for purchasing and selling electricity according to an embodiment of the present invention:
[0103] Further optional, such as Figure 2 As shown, in step S106, the optimal aggregation solution is found according to the aggregation requirement, including steps S201 to S202:
[0104] Step S201, defining a fitness function according to the aggregation requirement;
[0105] Step S202, combining the fitness function, searching for the best aggregation solution through a genetic algorithm, including determining the best aggregation algorithm and parameter combination.
[0106] Based on steps S201 to S202, the optimal aggregation scheme is found according to the aggregation requirements. First, a fitness function is defined according to specific requirements. This function is used to evaluate the effect of the aggregation scheme. Then, combined with the defined fitness function, an iterative search is performed using a genetic algorithm to find the optimal aggregation scheme. This process includes determining the most suitable aggregation algorithm and finding the best parameter combination that matches the algorithm, thereby ensuring the efficiency and accuracy of the aggregation calculation.
[0107] Since the selection of aggregation scheme is affected by multiple factors, such as data quality, algorithm performance, etc., the optimal aggregation scheme is found through genetic algorithms. Genetic algorithms can comprehensively consider these factors and find the best scheme that meets all conditions through iterative optimization. Even if some aggregation requirements specify the aggregation type, such as summation, average, etc., genetic algorithms can still be used to dynamically adjust other aspects, such as data preprocessing methods, aggregation granularity, query performance optimization, etc., to find the best solution under a specific aggregation type.
[0108] Further optionally, in step S202, the combining fitness function and searching for the optimal aggregation scheme through a genetic algorithm may include:
[0109] Combined with the clustering algorithm, an initial population containing initial individuals with higher fitness is created, wherein each individual represents an aggregation scheme, and each aggregation scheme contains different aggregation algorithms and parameter combination settings;
[0110] According to the fitness function, the aggregation schemes in the population are ranked;
[0111] Select the aggregation scheme with higher fitness as the parent scheme;
[0112] Performing a crossover operation on the parent solution to generate a new child solution, wherein the child solution inherits part of the aggregation algorithm and parameters of the parent solution;
[0113] Mutate the offspring solutions to explore new aggregation algorithms and parameter combinations;
[0114] The selection, crossover and mutation operations are repeated until the iteration termination condition is met. After the iteration is terminated, the solution with the highest fitness is selected as the optimal aggregation solution.
[0115] Understandably, with the global search capability of the genetic algorithm, the candidate solutions are iteratively optimized by simulating natural selection and genetic processes to find the global optimal solution among many candidate solutions. The optimal aggregation solution found by the genetic algorithm in this embodiment can play a significant role in improving the comprehensive performance of the efficiency, accuracy or timeliness of the aggregation calculation, thereby better meeting business needs and improving the performance and value of data processing.
[0116] In particular, in the process of finding the optimal aggregation scheme through the genetic algorithm, the clustering algorithm is combined to create the initial population to construct a set of initial individuals with higher fitness, which will serve as the starting point for the genetic algorithm optimization. Here, the clustering algorithm is used to group or cluster the aggregation schemes in the historical data. Based on their similarities in certain characteristics or attributes, those initial individuals that may have higher fitness can be found, because similar schemes are likely to show similar performance. Through clustering, the size of the initial population can be reduced while maintaining the diversity of the population, thereby improving the efficiency of the genetic algorithm.
[0117] Further optionally, the combining clustering algorithm to create an initial population including initial individuals with higher fitness includes:
[0118] The clustering algorithm is used to perform pattern recognition on the aggregation schemes in the historical data to identify the aggregation algorithms and parameter ranges that are closely related to the high-quality solutions, and the aggregation algorithm and parameter combinations that are closely related to the high-quality solutions are defined as high-quality combinations;
[0119] According to the results of pattern recognition, a group of initial individuals with higher fitness are generated.
[0120] Understandably, the clustering algorithm is combined with the initialization process of the genetic algorithm to improve the efficiency and accuracy of finding the optimal aggregation solution. Specifically, the clustering algorithm is first used to perform in-depth pattern recognition on the aggregation solutions in the historical data, which can accurately identify those aggregation algorithms and their corresponding parameter ranges that are closely related to the high-quality solutions. Through this pattern recognition, the system can automatically screen out the most potential aggregation algorithms and parameter combinations, which are called high-quality combinations. Subsequently, based on these high-quality combinations, the system generates a set of initial individuals with higher fitness to prepare for the subsequent optimization process of the genetic algorithm. This initialization strategy not only improves the quality of the initial population, but also significantly accelerates the speed at which the genetic algorithm converges to the optimal solution, thereby improving the efficiency and performance of finding the optimal aggregation solution as a whole.
[0121] Further optionally, generating a group of initial individuals with higher fitness according to the result of pattern recognition includes:
[0122] For each of the high-quality aggregation algorithms and parameters, a value probability distribution is established according to the frequency or importance of the algorithm in the historical high-quality solutions;
[0123] Create an empty initial population list to store the generated individuals;
[0124] Traversing all aggregation algorithms and parameters, and for each aggregation algorithm and parameter, determining whether it is part of the high-quality combination;
[0125] If it is part of the high-quality combination, the value is generated according to the bias of its value probability distribution;
[0126] If it is not part of the high-quality combination, the value is generated according to the uniform distribution to maintain the diversity of the population;
[0127] Combine the selected aggregation algorithm and parameter values into a complete individual;
[0128] The fitness of each generated individual is evaluated through the fitness function;
[0129] According to the fitness evaluation results, individuals with higher fitness are selected as part of the initial population;
[0130] Repeat the above steps until a sufficient number of initial individuals are generated to form a complete initial population.
[0131] It is understandable that the initial population generation strategy of this embodiment is based on the results of pattern recognition and combines probability bias and uniform distribution sampling, which can improve the fitness and diversity of individuals in the initial population. Specifically, first, according to the frequency or importance of high-quality aggregation algorithms and parameters in historical high-quality solutions, the value probability distribution is established for these algorithms and parameters. Subsequently, when creating the initial population, for the part belonging to the high-quality combination, the system performs biased generation according to its value probability distribution, which is more likely to produce individuals with high fitness; and for the part that does not belong to the high-quality combination, the uniform distribution is used to generate values to ensure the diversity and exploration of the population. Each individual composed of an aggregation algorithm and parameter values will be evaluated by the fitness function, and only individuals with higher fitness will be selected as part of the initial population. This process is repeated until a sufficient number of initial individuals are generated to form a complete initial population with both high quality and diversity. This strategy not only improves the average fitness of individuals in the initial population, but also provides a more favorable starting point for subsequent genetic algorithm optimization, thereby accelerating the search process for the optimal aggregation solution.
[0132] Further optionally, the method of performing pattern recognition on the aggregation schemes in the historical data by using a clustering algorithm to identify the aggregation algorithms and parameter ranges closely related to the high-quality solutions includes:
[0133] Collect a large amount of historical data with different aggregation requirements. Each data sample includes the aggregated input data, aggregation results, the adopted aggregation scheme and its fitness value.
[0134] Extract key features from each data sample, including the type of aggregation algorithm, parameter settings, statistical characteristics of the input data (such as mean, variance, etc.), and the fitness value of the corresponding solution;
[0135] Based on the extracted features, a similarity metric is defined to measure the similarity or difference between different aggregation schemes in terms of aggregation requirements and fitness evaluation directions;
[0136] Performing cluster analysis on all historical data through a clustering algorithm. In the clustering process, clustering schemes with similar aggregation requirements and fitness are classified into one category according to the similarity metric, and a clustering label is assigned to data samples of the same category.
[0137] The aggregation scheme in the cluster with the highest fitness is extracted as a high-quality solution to the aggregation demand corresponding to the cluster.
[0138] Understandably, clustering algorithms are used to efficiently recognize patterns in aggregation schemes in large amounts of historical data in order to discover aggregation algorithms and parameter ranges that are closely associated with high-quality solutions. First, historical data containing different aggregation requirements are collected and analyzed, and key features are extracted to fully characterize each data sample. Then, a similarity metric is defined to quantify the similarities or differences between different aggregation schemes in terms of aggregation requirements and fitness evaluation. Using this metric, the clustering algorithm can accurately classify schemes with similar aggregation requirements and fitness into one category, and identify cluster labels for each category. By extracting the aggregation schemes in the cluster with the highest fitness, the system can identify high-quality solutions for specific aggregation requirements, thereby preparing for subsequent optimization and decision-making.
[0139] Further optionally, in step S201, defining a fitness function according to the aggregation requirement includes:
[0140] If the aggregated demand is the proxy power purchase quantity forecast, and the aggregation target is determined to improve the accuracy of the forecast, the fitness function is defined as:
[0141] F P =w1*(1 / MSE)+w2*(1 / MAE),
[0142] Among them, F P It represents the fitness value of the proxy power purchase quantity forecast;
[0143] MSE is the mean square error of the purchased electricity volume, which is the mean of the sum of squares of the differences between the predicted value and the true value of the purchased electricity volume. It is used to measure the accuracy of the purchased electricity volume forecast. The smaller the MSE value, the more accurate the forecast.
[0144] MAE is the mean absolute error of electricity sales, which is the average of the absolute values of the difference between the predicted value and the actual value of electricity sales. It is used to measure the accuracy of electricity sales forecast. The smaller the MAE value, the more accurate the forecast.
[0145] w1 and w2 are weight coefficients used to balance the importance of the prediction accuracy of power purchase and power sales in the fitness function.
[0146] Understandably, according to the aggregated demand for proxy power purchase prediction, the fitness function F can be defined P , whose goal is to improve the accuracy of the prediction. This function combines the inverse of the mean square error and the mean absolute error, and balances the importance of the two in evaluating the accuracy of the prediction through the weight coefficient, thereby obtaining the fitness value. The definition of this fitness function can not only improve the evaluation accuracy of the prediction accuracy of the purchased and sold electricity, but also provide a clear guiding direction for the subsequent optimization algorithm, which is conducive to achieving a more accurate proxy purchase electricity prediction.
[0147] Further optionally, defining a fitness function according to the aggregation requirement further includes:
[0148] If the aggregation demand is the performance evaluation of electricity purchase and sales, and the aggregation target is determined to be a comprehensive evaluation of the company's profitability, the fitness function is defined as:
[0149] F OE =w3*(PC) / T+w4*(1 / R1)+w5*R2-w6*R3,
[0150] Among them, F OE It represents the fitness value of the performance evaluation of power purchase and sales business, which comprehensively reflects the profitability of the company in the power purchase and sales business;
[0151] P is the net profit from electricity sales, i.e. the net income after deducting relevant taxes and costs from electricity sales revenue;
[0152] C is the total cost of electricity purchase, that is, the total amount paid by the company for electricity;
[0153] T is the electricity sales revenue, which is the total revenue the company gets from selling electricity;
[0154] R1 is the cost-to-income ratio of the power purchase and sales business, that is, the ratio of the total cost of the power purchase and sales business to the total income. This indicator is used to measure the profitability efficiency of the company's power purchase and sales business;
[0155] R2 is the electricity fee recovery rate, especially refers to the recovery of electricity fees after electricity sales. This indicator reflects the efficiency and effect of the company's electricity fee recovery;
[0156] R3 is the loss rate of electricity purchase and sales business, including power transmission loss and unrecovered electricity charges. This indicator measures the company's losses in the process of purchasing and selling electricity;
[0157] w3, w4, w5 and w6 are weight coefficients used to balance the importance of different indicators in the fitness function.
[0158] Understandably, a multi-dimensional fitness function can be constructed for the aggregation needs of the performance evaluation of power purchase and sales operations. This function comprehensively considers multiple key financial indicators such as net profit from power sales, total power purchase cost, power sales revenue, cost-to-income ratio, electricity recovery rate, and power purchase and sales business loss rate. By introducing weight coefficients, it achieves a precise balance of the importance of different indicators in evaluating the company's profitability. The definition of this fitness function not only fully reflects the company's profitability in the power purchase and sales business, but also provides a scientific basis for subsequent optimization decisions, which helps to improve the company's overall operating performance and profitability.
[0159] Embodiment 2
[0160] See also Figure 3The present invention proposes a digital intelligent management system for electricity purchase and sale, the system comprising:
[0161] Event bus module: used to establish an event bus for receiving and distributing various events in the power purchase and sales business, including data query, data source update and process execution;
[0162] Listening module: used to configure an independent event listener for each application system, used to capture events on the event bus in real time and trigger corresponding business logic processing. The application system includes the electricity purchase and sale fee analysis and display system and the electricity purchase and sale operation analysis and display system;
[0163] Data connection module: used to create an initial database connection for each data source and store the connection in a database connection pool. The data source includes data sources such as user classification, quantity and fee budgeting, meter reading, electricity fee calculation and charging account data;
[0164] Query request initiation module: when the application system initiates a data query request to the data source through an event-driven mechanism, it obtains a connection from the database connection pool and retrieves target data from the corresponding data source;
[0165] Query request receiving module: used to receive the data query request of the application system through the aggregation management platform and parse out the aggregation requirements;
[0166] Aggregation scheme module: used to find the optimal aggregation scheme according to the aggregation requirement, and perform aggregation calculation on the target data according to the optimal aggregation scheme to generate an aggregation result;
[0167] Display module: used to trigger a data return event after the aggregation is completed, and distribute the aggregation results to the corresponding application system through the aggregation management platform for analysis and display through the application system.
[0168] Further optionally, the above aggregation scheme module is also used for:
[0169] According to the aggregation requirements, a fitness function is defined;
[0170] Combined with the fitness function, the optimal aggregation scheme is found through genetic algorithm, including determining the best aggregation algorithm and parameter combination.
[0171] Further optionally, the above aggregation scheme module is also used for:
[0172] Combined with the clustering algorithm, an initial population containing initial individuals with higher fitness is created, wherein each individual represents an aggregation scheme, and each aggregation scheme contains different aggregation algorithms and parameter combination settings;
[0173] According to the fitness function, the aggregation schemes in the population are ranked;
[0174] Select the aggregation scheme with higher fitness as the parent scheme;
[0175] Performing a crossover operation on the parent solution to generate a new child solution, wherein the child solution inherits part of the aggregation algorithm and parameters of the parent solution;
[0176] Mutate the offspring solutions to explore new aggregation algorithms and parameter combinations;
[0177] The selection, crossover and mutation operations are repeated until the iteration termination condition is met. After the iteration is terminated, the solution with the highest fitness is selected as the optimal aggregation solution.
[0178] Further optionally, the above aggregation scheme module is also used for:
[0179] The clustering algorithm is used to perform pattern recognition on the aggregation schemes in the historical data to identify the aggregation algorithms and parameter ranges that are closely related to the high-quality solutions, and the aggregation algorithm and parameter combinations that are closely related to the high-quality solutions are defined as high-quality combinations;
[0180] According to the results of pattern recognition, a group of initial individuals with higher fitness are generated.
[0181] Further optionally, the above aggregation scheme module is also used for:
[0182] For each of the high-quality aggregation algorithms and parameters, a value probability distribution is established according to the frequency or importance of the algorithm in the historical high-quality solutions;
[0183] Create an empty initial population list to store the generated individuals;
[0184] Traversing all aggregation algorithms and parameters, and for each aggregation algorithm and parameter, determining whether it is part of the high-quality combination;
[0185] If it is part of the high-quality combination, the value is generated according to the bias of its value probability distribution;
[0186] If it is not part of the high-quality combination, the value is generated according to the uniform distribution;
[0187] Combine the selected aggregation algorithm and parameter values into a complete individual;
[0188] The fitness of each generated individual is evaluated through the fitness function;
[0189] According to the fitness evaluation results, individuals with higher fitness are selected as part of the initial population;
[0190] Repeat the above steps until a sufficient number of initial individuals are generated to form a complete initial population.
[0191] Further optionally, the above aggregation scheme module is also used for:
[0192] Collect a large amount of historical data with different aggregation requirements. Each data sample includes the aggregated input data, aggregation results, the adopted aggregation scheme and its fitness value.
[0193] Extract key features from each data sample, including the type of aggregation algorithm, parameter settings, statistical characteristics of the input data, and the fitness value of the corresponding solution;
[0194] Based on the extracted features, a similarity metric is defined to measure the similarity or difference between different aggregation schemes in terms of aggregation requirements and fitness evaluation directions;
[0195] Performing cluster analysis on all historical data through a clustering algorithm. In the clustering process, clustering schemes with similar aggregation requirements and fitness are classified into one category according to the similarity metric, and a clustering label is assigned to data samples of the same category.
[0196] The aggregation scheme in the cluster with the highest fitness is extracted as a high-quality solution to the aggregation demand corresponding to the cluster.
[0197] Further optionally, the above aggregation scheme module is also used for:
[0198] If the aggregated demand is the proxy power purchase quantity forecast, and the aggregation target is determined to improve the accuracy of the forecast, the fitness function is defined as:
[0199] F P =w1*(1 / MSE)+w2*(1 / MAE),
[0200] Among them, F P It represents the fitness value of the proxy power purchase quantity forecast;
[0201] MSE is the mean square error of the purchased electricity, which is the mean of the sum of squares of the differences between the predicted value and the true value of the purchased electricity, and is used to measure the accuracy of the purchased electricity forecast;
[0202] MAE is the mean absolute error of electricity sales, which is the mean of the absolute values of the differences between the predicted value and the true value of electricity sales, and is used to measure the accuracy of electricity sales forecast;
[0203] w1 and w2 are weight coefficients used to balance the importance of the prediction accuracy of power purchase and power sales in the fitness function.
[0204] Further optionally, the above aggregation scheme module is also used for:
[0205] If the aggregation demand is the performance evaluation of electricity purchase and sales, and the aggregation target is determined to be a comprehensive evaluation of the company's profitability, the fitness function is defined as:
[0206] F OE =w3*(PC) / T+w4*(1 / R1)+w5*R2-w6*R3,
[0207] Among them, F OE It represents the fitness value of the performance evaluation of electricity purchase and sales operation;
[0208] P is the net profit from electricity sales;
[0209] C is the total cost of purchasing electricity;
[0210] T is the revenue from electricity sales;
[0211] R1 is the cost-to-income ratio of the electricity purchase and sales business, that is, the ratio of the total cost to the total income of the electricity purchase and sales business;
[0212] R2 is the electricity cost recovery rate;
[0213] R3 is the loss rate of electricity purchase and sales business, including power transmission loss and unrecovered electricity charges;
[0214] w3, w4, w5 and w6 are weight coefficients used to balance the importance of different indicators in the fitness function.
[0215] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A digital intelligent management method for electricity purchase and sale, characterized in that: The method comprises: Establish an event bus to receive and distribute various events in the power purchase and sales business, including data query, data source update and process execution; An independent event listener is configured for each application system to capture events on the event bus in real time and trigger corresponding business logic processing. The application system includes an electricity purchase and sales fee analysis and display system and an electricity purchase and sales operation analysis and display system; Creating an initial database connection for each data source, and storing the connection in a database connection pool, wherein the data source includes data sources such as user classification, quantity and fee budgeting, meter reading, electricity fee calculation, and charging account data; When the application system initiates a data query request to the data source through an event-driven mechanism, it obtains a connection from the database connection pool and retrieves target data from the corresponding data source; Receive data query requests from the application system through the aggregation management platform and parse out aggregation requirements; Finding an optimal aggregation solution according to the aggregation requirement, and performing aggregation calculation on the target data according to the optimal aggregation solution to generate an aggregation result; After the aggregation is completed, a data return event is triggered, and the aggregation result is distributed to the corresponding application system through the aggregation management platform for analysis and display through the application system.
2. The digital intelligent management method for electricity purchase and sale according to claim 1 is characterized in that: The finding the optimal aggregation solution according to the aggregation requirement includes: According to the aggregation requirements, a fitness function is defined; Combined with the fitness function, the optimal aggregation scheme is found through genetic algorithm, including determining the best aggregation algorithm and parameter combination.
3. The digital intelligent management method for electricity purchase and sale according to claim 2 is characterized in that: The combined fitness function and the search for the optimal aggregation scheme through a genetic algorithm include: Combined with the clustering algorithm, an initial population containing initial individuals with higher fitness is created, wherein each individual represents an aggregation scheme, and each aggregation scheme contains different aggregation algorithms and parameter combination settings; According to the fitness function, the aggregation schemes in the population are ranked; Select the aggregation scheme with higher fitness as the parent scheme; Performing a crossover operation on the parent solution to generate a new child solution, wherein the child solution inherits part of the aggregation algorithm and parameters of the parent solution; Mutate the offspring solutions to explore new aggregation algorithms and parameter combinations; The selection, crossover and mutation operations are repeated until the iteration termination condition is met. After the iteration is terminated, the solution with the highest fitness is selected as the optimal aggregation solution.
4. The digital intelligent management method for electricity purchase and sale according to claim 3 is characterized in that: The combined clustering algorithm creates an initial population containing initial individuals with higher fitness, including: The clustering algorithm is used to perform pattern recognition on the aggregation schemes in the historical data to identify the aggregation algorithms and parameter ranges that are closely related to the high-quality solutions, and the aggregation algorithm and parameter combinations that are closely related to the high-quality solutions are defined as high-quality combinations; According to the results of pattern recognition, a group of initial individuals with higher fitness are generated.
5. The digital intelligent management method for electricity purchase and sale according to claim 4 is characterized in that: According to the result of pattern recognition, a group of initial individuals with higher fitness are generated, including: For each of the high-quality aggregation algorithms and parameters, a value probability distribution is established according to the frequency or importance of the algorithm in the historical high-quality solutions; Create an empty initial population list to store the generated individuals; Traversing all aggregation algorithms and parameters, and for each aggregation algorithm and parameter, determining whether it is part of the high-quality combination; If it is part of the high-quality combination, the value is generated according to the bias of its value probability distribution; If it is not part of the high-quality combination, the value is generated according to the uniform distribution; Combine the selected aggregation algorithm and parameter values into a complete individual; The fitness of each generated individual is evaluated through the fitness function; According to the fitness evaluation results, individuals with higher fitness are selected as part of the initial population; Repeat the above steps until a sufficient number of initial individuals are generated to form a complete initial population.
6. The digital intelligent management method for electricity purchase and sale according to claim 4 is characterized in that: The clustering algorithm is used to perform pattern recognition on the aggregation schemes in the historical data to identify the aggregation algorithms and parameter ranges closely related to the high-quality solutions, including: Collect a large amount of historical data with different aggregation requirements. Each data sample includes the aggregated input data, aggregation results, the adopted aggregation scheme and its fitness value. Extract key features from each data sample, including the type of aggregation algorithm, parameter settings, statistical characteristics of the input data, and the fitness value of the corresponding solution; Based on the extracted features, a similarity metric is defined to measure the similarity or difference between different aggregation schemes in terms of aggregation requirements and fitness evaluation directions; Performing cluster analysis on all historical data through a clustering algorithm. In the clustering process, clustering schemes with similar aggregation requirements and fitness are classified into one category according to the similarity metric, and a clustering label is assigned to data samples of the same category. The aggregation scheme in the cluster with the highest fitness is extracted as a high-quality solution to the aggregation demand corresponding to the cluster.
7. The digital intelligent management method for electricity purchase and sale according to claim 2, characterized in that: Defining a fitness function according to the aggregation requirement includes: If the aggregated demand is the proxy power purchase quantity forecast, and the aggregation target is determined to improve the accuracy of the forecast, the fitness function is defined as: F P =w1*(1 / MSE)+w2*(1 / MAE), Among them, F P It represents the fitness value of the proxy power purchase quantity forecast; MSE is the mean square error of the purchased electricity, which is the mean of the sum of squares of the differences between the predicted value and the true value of the purchased electricity, and is used to measure the accuracy of the purchased electricity forecast; MAE is the mean absolute error of electricity sales, which is the mean of the absolute values of the differences between the predicted value and the true value of electricity sales, and is used to measure the accuracy of electricity sales forecast; w1 and w2 are weight coefficients used to balance the importance of the prediction accuracy of power purchase and power sales in the fitness function.
8. The digital intelligent management method for electricity purchase and sale according to claim 2 is characterized in that: Defining a fitness function according to the aggregation requirement also includes: If the aggregation demand is the performance evaluation of electricity purchase and sales, and the aggregation target is determined to be a comprehensive evaluation of the company's profitability, the fitness function is defined as: F OE =w3*(P-C) / T+w4*(1 / R1)+w5*R2-w6*R3, Among them, F OE It represents the fitness value of the performance evaluation of electricity purchase and sales operation; P is the net profit from electricity sales; C is the total cost of purchasing electricity; T is the revenue from electricity sales; R1 is the cost-to-income ratio of the electricity purchase and sales business, that is, the ratio of the total cost to the total income of the electricity purchase and sales business; R2 is the electricity cost recovery rate; R3 is the loss rate of electricity purchase and sales business, including power transmission loss and unrecovered electricity charges; w3, w4, w5 and w6 are weight coefficients used to balance the importance of different indicators in the fitness function.
9. A digital intelligent management system for electricity purchase and sale, characterized in that: The system comprises: Event bus module: used to establish an event bus for receiving and distributing various events in the power purchase and sales business, including data query, data source update and process execution; Listening module: used to configure an independent event listener for each application system, used to capture events on the event bus in real time and trigger corresponding business logic processing. The application system includes the electricity purchase and sale fee analysis and display system and the electricity purchase and sale operation analysis and display system; Data connection module: used to create an initial database connection for each data source and store the connection in a database connection pool. The data source includes data sources such as user classification, quantity and fee budgeting, meter reading, electricity fee calculation and charging account data; Query request initiation module: when the application system initiates a data query request to the data source through an event-driven mechanism, it obtains a connection from the database connection pool and retrieves target data from the corresponding data source; Query request receiving module: used to receive the data query request of the application system through the aggregation management platform and parse out the aggregation requirements; Aggregation scheme module: used to find the optimal aggregation scheme according to the aggregation requirement, and perform aggregation calculation on the target data according to the optimal aggregation scheme to generate an aggregation result; Display module: used to trigger a data return event after the aggregation is completed, and distribute the aggregation results to the corresponding application system through the aggregation management platform for analysis and display through the application system.
Citation Information
Patent Citations
Android-based smart home control system and control method
CN110794697A
Visual monitoring method, system and equipment for regulation and control data chain and readable storage medium
CN116095156A