A user-side power transaction electricity purchase scheme personalized recommendation method and device
Patent Information
- Application Number
- CN202610921862.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2046-06-25
AI Technical Summary
这一对价结构在用户负荷平稳的场景下不构成问题,然而当用户的设备检修时间介入后,用电量的分布会因检修窗口在合约周期内的不同位置而发生显著变化,合约执行结果也随之改变
本发明公开了一种用户侧电力交易购电方案个性化推荐方法,针对用户设备检修计划与合约周期匹配的复杂业务场景,融合了检修窗口落点位置、停机与复产时段分布、用电量逐月分布质心分析以及合约惩罚条款触发风险评估等核心问题,形成了一个逻辑关联的综合优化问题,即如何在检修窗口与合约周期不适配的情况下,平衡用电量分布与成本风险,实现购电方案的最优选择。本发明通过时序对齐技术对齐检修窗口落点位置与合约周期,采用决策树算法整合合约长度与风险因素,利用随机森林算法计算方案可达成概率,最终生成个性化购电方案列表。其核心发明点在于通过多维度数据分析与机器学习算法结合,精准评估质心偏移与保底电量门限匹配度,动态排序候选方案,从而有效降低长合约下的惩罚风险,提升用户购电决策的经济性与可行性。
Smart Images

Figure CN122453487B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and in particular to a method and apparatus for personalized recommendation of user-side power trading and electricity purchase schemes. Background Technology
[0002] In the field of electricity trading, personalized electricity purchase plans are of great significance for users to reduce costs and optimize resource allocation. This area is directly related to users' economic benefits and the stable operation of the power system, and is a crucial link in energy management that cannot be ignored. With the gradual opening of the electricity market, electricity sales companies need to purchase electricity in advance from the upstream medium- and long-term trading market based on users' declared electricity consumption expectations, and then provide differentiated electricity prices to users based on this. How to tailor the optimal electricity purchase plan for users has become a key issue that urgently needs to be addressed in the industry. However, existing methods often ignore the dynamic changes and special needs of users' actual electricity consumption behavior when designing electricity purchase plans, resulting in a mismatch between the recommended results and the actual situation of users. Especially when facing the influencing factor of users' equipment maintenance plans, traditional solutions fail to fully consider its specific impact on electricity consumption distribution, often judging the merits of the contract period based on fixed rules or simple assumptions, lacking adaptability to complex scenarios. This limitation makes it impossible for recommended solutions to truly meet users' personalized needs in some cases. In the conventional design of electricity purchase contracts, the longer the contract period and the larger the committed consumption, the lower the unit price of electricity offered by the electricity sales company. However, to hedge against the risk of deviations caused by purchasing electricity from upstream markets in advance, electricity sales companies typically include minimum electricity consumption clauses in long-term contracts: when a user's actual electricity consumption falls below the agreed threshold, they must pay compensation for the difference. This pricing structure is not problematic when user load is stable. However, when equipment maintenance is involved, the distribution of electricity consumption changes significantly depending on the location of the maintenance window within the contract period, thus altering the contract execution outcome. Industrial users have cyclical equipment maintenance needs, with electricity consumption dropping significantly during maintenance months. The specific location of the maintenance window is influenced by factors such as equipment condition assessment and upstream production scheduling coordination, making it difficult to pinpoint precisely at the time of signing. When the maintenance window happens to fall in a critical month of a long-term contract, users may fail to meet the agreed minimum electricity consumption, triggering compensation. This contradiction means that contracts that initially seem advantageous due to their long duration and low unit price can, under certain conditions, actually increase the user's overall electricity costs, becoming a core obstacle in recommender system design. Taking a specific scenario as an example, suppose a user signs a one-year electricity purchase contract, planning for relatively even monthly electricity consumption. However, due to a one-month maintenance requirement in the middle of the contract, electricity consumption drops significantly during that month, causing the total annual electricity consumption to fall below the minimum threshold stipulated in the contract. The electricity price discount obtained through the long-term contract is insufficient to cover the difference, ultimately resulting in the user's actual cost being higher than if they had chosen a short-term contract. This shift in electricity consumption distribution caused by the timing of maintenance directly alters the economic performance of contract execution and exposes the shortcomings of recommendation systems in dealing with such dynamic factors. Therefore, how to fully consider the impact of equipment maintenance time on electricity consumption distribution in electricity purchase plan recommendations and dynamically balance the contradiction between contract length and maintenance window location has become a critical issue that urgently needs to be addressed. Summary of the Invention
[0003] This invention provides a personalized recommendation method for user-side power trading and electricity purchase schemes, mainly including: Extract the maintenance window location from the user equipment maintenance plan text, obtain the monthly distribution of the maintenance window location within the contract period, and identify the downtime and resumption time during the maintenance period. Obtain the monthly planned electricity consumption and minimum electricity consumption threshold for each candidate contract period. Align the time sequence according to the location of the maintenance window and the length of each candidate contract period, and calculate the monthly distribution centroid of electricity consumption within the contract period. Analyze contract schemes where the centroid is located in a month that is outside the effective range, and assess the risk of penalty clauses being triggered for long contracts under conditions where the maintenance window landing point is not suitable; The decision tree algorithm is used to integrate the contract period length and the risk of penalty clauses, and candidate solutions are determined by combining the unit price discount level of each contract. For the candidate schemes, the schemes to be excluded are determined based on the matching results between the month in which the centroid is located and the minimum electricity threshold, and a recommended candidate set after preliminary screening is obtained; By combining the recommended candidate set after initial screening with the power recovery progress during the resumption of production, the feasibility of the remaining options at the location of the maintenance window is calculated, and a list of personalized power purchase options is determined.
[0004] Furthermore, the step of extracting the maintenance window location from the user equipment maintenance plan text, obtaining the monthly distribution of the maintenance window location within the contract period, and identifying the downtime and resumption periods during the maintenance period includes: The time information is extracted from the maintenance plan text uploaded by the user, and the time information is parsed using the named entity recognition method to identify the text fragments representing the date; Extract the maintenance start date and maintenance end date from the text fragment; The date range of the maintenance window is determined based on the time span between the maintenance start date and the maintenance end date; The date range is mapped to a preset contract period boundary to generate the monthly distribution of maintenance windows within the contract period.
[0005] Furthermore, the identification of downtime and resumption periods during maintenance includes: For each month in the aforementioned monthly distribution, determine whether the month contains the maintenance start date; if it does, mark the month as a downtime period. Determine whether the month includes the maintenance end date; if so, mark the month as the resumption period. Based on the labeled shutdown and resumption periods, monthly distribution data of shutdown and resumption periods during the maintenance period are generated within the contract period.
[0006] Furthermore, the step of obtaining the monthly planned electricity consumption and guaranteed electricity threshold for each candidate contract period, aligning the time sequence according to the location of the maintenance window and the length of each candidate contract period, and calculating the monthly distribution centroid of electricity consumption within the contract period includes: Obtain the monthly planned electricity consumption and minimum electricity consumption threshold for each candidate contract, and store them as an electricity consumption dataset according to the candidate contracts; The maintenance window's date range is aligned with the cycle length of each candidate contract to determine its relative monthly position within each candidate contract. For the aforementioned electricity consumption dataset, calculate the weight for each month; The position of the distribution centroid is calculated using the month sequence number as the position coordinate and the weight as the weighting value.
[0007] Furthermore, the analysis identifies contract schemes where the centroid's month exceeds the effective range, and assesses the risk of penalty clauses triggering for long contracts under conditions of mismatched maintenance window placement, including: Based on the location of the centroid of the distribution, the contract period is divided into the first, middle and last segments; Determine whether the position of the centroid of the distribution falls outside the middle range. If so, mark the corresponding candidate contract as a centroid offset contract. For the aforementioned centroid offset contract, calculate the distribution centroid during the downtime period; If the centroid of the distribution during the downtime falls in the earlier segment and the position of the centroid is biased towards the later segment, or if the centroid of the distribution during the downtime falls in the later segment and the position of the centroid is biased towards the earlier segment, then it is determined that there is a risk of triggering the penalty clause.
[0008] Furthermore, a decision tree algorithm is used to integrate the contract duration and the risk of penalty clauses, and candidate solutions are determined by combining the unit price discount level of each contract, including: Obtain the contract period length, risk marker, and unit price discount for each candidate contract, and construct a feature vector set; The feature vector group is classified using a decision tree algorithm. The decision tree algorithm uses the contract period length as the splitting attribute of the root node and the penalty clause trigger risk mark as the splitting attribute of the intermediate node. The feature vector group is divided layer by layer along the decision path to the corresponding leaf node according to each splitting attribute. Based on the distribution of the number of candidate contracts and the unit price discount within the leaf node, determine the category label of each leaf node; Generate candidate solutions labeled as priority recommendation class and alternative recommendation class.
[0009] Furthermore, by combining the initially screened recommended candidate set with the power recovery progress during the resumption period, the feasibility probability of the remaining solutions at the maintenance window location is calculated, and a personalized power purchase plan list is determined, including: Obtain the power consumption recovery progress during the production resumption period and construct a recovery progress curve; Based on the recovery progress curve and the date range of the maintenance window, construct an input feature set; The input feature set is associated with the candidate contracts in the preliminary recommendation scheme set and then input into the random forest algorithm for classification processing; The probability of achievement is obtained by statistically analyzing the proportion of decision trees classified as achievable categories in the random forest algorithm. The candidate contracts are sorted according to the probability of success, and the personalized electricity purchase plan list is generated.
[0010] This invention provides a personalized recommendation device for user-side power trading and electricity purchase schemes, mainly comprising: The time period identification module is used to extract the location of the maintenance window from the user equipment maintenance plan text, obtain the monthly distribution of the maintenance window location within the contract period, and identify the downtime and resumption time periods during the maintenance period. The centroid calculation module is used to obtain the monthly planned electricity consumption and the minimum electricity consumption threshold for each candidate contract period. Based on the location of the maintenance window and the length of each candidate contract period, the module performs time-series alignment and calculates the monthly distribution centroid of electricity consumption within the contract period. The risk assessment module is used to analyze contract schemes where the centroid is located in a month that is outside the effective range, and to assess the risk of penalty clauses being triggered when long contracts are not properly positioned within the maintenance window. The scheme determination module is used to integrate the contract period length and the risk of penalty clauses using a decision tree algorithm, and combine the unit price discount level of each contract to determine candidate schemes; The candidate set generation module is used to determine the schemes to be excluded based on the matching result between the month in which the centroid is located and the minimum electricity threshold, and to obtain a recommended candidate set after preliminary screening. The list generation module is used to combine the recommended candidate set after preliminary screening with the power recovery progress during the resumption of production period, calculate the achievability probability of the remaining solutions at the maintenance window landing point, and determine the personalized power purchase solution list.
[0011] Furthermore, the time period identification module, when extracting the maintenance window location from the user equipment maintenance plan text, obtaining the monthly distribution of the maintenance window location within the contract period, and identifying the downtime and resumption periods during maintenance, includes: The time information is extracted from the maintenance plan text uploaded by the user, and the time information is parsed using the named entity recognition method to identify the text fragments representing the date; Extract the maintenance start date and maintenance end date from the text fragment; The date range of the maintenance window is determined based on the time span between the maintenance start date and the maintenance end date; The date range is mapped to a preset contract period boundary to generate the monthly distribution of maintenance windows within the contract period.
[0012] Furthermore, when identifying downtime and resumption periods during maintenance, the time period identification module includes: For each month in the aforementioned monthly distribution, determine whether the month contains the maintenance start date; if it does, mark the month as a downtime period. Determine whether the month includes the maintenance end date; if so, mark the month as the resumption period. Based on the labeled shutdown and resumption periods, monthly distribution data of shutdown and resumption periods during maintenance are generated within the contract period.
[0013] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects: This invention discloses a personalized recommendation method for user-side power trading purchase schemes. Addressing the complex business scenario of matching user equipment maintenance plans with contract periods, it integrates core issues such as the location of maintenance windows, the distribution of outage and resumption periods, centroid analysis of monthly electricity consumption distribution, and risk assessment of contract penalty clauses. This forms a logically interconnected comprehensive optimization problem: how to balance electricity consumption distribution and cost risk when maintenance windows and contract periods are mismatched, achieving the optimal selection of the purchase scheme. This invention aligns the location of maintenance windows with the contract period using time-series alignment technology, integrates contract length and risk factors using a decision tree algorithm, and calculates the probability of scheme achievability using a random forest algorithm, ultimately generating a personalized list of purchase schemes. Its core invention lies in combining multi-dimensional data analysis with machine learning algorithms to accurately assess the centroid offset and the matching degree of the guaranteed electricity threshold, dynamically ranking candidate schemes, thereby effectively reducing the penalty risk under long contracts and improving the economy and feasibility of user electricity purchase decisions. Attached Figure Description
[0014] Figure 1 This is a flowchart of a personalized recommendation method for user-side power trading and electricity purchase schemes according to the present invention.
[0015] Figure 2 This is a schematic diagram of a personalized recommendation device for user-side power trading and electricity purchase schemes according to the present invention. Detailed Implementation
[0016] To further understand the content of this invention, a detailed description of the invention is provided in conjunction with the accompanying drawings and embodiments. The specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0017] like Figure 1 This embodiment of a personalized recommendation method for user-side power trading and electricity purchase schemes may specifically include: Step S101: Extract the maintenance window landing point location from the user equipment maintenance plan text, obtain the monthly distribution of the maintenance window landing point location within the contract period, and identify the downtime and resumption time during the maintenance period.
[0018] The system retrieves the user-uploaded equipment maintenance plan text and uses named entity recognition (NAME) to parse the time representations within the text. It identifies text fragments representing dates and extracts the maintenance start and end dates from these fragments. Based on the time span between these dates, it determines the date range for the maintenance window's endpoint. Using this date range, it obtains the contract period boundary agreed upon by the user at the time of signing the contract. It then maps the date range of the maintenance window's endpoint to the contract period boundary, converting the date range into a monthly distribution interval within the contract period. If the monthly distribution interval spans multiple calendar months, it is split into a continuous monthly coverage sequence in calendar order. For each month in the monthly coverage sequence, if the month contains a maintenance start date, it is marked as a downtime period; if it contains a maintenance end date, it is marked as a resumption period. This yields the monthly distribution of downtime and resumption periods during the maintenance period within the contract period.
[0019] In one implementation, the equipment maintenance plan text typically stores the user's maintenance schedule information in an unstructured format, which includes various elements such as maintenance time, maintenance object, and maintenance content. The time expression format of the maintenance plan text is diverse, including natural language descriptions such as "from a certain date in a certain month to a certain date in a certain year" or "starting in the first ten days of a certain month, expected to last for several days".
[0020] Specifically, the named entity recognition method identifies word sequences with temporal semantic features in the maintenance plan text by performing lexical and syntactic analysis.
[0021] For example, for the text "Main transformer overhaul is scheduled to begin on March 15, 2025, and production is expected to resume on April 20," the named entity recognition method identifies "March 15, 2025" as the start date of the overhaul and "April 20" as the end date, based on the syntactic structure features of time entities. For text containing only relative time statements, such as "overhaul to begin in the middle of next month," the method combines the text creation time with the calculation and conversion of absolute dates to obtain a clear date text fragment.
[0022] In one embodiment, the contract period boundary is defined by the start and end months agreed upon when the user and the electricity sales company sign the electricity purchase agreement.
[0023] For example, if a user's electricity purchase contract stipulates a contract period from January to June, then the starting boundary of the contract period is January 1st, and the ending boundary is June 30th.
[0024] It should be noted that the time interval mapping process involves projecting the date range of the maintenance window's landing point onto the monthly coordinate system of the contract period.
[0025] Preferably, if the maintenance start date is March 15th and the maintenance end date is April 20th, then the date range covers both March and April, and the month distribution interval obtained after mapping includes March and April. When the month distribution interval spans multiple calendar months, a month-by-month coverage sequence is generated in calendar order, and each element in this sequence corresponds to the specific month involved in the maintenance window within the contract period.
[0026] Understandably, the marking of outage and resumption periods is determined based on the positions of the maintenance start and end dates in the monthly coverage sequence. Months containing the maintenance start date are marked as outage periods, indicating a decrease in electricity load due to equipment shutdown during that month; months containing the maintenance end date are marked as resumption periods, indicating a gradual return to operation of equipment during that month. Through these markings, the monthly distribution of outage and resumption periods during maintenance within the contract period is obtained. This distribution information reflects the specific impact of maintenance activities on the temporal distribution of user electricity consumption.
[0027] Step S102: Obtain the monthly planned electricity consumption and minimum electricity consumption threshold for each candidate contract period. Align the time sequence according to the location of the maintenance window and the length of each candidate contract period, and calculate the monthly distribution centroid of electricity consumption within the contract period.
[0028] Obtain the monthly planned electricity consumption and minimum guaranteed electricity consumption threshold for each candidate contract period. The monthly planned electricity consumption is the sequence of expected electricity consumption values declared by users on a monthly basis within each candidate contract period. The minimum guaranteed electricity consumption threshold is the minimum electricity consumption agreed upon by the electricity sales company for each candidate contract period. The monthly planned electricity consumption and minimum guaranteed electricity consumption threshold are categorized and stored according to the candidate contract period to obtain the electricity consumption dataset for each candidate contract period. Perform time-series alignment based on the maintenance window's landing point position and the length of each candidate contract period. This time-series alignment maps the month of the maintenance window's landing point position to the months of each candidate contract period. If there is an offset between the start month of a candidate contract period and the month of the maintenance window's landing point position, then perform relative position conversion based on the contract start month to obtain the relative monthly location of the maintenance window within each candidate contract period. For the monthly planned electricity consumption and monthly minimum electricity consumption threshold in the electricity consumption dataset, first calculate the weight of each month: Wi = Pi - Bi, where Pi is the planned electricity consumption for the i-th month and Bi is the minimum electricity consumption threshold for the i-th month. If the difference is less than 0, set Wi = 0. Calculate the sum of Wi for all months: S = ∑Wi. If S > 0, then the centroid position of the monthly distribution of electricity consumption within the contract period is C = (∑(Li × Wi)) / S; if S = 0 (i.e., the planned electricity consumption for each month does not exceed the corresponding minimum threshold), then automatically use the planned electricity consumption Pi as the weight, i.e., C = (∑(Li × Pi)) / ∑Pi. The centroid position, combined with the relative monthly positioning, reflects the relative relationship between the months in which electricity consumption is concentrated and the location of the maintenance window.
[0029] In one implementation, each candidate contract period corresponds to a different contract cycle length. The electricity sales company sets monthly planned electricity consumption and a guaranteed minimum electricity consumption threshold for each candidate contract period. The monthly planned electricity consumption is declared monthly by the user based on their own production plan, reflecting the user's expected electricity demand in each month of the contract cycle. The guaranteed minimum electricity consumption threshold is determined by the electricity sales company based on a combination of the contract cycle length and the electricity price discount, serving as the minimum total electricity consumption that the user commits to complete within the contract period.
[0030] For example, an industrial user faces three candidate contract periods: three months, six months, and twelve months. For the three-month contract period, the user's declared monthly planned electricity consumption is 1.2 million kWh, 1.1 million kWh, and 1.3 million kWh, respectively, with a corresponding guaranteed electricity consumption threshold of 3 million kWh. For the six-month and twelve-month contract periods, the monthly planned electricity consumption and the guaranteed electricity consumption threshold are set according to the corresponding cycle, forming the electricity consumption dataset for each candidate contract period.
[0031] It should be noted that the purpose of time alignment is to uniformly express the position of the maintenance window location across candidate contract periods of different lengths. Because the starting month and cycle length of each candidate contract period differ, the relative position of the same maintenance window location varies across different contract periods.
[0032] Specifically, if the maintenance window falls in May, and the starting month of a candidate contract period is January with a cycle length of six months, then the maintenance window is positioned in the fifth month within that contract period; if the starting month of another candidate contract period is April with a cycle length of three months, then the maintenance window is positioned in the second month within that contract period.
[0033] In one embodiment, the location of the centroid of the distribution is calculated using a weighted average method. The sequential number of each month within the contract period is used as the location coordinate, and the planned electricity consumption of the corresponding month is used as the weight. The location coordinate of each month is multiplied by the planned electricity consumption of that month. The sum of all products is then divided by the sum of the planned electricity consumption of all months, and the quotient obtained is the location of the centroid of the distribution.
[0034] For example, if the planned electricity consumption for the first month of a three-month contract period is 1.2 million kWh, the second month is 800,000 kWh, and the third month is 1 million kWh, then the calculation result of the centroid location reflects that the electricity consumption is distributed in the earlier part of the contract period.
[0035] Understandably, combining the centroid location of the distribution with the relative monthly location can intuitively present the positional relationship between the concentrated distribution area of electricity consumption and the location of the maintenance window, providing a quantitative basis for judging the degree of impact of maintenance activities on contract execution.
[0036] Step S103: Analyze the contract schemes where the centroid is located in a month that is outside the effective range. Combine the distribution of downtime in the first and second halves of the contract to assess the risk of triggering penalty clauses for long contracts under the condition that the maintenance window landing point is not in line with the actual situation.
[0037] Based on the monthly distribution of the centroid position and the guaranteed electricity threshold for each candidate contract period, the contract cycle is divided into multiple segments in monthly order. The formula for calculating the centroid position is C=sum(Li ei) / sum(ei), where Li is the month number from 1 to N, ei is the electricity consumption for that month, and N is the total number of months in the contract. The contract period is divided into the first segment from 1 to floor(N / 3) months, the middle segment from floor(N / 3)+1 to floor(2N / 3) months, and the remaining months in the last segment. The valid interval is the range of months where the centroid position C falls within the number range of the middle segment months and the total electricity consumption exceeds the minimum electricity consumption threshold. For example, if the minimum electricity consumption threshold is set to 1000 kWh, it is valid if the total consumption is greater than 1000. If the centroid position C is less than the starting month number of the middle segment or greater than the ending month number of the middle segment, the corresponding long-term contract is marked as a centroid offset contract. For the centroid offset contract, the distribution positions of the shutdown periods in the first and last segments of the contract are obtained, and the centroid of the shutdown period distribution S is calculated as sum(tj) / sum(tj). dj) / sum(dj), where tj is the starting month number of the j-th downtime period, and dj is the duration of the period. If the centroid S of the downtime period distribution falls within the range of the preceding month numbers and the centroid position C is greater than the contract period midpoint N / 2 and biased towards the later period, or if S falls within the range of the following month numbers and C is less than N / 2 and biased towards the preceding period, then the long-term contract is determined to have a risk of triggering the penalty clause, and the risk markers of each long-term contract under the condition of mismatched maintenance window location are obtained.
[0038] In one implementation, if the centroid of a twelve-month contract falls in the third or tenth month, the centroid is deviated from the middle region, indicating that electricity consumption is excessively concentrated at the beginning and end of the contract period. Such contracts are marked as centroid-shifted contracts.
[0039] It should be noted that the determination of the risk triggered by the penalty clause is based on the directional relationship between the downtime period and the position of the distribution centroid. When the downtime period falls in the early part of the contract, the concentration of electricity consumption shifts towards the later part; when the downtime period falls in the later part of the contract, the concentration of electricity consumption shifts towards the early part. If the position of the downtime period is opposite to the direction of the centroid shift, the actual distribution of electricity consumption will be misaligned with the planned distribution, resulting in lower-than-expected actual electricity consumption in some months of the contract period, which may trigger the minimum electricity consumption threshold compensation clause.
[0040] Step S104: The decision tree algorithm is used to integrate the contract period length and the risk of penalty clauses, and candidate solutions are determined by combining the unit price discount level of each contract.
[0041] The contract period length, penalty clause trigger risk marker, and unit price discount for each candidate contract are obtained. The contract period length is represented by the number of months, and the unit price discount is the discount ratio of each candidate contract relative to the benchmark electricity price, which is 1 yuan per kilowatt-hour of the current market standard electricity price. These three attributes are associated and combined according to the contract number to obtain the feature vector group of each candidate contract. A decision tree algorithm is used to classify the feature vector group. The decision tree algorithm uses the contract period length as the splitting attribute of the root node and the penalty clause trigger risk marker as the splitting attribute of the intermediate nodes. Splitting conditions are set at the nodes according to the values of each attribute, and the feature vector group is divided layer by layer along the decision path to the corresponding leaf nodes to obtain the leaf node assignment result of each candidate contract. Based on the leaf node assignment result, the category label of each leaf node is determined according to the distribution of the number of candidate contracts falling into each leaf node and the unit price discount, thus determining the candidate solution set.
[0042] In one implementation, after extracting the contracts within the leaf nodes labeled as priority recommendation and alternative recommendation, the following steps are performed to form a candidate solution set: Based on the unit price discount and penalty clause trigger risk flag of each candidate contract in the filtered contract subset, the candidate contracts in the contract subset are sorted from high to low according to the unit price discount. If there are contracts with the same unit price discount, they are sorted a second time according to the penalty clause trigger risk from low to high to obtain the candidate solution set. The feature vector group of each candidate contract consists of three attributes. The contract period length is quantified in months, reflecting the time span of the candidate contract. Common contract period lengths include three months, six months, and twelve months. The unit price discount is expressed as a percentage, representing the degree of discount of each candidate contract relative to the benchmark electricity price. The higher the discount percentage, the lower the user's unit electricity cost. The penalty clause trigger risk flag is a binary attribute, marked as either having risk or not having risk. This flag comes from the determination result of the matching relationship between the maintenance window landing point position and the contract period in the previous processing flow.
[0043] Specifically, the process of constructing the feature vector group involves associating the above three attributes one-to-one according to the contract number.
[0044] For example, if a candidate contract has contract number A, a contract period of twelve months, a unit price discount of eight percent, and a penalty clause triggering a risk marker indicating the existence of risk, then the feature vector group of this candidate contract is represented by the triplet data structure corresponding to contract number A.
[0045] It should be noted that the decision tree algorithm classifies the feature vector group through recursive partitioning. The root node of the decision tree algorithm uses the contract period length as the splitting attribute, and divides the feature vector group into two subsets, long-term contracts and short-term contracts, according to a preset contract period length threshold.
[0046] For example, using six months as the splitting threshold, candidate contracts with a contract period of six months or more enter the long-cycle branch, while those with a contract period of less than six months enter the short-cycle branch. Furthermore, the intermediate nodes of the decision tree use a risk flag triggered by a penalty clause as the splitting attribute. In the long-cycle branch, candidate contracts are further divided into risky subsets and non-risky subsets based on the risk flag triggered by the penalty clause; the same division is performed in the short-cycle branch. After this layer-by-layer division by the root node and intermediate nodes, each candidate contract reaches its corresponding leaf node along the decision path, forming a leaf node assignment result. The leaf node assignment result records the leaf node number to which each candidate contract belongs and its decision path information.
[0047] In one embodiment, the category label of a leaf node is determined based on the characteristic distribution of the candidate contracts falling into that leaf node. If all candidate contracts in a leaf node are short-term contracts and the risk of penalty clause triggering is marked as non-existent, the category label of that leaf node is set to "Preferred Recommendation". If all candidate contracts in a leaf node are long-term contracts and the risk of penalty clause triggering is marked as non-existent, and the average unit price discount exceeds a preset threshold, the category label of that leaf node is set to "Alternative Recommendation". If all candidate contracts in a leaf node have the risk of penalty clause triggering and the average unit price discount is lower than a preset threshold, the category label of that leaf node is set to "Excluded". Optionally, each leaf node is assigned a category label based on the number of contracts falling into it and the distribution of unit price discounts: if the number of contracts in the leaf node is not less than 3 and the average discount is greater than 15%, it is marked as "Preferred Recommendation"; if the number is not less than 1 and the average discount is greater than 5%, it is marked as "Alternative Recommendation"; otherwise, it is marked as "Excluded".
[0048] Understandably, the filtered subset of contracts consists of candidate contracts within the leaf nodes of the priority recommendation class and the alternative recommendation class. This subset excludes candidate contracts marked as excluded and retains candidate contracts that have recommendation value under the current maintenance window's position.
[0049] Preferably, the selected subset of contracts is sorted under two conditions to form a candidate solution set. The primary sorting condition is the unit price discount, and the candidate contracts are arranged from highest to lowest discount percentage, so that contracts with higher unit price discounts are ranked first. When multiple candidate contracts have the same unit price discount, the secondary sorting condition is activated, and the contracts are sorted from lowest to highest risk according to the penalty clause, so that contracts with lower risk are ranked first under the same discount conditions.
[0050] In one possible implementation, the filtered subset of contracts contains four candidate contracts with unit price discounts of 10%, 8%, 8%, and 6%, respectively. The penalty clause trigger risk flags are "no risk," "risk exists," "no risk," and "no risk," respectively. After sorting according to the dual conditions, the order is: contracts with a 10% unit price discount, contracts with an 8% unit price discount and no risk, contracts with an 8% unit price discount and risk, and contracts with a 6% unit price discount, forming a candidate solution set. This sorting method allows users to prioritize electricity purchase plans with higher cost-effectiveness and lower execution risk.
[0051] Step S105: For candidate schemes, determine the schemes to be excluded based on the matching result between the month in which the centroid is located and the minimum power threshold, and obtain the recommended candidate set after preliminary screening.
[0052] The process involves obtaining the monthly centroid positions of each candidate contract in the candidate solution set and their corresponding minimum electricity consumption thresholds. The minimum electricity consumption threshold is divided by the number of months in the contract period to obtain the monthly average threshold value. The planned electricity consumption of the month in which the centroid position is located is then matched with the monthly average threshold value. If the month in which the centroid position is located falls in the first or last month of the contract period and the planned electricity consumption for that month is lower than the monthly average threshold value, the candidate contract is marked as a solution to be excluded. All candidate contracts marked as solutions to be excluded are removed from the candidate solution set, and only those candidate contracts whose matching results meet the threshold requirements are retained, resulting in a preliminary recommended candidate set. This step excludes solutions from the perspective of avoiding exceeding the minimum threshold. Therefore, these two steps exclude solutions with insufficient adaptability to the user from different angles, thus obtaining a preliminary recommended candidate set.
[0053] In one implementation, the guaranteed electricity threshold for each candidate contract in the candidate scheme set is the minimum agreed-upon electricity consumption value for the entire contract. The monthly average threshold is calculated by dividing the guaranteed electricity threshold by the number of months in the contract period to obtain the average electricity consumption level that should be achieved each month. This monthly average serves as a reference benchmark for judging whether the planned electricity consumption for each month is sufficient.
[0054] Specifically, the month in which the centroid is located reflects the concentrated distribution of electricity consumption within the contract period. If the centroid falls in the first month of the contract period, it indicates that electricity consumption is concentrated at the beginning of the contract; if the centroid falls in the last month of the contract period, it indicates that electricity consumption is concentrated at the end of the contract. When the centroid is in the first or last month, the distribution of electricity consumption exhibits a clear skewed characteristic.
[0055] It should be noted that when the planned electricity consumption for the month in which the centroid is located is lower than the monthly average threshold, the electricity consumption for that month cannot support the amortization requirement of the guaranteed electricity threshold, posing a risk to contract execution. Such candidate contracts are marked as exclusions and removed from the candidate set, leaving a preliminary recommended candidate set of remaining candidate contracts.
[0056] Step S106: Combining the recommended candidate set after preliminary screening with the power recovery progress during the resumption period, calculate the achievability probability of the remaining schemes at the maintenance window location, and arrange the recommended candidate set after preliminary screening according to the achievability probability to obtain a personalized power purchase scheme list.
[0057] The process involves obtaining a preliminary recommended candidate set and the power recovery progress during the resumption of production. The power recovery progress is defined as the ratio of daily electricity consumption to normal production daily electricity consumption within the resumption period. This power recovery progress is then arranged chronologically to obtain a recovery progress curve for the resumption period. Based on the recovery progress curve and the location of the maintenance window, an input feature set for a random forest algorithm is constructed. This input feature set includes: contract period length (in months), the starting month of the resumption period (its sequence within the contract period), the variation of the recovery progress curve within the resumption period (defined as the difference between the maximum and minimum power recovery progress values within the resumption period), and the relative position of the maintenance window location within the contract period (defined as the proportion of days the maintenance window's start date occupies within the contract period, a dimensionless ratio ranging from 0 to 1). This input feature set is then associated with each candidate contract in the recommended candidate set and input into the random forest algorithm for classification. The random forest algorithm consists of multiple decision trees, each of which independently judges the input features and outputs a category determination result. Based on the classification results of each decision tree in the random forest algorithm, the proportion of decision trees classified as achievable is calculated out of the total number of decision trees. This proportion represents the achievability probability of each candidate contract at the maintenance window's landing point, thus obtaining the achievability probability value for each candidate contract in the recommended candidate set. The candidate contracts in the recommended candidate set are then sorted according to their achievability probability values, arranged in descending order of priority, resulting in a personalized electricity purchase plan list.
[0058] In one implementation, the preliminary recommended candidate set originates from the preceding processing flow and includes multiple candidate contracts retained after being filtered by a decision tree algorithm. Each candidate contract in the recommended candidate set has been characterized by its contract period length, penalty clause trigger risk, and unit price discount, forming a set of contracts awaiting further evaluation.
[0059] Specifically, the power recovery progress during the resumption of production reflects the gradual increase in user electricity consumption after equipment maintenance. Industrial users typically cannot immediately return to full-load production after equipment maintenance, but rather experience a gradual ramp-up process. The power recovery progress is expressed as the ratio of daily electricity consumption during the resumption period to the electricity consumption on normal production days, and this ratio sequence is arranged in chronological order to form a recovery progress curve.
[0060] For example, if a user's electricity consumption on the first day of resuming production is 40% of that on a normal production day, recovers to 70% on the fifth day, and recovers to 95% on the tenth day, then the recovery progress curve shows an upward trend that is steep at first and then slows down.
[0061] It should be noted that the shape of the recovery progress curve is related to the location of the maintenance window within the contract period. If the maintenance window falls in the middle or later part of the contract period, the resumption period may extend to the last month of the contract period. In this case, the magnitude of the change in the recovery progress curve directly affects whether the user can meet the minimum electricity consumption threshold within the contract period.
[0062] In one embodiment, the input feature set of the random forest algorithm consists of four types of features. The contract period length feature represents the period span of the candidate contract in months; the starting month of the resumption period feature identifies the position of the equipment's resumption of production within the contract period; the change amplitude feature of the recovery progress curve reflects the rate of electricity consumption recovery during the resumption process; and the relative position feature of the maintenance window landing point represents the proportion of maintenance activity within the contract period. These four types of features together constitute a multi-dimensional feature vector describing the attainable state of the candidate contract. Further, the random forest algorithm consists of multiple independent decision trees, each constructed during the training phase based on historical contract execution data and electricity recovery records. Each decision tree randomly extracts a portion of features from the input feature set as the basis for splitting, forming a tree structure through recursive partitioning. During the inference phase, the input feature set is fed into each decision tree for independent judgment. Each decision tree outputs a category judgment result according to its own splitting rules, classifying the categories as attainable or unattainable.
[0063] For example, the input features of a candidate contract are determined to be achievable by the first decision tree, unachievable by the second decision tree, achievable by the third decision tree, and so on.
[0064] Understandably, the probability of achievement is calculated based on the voting results of each decision tree in the random forest. The probability of achievement is calculated by dividing the number of decisions in all decision trees that classify a contract as achievable by the total number of decision trees. The numerical range of this probability is between zero and one; a higher value indicates that the candidate contract is more likely to meet the minimum electricity threshold given the current maintenance window's location and production resumption progress.
[0065] In one possible implementation, the recommended candidate set contains five candidate contracts, which, after processing by the random forest algorithm, yield attainable probabilities of 0.85, 0.72, 0.68, 0.91, and 0.56, respectively. These are then sorted from highest to lowest attainable probability, with the priority order being the fourth contract, the first contract, the second contract, the third contract, and the fifth contract, forming a personalized electricity purchase plan list.
[0066] Preferably, each candidate contract in the personalized electricity purchase plan list retains its original contract length, unit price discount, and penalty clause trigger risk marker, and is supplemented with an achievement probability value as the sorting criterion. Users can select an electricity purchase plan that matches their maintenance plan and electricity consumption expectations based on the comprehensive attributes of each candidate contract in the personalized electricity purchase plan list. The sorting method of this list reflects the differences in the feasibility of each candidate contract under the constraint of the maintenance window location, ensuring that the recommended electricity purchase plan matches the user's actual production rhythm.
[0067] like Figure 2 This invention provides a personalized recommendation device for user-side power trading and electricity purchase schemes, mainly comprising: The time period identification module is used to extract the location of the maintenance window from the user equipment maintenance plan text, obtain the monthly distribution of the maintenance window location within the contract period, and identify the downtime and resumption time periods during the maintenance period. The centroid calculation module is used to obtain the monthly planned electricity consumption and the minimum electricity consumption threshold for each candidate contract period. Based on the location of the maintenance window and the length of each candidate contract period, the module performs time-series alignment and calculates the monthly distribution centroid of electricity consumption within the contract period. The risk assessment module is used to analyze contract schemes where the centroid is located in a month that is outside the effective range, and to assess the risk of penalty clauses being triggered when long contracts are not properly positioned within the maintenance window. The solution determination module is used to integrate the contract period length and the risk of penalty clauses using a decision tree algorithm, and combine the unit price discount level of each contract to determine candidate solutions; The candidate set generation module is used to determine the schemes to be excluded based on the matching result between the month in which the centroid is located and the minimum electricity threshold, and to obtain a recommended candidate set after preliminary screening. The list generation module is used to combine the recommended candidate set after preliminary screening with the power recovery progress during the resumption of production period, calculate the achievability probability of the remaining solutions at the maintenance window landing point, and determine the personalized power purchase solution list.
[0068] Furthermore, the time period identification module, when extracting the maintenance window location from the user equipment maintenance plan text, obtaining the monthly distribution of the maintenance window location within the contract period, and identifying the downtime and resumption periods during maintenance, includes: The time information is extracted from the maintenance plan text uploaded by the user, and the time information is parsed using the named entity recognition method to identify the text fragments representing the date; Extract the maintenance start date and maintenance end date from the text fragment; The date range of the maintenance window is determined based on the time span between the maintenance start date and the maintenance end date; The date range is mapped to a preset contract period boundary to generate the monthly distribution of maintenance windows within the contract period.
[0069] Furthermore, when identifying downtime and resumption periods during maintenance, the time period identification module includes: Obtain the monthly coverage sequence of maintenance windows within the contract period; For each month in the monthly coverage sequence, determine whether the month contains the maintenance start date. If it does, mark the month as a downtime period. Determine whether the month includes the maintenance end date; if so, mark the month as the resumption period. Based on the labeled results, the monthly distribution data of the downtime and resumption of production during the maintenance period within the contract cycle is generated.
[0070] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.
Claims
1. A method for personalized recommendation of user-side power trading and electricity purchase schemes, characterized in that, The method includes: Extract the maintenance window location from the user equipment maintenance plan text, obtain the monthly distribution of the maintenance window location within the contract period, and identify the downtime and resumption time during the maintenance period. Obtain the monthly planned electricity consumption and minimum electricity consumption threshold for each candidate contract period. Align the time sequence according to the location of the maintenance window and the length of each candidate contract period, and calculate the monthly distribution centroid of electricity consumption within the contract period. The analysis identifies contract schemes where the centroid is located in a month that is outside the effective range. Combined with the distribution of downtime periods in contracts, the risk of triggering penalty clauses for long contracts under conditions where the maintenance window location is not suitable is assessed. The decision tree algorithm is used to integrate the contract period length and the risk of penalty clauses, and candidate solutions are determined by combining the unit price discount level of each contract. For the candidate schemes, the schemes to be excluded are determined based on the matching results between the month in which the centroid is located and the minimum electricity threshold, and a recommended candidate set after preliminary screening is obtained; Based on the recommended candidate set after preliminary screening and the power recovery progress during the resumption of production, the probability of the remaining options being achievable at the location of the maintenance window is calculated, and a list of personalized power purchase options is determined. The analysis identifies contract schemes where the centroid's month exceeds the effective range. It also assesses the risk of penalty clauses triggering in long contracts under conditions where the maintenance window's location is mismatched, based on the distribution of downtime periods across contracts. This includes: Based on the location of the centroid of the distribution, the contract period is divided into the first, middle and last segments; Determine whether the position of the centroid of the distribution falls outside the middle range. If so, mark the corresponding candidate contract as a centroid offset contract. For the aforementioned centroid offset contract, calculate the distribution centroid during the downtime period; If the centroid of the distribution during the downtime falls in the earlier segment and the position of the centroid is biased towards the later segment, or if the centroid of the distribution during the downtime falls in the later segment and the position of the centroid is biased towards the earlier segment, then it is determined that there is a risk of triggering the penalty clause. The method of using a decision tree algorithm to integrate contract duration and penalty clause triggering risks, combined with the unit price discount level of each contract to determine candidate solutions, includes: Obtain the contract period length, risk marker, and unit price discount for each candidate contract, and construct a feature vector set; The feature vector group is classified using a decision tree algorithm. The decision tree algorithm uses the contract period length as the splitting attribute of the root node and the penalty clause trigger risk mark as the splitting attribute of the intermediate node. The feature vector group is divided layer by layer along the decision path to the corresponding leaf node according to the value of each splitting attribute. Based on the distribution of the number of candidate contracts and the unit price discount within the leaf node, determine the category label of each leaf node; Generate candidate solutions labeled as priority recommendation class and alternative recommendation class.
2. The personalized recommendation method for user-side power trading and electricity purchase schemes according to claim 1, characterized in that, The step of extracting the maintenance window location from the user equipment maintenance plan text, obtaining the monthly distribution of the maintenance window location within the contract period, and identifying the downtime and resumption periods during the maintenance period includes: The time information is extracted from the maintenance plan text uploaded by the user, and the time information is parsed using the named entity recognition method to identify the text fragments representing the date; Extract the maintenance start date and maintenance end date from the text fragment; The date range of the maintenance window is determined based on the time span between the maintenance start date and the maintenance end date; The date range is mapped to a preset contract period boundary to generate the monthly distribution of maintenance windows within the contract period.
3. The personalized recommendation method for user-side power trading and electricity purchase schemes according to claim 2, characterized in that, The identification of downtime and resumption periods during maintenance includes: For each month in the aforementioned monthly distribution, determine whether the month contains the maintenance start date; if it does, mark the month as a downtime period. Determine whether the month includes the maintenance end date; if so, mark the month as the resumption period. Based on the labeled shutdown and resumption periods, monthly distribution data of shutdown and resumption periods during maintenance are generated within the contract period.
4. The personalized recommendation method for user-side power trading and electricity purchase schemes according to claim 1, characterized in that, The process of obtaining the monthly planned electricity consumption and guaranteed electricity threshold for each candidate contract period, aligning the time sequence according to the location of the maintenance window and the length of each candidate contract period, and calculating the monthly distribution centroid of electricity consumption within the contract period includes: Obtain the monthly planned electricity consumption and minimum electricity consumption threshold for each candidate contract, and store them as an electricity consumption dataset according to the candidate contracts; The maintenance window's date range is aligned with the cycle length of each candidate contract to determine its relative monthly position within each candidate contract. For the aforementioned electricity consumption dataset, calculate the weight for each month; The position of the centroid of the distribution is calculated using the month sequence number as the position coordinate and the weight as the weighting value.
5. The personalized recommendation method for user-side power trading and electricity purchase schemes according to claim 1, characterized in that, The process involves combining the initially screened recommended candidate set with the power recovery progress during the resumption period, calculating the probability of achievability of the remaining options at the maintenance window's endpoint, and determining a personalized power purchase plan list, including: Obtain the power consumption recovery progress during the production resumption period and construct a recovery progress curve; Based on the recovery progress curve and the date range of the maintenance window, construct an input feature set; The input feature set is associated with the candidate contracts in the preliminary recommendation scheme set and then input into the random forest algorithm for classification processing; The probability of achievement is obtained by statistically analyzing the proportion of decision trees classified as achievable categories in the random forest algorithm. The candidate contracts are sorted according to the probability of success, and the personalized electricity purchase plan list is generated.
6. A personalized recommendation device for user-side power trading and electricity purchase schemes, characterized in that, The device includes: The time period identification module is used to extract the location of the maintenance window from the user equipment maintenance plan text, obtain the monthly distribution of the maintenance window location within the contract period, and identify the downtime and resumption time periods during the maintenance period. The centroid calculation module is used to obtain the monthly planned electricity consumption and the minimum electricity consumption threshold for each candidate contract period. Based on the location of the maintenance window and the length of each candidate contract period, the module performs time-series alignment and calculates the monthly distribution centroid of electricity consumption within the contract period. The risk assessment module is used to analyze contract schemes where the centroid is located in a month that is outside the effective range, and to assess the risk of penalty clauses being triggered when long contracts are not properly positioned within the maintenance window. The scheme determination module is used to integrate the contract period length and the risk of penalty clauses using a decision tree algorithm, and combine the unit price discount level of each contract to determine candidate schemes; The candidate set generation module is used to determine the schemes to be excluded based on the matching result between the month in which the centroid is located and the minimum electricity threshold, and to obtain a recommended candidate set after preliminary screening. The list generation module is used to combine the recommended candidate set after preliminary screening with the power recovery progress during the resumption of production period, calculate the probability of the remaining solutions being achievable at the location of the maintenance window, and determine the personalized power purchase solution list. When the risk assessment module analyzes contract schemes where the centroid's month exceeds the effective range, and assesses the risk of penalty clauses triggering under conditions where the maintenance window's landing point is mismatched, based on the distribution of downtime periods across contracts, it includes: Based on the location of the centroid of the distribution, the contract period is divided into the first, middle and last segments; Determine whether the position of the centroid of the distribution falls outside the middle range. If so, mark the corresponding candidate contract as a centroid offset contract. For the aforementioned centroid offset contract, calculate the distribution centroid during the downtime period; If the centroid of the distribution during the downtime falls in the earlier segment and the position of the centroid is biased towards the later segment, or if the centroid of the distribution during the downtime falls in the later segment and the position of the centroid is biased towards the earlier segment, then it is determined that there is a risk of triggering the penalty clause. The scheme determination module, when using a decision tree algorithm to integrate contract period length and penalty clause triggering risk, and combining the unit price discount level of each contract to determine candidate schemes, includes: Obtain the contract period length, risk marker, and unit price discount for each candidate contract, and construct a feature vector set; The feature vector group is classified using a decision tree algorithm. The decision tree algorithm uses the contract period length as the splitting attribute of the root node and the penalty clause trigger risk mark as the splitting attribute of the intermediate node. The feature vector group is divided layer by layer along the decision path to the corresponding leaf node according to the value of each splitting attribute. Based on the distribution of the number of candidate contracts and the unit price discount within the leaf node, determine the category label of each leaf node; Generate candidate solutions labeled as priority recommendation class and alternative recommendation class.
7. The personalized recommendation device for user-side power trading and electricity purchase schemes according to claim 6, characterized in that, The time period identification module, when extracting the maintenance window location from the user equipment maintenance plan text, obtaining the monthly distribution of the maintenance window location within the contract period, and identifying the downtime and resumption periods during maintenance, includes: The time information is extracted from the maintenance plan text uploaded by the user, and the time information is parsed using the named entity recognition method to identify the text fragments representing the date; Extract the maintenance start date and maintenance end date from the text fragment; The date range of the maintenance window is determined based on the time span between the maintenance start date and the maintenance end date; The date range is mapped to a preset contract period boundary to generate the monthly distribution of maintenance windows within the contract period.
8. The personalized recommendation device for user-side power trading and electricity purchase schemes according to claim 7, characterized in that, When the time period identification module identifies downtime and resumption periods during maintenance, it includes: For each month in the aforementioned monthly distribution, determine whether the month contains the maintenance start date; if it does, mark the month as a downtime period. Determine whether the month includes the maintenance end date; if so, mark the month as the resumption period. Based on the labeled shutdown and resumption periods, monthly distribution data of shutdown and resumption periods during maintenance are generated within the contract period.
Citation Information
Patent Citations
Cross-provincial and cross-regional year-round electricity purchase strategy layered optimization method considering source load time sequence simulation and reservoir monthly coordination
CN114925893A
Quantity price declaration method for inter-provincial day-ahead spot transaction
CN117114776A