A power transaction settlement method and device, a storage medium and a computer device
Patent Information
- Application Number
- CN202311575577.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-11-23
AI Technical Summary
[0003]有鉴于此,本发明提供一种电力交易结算方法及装置、存储介质、计算机设备,主要目的在于解决现有技术中电力结算模型开发成本高以及上线周期长的问题
[0070]本发明提供了一种电力交易结算方法及装置、存储介质、计算机设备,与现有技术相比,本发明通过调用表格形式的可视化结算单配置模板,并根据结算业务需求对所述可视化结算单配置模板进行调整,得到目标结算单配置表;获取所述目标结算单配置表中所有的引用关系,并基于所述引用关系确定所述目标结算单配置表中的可计算序列;当所述目标结算单配置表中不存在循环依赖时,调用预置解析程序对所述目标结算单配置表进行解析;并将解析结果与所述可计算序列相结合,得到电力结算模型;将所述电力结算模型并行化分发至电力系统内的各个计算节点,以使得所述计算节点基于所述电力结算模型生成用户结算单,实现了自动响应结算业务需求生成适应交易规则变化的电力结算模型,产生多元化非刚性的电力结算单,及时满足电力结算需求的调整,从而大大减少了人力开发成本和上线周期,降低程序错误发生的风险。
Smart Images

Figure CN117575736B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system data processing technology, and in particular to a power trading settlement method and apparatus, storage medium, and computer equipment. Background Technology
[0002] The electricity retail trading sector has always required flexible and efficient settlement models to support the generation of daily and monthly transaction settlement statements. Current methods typically involve manually customizing the electricity settlement model and transaction settlement statement generation logic based on electricity trading business needs and electricity billing rules. However, this rigid settlement model has significant drawbacks. First, the R&D output and settlement model corresponding to manual customization are usually relatively fixed, requiring substantial human resources for development and testing, resulting in long development cycles. Second, the fixed nature of manually customized electricity settlement models prevents them from quickly adapting to changes in business needs and rules. When settlement rules are adjusted, existing customization methods require a significant reinvestment of human resources for tedious development and testing to ensure the newly developed settlement model complies with the rules. This further leads to high development costs and long deployment cycles, limiting the flexibility and agility of electricity retail trading. Summary of the Invention
[0003] In view of this, the present invention provides a power transaction settlement method and apparatus, storage medium and computer equipment, the main purpose of which is to solve the problems of high development cost and long launch cycle of power settlement models in the prior art.
[0004] According to one aspect of the present invention, a method for electricity trading settlement is provided, comprising:
[0005] Call the tabular form of the visual settlement form configuration template, and adjust the visual settlement form configuration template according to the settlement business requirements to obtain the target settlement form configuration table;
[0006] Obtain all reference relationships in the target settlement statement configuration table, and determine the computable sequence in the target settlement statement configuration table based on the reference relationships;
[0007] When there is no circular dependency in the target settlement form configuration table, a pre-set parsing program is invoked to parse the target settlement form configuration table; and the parsing result is combined with the computable sequence to obtain the power settlement model.
[0008] The electricity settlement model is parallelized and distributed to various computing nodes within the power system, so that the computing nodes can generate user settlement statements based on the electricity settlement model.
[0009] Furthermore, the visual settlement statement configuration template includes a basic information area, a constant area, a details area, and a summary area;
[0010] The basic information area contains basic information about electricity users;
[0011] The constant region contains constant values related to the settlement business requirements;
[0012] The details area includes electricity consumption details from the reference data warehouse, as well as the reference relationships between fields in the electricity consumption details;
[0013] The summary area contains summary values corresponding to the settlement business requirements.
[0014] Furthermore, determining the computable sequence in the target settlement statement configuration table based on the reference relationship includes:
[0015] Identify all calculation-related fields in the target settlement statement configuration table that are associated with the reference relationship;
[0016] A directed graph is generated based on the computation-related fields and the reference relationship, wherein the nodes in the directed graph are the computation-related fields, and the edges in the directed graph point from the referenced computation-related fields to the referencing computation-related fields;
[0017] The computable sequence is determined from the directed graph.
[0018] Furthermore, determining the computable sequence from the directed graph includes:
[0019] Obtain all nodes with an in-degree of 0 in the directed graph, and determine whether the current node has a configuration error;
[0020] If a configuration error occurs, a configuration error message will be issued; the configuration error message includes field information corresponding to the configuration error node.
[0021] If no configuration error occurs, remove the current node and its outgoing edges from the directed graph so that the removed directed graph has a new node with an in-degree of 0.
[0022] A method of iterative judgment and removal is used to check for configuration errors of new nodes with an in-degree of 0 until the directed graph is empty, thus obtaining the computable sequence.
[0023] Furthermore, determining whether the current node has a configuration error includes:
[0024] Determine the field type of the current node, obtain the field type determination result, and retrieve the corresponding field value based on the field type determination result;
[0025] If the value of the field is a field referenced in the formula, then determine whether all fields that the formula depends on have been included in the calculation.
[0026] If all fields that the formula depends on have already been included in the calculation, then it is certain that no configuration error has occurred;
[0027] If some of the fields that the formula depends on have not been included in the calculation, then a configuration error has occurred.
[0028] Furthermore, the step of combining the analytical results with the computable sequence to obtain the electricity settlement model includes:
[0029] Obtain all query requests to the data warehouse from the parsing results;
[0030] Optimize and merge query requests from the same electricity user across different dimensions into a single target query request;
[0031] The electricity settlement model is obtained based on the target query request and the computable sequence.
[0032] Furthermore, the parallelization and distribution of the power settlement model to various computing nodes within the power system includes:
[0033] Modulo calculation is performed based on the transaction account number and the number of computing nodes, and the target computing node corresponding to each transaction account number is determined based on the calculation result.
[0034] Based on the transaction account number dimension, the electricity settlement model is distributed in parallel to the target computing nodes corresponding to each transaction account number.
[0035] According to another aspect of the present invention, an electricity trading settlement device is provided, comprising:
[0036] The configuration module is used to call the tabular form of the visual settlement form configuration template and adjust the visual settlement form configuration template according to the settlement business requirements to obtain the target settlement form configuration table.
[0037] The calculation sequence determination module is used to obtain all the reference relationships in the target settlement form configuration table, and determine the computable sequence in the target settlement form configuration table based on the reference relationships;
[0038] The settlement model module is used to call a pre-set parsing program to parse the target settlement form configuration table when there is no circular dependency in the target settlement form configuration table; and combine the parsing result with the computable sequence to obtain the power settlement model.
[0039] The distribution module is used to distribute the power settlement model in parallel to various computing nodes within the power system, so that the computing nodes can generate user settlement statements based on the power settlement model.
[0040] Furthermore, the visual settlement form configuration template in the configuration module includes a basic information area, a constant area, a details area, and a summary area;
[0041] The basic information area contains basic information about electricity users;
[0042] The constant region contains constant values related to the settlement business requirements;
[0043] The details area includes electricity consumption details from the reference data warehouse, as well as the reference relationships between fields in the electricity consumption details;
[0044] The summary area contains summary values corresponding to the settlement business requirements.
[0045] Furthermore, the calculation sequence determination module is also used for:
[0046] Identify all calculation-related fields in the target settlement statement configuration table that are associated with the reference relationship;
[0047] A directed graph is generated based on the computation-related fields and the reference relationship, wherein the nodes in the directed graph are the computation-related fields, and the edges in the directed graph point from the referenced computation-related fields to the referencing computation-related fields;
[0048] The computable sequence is determined from the directed graph.
[0049] Furthermore, the calculation sequence determination module is also used for:
[0050] Obtain all nodes with an in-degree of 0 in the directed graph, and determine whether the current node has a configuration error;
[0051] If a configuration error occurs, a configuration error message will be issued; the configuration error message includes field information corresponding to the configuration error node.
[0052] If no configuration error occurs, remove the current node and its outgoing edges from the directed graph so that the removed directed graph has a new node with an in-degree of 0.
[0053] A method of iterative judgment and removal is used to check for configuration errors of new nodes with an in-degree of 0 until the directed graph is empty, thus obtaining the computable sequence.
[0054] Furthermore, the calculation sequence determination module is also used for:
[0055] Determine the field type of the current node, obtain the field type determination result, and retrieve the corresponding field value based on the field type determination result;
[0056] If the value of the field is a field referenced in the formula, then determine whether all fields that the formula depends on have been included in the calculation.
[0057] If all fields that the formula depends on have already been included in the calculation, then it is certain that no configuration error has occurred;
[0058] If some of the fields that the formula depends on have not been included in the calculation, then a configuration error has occurred.
[0059] Furthermore, the settlement model module is also used for:
[0060] Obtain all query requests to the data warehouse from the parsing results;
[0061] Optimize and merge query requests from the same electricity user across different dimensions into a single target query request;
[0062] The electricity settlement model is obtained based on the target query request and the computable sequence.
[0063] Furthermore, the distribution module is also used for:
[0064] Modulo calculation is performed based on the transaction account number and the number of computing nodes, and the target computing node corresponding to each transaction account number is determined based on the calculation result.
[0065] Based on the transaction account number dimension, the electricity settlement model is distributed in parallel to the target computing nodes corresponding to each transaction account number.
[0066] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform an operation corresponding to the above-described power trading settlement method.
[0067] According to another aspect of the present invention, a computer device is provided, including a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus;
[0068] The memory is used to store at least one executable instruction, which causes the processor to perform operations corresponding to the above-described power trading settlement method.
[0069] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages:
[0070] This invention provides a power transaction settlement method and apparatus, storage medium, and computer equipment. Compared with existing technologies, this invention obtains a target settlement statement configuration table by calling a tabular visual settlement statement configuration template and adjusting the template according to settlement business requirements. It then acquires all reference relationships within the target settlement statement configuration table and determines the computable sequences based on these relationships. When no circular dependencies exist in the target settlement statement configuration table, a pre-set parsing program is invoked to parse the table. The parsing result is combined with the computable sequences to obtain a power settlement model. This model is then distributed in parallel to various computing nodes within the power system, enabling the computing nodes to generate user settlement statements based on the model. This achieves automatic response to settlement business requirements, generating power settlement models that adapt to changes in trading rules, producing diversified and non-rigid power settlement statements, and promptly meeting adjustments to power settlement needs. This significantly reduces human development costs and deployment time, and lowers the risk of program errors.
[0071] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0072] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0073] Figure 1 A flowchart illustrating a power trading settlement method provided by an embodiment of the present invention is shown;
[0074] Figure 2 A flowchart illustrating another power transaction settlement method provided by an embodiment of the present invention is shown;
[0075] Figure 3 A flowchart illustrating another power trading settlement method provided by an embodiment of the present invention is shown;
[0076] Figure 4 A flowchart illustrating another power trading settlement method provided by an embodiment of the present invention is shown;
[0077] Figure 5 This diagram illustrates the structure of a power trading settlement device according to an embodiment of the present invention.
[0078] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation
[0079] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0080] This invention provides a method for electricity trading settlement, such as... Figure 1 As shown, the method includes:
[0081] 101. Call the visual settlement form configuration template in tabular form, and adjust the visual settlement form configuration template according to the settlement business requirements to obtain the target settlement form configuration table;
[0082] In this embodiment of the invention, the current execution terminal retrieves a tabular visual settlement statement configuration template from the power settlement system. The transaction center administrator adjusts the visual settlement statement configuration template according to settlement business requirements to obtain the target settlement statement configuration table. The visual settlement statement configuration template includes a basic information area, a constant area, a detail area, and a summary area. The basic information area contains basic information about the electricity user, such as the user name, transaction account number, order month, and contract transaction information; this embodiment does not impose specific limitations on this information. The constant area contains constant values related to settlement business requirements, such as settlement risk control coefficients, underutilization deviation penalty coefficients, and overutilization deviation penalty coefficients; this embodiment does not impose specific limitations on this information. The detail area contains electricity consumption details referenced from the data warehouse, as well as the reference relationships between fields in the electricity consumption details. Electricity consumption details include daily or monthly data such as electricity consumption, electricity price, and electricity charges; this embodiment does not impose specific limitations on this information. The target settlement statement configuration table configured in this embodiment is shown in Table 1.
[0083] Table 1 Settlement Statement Configuration Table
[0084]
[0085] Taking the table shown in Table 1 above as an example, a formula is inserted in cell F4 of the table. This formula references cells D4 and E4, thus obtaining the reference relationship between F4 and D4 and E4. This embodiment of the invention does not impose specific limitations. The summary area in the table contains summary values corresponding to the settlement business requirements, such as monthly electricity consumption, total electricity cost, deviation electricity consumption, transaction electricity cost, etc. This embodiment of the invention does not impose specific limitations.
[0086] 102. Obtain all reference relationships in the target settlement statement configuration table, and determine the computable sequence in the target settlement statement configuration table based on the reference relationships;
[0087] In this embodiment of the invention, the current execution end obtains all reference relationships in the target settlement statement configuration table and determines the computable sequences in the target settlement statement configuration table based on the reference relationships. The process of determining the computable sequences is used to characterize the process of eliminating circular dependencies in the computational sequences. Each target settlement statement configuration table may contain multiple computable sequences, specifically determined by the settlement business requirements; this embodiment of the invention does not impose specific limitations.
[0088] 103. When there is no circular dependency in the target settlement form configuration table, the preset parsing program is called to parse the target settlement form configuration table; and the parsing result is combined with the computable sequence to obtain the power settlement model;
[0089] In this embodiment of the invention, after determining that there are no circular dependencies in the target settlement statement configuration table, the current execution end calls a pre-built parsing program to parse the target settlement statement configuration table and obtains the parsing result. The parsing result is then combined with a computable sequence to obtain a power settlement model corresponding to the settlement business requirements. The power settlement model obtained in this invention does not require a long period of customized development and can quickly respond to changes in power settlement requirements.
[0090] 104. The power settlement model is parallelized and distributed to various computing nodes within the power system, so that the computing nodes generate user settlement statements based on the power settlement model.
[0091] In this embodiment of the invention, the current execution terminal distributes the electricity settlement model in parallel to various computing nodes within the power system, so that each computing node, upon receiving the electricity settlement model, generates a user settlement statement based on the model. The user settlement statement includes daily settlement statements, monthly settlement statements, etc., and this embodiment of the invention does not specifically limit the types. This embodiment of the invention, through parallel distribution, can significantly improve the generation speed of daily and monthly electricity settlement statements, increase system response speed, and reduce user waiting time.
[0092] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to quickly eliminate errors that occur during the configuration process and quickly determine the computable sequences in the configuration table, another power transaction settlement method is provided, such as... Figure 2 As shown, the step of determining the computable sequence in the target settlement statement configuration table based on the reference relationship includes:
[0093] 201. Determine all calculation-related fields in the target settlement statement configuration table that are related to the reference relationship;
[0094] In this embodiment of the invention, the current execution end obtains cells with reference relationships from the target settlement form configuration table. Based on the content of the cells with reference relationships, all calculation-related fields related to the reference relationships are determined. For example, if the content of cell F4 with reference relationships is "=D4*E4", then based on the content "=D4*E4", the calculation-related fields can be determined to be the "transactional electricity volume" field corresponding to cell D4 and the "transactional electricity price" field corresponding to cell E4, etc. This embodiment of the invention does not make specific limitations.
[0095] 202. Generate a directed graph based on the computation-related fields and the reference relationship, wherein the nodes in the directed graph are the computation-related fields, and the edges in the directed graph point from the referenced computation-related fields to the referencing computation-related fields;
[0096] In this embodiment of the invention, the current execution end generates a directed graph based on the computation-related fields and the obtained reference relationships. The nodes in the directed graph are computation-related fields, and the edges in the directed graph point from the referenced computation-related fields to the referencing computation-related fields. For example, in step 201, cells D4 and E4 are referenced computation-related fields, and cell F4 is a referencing computation-related field. Then, there is an edge between node D4 and node F4 in the directed graph pointing from D4 to F4; there is also an edge between node E4 and node F4 pointing from E4 to F4, etc. This embodiment of the invention does not impose specific limitations.
[0097] 203. Determine the computable sequence from the directed graph.
[0098] In this embodiment of the invention, the process by which the current execution end determines a computable sequence from a directed graph includes:
[0099] 203-1. Obtain all nodes with an in-degree of 0 in the directed graph and determine whether the current node has a configuration error; wherein, a node with an in-degree of 0 represents a node whose edges connected to the node do not have incoming edges.
[0100] It should be noted that before determining whether a node has a configuration error, the current execution end needs to first determine the field type of the current node and obtain the field type determination result. Specifically, field types are divided into row fields, column fields, and row-column combined fields. A row field has the field name and value in the same row, with the value to the right of the field name. A column field has the field name and value in the same column, with the value below the field name. A row-column combined field is expressed in a two-dimensional table format, where the header row and header column combine to form the final field name, and the field value is located at the corresponding coordinate position in the header row and header column. The field value of each field can be expressed in any of the following ways:
[0101] a) Data warehouse reference: Field values are taken from the user electricity consumption details table generated in the data warehouse (the power transaction data warehouse system incrementally obtains power transaction information, electricity usage information, user profile information, etc. from various business systems on a daily and monthly basis, and processes and organizes them into a electricity consumption details table for each user).
[0102] b) Constants: Field values are fixed constants, configured by the transaction center administrator.
[0103] c) Formula reference: Field values are calculated by combining formulas from other fields in the settlement form configuration table.
[0104] In this embodiment of the invention, the field types appearing in Table 1 in step 101 are judged, and the corresponding field values are determined to include: transaction account number (row field, data warehouse reference), electricity user name (row field, data warehouse reference), and order issuance cycle (row field, data warehouse reference); the constant area includes Pd benchmark price (row field, constant), U2 (row field, constant), and settlement risk control coefficient α (row field, constant); the details area includes: transaction date (column field, constant), actual daily electricity consumption (row and column fields, data warehouse reference), transaction electricity volume (row and column fields, data warehouse reference), transaction electricity price (row and column fields, data warehouse reference), and contract settlement electricity fee. (Row and column fields, formula references), Underutilized Deviation Electricity (Row and column fields, formula references), Deviation Electricity Price (Row and column fields, formula references), Daily Transaction Settlement Electricity (Row and column fields, formula references), Daily Electricity Charge (Row and column fields, formula references); The summary area includes: Daily Actual Electricity Consumption (Row and column fields, formula references), Transaction Electricity (Row and column fields, formula references), Transaction Electricity Price (Row and column fields, formula references), Contract Settlement Electricity Charge (Row and column fields, formula references), Underutilized Deviation Electricity (Row and column fields, formula references), Deviation Electricity Price (Row and column fields, formula references), Daily Transaction Settlement Electricity (Row and column fields, formula references), Daily Electricity Charge (Row and column fields, formula references).
[0105] After receiving the field type determination result, the current execution end retrieves the corresponding field value based on the field type determination result. If the retrieved field value is a data warehouse reference, the field value is retrieved from the data warehouse according to the steps. If the retrieved field value is a constant, the field value is directly retrieved from the settlement form configuration table. If the retrieved field value is a formula reference field, it is determined whether all fields that the formula depends on have been calculated. If all fields that the formula depends on have been calculated, it is determined that no configuration error has occurred. If some fields that the formula depends on have not been calculated, it is determined that a configuration error has occurred.
[0106] 203-2. If a configuration error occurs, a configuration error message will be issued; the configuration error message includes field information corresponding to the configuration error node;
[0107] 203-3. If no configuration error occurs, remove the current node and its outgoing edges from the directed graph so that the removed directed graph has a new node with an in-degree of 0.
[0108] In this embodiment of the invention, if nodes D4 and E4 are not misconfigured, nodes D4 and E4 are removed from the directed graph, and the edges pointing from D4 and E4 to F4 are removed, that is, the outgoing edges of nodes D4 and E4 are removed. After the removal, node F4 in the directed graph becomes a new node with an in-degree of 0. This embodiment of the invention does not impose specific limitations.
[0109] 203-4. A method of iterative judgment and removal is used to check for configuration errors of new nodes with an in-degree of 0 until the directed graph is empty, thus obtaining the computable sequence.
[0110] In this embodiment of the invention, the current execution end adopts a loop judgment and removal method, repeatedly executing steps 203-1 to 203-3, performing configuration error judgment on new nodes with an in-degree of 0 until the directed graph is empty, that is, all nodes in the directed graph have participated in the calculation, and the final computable sequence is obtained.
[0111] Furthermore, as a refinement and extension of the specific implementation methods described above, in order to improve the efficiency of data querying and the efficiency of generating electricity settlement models, another electricity transaction settlement method is provided, such as... Figure 3 As shown, the steps of combining the parsing results with the computable sequence to obtain the electricity settlement model include:
[0112] 301. Obtain all query requests to the data warehouse from the parsing results;
[0113] 302. Optimize and merge query requests from the same electricity user across different dimensions into a single target query request;
[0114] 303. Based on the target query request and the computable sequence, the power settlement model is obtained.
[0115] In this embodiment of the invention, the current execution end obtains all query requests to the data warehouse from the parsing results, optimizes and merges query requests from the same electricity user across different dimensions into a single target query request; based on the target query request and the computable sequence, the electricity settlement model is obtained. This embodiment of the invention improves the query efficiency of the data warehouse through optimization and merging, further enhancing the efficiency of generating the electricity settlement model.
[0116] Furthermore, as a refinement and extension of the specific implementation methods described above, in order to improve the speed of settlement statement generation, increase system response speed, and reduce user waiting time, another power transaction settlement method is provided, such as... Figure 4 As shown, the step of parallelizing and distributing the electricity settlement model to various computing nodes within the power system includes:
[0117] 401. Perform modulo calculation based on the transaction account number and the number of computing nodes, and determine the target computing node corresponding to each of the transaction account numbers based on the calculation results;
[0118] 402. Based on the transaction account number dimension, the power settlement model is distributed in parallel to the target computing nodes corresponding to each transaction account number.
[0119] In this embodiment of the invention, the current execution terminal performs modulo calculation based on the transaction account number and the number of computing nodes to obtain the modulo calculation result. For example, the transaction account numbers of electricity users are 1, 2, 3, 4, 5, 6..., and the number of computing nodes is 4, numbered 0, 1, 2, 3 respectively. The modulo calculation results are 1%4=1, 2%4=2, 3%4=3, 4%4=0, 5%4=1, 6%4=2... Based on the above modulo calculation results, the current execution terminal determines the computing node numbered 0 as the target computing node for all transaction account numbers with a modulo value of 0 in the modulo calculation result; determines the computing node numbered 1 as the target computing node for all transaction account numbers with a modulo value of 1 in the modulo calculation result; determines the computing node numbered 2 as the target computing node for all transaction account numbers with a modulo value of 2 in the modulo calculation result; and determines the computing node numbered 3 as the target computing node for all transaction account numbers with a modulo value of 3 in the modulo calculation result. This embodiment of the invention does not impose specific limitations. After determining the target computing nodes corresponding to each transaction account number, the current execution end distributes the electricity settlement model in parallel to the corresponding target computing nodes based on the transaction account number. Upon receiving the electricity settlement model, the target computing node generates a user settlement statement.
[0120] This invention provides a power transaction settlement method. Compared with existing technologies, this invention calls a tabular visual settlement form configuration template and adjusts the template according to settlement business requirements to obtain a target settlement form configuration table. It then obtains all reference relationships in the target settlement form configuration table and determines the computable sequence based on these relationships. When there are no circular dependencies in the target settlement form configuration table, a pre-set parsing program is called to parse the table. The parsing result is combined with the computable sequence to obtain a power settlement model. The power settlement model is then distributed in parallel to various computing nodes within the power system, enabling these nodes to generate user settlement forms based on the model. This achieves automatic response to settlement business requirements, generating power settlement models that adapt to changes in trading rules, producing diversified and non-rigid power settlement forms, and promptly meeting adjustments to power settlement needs. This significantly reduces human development costs and deployment time, and lowers the risk of program errors.
[0121] As a response to the above Figure 1 The implementation of the method shown in this invention provides an electricity trading settlement device, such as... Figure 5 As shown, the device includes:
[0122] Configuration module 51 is used to call the tabular form of the visual settlement form configuration template and adjust the visual settlement form configuration template according to the settlement business requirements to obtain the target settlement form configuration table;
[0123] The calculation sequence determination module 52 is used to obtain all the reference relationships in the target settlement form configuration table, and determine the computable sequence in the target settlement form configuration table based on the reference relationships;
[0124] The settlement model module 53 is used to call a preset parsing program to parse the target settlement form configuration table when there is no circular dependency in the target settlement form configuration table; and combine the parsing result with the computable sequence to obtain the power settlement model.
[0125] The distribution module 54 is used to distribute the power settlement model in parallel to each computing node in the power system, so that the computing nodes can generate user settlement statements based on the power settlement model.
[0126] Furthermore, the visual settlement form configuration template in the configuration module 51 includes a basic information area, a constant area, a details area, and a summary area;
[0127] The basic information area contains basic information about electricity users;
[0128] The constant region contains constant values related to the settlement business requirements;
[0129] The details area includes electricity consumption details from the reference data warehouse, as well as the reference relationships between fields in the electricity consumption details;
[0130] The summary area contains summary values corresponding to the settlement business requirements.
[0131] Furthermore, the calculation sequence determination module 52 is also used for:
[0132] Identify all calculation-related fields in the target settlement statement configuration table that are associated with the reference relationship;
[0133] A directed graph is generated based on the computation-related fields and the reference relationship, wherein the nodes in the directed graph are the computation-related fields, and the edges in the directed graph point from the referenced computation-related fields to the referencing computation-related fields;
[0134] The computable sequence is determined from the directed graph.
[0135] Furthermore, the calculation sequence determination module 52 is also used for:
[0136] Obtain all nodes with an in-degree of 0 in the directed graph, and determine whether the current node has a configuration error;
[0137] If a configuration error occurs, a configuration error message will be issued; the configuration error message includes field information corresponding to the configuration error node.
[0138] If no configuration error occurs, remove the current node and its outgoing edges from the directed graph so that the removed directed graph has a new node with an in-degree of 0.
[0139] A method of iterative judgment and removal is used to check for configuration errors of new nodes with an in-degree of 0 until the directed graph is empty, thus obtaining the computable sequence.
[0140] Furthermore, the calculation sequence determination module 52 is also used for:
[0141] Determine the field type of the current node, obtain the field type determination result, and retrieve the corresponding field value based on the field type determination result;
[0142] If the value of the field is a field referenced in the formula, then determine whether all fields that the formula depends on have been included in the calculation.
[0143] If all fields that the formula depends on have already been included in the calculation, then it is certain that no configuration error has occurred;
[0144] If some of the fields that the formula depends on have not been included in the calculation, then a configuration error has occurred.
[0145] Furthermore, the settlement model module 53 is also used for:
[0146] Obtain all query requests to the data warehouse from the parsing results;
[0147] Optimize and merge query requests from the same electricity user across different dimensions into a single target query request;
[0148] The electricity settlement model is obtained based on the target query request and the computable sequence.
[0149] Furthermore, the distribution module 54 is also used for:
[0150] Modulo calculation is performed based on the transaction account number and the number of computing nodes, and the target computing node corresponding to each transaction account number is determined based on the calculation result.
[0151] Based on the transaction account number dimension, the electricity settlement model is distributed in parallel to the target computing nodes corresponding to each transaction account number.
[0152] This invention provides a power trading settlement device. Compared with the prior art, this invention obtains a target settlement form configuration table by calling a tabular visual settlement form configuration template and adjusting the template according to settlement business requirements. It then acquires all reference relationships in the target settlement form configuration table and determines the computable sequence based on these relationships. When there are no circular dependencies in the target settlement form configuration table, a pre-set parsing program is invoked to parse the table. The parsing result is combined with the computable sequence to obtain a power settlement model. The power settlement model is then distributed in parallel to various computing nodes within the power system, enabling these nodes to generate user settlement forms based on the model. This achieves automatic response to settlement business requirements, generating power settlement models that adapt to changes in trading rules, producing diversified and non-rigid power settlement forms, and promptly meeting adjustments to power settlement needs. This significantly reduces human development costs and deployment time, and lowers the risk of program errors.
[0153] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, the computer-executable instruction being able to execute the power trading settlement method in any of the above method embodiments.
[0154] Figure 6The diagram illustrates a structural schematic of a computer device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.
[0155] like Figure 6 As shown, the computer device may include: a processor 602, a communications interface 604, a memory 606, and a communications bus 608.
[0156] The processor 602, communication interface 604, and memory 606 communicate with each other via communication bus 608.
[0157] Communication interface 604 is used to communicate with other network elements such as clients or other servers.
[0158] The processor 602 is used to execute program 610, which can specifically perform the relevant steps of the above-mentioned power trading settlement method.
[0159] Specifically, program 610 may include program code that includes computer operation instructions.
[0160] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0161] Memory 606 is used to store program 610. Memory 606 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0162] Specifically, program 610 can be used to cause processor 602 to perform the following operations:
[0163] Call the tabular form of the visual settlement form configuration template, and adjust the visual settlement form configuration template according to the settlement business requirements to obtain the target settlement form configuration table;
[0164] Obtain all reference relationships in the target settlement statement configuration table, and determine the computable sequence in the target settlement statement configuration table based on the reference relationships;
[0165] When there is no circular dependency in the target settlement form configuration table, a pre-set parsing program is invoked to parse the target settlement form configuration table; and the parsing result is combined with the computable sequence to obtain the power settlement model.
[0166] The electricity settlement model is parallelized and distributed to various computing nodes within the power system, so that the computing nodes can generate user settlement statements based on the electricity settlement model.
[0167] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0168] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for electricity trading settlement, characterized in that, include: Call the tabular form of the visual settlement form configuration template, and adjust the visual settlement form configuration template according to the settlement business requirements to obtain the target settlement form configuration table; Obtain all reference relationships in the target settlement statement configuration table, and determine the computable sequence in the target settlement statement configuration table based on the reference relationships; When there is no circular dependency in the target settlement form configuration table, a pre-set parsing program is invoked to parse the target settlement form configuration table; and the parsing result is combined with the computable sequence to obtain the power settlement model. The electricity settlement model is parallelized and distributed to various computing nodes within the power system, so that the computing nodes can generate user settlement statements based on the electricity settlement model. The step of determining the computable sequence in the target settlement statement configuration table based on the reference relationship includes: Identify all calculation-related fields in the target settlement statement configuration table that are associated with the reference relationship; A directed graph is generated based on the computation-related fields and the reference relationship, wherein the nodes in the directed graph are the computation-related fields, and the edges in the directed graph point from the referenced computation-related fields to the referencing computation-related fields; The computable sequence is determined from the directed graph; Determining the computable sequence from the directed graph includes: Obtain all nodes with an in-degree of 0 in the directed graph, and determine whether the current node has a configuration error; If a configuration error occurs, a configuration error message will be issued; the configuration error message includes field information corresponding to the configuration error node. If no configuration error occurs, remove the current node and its outgoing edges from the directed graph so that the removed directed graph has a new node with an in-degree of 0. A method of iterative judgment and removal is used to check for configuration errors of new nodes with an in-degree of 0 until the directed graph is empty, thus obtaining the computable sequence.
2. The method according to claim 1, characterized in that, The visual settlement statement configuration template includes a basic information area, a constant area, a details area, and a summary area; The basic information area contains basic information about electricity users; The constant region contains constant values related to the settlement business requirements; The details area includes electricity consumption details from the reference data warehouse, as well as the reference relationships between fields in the electricity consumption details; The summary area contains summary values corresponding to the settlement business requirements.
3. The method according to claim 1, characterized in that, The process of determining whether the current node has a configuration error includes: Determine the field type of the current node, obtain the field type determination result, and retrieve the corresponding field value based on the field type determination result; If the value of the field is a field referenced in the formula, then determine whether all fields that the formula depends on have been included in the calculation. If all fields that the formula depends on have already been included in the calculation, then it is certain that no configuration error has occurred; If some of the fields that the formula depends on have not been included in the calculation, then a configuration error has occurred.
4. The method according to claim 1, characterized in that, The step of combining the analytical results with the computable sequence to obtain the electricity settlement model includes: Obtain all query requests to the data warehouse from the parsing results; Optimize and merge query requests from the same electricity user across different dimensions into a single target query request; The electricity settlement model is obtained based on the target query request and the computable sequence.
5. The method according to any one of claims 1 to 4, characterized in that, The step of parallelizing and distributing the power settlement model to various computing nodes within the power system includes: Modulo calculation is performed based on the transaction account number and the number of computing nodes, and the target computing node corresponding to each transaction account number is determined based on the calculation result. Based on the transaction account number dimension, the electricity settlement model is distributed in parallel to the target computing nodes corresponding to each transaction account number.
6. A power trading settlement device, characterized in that, include: The configuration module is used to call the tabular form of the visual settlement form configuration template and adjust the visual settlement form configuration template according to the settlement business requirements to obtain the target settlement form configuration table. The calculation sequence determination module is used to obtain all the reference relationships in the target settlement form configuration table, and determine the computable sequence in the target settlement form configuration table based on the reference relationships; The settlement model module is used to call a pre-set parsing program to parse the target settlement form configuration table when there is no circular dependency in the target settlement form configuration table; and combine the parsing result with the computable sequence to obtain the power settlement model. The distribution module is used to distribute the power settlement model in parallel to various computing nodes within the power system, so that the computing nodes can generate user settlement statements based on the power settlement model. The calculation sequence determination module is specifically used for: Identify all calculation-related fields in the target settlement statement configuration table that are associated with the reference relationship; A directed graph is generated based on the computation-related fields and the reference relationship, wherein the nodes in the directed graph are the computation-related fields, and the edges in the directed graph point from the referenced computation-related fields to the referencing computation-related fields; The computable sequence is determined from the directed graph; The step of determining the computable sequence from the directed graph includes: Obtain all nodes with an in-degree of 0 in the directed graph, and determine whether the current node has a configuration error; If a configuration error occurs, a configuration error message will be issued; the configuration error message includes field information corresponding to the configuration error node. If no configuration error occurs, remove the current node and its outgoing edges from the directed graph so that the removed directed graph has a new node with an in-degree of 0. A method of iterative judgment and removal is used to check for configuration errors of new nodes with an in-degree of 0 until the directed graph is empty, thus obtaining the computable sequence.
7. A storage medium storing at least one executable instruction that performs an operation corresponding to the power trading settlement method as described in any one of claims 1-5.
8. A computer device, comprising a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the power trading settlement method as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and system for processing user-defined formula based on directed graph and storage medium
CN113886459A
Form file processing method and device, computer equipment and storage medium
CN116644729A