Electricity purchasing cash register method, medium and system

By acquiring electricity purchase requests, calculating the initial pure electricity purchase amount, calculating the available electricity volume based on the tiered electricity price inverse function, and constructing a dynamic parameter set, the problem of the single debt settlement method in the existing system is solved, realizing flexible electricity purchase and repayment methods, and improving the user's electricity purchase experience.

CN122434522APending Publication Date: 2026-07-21SHENZHEN INHEMETER +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN INHEMETER
Filing Date
2026-04-23
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

The existing electricity purchase payment system can only support a single payment method and cannot flexibly configure payment methods, resulting in low choice for users during the electricity purchase process and affecting the electricity purchase experience.

Method used

By acquiring electricity purchase requests, calculating the initial pure electricity purchase amount, calculating the available electricity volume based on the tiered electricity price inverse function, constructing a dynamic parameter set, and performing dynamic calculations to generate the final payment result, the system supports flexible configuration of different rates, fees, and debt repayment methods.

Benefits of technology

It improves the choices and experience for electricity users during the electricity purchase process, and enables accurate calculation of flexible electricity purchase methods and repayment methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122434522A_ABST
    Figure CN122434522A_ABST
Patent Text Reader

Abstract

The application discloses a power purchase cash register method, medium and system for a power consumer, wherein the method comprises the following steps: obtaining a power purchase request; obtaining corresponding user comprehensive information, rate configuration information and fee configuration information according to user account information; calculating a corresponding initial pure power purchase amount guess value and taking the initial pure power purchase amount guess value as a current guess value; calculating corresponding purchasable power according to the rate configuration information, the fee configuration information and the current guess value based on a ladder electricity price inverse function; constructing a dynamic parameter set and calculating a corresponding dynamic item total amount; calculating a difference value between the current guess value and the dynamic item total amount and calculating a corresponding convergence judgment value according to the difference value; judging whether a current convergence condition is established according to the convergence judgment value; and if yes, generating a final cash register result based on the current guess value. The application can improve the configuration flexibility of the power consumer in the power purchase process and improve the power purchase experience of the power consumer while ensuring effective and accurate billing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity billing and payment technology, and in particular to a method, medium, and system for electricity purchase and payment by electricity users. Background Technology

[0002] In related technologies, most electricity purchase payment systems only support a single, structured debt settlement method. That is, existing electricity purchase payment systems mostly only support registering debt information after a user incurs debt, and only allowing normal electricity purchases after the user settles the debt. They cannot support flexible configuration of debt settlement methods (e.g., per transaction / per time period / per unit of electricity / per unit of pure purchase amount, etc.). This results in limited choices for users during the electricity purchase process, significantly impacting their electricity purchase experience. Summary of the Invention

[0003] The technical problem to be solved by this invention is: how to improve the flexibility of payment methods for electricity users during the electricity purchase process, increase the options available to electricity users, and thus improve the user experience during the electricity purchase process.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for electricity purchase and payment for users includes the following steps: obtaining an electricity purchase request, the request including user account information and purchase amount; obtaining corresponding user comprehensive information, rate configuration information, and fee configuration information based on the user account information; calculating an initial pure electricity purchase amount guess based on the purchase amount and the user comprehensive information, and using the initial pure electricity purchase amount guess as the current guess; calculating the corresponding purchasable electricity volume based on the rate configuration information, fee configuration information, and the current guess based on the tiered electricity price inverse function; constructing a dynamic parameter set based on the user comprehensive information, and calculating the corresponding dynamic item total amount based on the dynamic parameter set and the purchasable electricity volume; calculating the difference between the current guess and the dynamic item total amount, and calculating the corresponding convergence judgment value based on the difference; determining whether the current convergence condition is met based on the convergence judgment value; if so, generating the final payment result based on the current guess.

[0005] Optionally, the comprehensive user information includes overdue payment information, fixed fee information, and non-overdue fixed payment information. The calculation of the initial pure electricity purchase amount estimate based on the electricity purchase amount and the comprehensive user information includes: performing mandatory overdue payment settlement based on the overdue payment information and the electricity purchase amount; collecting fixed fees based on the mandatory settlement result and the fixed fee information after the mandatory settlement is completed; and settling non-overdue fixed payments based on the collection result and the non-overdue fixed payment information after the fixed fees are collected, to obtain the initial pure electricity purchase amount estimate.

[0006] Optionally, before calculating the corresponding purchasable electricity volume based on the tiered electricity price inverse function according to the rate configuration information, cost configuration information and the current guess value, the method further includes: obtaining the user's last electricity purchase date and current electricity purchase date; determining whether the last electricity purchase date and the current electricity purchase date belong to the same month; if not, resetting the cumulative purchased electricity volume for the current month.

[0007] Optionally, the calculation of the corresponding purchasable electricity volume based on the tiered electricity price inverse function according to the rate configuration information, cost configuration information, and the current guess value includes: obtaining tiered electricity consumption configuration information based on the rate configuration information and the cost configuration information, wherein the tiered electricity consumption configuration information includes multiple electricity consumption tiers and the electricity price corresponding to each electricity consumption tier; sorting the electricity consumption tiers according to the electricity prices; and calculating the tiered electricity price inverse function based on the sorting result and the cumulative purchased electricity volume for this month to obtain the corresponding purchasable electricity volume.

[0008] Optionally, constructing a dynamic parameter set based on the comprehensive user information includes: obtaining dynamic parameters from the comprehensive user information, the dynamic parameters including calculating fees based on electricity consumption, calculating fees based on a percentage of the amount, calculating outstanding payments based on electricity consumption, and calculating outstanding payments based on a percentage of the amount; verifying the validity of the dynamic parameters; if the verification result is that the dynamic parameters are valid, then constructing a dynamic parameter set based on the dynamic parameters.

[0009] Optionally, calculating the total amount of the corresponding dynamic items based on the set of dynamic parameters and the available electricity volume includes: calculating the amount of the dynamic items corresponding to each of the dynamic parameters based on the available electricity volume; calculating the sum of all dynamic item amounts, and using the sum as the total amount of the dynamic items.

[0010] Optionally, determining whether the current convergence condition is met based on the convergence judgment value includes: determining whether the convergence judgment value is less than a preset convergence threshold; if yes, the current convergence condition is considered met; if no, determining whether the current iteration count has reached the iteration count threshold; if the current iteration count has reached the iteration count threshold, the current guess value is used as the output value, and an alarm message is generated; if the current iteration count has not reached the iteration count threshold, the difference is used as the current guess value, and the step of calculating the corresponding purchasable electricity based on the tiered electricity price inverse function according to the rate configuration information, cost configuration information, and the current guess value is returned.

[0011] Another technical solution provided by this invention is: A computer-readable storage medium storing an electricity purchase and payment program for electricity users, which, when executed by a processor, implements the electricity purchase and payment method for electricity users as described above.

[0012] Another technical solution provided by this invention is: A user electricity purchase and payment system includes: an acquisition module for acquiring an electricity purchase request, the purchase request including user account information and an electricity purchase amount; a query module for acquiring corresponding user comprehensive information, rate configuration information, and fee configuration information based on the user account information; a first calculation module for calculating an initial pure electricity purchase amount guess value based on the electricity purchase amount and user comprehensive information, and using the initial pure electricity purchase amount guess value as the current guess value; and a second calculation module for calculating the rate configuration information based on the tiered electricity pricing inverse function. The system includes: a configuration module for calculating the available electricity volume based on the user's comprehensive information, fee configuration information, and the current guess value; a dynamic calculation module for constructing a dynamic parameter set based on the user's comprehensive information and calculating the total amount of the corresponding dynamic item based on the dynamic parameter set and the available electricity volume; a judgment module for calculating the difference between the current guess value and the total amount of the dynamic item, calculating the corresponding convergence judgment value based on the difference, and judging whether the current convergence condition is met based on the difference; and a result output module for generating the final payment result based on the current guess value when the current convergence condition is met.

[0013] Optionally, the comprehensive user information includes overdue payment information, fixed fee information, and non-overdue fixed payment information. The first calculation module is further configured to perform mandatory overdue payment settlement based on the overdue payment information and the electricity purchase amount; after the mandatory settlement is completed, to collect fixed fees based on the result of the mandatory settlement and the fixed fee information; and after the fixed fees are collected, to perform non-overdue fixed payment settlement based on the collection result and the non-overdue fixed payment information, so as to obtain an initial pure electricity purchase amount estimate.

[0014] The beneficial effects of this invention are as follows: By configuring rates and fees, it supports electricity users in configuring different rates, fees, and repayment methods during the electricity purchase process, thereby increasing the choices available to electricity users. Furthermore, to accommodate flexible configuration of purchase and repayment methods, a dynamic parameter set is constructed based on comprehensive user information. Dynamic calculations are then performed based on this dynamic parameter set and the available electricity volume, enabling accurate calculation of costs after flexible configuration. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the electricity purchase method for electricity users according to an embodiment of the present invention; Figure 2 This is a block diagram of the electricity purchase system for electricity users according to an embodiment of the present invention; Figure 3 This is a block diagram of an electricity purchase system for electricity users according to another embodiment of the present invention; Figure 4 This is a schematic diagram of the electricity purchase request processing flow according to another embodiment of the present invention. Detailed Implementation

[0016] To explain in detail the technical principles, specific implementable solutions, possible application scenarios, and achievable objectives and effects of the present invention, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. It is understood that the embodiments described herein and the embodiments shown in the accompanying drawings are only used to more clearly illustrate the technical solutions of the present invention, and are therefore only examples intended to explain the present invention, and should not be construed as limiting the present invention. It should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0017] This invention effectively improves the selectivity and user experience of electricity purchases. Specifically, the electricity purchase payment method includes: obtaining an electricity purchase request, which includes user account information and a purchase amount; obtaining corresponding user comprehensive information, rate configuration information, and fee configuration information based on the user account information; calculating an initial pure electricity purchase amount guess based on the purchase amount and the user comprehensive information, and using the initial pure electricity purchase amount guess as the current guess; and calculating the corresponding initial pure electricity purchase amount guess based on the tiered electricity pricing inverse function, according to the rate configuration information and fee configuration information. The system calculates the available electricity volume based on the user's comprehensive information and the current guess value; it constructs a dynamic parameter set based on the user's comprehensive information and calculates the total amount of the corresponding dynamic item based on the dynamic parameter set and the available electricity volume; it calculates the difference between the current guess value and the total amount of the dynamic item, and calculates the corresponding convergence judgment value based on the difference; it determines whether the current convergence condition is met based on the convergence judgment value; if so, it generates the final payment result based on the current guess value; thus, users can flexibly configure their electricity purchase and repayment methods during the electricity purchase process, improving their electricity purchase experience. Correspondingly, the results can be accurately calculated through dynamic calculation.

[0018] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0019] Figure 1 This is a flowchart illustrating the electricity purchase and payment method for electricity users according to an embodiment of the present invention.

[0020] like Figure 1 As shown, the electricity purchase and payment method for users according to an embodiment of the present invention includes the following steps: S101, Obtain electricity purchase request. The electricity purchase request includes user account information and electricity purchase amount.

[0021] S102, obtains the corresponding comprehensive user information, rate configuration information and fee configuration information based on the user account information.

[0022] As an example, firstly, the system supports the configuration of rates under different billing models through the fee management module. Preferably, it supports multiple rate model versions, such as prepaid-electricity settlement model, prepaid-amount settlement model, and dynamic periodic rate model. Within the rate model versions, it supports the configuration of tiered pricing and fixed pricing. Secondly, the fee management module supports flexible configuration of fees based on different calculation bases and calculation periods; it also supports configuring dynamic fee versions, which are only effective during the configured start time period. Next, the user management module manages relevant information in user profiles, such as the rates and fees associated with the user. This module also generates various outstanding payments for users. The initial amount, repayment method, start repayment date, and overdue date of these outstanding payments can all be flexibly configured. Thus, after generating a corresponding account for a user, the system configures the corresponding rate and fees for that account and associates these rates and fees with the user's account information. Subsequently, the associated rate and fee configuration information can be obtained based on the user's account information in the user's electricity purchase request.

[0023] S103, calculate the corresponding initial pure electricity purchase amount guess value based on the electricity purchase amount and user comprehensive information, and use the initial pure electricity purchase amount guess value as the current guess value.

[0024] In some embodiments, the comprehensive user information includes overdue payment information, fixed fee information, and non-overdue fixed payment information. The calculation of the initial pure electricity purchase amount estimate based on the electricity purchase amount and the comprehensive user information includes: performing mandatory overdue payment settlement based on the overdue payment information and the electricity purchase amount; collecting fixed fees based on the mandatory settlement result and fixed fee information after the mandatory settlement is completed; and performing non-overdue fixed payment settlement based on the collection result and non-overdue fixed payment information after the fixed fee is collected, to obtain the initial pure electricity purchase amount estimate.

[0025] As an example, different priorities are set when settling outstanding debts. Preferably, the first priority is the settlement of overdue debts, the second priority is the collection of fixed fees, and the third priority is the settlement of non-overdue fixed debts.

[0026] Regarding the first priority, when settling overdue payments, any payment marked as overdue is defined as requiring full repayment in this round of electricity purchases, regardless of its original repayment method. This is the highest priority processing step to ensure compliance; its specific steps include: 1. Iterate through all outstanding payments and filter out those that are overdue and have a balance greater than 0.

[0027] 2. Sort the filtered items according to the outstanding payment ID to ensure the processing order.

[0028] 3. Deduct the overdue amount one by one according to the debtor ID.

[0029] 4. Update the remaining electricity purchase amount after each deduction.

[0030] 5. Determine if the remaining electricity purchase amount is less than 0; if so, it indicates insufficient funds, and the returned amount is insufficient to pay off all overdue debts, and the current transaction is confirmed to have failed; if not, continue to deduct until all overdue debts are paid off.

[0031] 6. Record the details of debt settlement.

[0032] Regarding the second priority, when charging fixed fees, this includes both a fixed amount per transaction and a fixed amount per day. These fees are independent of the electricity purchase outcome and can be calculated directly. Specifically, the steps include: 1. Process fixed-amount fees each time, deducting the fixed amount from the remaining electricity purchase amount each time.

[0033] 2. For fixed-amount fees charged on a daily / monthly / yearly basis, calculate the fees based on the number of days since the last electricity purchase.

[0034] 3. Check if the funds are sufficient. If not, the returned amount will be insufficient to complete the transaction, and the transaction will fail; otherwise, continue to the next step.

[0035] 4. Record the details of fee collection.

[0036] Regarding the third priority, non-overdue fixed-amount payments include both fixed amounts per payment and fixed amounts per day. These payments are fixed or time-based and are independent of the electricity purchase outcome. Specific steps include: 1. Screen for non-overdue debts.

[0037] 2. Processing type 1: Fixed amount each time, not exceeding the outstanding balance.

[0038] 3. Processing type 2: Fixed amount per day, calculated based on the number of days, not exceeding the outstanding balance.

[0039] 4. Check if the funds are sufficient. If not, the returned amount will be insufficient to complete the transaction, and the transaction will fail; otherwise, continue to the next step.

[0040] 5. Record the details of debt settlement.

[0041] S104, based on the inverse function of tiered electricity pricing, calculates the corresponding purchasable electricity volume according to the rate configuration information, cost configuration information, and current guess value.

[0042] In some embodiments, before calculating the corresponding purchasable electricity volume based on the tiered electricity price inverse function according to the rate configuration information, cost configuration information and the current guess value, the method further includes: obtaining the user's last electricity purchase date and current electricity purchase date; determining whether the last electricity purchase date and current electricity purchase date belong to the same month; if not, resetting the cumulative purchased electricity volume for the current month.

[0043] As an example, after receiving a user's electricity purchase request, the first step is to load parameters. This process mainly involves requesting the user management module and the prepaid module to obtain the user's associated fee list and the currently effective version of the fee (which includes fee parameters), the user's associated tariff rate and the currently effective version of the tariff rate, i.e., the user's tiered electricity price configuration, the user's outstanding payment list, the user's cumulative electricity purchases this month, the last electricity purchase date, and the date of the current electricity purchase transaction.

[0044] Next, state initialization and time difference calculation are performed.

[0045] Specifically, state initialization: If the month in which the current transaction occurred is not the same as the month of the last electricity purchase date, that is, if no electricity purchase transaction was conducted this month, then the cumulative electricity purchased this month is reset to 0.

[0046] Calculate the time difference: If the last electricity purchase date exists, then the time difference = the current electricity purchase transaction date - the last electricity purchase date; otherwise, the time difference = the current electricity purchase transaction date - the electricity user's filing date.

[0047] In some embodiments, the corresponding purchasable electricity volume is calculated based on the tiered electricity price inverse function according to the rate configuration information, the cost configuration information, and the current estimated value. This includes: obtaining tiered electricity consumption configuration information based on the rate configuration information and the cost configuration information, wherein the tiered electricity consumption configuration information includes multiple electricity consumption tiers and the electricity price corresponding to each electricity consumption tier; sorting the electricity consumption tiers according to the electricity price; and calculating the tiered electricity price inverse function based on the sorting result and the cumulative purchased electricity volume for the current month to obtain the corresponding purchasable electricity volume.

[0048] As an example, firstly, based on a given amount and the electricity consumed this month, calculate the amount of electricity that can be purchased under the tiered pricing system, i.e., the purchasable electricity volume. This process requires accurately calculating the remaining capacity for each tier. The specific calculation process for the inverse function of the tiered pricing system includes: 1. Obtain the tiered configuration and sort by price.

[0049] 2. Calculate the remaining available capacity for each step.

[0050] 3. Funds are allocated in a tiered order.

[0051] 4. If there are enough funds to purchase the current step, continue to traverse the next step.

[0052] 5. If the funds are insufficient to purchase the current tier, calculate the amount of electricity that can be purchased in that tier.

[0053] 6. If there are still funds remaining and all tiers have been exceeded, continue purchasing at the price of the last tier.

[0054] As a specific example, assuming the electricity purchased this month is 50 kWh and the purchase amount is 400 yuan, the calculation can be performed as follows: Tier 1: Maximum capacity = 200 kWh, unit price = 0.5 yuan / kWh, available capacity = 200 (Tier 1 capacity) - 50 (electricity purchased this month) = 150 kWh; to purchase the full Tier 1: 150 kWh, the cost is 150 * 0.5 = 75.00 yuan.

[0055] Tier 2: Maximum capacity = 500 degrees, unit price = 0.8 yuan / degree, available capacity = 500 (Tier 2 maximum capacity) - 200 (Tier 1 maximum capacity) = 300 degrees; to purchase the full Tier 2: 300 degrees, the cost is 300 * 0.8 = 240.00 yuan.

[0056] Tier 3: Maximum capacity = inf degrees, unit price = 1.0 yuan / degree, available capacity = inf degrees; In the Infinite Tier, purchase 400-75-240=85 yuan, unit price 1.0 yuan / degree, and you can purchase 85.00 degrees.

[0057] Calculation complete: Available electricity = 150 + 300 + 85 = 535.00 kWh, remaining amount = 0.00 yuan.

[0058] As another specific example, assuming the purchased electricity this month is 320 kWh and the total purchase amount is 300 yuan, it can be calculated as follows: Tier 1: Maximum = 200 kWh, Unit Price = 0.5 yuan / kWh, Available Capacity = 0 kWh Tier 2: Maximum capacity = 500 kWh, unit price = 0.8 yuan / kWh, usable capacity = 500 - 320 = 180 kWh; to purchase the full Tier 2: 180 kWh, the cost is 180 * 0.8 = 144.00 yuan; Tier 3: Maximum capacity = inf degrees, unit price = 1.0 yuan / degree, available capacity = inf degrees; Purchasing in the Infinite Tier costs 300 - 144 = 156.00 yuan, at a unit price of 1.0 yuan / degree, allowing you to purchase 156.00 degrees. Calculation complete: Available electricity = 180 + 156 = 336.00 kWh, remaining amount = 0.00 yuan.

[0059] In this way, the corresponding available electricity volume can be obtained by calculating the inverse function of the tiered electricity price based on the ranking results of the electricity consumption tiers and the cumulative electricity purchased this month.

[0060] S105 constructs a dynamic parameter set based on comprehensive user information, and calculates the total amount of the corresponding dynamic item based on the dynamic parameter set and the available electricity volume.

[0061] In some embodiments, constructing a dynamic parameter set based on comprehensive user information includes: obtaining dynamic parameters from the comprehensive user information, the dynamic parameters including calculating fees based on electricity consumption, calculating fees based on a percentage of the amount, calculating outstanding payments based on electricity consumption, and calculating outstanding payments based on a percentage of the amount; verifying the validity of the dynamic parameters; if the verification result is that the dynamic parameters are valid, then constructing a dynamic parameter set based on the dynamic parameters.

[0062] As an example, first, all dynamic parameters that need to be calculated iteratively are collected, including fees and outstanding payments related to the purchased electricity volume, as well as percentage fees and outstanding payments related to the net electricity purchase amount. These parameters will be used in subsequent iterative calculations. Specifically, this includes the following steps: 1. Filter by cost based on electricity consumption and by cost as a percentage of the amount.

[0063] 2. Filter non-overdue payments calculated by electricity consumption and payments calculated as a percentage of the amount.

[0064] 3. Verify parameter validity. This step mainly verifies data types and formats to prevent incorrect parameters from producing unreasonable results. For example, for fees and outstanding payments calculated by electricity consumption * unit price, the unit price should be a positive numeric number; for fees and outstanding payments calculated as a percentage of the amount, the percentage should be a positive numeric number and not exceed 100%.

[0065] 4. Construct a dynamic parameter set. This step mainly involves collecting the dynamic parameters that need to be iteratively calculated in steps (1) and (2): the unit price of the fee calculated by electricity consumption, the percentage of the fee calculated by the percentage of the amount, the unit price of the non-overdue amount calculated by electricity consumption, and the percentage of the non-overdue amount calculated by the percentage of the amount.

[0066] S106, calculate the difference between the current guess value and the total amount of the dynamic item, and calculate the corresponding convergence judgment value based on the difference.

[0067] S107, determine whether the current convergence condition is met based on the convergence judgment value.

[0068] S108, If so, generate the final checkout result based on the current guess value.

[0069] In some embodiments, calculating the total amount of the corresponding dynamic item based on the set of dynamic parameters and the available electricity volume includes: calculating the amount of the dynamic item corresponding to each dynamic parameter based on the available electricity volume; calculating the sum of all dynamic item amounts, and using the sum as the total amount of the dynamic item.

[0070] In some embodiments, determining whether the current convergence condition is met based on the convergence judgment value includes: determining whether the convergence judgment value is less than a preset convergence threshold; if yes, the current convergence condition is considered met; if no, determining whether the current iteration count has reached the iteration count threshold; if the current iteration count has reached the iteration count threshold, the current guess value is used as the output value, and an alarm message is generated; if the current iteration count has not reached the iteration count threshold, the difference is used as the current guess value, and the step of calculating the corresponding purchasable electricity volume based on the tiered electricity price inverse function according to the rate configuration information, cost configuration information, and the current guess value is returned.

[0071] As an example, it's important to first clarify that the dynamic solution process is the core of the entire model, solving a system of interdependent dynamic variable equations through iterative methods. Since the fees calculated per unit of electricity and the outstanding payments calculated per unit of electricity depend on the amount of electricity purchased, while the fees calculated as a percentage of the amount and the outstanding payments calculated as a percentage of the amount depend on the pure electricity purchase amount, and these variables influence each other, iterative approaches are needed to approximate the optimal solution.

[0072] Its specific algorithm logic includes: 1. Initialize the guess value of the pure electricity purchase amount. The guess value M_pure_guess = total transaction amount - amount of overdue debts to be forcibly repaid; that is, calculate the initial guess value of the spring electricity purchase amount and use this initial pure electricity purchase amount guess value as the current guess value.

[0073] 2. Enter the iteration loop (maximum N times, N is configurable, generally configured to be between 10 and 15 times): a. Calculate the available electricity volume based on the current guess value M_pure_guess using the inverse function of tiered electricity pricing.

[0074] b. Calculate the total amount of all dynamic items. That is, based on the available electricity volume calculated in step a, calculate the amounts of all the following dynamic items in sequence: fees and outstanding payments related to the purchased electricity volume, percentage fees and outstanding payments related to the pure electricity purchase amount, and sum the total amount of all dynamic items as M_dynamic.

[0075] c. Considering the outstanding balance limit, it cannot exceed the actual balance (e.g., if the outstanding amount is M yuan, but the value calculated based on electricity volume * unit price exceeds M, then the smaller value between the calculated value and the actual balance should be taken). d. Recalculate the pure electricity purchase amount. The recalculated pure electricity purchase amount M_pure_new = the guessed value of the pure electricity purchase amount M_pure_guess - M_dynamic.

[0076] e. Check the convergence condition (the change is less than the threshold ε, which can be configured; generally, ε=0.01). That is, check whether abs(M_pure_new - M_pure_guess)<ε is true.

[0077] 3. If convergence is achieved, return the result; if convergence is not achieved, update the guess value M_pure_guess to M_pure_new and continue the iteration.

[0078] 4. If convergence is not achieved after reaching the maximum number of iterations, return the last calculation result and record a warning.

[0079] In some embodiments, generating the final checkout result based on the current guess value includes: Integrate the results of all steps to perform the final settlement. This includes calculating totals, verifying data consistency, and preparing detailed results to return to the user. The algorithm logic is as follows: 1. Summarize all payment items (overdue payments, fixed fees, fixed outstanding payments, and dynamic items).

[0080] 2. Calculate the net electricity purchase amount and the total electricity purchase amount.

[0081] 3. Verify the balance of funds (total payment = all expenses + net electricity purchase).

[0082] 4. Calculate the new monthly cumulative electricity consumption.

[0083] 5. Construct a detailed result structure.

[0084] Next, state persistence updates are performed, meaning the calculation results are persisted to the storage system, updating user status, recording transaction history, and updating outstanding balances. This is a crucial step in ensuring data consistency and traceability. The algorithm logic is as follows: 1. Update users' monthly cumulative electricity consumption.

[0085] 2. Update the last electricity purchase date.

[0086] 3. Update the outstanding balance and status.

[0087] 4. Record the complete transaction history.

[0088] 5. Update statistics (such as the number of electricity purchases this month).

[0089] 6. Ensure that all updates are completed within a single transaction.

[0090] Furthermore, it should be noted that the electricity purchase and payment method for users according to embodiments of the present invention employs strict priority processing: through a layered design (phases one, two, and three), the repayment order of "overdue > fixed fees > unexpected fixed debts" is solidified, with clear logic and no ambiguity; secondly, through decoupling and modularization: the complex hybrid problem is decomposed into independent modules that are executed sequentially, making it easy to implement, test, and maintain; and thirdly, through precise tiered matching: the core algorithm for dynamic system iterative solution can accurately handle situations where funds span multiple electricity price tiers, and the ε value is configurable to meet different accuracy and response speed requirements; at the same time, through the above methods, scalability can be greatly improved: if other types of debts need to be added (such as "fixed ratio + floating ratio"), they can be included in the corresponding priority phase without affecting the overall architecture.

[0091] In summary, the electricity purchase and payment method for users according to embodiments of the present invention includes the following steps: obtaining an electricity purchase request, the electricity purchase request including user account information and electricity purchase amount; obtaining corresponding user comprehensive information, rate configuration information, and fee configuration information based on the user account information; calculating a corresponding initial pure electricity purchase amount guess value based on the electricity purchase amount and the user comprehensive information, and using the initial pure electricity purchase amount guess value as the current guess value; calculating the corresponding purchasable electricity volume based on the tiered electricity price inverse function according to the rate configuration information, fee configuration information, and the current guess value; constructing a dynamic parameter set based on the user comprehensive information, and calculating the corresponding dynamic item total amount based on the dynamic parameter set and the purchasable electricity volume; calculating the difference between the current guess value and the dynamic item total amount, and calculating the corresponding convergence judgment value based on the difference; determining whether the current convergence condition is met based on the convergence judgment value; if so, generating the final payment result based on the current guess value. This allows electricity users to configure different rates, fees, and repayment methods during the electricity purchase process through rate and fee configuration, thereby increasing their choices. To accommodate flexible configuration of purchase and repayment methods, a dynamic parameter set is constructed based on comprehensive user information. Based on this dynamic parameter set and available electricity volume, accurate calculations are performed to determine the cost after flexible configuration.

[0092] This invention also proposes a computer-readable storage medium storing a user electricity purchase and payment program, which, when executed by a processor, implements the user electricity purchase and payment method as described above.

[0093] like Figure 2 As shown in the figure, this embodiment of the invention also proposes an electricity purchase and payment system for electricity users, including an acquisition module 10, a query module 20, a first calculation module 30, a second calculation module 40, a dynamic calculation module 50, a judgment module 60, and a result output module 70.

[0094] The acquisition module 10 is used to acquire electricity purchase requests, which include user account information and electricity purchase amount. The query module 20 is used to obtain the corresponding comprehensive user information, rate configuration information, and fee configuration information based on the user account information; The first calculation module 30 is used to calculate the corresponding initial pure electricity purchase amount guess value based on the electricity purchase amount and user comprehensive information, and use the initial pure electricity purchase amount guess value as the current guess value. The second calculation module 40 is used to calculate the corresponding purchasable electricity volume based on the tiered electricity price inverse function, the rate configuration information, the cost configuration information, and the current guess value. The dynamic calculation module 50 is used to construct a dynamic parameter set based on the user's comprehensive information, and to calculate the total amount of the corresponding dynamic item based on the dynamic parameter set and the available electricity volume; The judgment module 60 is used to calculate the difference between the current guess value and the total amount of the dynamic item, calculate the corresponding convergence judgment value based on the difference, and determine whether the current convergence condition is met based on the difference. The result output module 70 is used to generate the final cashier result based on the current guess value when the current convergence condition is met.

[0095] In some embodiments, the comprehensive user information includes overdue payment information, fixed fee information, and non-overdue fixed payment information. The first calculation module 30 is further configured to perform mandatory overdue payment processing based on the overdue payment information and the electricity purchase amount; after the mandatory payment processing is completed, the fixed fee is collected based on the result of the mandatory payment processing and the fixed fee information; after the fixed fee is collected, the non-overdue fixed payment processing is performed based on the collection result and the non-overdue fixed payment information to obtain an initial pure electricity purchase amount estimate.

[0096] In some embodiments, such as Figure 3 As shown, the system modules can be divided into a rate management module, a cost management module, an electricity user management module, a cashier module, and a billing engine module.

[0097] The rate management module supports configuring rates under different billing models, such as prepaid-electricity settlement and prepaid-amount settlement. It also supports configuring rate versions with dynamic cycles. Within the rate versions, tiered pricing and fixed pricing can be configured.

[0098] The cost management module supports flexible configuration of costs based on different calculation bases and calculation periods. It also supports configuring dynamic cost versions, which are only effective during their configured activation period.

[0099] The electricity user management module is responsible for managing relevant information in the electricity user profile, such as the associated rates and fees. It is also responsible for generating various outstanding payments for electricity users, and the initial amount, repayment method, repayment start date, and overdue date of the outstanding payments can all be configured.

[0100] The cashier module is responsible for receiving electricity purchase requests from users, integrating relevant parameters, calling the billing engine module, and finally returning the transaction results.

[0101] The billing engine module is responsible for prioritizing and dynamically iterating the billing parameters input, including the electricity user's purchased electricity this month, the total transaction amount, the electricity user's effective rate and version at the time of the transaction, the effective fee and version at the time of the transaction, the list of outstanding debts under the electricity user's name, and the current time. It generates settlement results and finally outputs the electricity purchased by the electricity user in this transaction, the net electricity purchase price, the details of the amount payable for each debt in the list of outstanding debts, and the details of the amount payable for the list of fees payable.

[0102] Specifically, the system process may include: Step 1: Supports configuring rates for different billing modes, such as prepaid-electricity settlement, prepaid-amount settlement, and postpaid. After creating a rate, add a rate version V1 for that rate. When adding rate version V1, you can configure the scheduled activation time for V1. Version V1 only becomes effective after the activation time begins. If you add version V2, version V1 will automatically become invalid when the scheduled activation time for version V2 begins, and version V2 will become effective. That is, only one version of the same rate is valid at a time. When adding a rate version, you can flexibly configure fixed-price rates and tiered-price rates as needed. The tiered-price rates support customizing the electricity range and corresponding unit price for each tier.

[0103] Step 2: Configure the cost and version.

[0104] It supports configuring fees based on different calculation bases and calculation periods. The calculation base can be configured as a fixed amount, purchased electricity volume, payment amount, maximum demand, or capacity. The calculation period can be configured as daily, monthly, per billing period, or per transaction. After creating a fee, you can add a fee version to that fee. The fee version, like the rate version, supports configuring the scheduled activation time and different fee calculation methods. The calculation method can be configured as a percentage of the payment basis, or as payment basis * unit price, etc.

[0105] Step 3: Link electricity user files to fees and rates.

[0106] When adding a new user profile, select the appropriate tariff rate, single fee, or multiple fees for the electricity user as needed. Subsequently, when the electricity user makes an electricity purchase transaction, the associated tariff rate and fee list will be used for billing.

[0107] Step 4: Electricity users generate outstanding payments.

[0108] Electricity users may need to incur new outstanding debts for various reasons, such as electricity theft fines, unpaid access fees, subscription deposits, etc. When creating an outstanding debt, first select the electricity user, then configure the initial amount, repayment method, start repayment date, and overdue date (optional). The debt becomes effective on the start repayment date. If an overdue date is configured and the debt remains unpaid after the overdue date, the first transaction after the overdue date must settle the remaining debt.

[0109] Step 5: Electricity purchase by the user.

[0110] After the electricity user enters the transaction amount, they request to purchase electricity. The billing engine module calculates the billing based on the input parameters and finally outputs the electricity purchased, the net purchase amount, the amount of each fee paid, and the amount of each outstanding payment.

[0111] For the complex electricity purchase scenario involving dynamic multi-period tiered pricing, mandatory overdue payments, various types of debt repayment, and multiple types of fees (as shown in Table 1 below), the calculation process of the billing engine in step 5 is described in detail: Table 1 like Figure 4 When processing user-initiated electricity purchase requests, the system specifically includes the following steps: First, it queries the user's comprehensive information based on the request, including basic user information and a list of outstanding payments. Next, it queries the tariff configuration and fee rules to obtain the corresponding tariff and fee configuration information. Then, it invokes the algorithm engine to execute priority repayment and dynamic iterative calculations sequentially to generate the final result. Following this, it performs a status update, that is, updating the electricity consumption status, updating outstanding payments, and recording transaction history. Finally, it returns the electricity purchase result.

[0112] It should be noted that the above description of the electricity purchase payment method also applies to this electricity purchase payment system, and will not be repeated here.

[0113] Those skilled in the art will understand that all or part of the processes in the above technical solutions can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the methods described above. After being executed by a processor, the program can also achieve the beneficial effects of the corresponding methods.

[0114] The storage medium can be a disk, optical disc, read-only memory (ROM), or random access memory (RAM), etc.

[0115] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0116] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0117] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

[0118] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0119] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0120] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0121] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0122] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for electricity users to pay for electricity, characterized in that, Includes the following steps: Obtain an electricity purchase request, which includes user account information and the amount of electricity to be purchased; Based on the user account information, obtain the corresponding comprehensive user information, rate configuration information, and fee configuration information; Calculate the corresponding initial pure electricity purchase amount guess value based on the electricity purchase amount and the user comprehensive information, and use the initial pure electricity purchase amount guess value as the current guess value; Based on the inverse function of tiered electricity pricing, the corresponding purchasable electricity volume is calculated according to the rate configuration information, cost configuration information, and the current guess value. A dynamic parameter set is constructed based on the user's comprehensive information, and the total amount of the corresponding dynamic item is calculated based on the dynamic parameter set and the available electricity volume. Calculate the difference between the current guess value and the total amount of the dynamic item, and calculate the corresponding convergence judgment value based on the difference; Determine whether the current convergence condition is met based on the convergence judgment value; If so, generate the final checkout result based on the current guess value.

2. The electricity purchase and payment method for electricity users as described in claim 1, characterized in that, The comprehensive user information includes overdue payment information, fixed fee information, and non-overdue fixed payment information. The calculation of the corresponding initial pure electricity purchase amount estimate based on the electricity purchase amount and the comprehensive user information includes: The overdue payment information and the amount of electricity purchased will be used to enforce the repayment of overdue payments. After the compulsory liquidation is completed, the fixed fee will be charged based on the results of the compulsory liquidation and the aforementioned fixed fee information; After the fixed fees are collected, the non-overdue fixed debts are settled based on the collection results and the non-overdue fixed debt information to obtain the initial pure electricity purchase amount estimate.

3. The electricity purchase and payment method for electricity users as described in claim 1, characterized in that, Before calculating the corresponding purchasable electricity volume based on the tiered electricity pricing inverse function according to the rate configuration information, cost configuration information, and the current guessed value, the following steps are also included: Get the user's last electricity purchase date and current electricity purchase date; Determine whether the previous electricity purchase date and the current electricity purchase date belong to the same month; If not, then reset the total electricity purchased this month.

4. The electricity purchase and payment method for electricity users as described in claim 3, characterized in that, Based on the inverse function of tiered electricity pricing, the corresponding purchasable electricity volume is calculated according to the rate configuration information, cost configuration information, and the current guessed value, including: Tiered electricity consumption configuration information is obtained based on the rate configuration information and the cost configuration information. The tiered electricity consumption configuration information includes multiple electricity consumption tiers and the electricity price corresponding to each electricity consumption tier. The electricity consumption tiers are sorted according to the electricity price. Based on the sorting results and the cumulative purchased electricity volume for this month, the tiered electricity price inverse function is calculated to obtain the corresponding available electricity volume.

5. The electricity purchase and payment method for electricity users as described in claim 1, characterized in that, A dynamic parameter set is constructed based on the comprehensive user information, including: The dynamic parameters in the user's comprehensive information are obtained, including the calculation of fees based on electricity consumption, the calculation of fees based on a percentage of the amount, the calculation of outstanding payments based on electricity consumption, and the calculation of outstanding payments based on a percentage of the amount. Verify the validity of the dynamic parameters; If the verification result indicates that the dynamic parameters are valid, then a set of dynamic parameters is constructed based on the dynamic parameters.

6. The electricity purchase and payment method for electricity users as described in claim 5, characterized in that, The total amount of the corresponding dynamic item is calculated based on the set of dynamic parameters and the available electricity volume, including: Calculate the amount of the dynamic item corresponding to each of the dynamic parameters based on the available electricity volume; Calculate the sum of all dynamic item amounts and use the sum as the total dynamic item amount.

7. The electricity purchase and payment method for electricity users as described in claim 1, characterized in that, Determining whether the current convergence condition is met based on the convergence judgment value includes: Determine whether the convergence judgment value is less than a preset convergence threshold; If so, then the current convergence condition is considered to be true; If not, then determine whether the current iteration count has reached the iteration count threshold; If the current iteration count reaches the iteration count threshold, the current guess value will be used as the output value, and an alarm message will be generated. If the current iteration count has not reached the iteration count threshold, the difference is used as the current guess value, and the process of calculating the corresponding purchasable electricity volume based on the tiered electricity price inverse function according to the rate configuration information, cost configuration information, and the current guess value is returned.

8. A computer-readable storage medium, characterized in that, It stores a user electricity purchase and payment program, which, when executed by a processor, implements the user electricity purchase and payment method as described in any one of claims 1-7.

9. A customer payment system for purchasing electricity, characterized in that, include: The acquisition module is used to acquire an electricity purchase request, which includes user account information and the amount of electricity to be purchased. The query module is used to obtain corresponding comprehensive user information, rate configuration information, and fee configuration information based on the user account information. The first calculation module is used to calculate the corresponding initial pure electricity purchase amount guess value based on the electricity purchase amount and the user comprehensive information, and use the initial pure electricity purchase amount guess value as the current guess value. The second calculation module is used to calculate the corresponding purchasable electricity volume based on the inverse function of the tiered electricity price, the rate configuration information, the cost configuration information, and the current guess value. A dynamic calculation module is used to construct a dynamic parameter set based on the user's comprehensive information, and to calculate the total amount of the corresponding dynamic item based on the dynamic parameter set and the available electricity volume; The judgment module is used to calculate the difference between the current guess value and the total amount of the dynamic item, calculate the corresponding convergence judgment value based on the difference, and determine whether the current convergence condition is met based on the difference. The result output module is used to generate the final cashier result based on the current guess value when the current convergence condition is met.

10. The electricity purchase and payment system for electricity users as described in claim 9, characterized in that, The comprehensive user information includes overdue payment information, fixed fee information, and non-overdue fixed payment information. The first calculation module is also used to perform mandatory overdue payment processing based on the overdue payment information and the electricity purchase amount. After the compulsory liquidation is completed, the fixed fee will be charged based on the results of the compulsory liquidation and the aforementioned fixed fee information; After the fixed fees are collected, the non-overdue fixed debts are settled based on the collection results and the non-overdue fixed debt information to obtain the initial pure electricity purchase amount estimate.