An automatic settlement system for cross-regional electric energy transaction based on smart contract

CN122601241APending Publication Date: 2026-08-18CHINA YANGTZE POWER
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610548203.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-23
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]本发明的目的是提供一种基于智能合约的跨区域电能交易自动结算系统,旨在解决现有技术在汇总多个发电企业端的结算数据时由于数据来源庞杂,若结算数据包被伪装身份后拦截篡改,容易出现结算安全问题,以及传统的信息加密方式形式单一安全性不佳的问题

Benefits of technology

1,本发明特征记录模块记录发电企业端的结算数据包的多维结算特征,数据准备模块响应于发电企业端需发送结算数据包,基于调用多维结算特征,生成多维结算特征映射的发送需求,发送模块基于所述发送需求处理所述结算数据包以封装所述访问序号以及关键区段序号进行同步发送,验证模块对结算数据包进行验证,将验证通过的结算数据包通过合约交易模块生成交易合约,并基于交易合约生成交易资金划转指令,本发明实现电力交易结算的全流程自动化,重构电力交易结算的信任体系,为构建新一代透明、智能、高效的电力市场运营生态奠定了坚实基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601241A_ABST
    Figure CN122601241A_ABST
Patent Text Reader

Abstract

This invention discloses an automated settlement system for cross-regional power trading based on smart contracts. A feature recording module records multi-dimensional settlement characteristics of settlement data packets from power generation companies. A data preparation module, responding to the power generation company's need to send settlement data packets, generates a sending request based on the multi-dimensional settlement characteristics. A sending module processes the settlement data packets based on the sending request, encapsulating the access sequence number and key segment sequence number for synchronous transmission. A verification module verifies the settlement data packets, and the verified data packets are used to generate a trading contract through a contract trading module. Based on the trading contract, a transaction fund transfer instruction is generated. This invention automates the entire power trading settlement process, reconstructs the trust system for power trading settlement, and lays a solid foundation for building a new generation of transparent, intelligent, and efficient power market operation ecosystem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power trading and settlement technology, and specifically relates to an automatic settlement system for cross-regional power trading based on smart contracts. Background Technology

[0002] With the deepening of my country's power market reform and the large-scale integration of distributed energy resources, the demand for cross-regional, small-scale electricity trading is growing rapidly. However, traditional electricity trading settlement methods face severe challenges. Existing systems largely rely on the independent operation of power generation companies, dispatching agencies, and metering systems in various regions, creating "data silos." During settlement, massive amounts of data, such as electricity volume, price, network losses, and congestion fees, need to be manually collected and verified from multiple sources. This process is cumbersome, inefficient, and prone to errors and delays due to human factors or inconsistent data interpretations. Furthermore, electricity trading settlement rules are complex, involving multiple dimensions such as price calculation, cost allocation, and deviation assessment. These rules are mostly in the form of written contracts or regulations, and their implementation heavily relies on manual interpretation and operation, making it difficult to guarantee transparency and consistency and creating potential for disputes. The entire settlement cycle is long and costly, making it difficult to adapt to the demands of a high-frequency, multi-participant modern electricity market. Therefore, the market urgently needs an intelligent settlement solution that can achieve automatic data collection and verification, precise automatic rule execution, and secure and efficient fund clearing. For example, Chinese Patent Publication No. CN118944033A discloses a method for generating smart contracts in electricity trading, belonging to the field of data security technology. This invention connects all distributed energy entities to a blockchain network built by a virtual power plant operator. The virtual power plant operator predicts the power generation and load for the next period based on historical load and power generation data, and broadcasts the prediction results to the virtual power plant blockchain network. Each distributed energy entity determines a trading plan and publishes it on the blockchain network. After the virtual power plant operator confirms the trading plan published on the blockchain network, the smart contract becomes effective. This invention uses blockchain technology to generate smart contracts, solving the current problems of reliable information transmission and coordination among distributed energy entities in virtual power plants. It can effectively solve the trust problem between distributed energy entities and reduce the cost of information interaction. However, similar existing technologies still have the following problems: When aggregating settlement data from multiple power generation companies, the data sources are complex. If the settlement data packets are intercepted and tampered with after the identity is disguised, settlement security issues can easily arise. Traditional information encryption methods are simple and lack security. Therefore, it is necessary to design an automatic settlement system for cross-regional power trading based on smart contracts to solve the above problems. Summary of the Invention

[0003] The purpose of this invention is to provide an automatic settlement system for cross-regional power trading based on smart contracts. This system aims to solve the problems of existing technologies when aggregating settlement data from multiple power generation companies. Due to the complexity of the data sources, if the settlement data packets are intercepted and tampered with after being disguised, settlement security issues can easily arise. In addition, traditional information encryption methods are often limited in form and have poor security.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A smart contract-based automated settlement system for cross-regional electricity trading includes: The feature recording module is used to record the multi-dimensional settlement features of the settlement data packets of several power generation enterprises. Every predetermined period, the dataset containing the serial number of each power generation enterprise is distributed to each power generation enterprise. The serial number of each power generation enterprise is determined based on the multi-dimensional settlement features of each power generation enterprise. The data preparation module responds to the power generation company's need to send settlement data packets. It is used to determine the access sequence number of the local end based on the dataset of the current period, and to call the corresponding multi-dimensional settlement features based on the access sequence number. According to the called multi-dimensional settlement features, the encryption algorithm sequence of this data transmission is determined through the preset feature-algorithm mapping rules. The encryption algorithm sequence and the access sequence number are encapsulated into a sending request packet. The sending module is used to divide the settlement data packet to be sent into several sub-settlement data packets, encrypt each sub-settlement data packet in sequence according to the encryption algorithm sequence in the sending request packet, obtain encrypted sub-settlement data packets, and encapsulate all encrypted sub-settlement data packets together with the access sequence number into a transmission data packet for synchronous transmission. The verification module is used to receive the transmitted data packet, decrypt it to obtain the access sequence number and several encrypted sub-settlement data packets, call the corresponding multi-dimensional settlement feature based on the access sequence number, derive the decryption algorithm sequence according to the feature-algorithm mapping rule based on the multi-dimensional settlement feature, and decrypt each encrypted sub-settlement data packet in turn according to the decryption algorithm sequence to restore the settlement data packet. The contract trading module is used to generate trading contracts based on verified settlement data packets and to generate trading fund transfer instructions based on the trading contracts. The monitoring module is used to obtain the access records of the feature recording module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module.

[0005] Preferably, the multi-dimensional settlement features recorded by the feature recording module include: the identity identification code of each power generation enterprise, the average transaction confirmation delay in the previous period, and the average time taken for the entire transaction process.

[0006] Preferably, the feature recording module distributes the dataset to each power generation enterprise at predetermined intervals, including: Based on the transaction frequency of each power generation enterprise in the previous period, the serial numbers of each power generation enterprise in the dataset are sorted in descending order of transaction frequency, and the adjusted dataset is distributed to each power generation enterprise.

[0007] Preferably, the data preparation module determines the encryption algorithm sequence based on the invoked multi-dimensional settlement features using preset feature-algorithm mapping rules, specifically including: Based on the system's preset standard network latency and standard full-process time, calculate the first ratio of the average transaction confirmation latency to the standard network latency, and the second ratio of the average transaction full-process time to the standard full-process time. The weighted sum of the first ratio and the second ratio is used as the encryption feature value; The encrypted feature value is matched with several preset feature value ranges. Based on the matching results, the corresponding encryption algorithm group is selected from the preset algorithm library, and the execution order of each encryption algorithm in the encryption algorithm group is determined to form an encryption algorithm sequence. Each feature value range corresponds to a set of preset encryption algorithms.

[0008] Preferably, the weighting weight of the first ratio is 0.4, and the weighting weight of the second ratio is 0.6; the length of the encryption algorithm sequence is less than or equal to the number of sub-settlement data packets. When the length of the encryption algorithm sequence is less than the number of sub-settlement data packets, the system uses the encryption algorithm in sequence until all sub-settlement data packets are encrypted.

[0009] Preferably, the sending module divides the settlement data packet to be sent into several sub-settlement data packets, including: Obtain the size of the settlement data packet to be sent, and compare the size with a preset data packet size threshold; If the size of the settlement data packet is less than or equal to the threshold, then a number of segments is determined from the first set of segments, and the settlement data packet is divided into that number of sub-settlement data packets. If the size of the settlement data packet exceeds the threshold, a number of segments is determined from the second set of segments, and the settlement data packet is divided into that number of sub-settlement data packets. Among them, the values ​​in the first set of segmentation values ​​are less than the values ​​in the second set of segmentation values.

[0010] Preferably, the sending module synchronously sends the data packet to the target power generation enterprise via peer-to-peer transmission through the blockchain network or a message queue; the data packet also contains the cycle identifier of the current cycle; after receiving the data packet, the verification module requests the dataset of the corresponding cycle from the feature recording module according to the cycle identifier, and then obtains the multi-dimensional settlement features from it based on the access sequence number.

[0011] Preferably, the monitoring module determines whether to lock the access port of the feature recording module by including: Continuously monitor and collect access logs from the feature recording module. The access logs should at least record the access sequence number, access time, and access source address. Based on the access source address in the access log, determine whether the visitor is in the preset regulatory whitelist; if not, generate and execute a port blocking command to block the visitor's access permissions. Based on the access sequence number in the access log, determine whether the current access reading order is consistent with the pre-stored valid order; if not, generate and execute a port locking command to temporarily lock the access rights of the visitor.

[0012] Preferably, the pre-stored legal order is determined based on the dataset distributed to the corresponding power generation enterprise in the current period. The legal order is as follows: in any predetermined period, any power generation enterprise is only authorized to access the record in the dataset corresponding to its own sequence number.

[0013] Furthermore, the predetermined period ranges from 60 seconds to 100 seconds; the data packet size threshold ranges from 8MB to 16MB.

[0014] Preferably, the method for an automated settlement system for cross-regional electricity trading based on smart contracts includes the following steps: S1, the feature recording module records the multi-dimensional settlement features of the settlement data packets of several power generation enterprises. The dataset containing the serial numbers of each power generation enterprise is distributed to each power generation enterprise at predetermined intervals. The serial numbers of each power generation enterprise are determined based on the multi-dimensional settlement features of each power generation enterprise. S2, in response to the power generation company's need to send settlement data packets, the data preparation module determines the access sequence number of this end based on the dataset of the current period, and calls the corresponding multi-dimensional settlement feature based on the access sequence number. According to the called multi-dimensional settlement feature, the encryption algorithm sequence of this data transmission is determined through the preset feature-algorithm mapping rules, and the encryption algorithm sequence and access sequence number are encapsulated into a sending request packet. S3, the sending module divides the settlement data packet to be sent into several sub-settlement data packets, encrypts each sub-settlement data packet in sequence according to the encryption algorithm sequence in the sending request packet, obtains encrypted sub-settlement data packets, and encapsulates all encrypted sub-settlement data packets together with the access sequence number into a transmission data packet for synchronous sending; S4. The verification module receives the transmission data packet, decrypts it to obtain the access sequence number and several encrypted sub-settlement data packets, calls the corresponding multi-dimensional settlement feature based on the access sequence number, derives the decryption algorithm sequence according to the feature-algorithm mapping rule based on the multi-dimensional settlement feature, and decrypts each encrypted sub-settlement data packet in turn according to the decryption algorithm sequence to restore the settlement data packet. S5 generates a transaction contract based on the verified settlement data packet through the contract trading module, and generates a transaction fund transfer instruction based on the transaction contract; S6: Obtain the access records of the feature recording module through the monitoring module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module.

[0015] Furthermore, a computer device includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the method of the smart contract-based cross-regional automatic settlement system for electricity trading.

[0016] Furthermore, a computer-readable storage medium stores computer instructions for instructing a computer to execute the method of the smart contract-based cross-regional automatic settlement system for electricity trading.

[0017] The beneficial effects of the cross-regional power trading automatic settlement system based on smart contracts provided by this invention are as follows: 1. The feature recording module of this invention records the multi-dimensional settlement features of the settlement data packets from the power generation enterprise. The data preparation module responds to the power generation enterprise's need to send settlement data packets by generating a sending requirement for the multi-dimensional settlement feature mapping based on the multi-dimensional settlement features. The sending module processes the settlement data packets based on the sending requirement to encapsulate the access sequence number and key segment sequence number for synchronous sending. The verification module verifies the settlement data packets and generates a transaction contract through the contract trading module for the verified settlement data packets. Based on the transaction contract, a transaction fund transfer instruction is generated. This invention realizes full-process automation of power transaction settlement, reconstructs the trust system of power transaction settlement, and lays a solid foundation for building a new generation of transparent, intelligent, and efficient power market operation ecosystem.

[0018] 2. This invention considers the impact of dynamic differences in network environment and system load on the secure transmission of settlement data in cross-regional power transactions. In practice, using a fixed encryption strategy makes it difficult to simultaneously ensure security and settlement timeliness when transaction confirmation delays surge or system processing bottlenecks occur. This invention, through a mechanism in the data preparation module that dynamically maps multi-dimensional settlement features and generates encryption algorithm sequences, achieves adaptive adjustment of the security strategy based on real-time performance data. This optimizes resource consumption and ensures reliable transmission of settlement instructions even under complex network conditions.

[0019] 3. This invention considers the integrity and tamper resistance risks faced by large-capacity settlement data packets during cross-regional network transmission. In practice, if a data packet transmitted entirely with encryption is maliciously intercepted or partially tampered with, it will affect the settlement verification of the entire transaction, and it will be difficult to locate the problematic link. This invention achieves refined management and verification of the data flow by using a mechanism where the sending module segments the settlement data packet and processes the sub-packets sequentially using a serialization encryption algorithm, and the verification module must strictly decrypt and verify in sequence. This effectively resists man-in-the-middle attacks and data tampering, improving the risk resistance and reliability of the settlement process.

[0020] 4. This invention addresses the security threats posed by malicious access and attacks to the feature recording module, which serves as the core data hub. In practice, relying solely on static authentication is insufficient to identify access from individuals with legitimate identities but exhibiting abnormal behavior, potentially leading to data leaks or service disruptions. This invention utilizes a monitoring module to analyze access logs in real time and employs a dual approach of "whitelist identity" and "access sequence consistency" for assessment. This enables dynamic and proactive security monitoring of access behavior, allowing for timely identification and blocking of suspicious attack patterns, thus ensuring the stability and security of the system's underlying data services. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the system structure connection in an embodiment of the invention; Figure 2 This is a logic block diagram for determining the data packet type in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a computer device in an embodiment of the present invention. Detailed Implementation

[0022] Example 1: An automated settlement system for cross-regional power trading based on smart contracts includes: The feature recording module is used to record the multi-dimensional settlement features of the settlement data packets of several power generation enterprises. Every predetermined period, the dataset containing the serial number of each power generation enterprise is distributed to each power generation enterprise. The serial number of each power generation enterprise is determined based on the multi-dimensional settlement features of each power generation enterprise. The data preparation module responds to the power generation company's need to send settlement data packets. It is used to determine the access sequence number of the local end based on the dataset of the current period, and to call the corresponding multi-dimensional settlement features based on the access sequence number. According to the called multi-dimensional settlement features, the encryption algorithm sequence of this data transmission is determined through the preset feature-algorithm mapping rules. The encryption algorithm sequence and the access sequence number are encapsulated into a sending request packet. The sending module is used to divide the settlement data packet to be sent into several sub-settlement data packets, encrypt each sub-settlement data packet in sequence according to the encryption algorithm sequence in the sending request packet, obtain encrypted sub-settlement data packets, and encapsulate all encrypted sub-settlement data packets together with the access sequence number into a transmission data packet for synchronous transmission. The verification module is used to receive the transmitted data packet, decrypt it to obtain the access sequence number and several encrypted sub-settlement data packets, call the corresponding multi-dimensional settlement feature based on the access sequence number, derive the decryption algorithm sequence according to the feature-algorithm mapping rule based on the multi-dimensional settlement feature, and decrypt each encrypted sub-settlement data packet in turn according to the decryption algorithm sequence to restore the settlement data packet. The contract trading module is used to generate trading contracts based on verified settlement data packets and to generate trading fund transfer instructions based on the trading contracts. The monitoring module is used to obtain the access records of the feature recording module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module.

[0023] Preferably, the multi-dimensional settlement features recorded by the feature recording module include: the identity identification code of each power generation enterprise, the average transaction confirmation delay in the previous period, and the average time taken for the entire transaction process.

[0024] Preferably, the feature recording module distributes the dataset to each power generation enterprise at predetermined intervals, including: Based on the transaction frequency of each power generation enterprise in the previous period, the serial numbers of each power generation enterprise in the dataset are sorted in descending order of transaction frequency, and the adjusted dataset is distributed to each power generation enterprise.

[0025] Preferably, the data preparation module determines the encryption algorithm sequence based on the invoked multi-dimensional settlement features using preset feature-algorithm mapping rules, specifically including: Based on the system's preset standard network latency and standard full-process time, calculate the first ratio of the average transaction confirmation latency to the standard network latency, and the second ratio of the average transaction full-process time to the standard full-process time. The weighted sum of the first ratio and the second ratio is used as the encryption feature value; The encrypted feature value is matched with several preset feature value ranges. Based on the matching results, the corresponding encryption algorithm group is selected from the preset algorithm library, and the execution order of each encryption algorithm in the encryption algorithm group is determined to form an encryption algorithm sequence. Each feature value range corresponds to a set of preset encryption algorithms.

[0026] Preferably, the weighting weight of the first ratio is 0.4, and the weighting weight of the second ratio is 0.6; the length of the encryption algorithm sequence is less than or equal to the number of sub-settlement data packets. When the length of the encryption algorithm sequence is less than the number of sub-settlement data packets, the system uses the encryption algorithm in sequence until all sub-settlement data packets are encrypted.

[0027] Preferably, the sending module divides the settlement data packet to be sent into several sub-settlement data packets, including: Obtain the size of the settlement data packet to be sent, and compare the size with a preset data packet size threshold; If the size of the settlement data packet is less than or equal to the threshold, then a number of segments is determined from the first set of segments, and the settlement data packet is divided into that number of sub-settlement data packets. If the size of the settlement data packet exceeds the threshold, a number of segments is determined from the second set of segments, and the settlement data packet is divided into that number of sub-settlement data packets. Among them, the values ​​in the first set of segmentation values ​​are less than the values ​​in the second set of segmentation values.

[0028] Preferably, the sending module synchronously sends the data packet to the target power generation enterprise via peer-to-peer transmission through the blockchain network or a message queue; the data packet also contains the cycle identifier of the current cycle; after receiving the data packet, the verification module requests the dataset of the corresponding cycle from the feature recording module according to the cycle identifier, and then obtains the multi-dimensional settlement features from it based on the access sequence number.

[0029] Preferably, the monitoring module determines whether to lock the access port of the feature recording module by including: Continuously monitor and collect access logs from the feature recording module. The access logs should at least record the access sequence number, access time, and access source address. Based on the access source address in the access log, determine whether the visitor is in the preset regulatory whitelist; if not, generate and execute a port blocking command to block the visitor's access permissions. Based on the access sequence number in the access log, determine whether the current access reading order is consistent with the pre-stored valid order; if not, generate and execute a port locking command to temporarily lock the access rights of the visitor.

[0030] Preferably, the pre-stored legal order is determined based on the dataset distributed to the corresponding power generation enterprise in the current period. The legal order is as follows: in any predetermined period, any power generation enterprise is only authorized to access the record in the dataset corresponding to its own sequence number.

[0031] Furthermore, the predetermined period ranges from 60 seconds to 100 seconds; the data packet size threshold ranges from 8MB to 16MB.

[0032] Preferably, the method for an automated settlement system for cross-regional electricity trading based on smart contracts includes the following steps: S1, the feature recording module records the multi-dimensional settlement features of the settlement data packets of several power generation enterprises. The dataset containing the serial numbers of each power generation enterprise is distributed to each power generation enterprise at predetermined intervals. The serial numbers of each power generation enterprise are determined based on the multi-dimensional settlement features of each power generation enterprise. S2, in response to the power generation company's need to send settlement data packets, the data preparation module determines the access sequence number of this end based on the dataset of the current period, and calls the corresponding multi-dimensional settlement feature based on the access sequence number. According to the called multi-dimensional settlement feature, the encryption algorithm sequence of this data transmission is determined through the preset feature-algorithm mapping rules, and the encryption algorithm sequence and access sequence number are encapsulated into a sending request packet. S3, the sending module divides the settlement data packet to be sent into several sub-settlement data packets, encrypts each sub-settlement data packet in sequence according to the encryption algorithm sequence in the sending request packet, obtains encrypted sub-settlement data packets, and encapsulates all encrypted sub-settlement data packets together with the access sequence number into a transmission data packet for synchronous sending; S4. The verification module receives the transmission data packet, decrypts it to obtain the access sequence number and several encrypted sub-settlement data packets, calls the corresponding multi-dimensional settlement feature based on the access sequence number, derives the decryption algorithm sequence according to the feature-algorithm mapping rule based on the multi-dimensional settlement feature, and decrypts each encrypted sub-settlement data packet in turn according to the decryption algorithm sequence to restore the settlement data packet. S5 generates a transaction contract based on the verified settlement data packet through the contract trading module, and generates a transaction fund transfer instruction based on the transaction contract; S6: Obtain the access records of the feature recording module through the monitoring module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module.

[0033] Example 2: like Figure 1 The diagram shown is a structural connection diagram of an automated settlement system for cross-regional power trading based on smart contracts according to an embodiment of the present invention. This embodiment provides an automated settlement system for cross-regional power trading based on smart contracts, comprising: The feature recording module is used to record the multi-dimensional settlement features of settlement data packets from several power generation enterprises. Every predetermined period, it calls the dataset used to store the serial numbers of the power generation enterprises and distributes it to each of the power generation enterprises. The serial numbers of the power generation enterprises are determined based on the multi-dimensional settlement features of each power generation enterprise. The data preparation module responds to the power generation enterprise's need to send a settlement data packet by calling multi-dimensional settlement features based on the access sequence number, determining the encryption algorithm sequence number of the multi-dimensional settlement feature mapping, generating an encryption algorithm sequence and encapsulating it into the sending request packet. The access sequence number is determined based on the dataset. The sending module is used to segment the settlement data packet, call the corresponding encryption algorithm based on the sending request packet to encrypt the segmented sub-settlement data packets in sequence, and send the access sequence number synchronously. The verification module receives data sent by the sending module, decrypts and obtains access sequence number and several encrypted sub-settlement data packets, and calls the multi-dimensional settlement feature to determine the decryption algorithm sequence number of the multi-dimensional settlement feature mapping based on the access sequence number, so as to call the corresponding decryption algorithm to decrypt the encrypted sub-settlement data packets and restore the settlement data packets in turn. The contract trading module is used to generate trading contracts based on settlement data packets and to generate trading fund transfer instructions based on the trading contracts. The monitoring module is used to obtain the access records of the feature recording module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module.

[0034] Specifically, the predetermined period is set within the range of [60 seconds, 100 seconds]. The predetermined period length is set based on a comprehensive balance between data timeliness, business continuity, and operational load. Cross-regional power trading activities are ongoing, and the dynamic characteristics of settlement data need to be captured promptly to support subsequent dynamic encryption mapping and secure transmission decisions. An update interval of sixty to one hundred seconds ensures that the system can continuously perceive changes in network latency and trading behavior, thereby improving its responsiveness to fluctuations in the trading environment and the real-time nature of overall security protection. Simultaneously, this interval, compared to a shorter period, effectively reduces the access pressure on core modules and network synchronization overhead, avoiding impacts on system processing stability due to frequent data refreshes.

[0035] Specifically, the feature recording module is used to record the multi-dimensional settlement features of several power generation enterprise settlement data packets, including: The system obtains the registration information and settlement documents submitted by each power generation company, parses out the identification code of the power generation company, and extracts the average transaction confirmation delay and the average transaction time of the previous period as settlement features.

[0036] Specifically, the feature recording module is used to periodically call the dataset storing the serial numbers of the power generation enterprises and distribute it to each of the power generation enterprises, including... Based on the transaction frequency of each power generation enterprise in the previous period, the power generation enterprise serial numbers in the data are sorted in descending order based on the transaction frequency. The adjusted dataset will be distributed to each of the aforementioned power generation companies.

[0037] Specifically, the data preparation module is used to access the feature record module based on the access sequence number and key segment sequence number, and to call the multi-dimensional settlement features to generate the sending requirements for the multi-dimensional settlement feature mapping, including: In response to the need to send settlement data packets, the corresponding access sequence number is determined by querying the dataset of the current period based on the identifier of the target power generation enterprise. Based on the access sequence number, an access request is initiated to the feature recording module to call the multi-dimensional settlement feature corresponding to the target power generation enterprise. The multi-dimensional settlement feature includes at least the average transaction confirmation delay and the average transaction process time in the previous cycle. Based on the retrieved multidimensional settlement features, the type of encryption algorithm and its execution sequence number applicable to this data transmission are determined through the preset feature-algorithm mapping rules, and an encryption algorithm sequence is generated according to predetermined logic. The encryption algorithm sequence, the access sequence number, and the necessary transmission control parameters are encapsulated together to generate the sending request packet.

[0038] Specifically, the data preparation module, based on the retrieved multi-dimensional settlement features and using preset feature-algorithm mapping rules, determines the encryption algorithm type and its execution sequence number suitable for this data transmission, including: Using the system's preset standard network delay and standard full-process time as benchmarks, the first ratio of the average transaction confirmation delay of the previous cycle to the standard network delay and the second ratio of the average transaction full-process time to the standard full-process time are calculated respectively. The weighted sum of the first ratio and the second ratio is determined as the encryption feature value of this data transmission; The encrypted feature value is matched with a preset feature value range. Based on the matching result, a corresponding encryption algorithm group is selected from a preset algorithm library, and their execution order is determined to form an encryption algorithm sequence. Each feature value range corresponds to a set of preset encryption algorithms.

[0039] Specifically, the algorithm library contains several encryption algorithm groups, and each encryption algorithm group contains several encryption algorithms. Those skilled in the art can choose symmetric encryption algorithms such as SM4 and AES-256, asymmetric encryption algorithms such as SM2 and RSA-2048, or they can define or combine new encryption algorithms as needed.

[0040] Specifically, the embodiments of the present invention predetermine four feature value ranges to map the calculated encryption feature values ​​to four different encryption algorithm groups. Each encryption algorithm group contains at least two different encryption algorithms, and the encryption algorithms within the group have preset numbers.

[0041] The execution order of the encryption algorithms in the selected encryption algorithm group is determined based on the parity of the last bit of the encryption feature value of this data transmission.

[0042] Specifically, when the last digit of the encryption feature value of this data transmission is odd, the encryption algorithm with the odd number is selected, and the first half of the encryption algorithm sequence is formed from largest to smallest. The encryption algorithm with the even number is selected, and the second half of the encryption algorithm sequence is formed from smallest to largest.

[0043] Understandably, the number of bits in the encryption algorithm sequence is often less than the number of sub-settlement data packets after segmentation. When the length of the encryption algorithm sequence is less than the number of sub-settlement data packets, the system will automatically repeat the execution from the beginning of the sequence after executing the sequence once, until all sub-settlement data packets have been encrypted.

[0044] It is understandable that those skilled in the art can choose the number of bits in the encrypted feature value and the correspondence rule between the parity of the encrypted feature value and the parity of the encryption algorithm number, depending on the circumstances. In practical applications, the preset numbering and parity correspondence rules of the encryption algorithms within the group can be updated periodically or irregularly as needed to improve encryption security, which will not be elaborated further here.

[0045] Specifically, the standard network latency is a benchmark value used by the system to measure the network transmission performance of each power generation enterprise. This value is the design value calculated based on the network topology and communication protocol during the network system design phase of the power generation enterprise, providing a unified and stable basis for subsequent calculation of the real-time network latency ratio of each power generation enterprise.

[0046] Specifically, the standard total processing time is a benchmark value used by the system to evaluate the processing efficiency of a single transaction from data preparation to contract generation. This value is the design value determined through performance modeling and stress testing during the network system design phase at the power generation enterprise level, providing a clear and reliable comparison standard for subsequently calculating the actual processing efficiency ratios of each power generation enterprise.

[0047] Specifically, a weighting of 0.4 is assigned to the first ratio, and a weighting of 0.6 is assigned to the second ratio. This weighting allocation is based on the different levels of consideration given to the two types of risks in the system's security strategy. The first ratio mainly reflects the real-time volatility of the network transmission environment at the power generation enterprise end; a weight of 0.4 means that the system considers this a factor that needs attention but is not a decisive adjustment factor. The second ratio comprehensively characterizes the overall level of data compliance, interaction reliability, and potential operational risks at the power generation enterprise end throughout the entire transaction process, and is given a higher weight of 0.6, indicating that the system design regards the reliability and compliance of the business process itself as the core elements affecting settlement security and the main source of risk. This weighting scheme guides the encryption algorithm mapping mechanism to focus more on preventing risks caused by process anomalies, data defects, or behavioral irregularities.

[0048] Specifically, the sending module processes the settlement data packet based on the sending requirement to encapsulate the access sequence number and key segment sequence number for synchronous sending, including: Based on the size of the sending request packet and the data packet size threshold, the settlement data packet to be sent is divided into several sub-settlement data packets; Read the encryption algorithm sequence encapsulated in the sending request packet in sequence, and call the corresponding encryption algorithm from the local algorithm library in sequence according to the encryption algorithm sequence number; According to the segmentation order of the sub-settlement data packets, each sub-settlement data packet is encrypted using the currently invoked encryption algorithm to generate the corresponding encrypted sub-settlement data packet, until all sub-settlement data packets have been processed; All encrypted sub-settlement data packets are encapsulated together with the access sequence number into a transmission data packet, which is then synchronously sent to the target power generation enterprise via peer-to-peer transmission or message queue through the blockchain network.

[0049] Specifically, the data packet size threshold is used to determine the data packet size type so as to select the data packet segmentation strategy based on the data packet size. The reference range for the data packet size threshold is [8MB, 16MB]. In this embodiment of the invention, the data packet size threshold is 8MB.

[0050] Please see Figure 2 As shown, Figure 2 This is a logic block diagram for determining the data packet type according to an embodiment of the invention; If the size of the settlement data packet to be sent is less than or equal to the data packet size threshold, it is considered a small data packet; If the size of the settlement data packet to be sent is greater than the data packet size threshold, it is considered a large data packet.

[0051] When the sending module segments small data packets, it randomly selects a number from the first set of segmentation quantities and uses the number as the number of sub-settlement data packets after segmentation. When the sending module segments a large data packet, it randomly selects a number from the second set of segments and uses that number as the number of sub-settlement data packets after segmentation. In this embodiment of the invention, the first set of segmentation quantities includes integers within the interval [16, 32], and the second set of segmentation quantities includes integers within the interval [64, 128].

[0052] It is understood that those skilled in the art can adjust the data packet size threshold, the value range of the first segmentation set, and the value range of the second segmentation set according to actual computing power, encryption requirements, etc., which will not be elaborated here.

[0053] Specifically, the verification module is used to receive data sent by the sending module, decrypt and obtain the access sequence number and key segment sequence number access feature record module, and invoke the receiving requirements of the multi-dimensional settlement feature mapping, including... Receive and decapsulate the transmitted data packet, and extract the access sequence number and several encrypted sub-settlement data packets arranged in order; Based on the access sequence number, a query request is initiated to the feature recording module to obtain the multi-dimensional settlement feature corresponding to the access sequence number. The decryption algorithm sequence number is derived according to the preset mapping rules and decryption processing is performed to obtain the restored sub-settlement data packet.

[0054] Specifically, the verification module derives the decryption algorithm sequence number according to preset mapping rules and performs decryption processing to obtain the restored sub-settlement data packet, which includes: Based on the acquired multidimensional settlement features, using the same feature-algorithm mapping rules and the same weighting parameters as in the data preparation module, the decryption algorithm sequence corresponding to the encryption algorithm sequence is calculated; Based on the decryption algorithm sequence number, the corresponding decryption algorithms are sequentially called from the local algorithm library, and each of the encrypted sub-settlement data packets is decrypted in turn according to the receiving order of the encrypted sub-settlement data packets.

[0055] Specifically, the configuration of the local algorithm library should be the same as that of the aforementioned algorithm library, which will not be repeated here.

[0056] Specifically, the monitoring module is used to obtain the access records of the feature recording module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module, including... The access log of the feature recording module is continuously monitored and collected. The access log records at least the access sequence number, access time and access source address. Based on the access source address in the access log, determine whether the visitor is in the preset regulatory whitelist; If the visitor is not on the whitelist, a port locking command is generated and executed to lock the visitor's access permissions. Based on the access sequence number in the access log, determine whether the current access reading order is consistent with the pre-stored valid order; If the order in which the visitors read the data is inconsistent, a port locking instruction is generated and executed to temporarily lock the visitors' access permissions.

[0057] Specifically, the pre-stored legal order is determined based on the dataset distributed to the corresponding power generation enterprise within the cycle.

[0058] Example 3: like Figure 3 As shown, embodiments of the present invention also provide a computer device. Figure 3 Taking a single processor 10 as an example, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other using different buses and can be mounted on a common motherboard or otherwise installed as needed. The processor can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices, such as display devices coupled to the interface. In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations, for example, as a server array, a group of blade servers, or a multiprocessor system.

[0059] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0060] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0061] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0062] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0063] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0064] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

Claims

1. A cross-regional automatic settlement system for electricity trading based on smart contracts, characterized in that, include: The feature recording module is used to record the multi-dimensional settlement features of the settlement data packets of several power generation enterprises. Every predetermined period, the dataset containing the serial number of each power generation enterprise is distributed to each power generation enterprise. The serial number of each power generation enterprise is determined based on the multi-dimensional settlement features of each power generation enterprise. The data preparation module responds to the power generation company's need to send settlement data packets. It is used to determine the access sequence number of the local end based on the dataset of the current period, and to call the corresponding multi-dimensional settlement features based on the access sequence number. According to the called multi-dimensional settlement features, the encryption algorithm sequence of this data transmission is determined through the preset feature-algorithm mapping rules. The encryption algorithm sequence and the access sequence number are encapsulated into a sending request packet. The sending module is used to divide the settlement data packet to be sent into several sub-settlement data packets, encrypt each sub-settlement data packet in sequence according to the encryption algorithm sequence in the sending request packet, obtain encrypted sub-settlement data packets, and encapsulate all encrypted sub-settlement data packets together with the access sequence number into a transmission data packet for synchronous transmission. The verification module is used to receive the transmitted data packet, decrypt it to obtain the access sequence number and several encrypted sub-settlement data packets, call the corresponding multi-dimensional settlement feature based on the access sequence number, derive the decryption algorithm sequence according to the feature-algorithm mapping rule based on the multi-dimensional settlement feature, and decrypt each encrypted sub-settlement data packet in turn according to the decryption algorithm sequence to restore the settlement data packet. The contract trading module is used to generate trading contracts based on verified settlement data packets and to generate trading fund transfer instructions based on the trading contracts. The monitoring module is used to obtain the access records of the feature recording module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module.

2. The cross-regional power trading automatic settlement system based on smart contracts according to claim 1, characterized in that, The multi-dimensional settlement features recorded by the feature recording module include: the identity identification code of each power generation enterprise, the average transaction confirmation delay in the previous period, and the average time taken for the entire transaction process.

3. The cross-regional power trading automatic settlement system based on smart contracts according to claim 1, characterized in that, The feature recording module distributes the dataset to each power generation company at predetermined intervals, including: Based on the transaction frequency of each power generation enterprise in the previous period, the serial numbers of each power generation enterprise in the dataset are sorted in descending order of transaction frequency, and the adjusted dataset is distributed to each power generation enterprise.

4. The cross-regional power trading automatic settlement system based on smart contracts according to claim 1, characterized in that, The data preparation module determines the encryption algorithm sequence based on the invoked multi-dimensional settlement features and a preset feature-algorithm mapping rule, specifically including: Based on the system's preset standard network latency and standard full-process time, calculate the first ratio of the average transaction confirmation latency to the standard network latency, and the second ratio of the average transaction full-process time to the standard full-process time. The weighted sum of the first ratio and the second ratio is used as the encryption feature value; The encrypted feature value is matched with several preset feature value ranges. Based on the matching results, the corresponding encryption algorithm group is selected from the preset algorithm library, and the execution order of each encryption algorithm in the encryption algorithm group is determined to form an encryption algorithm sequence. Each feature value range corresponds to a set of preset encryption algorithms.

5. The cross-regional power trading automatic settlement system based on smart contracts according to claim 4, characterized in that, The weighting weight of the first ratio is 0.4, and the weighting weight of the second ratio is 0.

6. The length of the encryption algorithm sequence is less than or equal to the number of sub-settlement data packets. When the length of the encryption algorithm sequence is less than the number of sub-settlement data packets, the system uses the encryption algorithm in sequence until all sub-settlement data packets are encrypted.

6. The cross-regional power trading automatic settlement system based on smart contracts according to claim 1, characterized in that, The sending module divides the settlement data packet to be sent into several sub-settlement data packets, including: Obtain the size of the settlement data packet to be sent, and compare the size with a preset data packet size threshold; If the size of the settlement data packet is less than or equal to the threshold, then a number of segments is determined from the first set of segments, and the settlement data packet is divided into that number of sub-settlement data packets. If the size of the settlement data packet exceeds the threshold, a number of segments is determined from the second set of segments, and the settlement data packet is divided into that number of sub-settlement data packets. Among them, the values ​​in the first set of segmentation values ​​are less than the values ​​in the second set of segmentation values.

7. The cross-regional power trading automatic settlement system based on smart contracts according to claim 1, characterized in that, The sending module synchronously sends data packets to the target power generation enterprise via peer-to-peer transmission through the blockchain network or message queue; the data packets also contain the cycle identifier of the current cycle; after receiving the data packets, the verification module requests the corresponding cycle's dataset from the feature recording module based on the cycle identifier, and then obtains the multi-dimensional settlement features from it based on the access sequence number.

8. The cross-regional power trading automatic settlement system based on smart contracts according to claim 1, characterized in that, The monitoring module determines whether to lock the access ports of the feature recording module, including: Continuously monitor and collect access logs from the feature recording module. The access logs should at least record the access sequence number, access time, and access source address. Based on the access source address in the access log, determine whether the visitor is in the preset regulatory whitelist; if not, generate and execute a port blocking command to block the visitor's access permissions. Based on the access sequence number in the access log, determine whether the current access reading order is consistent with the pre-stored valid order; if not, generate and execute a port locking command to temporarily lock the access rights of the visitor.

9. The cross-regional power trading automatic settlement system based on smart contracts according to claim 1, characterized in that, The pre-stored legal order is determined based on the dataset distributed to the corresponding power generation enterprise in the current period. The legal order is as follows: in any predetermined period, any power generation enterprise is only authorized to access the record in the dataset that corresponds to its own sequence number.

10. The method of the cross-regional power trading automatic settlement system based on smart contracts according to any one of claims 1-9, characterized in that, Includes the following steps: S1, the feature recording module records the multi-dimensional settlement features of the settlement data packets of several power generation enterprises. The dataset containing the serial numbers of each power generation enterprise is distributed to each power generation enterprise at predetermined intervals. The serial numbers of each power generation enterprise are determined based on the multi-dimensional settlement features of each power generation enterprise. S2, in response to the power generation company's need to send settlement data packets, the data preparation module determines the access sequence number of this end based on the dataset of the current period, and calls the corresponding multi-dimensional settlement feature based on the access sequence number. According to the called multi-dimensional settlement feature, the encryption algorithm sequence of this data transmission is determined through the preset feature-algorithm mapping rules, and the encryption algorithm sequence and access sequence number are encapsulated into a sending request packet. S3, the sending module divides the settlement data packet to be sent into several sub-settlement data packets, encrypts each sub-settlement data packet in sequence according to the encryption algorithm sequence in the sending request packet, obtains encrypted sub-settlement data packets, and encapsulates all encrypted sub-settlement data packets together with the access sequence number into a transmission data packet for synchronous sending; S4. The verification module receives the transmission data packet, decrypts it to obtain the access sequence number and several encrypted sub-settlement data packets, calls the corresponding multi-dimensional settlement feature based on the access sequence number, derives the decryption algorithm sequence according to the feature-algorithm mapping rule based on the multi-dimensional settlement feature, and decrypts each encrypted sub-settlement data packet in turn according to the decryption algorithm sequence to restore the settlement data packet. S5 generates a transaction contract based on the verified settlement data packet through the contract trading module, and generates a transaction fund transfer instruction based on the transaction contract; S6: Obtain the access records of the feature recording module through the monitoring module, determine the monitoring access order and monitoring access address based on the access sequence number, and determine whether to lock the access port of the feature recording module.

Citation Information

Patent Citations

  • Method for generating smart contract in electricity transaction

    CN118944033A