Power grid privacy enhancement transaction secret state matching method and system based on sequence uncovering encryption

Through sequence-revealing encryption and quick sorting algorithms, privacy protection and efficient matching in power grid transactions are achieved, which solves the problems of privacy leakage and high time complexity in existing electricity bidding transactions and improves the security and efficiency of the power resource market.

CN120744966APending Publication Date: 2025-10-03ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510597422.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Existing anonymous electricity bidding and trading methods have the risk of privacy leakage, cannot achieve fine-grained permission control, and have high time complexity, which cannot meet the real-time trading needs of the power grid.

Method used

A power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption is adopted. The public-private key pair and public parameters are generated by the authoritative center. The electricity seller uploads the information, the electricity buyer generates the secret bid amount and sends the bid ciphertext, and the matching party performs secret comparison and sorting to ensure the privacy of the transaction amount and identity. The transaction process is optimized by combining the quick sorting algorithm.

Benefits of technology

It achieves the goal of hiding data distribution characteristics, preventing external inference attacks, and reducing computing and storage overheads while protecting the privacy of transaction amounts and seller identities. It is suitable for power grid terminal equipment and improves the privacy, security, and reliability of market-based transactions of power resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120744966A_ABST
    Figure CN120744966A_ABST
Patent Text Reader

Abstract

The invention relates to the field of electric power bidding transactions, and provides a power grid privacy enhancement transaction secret state matching method and system based on sequence uncovering encryption. The method comprises the following steps: an electricity seller uploads electricity selling information to a matching party; the electricity buyer screens a target electricity seller according to a preset condition and encrypts the bidding amount to obtain an encryption result of the bidding amount; generating a bidding ciphertext according to the encryption result of the bidding amount and the identity commitment; sending the bidding ciphertext to a matching party; the matching party divides the transaction list into a plurality of ciphertext blocks, randomly selects a transaction as a reference transaction in each ciphertext block, and performs secret state comparison on each transaction and the reference transaction according to the bidding ciphertext to obtain a sorting result; selecting the transaction with the maximum bidding amount according to the sorting result, and determining the transaction as the final transaction amount; and the matching party signs the identity commitment of the electricity buyer by using the private key of the matching party to obtain a signature value, so that the electricity buyer performs offline transaction with the seller according to the signature value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power bidding transactions, and in particular to a power grid privacy-enhanced transaction secret matching method and system based on sequence-revealing encryption. Background Art

[0002] In the electricity spot market, the context for matching grid-privacy transactions is closely related to the market's regulatory mechanisms. With the gradual opening of the electricity market and the widespread integration of distributed energy resources, the frequency and complexity of spot market transactions have increased significantly. The application of digital technologies, particularly smart contracts and blockchain, has enabled automated and efficient transactions. These technologies not only enhance market transparency but also improve transaction efficiency. However, traditional centralized trading models carry significant data leakage risks, especially for sensitive information such as user electricity usage data and transaction records, which require effective protection. With the growing demand for privacy protection, decentralized trading models are gaining attention. In a decentralized model, trading parties can directly match and trade, reducing reliance on centralized institutions while enhancing privacy protection. In the spot market, decentralized trading models offer greater flexibility, enabling faster response to market supply and demand changes and enabling real-time adjustments and optimization. This model not only improves market efficiency but also promotes the optimal allocation of electricity resources and stable market operation while protecting user privacy.

[0003] The emergence of Order-Revealing Encryption (ORE) technology stems from the need to balance data encryption and query efficiency. In the era of cloud computing and big data, the conflict between privacy protection and data availability has become increasingly prominent. As data storage and computing gradually migrate to the cloud, users' demand for data privacy protection is increasing. However, traditional encryption technologies often struggle to support efficient query and comparison operations without decryption, which limits data availability. Order-Revealing Encryption (ORE) addresses this issue. It allows direct comparison operations on encrypted data, ensuring data privacy while supporting efficient query and sorting operations. This achieves an ideal balance between privacy protection and data availability.

[0004] Existing anonymous electricity bidding and trading methods use symmetric unencrypted encryption, where all buyers and sellers share the same private key k. If buyer A obtains key k, they can decrypt the bidding data of other buyers, resulting in privacy leaks. This approach makes it difficult to implement fine-grained permission control and fails to meet the security requirements of multiple participants in power grid transactions. Furthermore, the unencrypted encryption employed does not hide the underlying parameters, allowing malicious users to exploit the data distribution to infer important statistical information (such as mean and variance). Furthermore, current anonymous electricity bidding and trading methods require sequential comparison and sorting of the transaction list, resulting in a time complexity of O(n²). When the transaction volume n exceeds 10^4, the system latency will not be able to meet the real-time trading requirements of the power grid.

[0005] Therefore, the existing electricity market matching mechanism still cannot fully meet the demand for efficient and privacy-protected transaction matching in the spot market, and lacks a market-based matching mechanism that protects privacy while ensuring the efficiency and fairness of transactions. Summary of the Invention

[0006] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a power grid privacy-enhanced transaction secret matching method and system based on sequence-revealing encryption. The present invention encrypts and compares transaction data through sequence-revealing encryption and signature technology. On the basis of protecting the privacy of transaction amount and seller identity, the transactions are queried and sorted to achieve maximum transaction volume matching.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions: The first aspect of the present invention provides a power grid privacy-enhanced transaction secret state matching method based on sequence-revealing encryption.

[0008] A power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption, comprising: The authority generates the public-private key pair of the matching party, discloses the public parameters and the matching party's public key, and sends the matching party's public-private key pair to the matching party; The electricity seller uploads the electricity selling information to the matching party, and the matching party broadcasts the electricity selling information after receiving it; The electricity buyer selects the target electricity seller based on the preset conditions, encrypts the bid amount to obtain the secret bid amount, generates the bid ciphertext based on the secret bid amount and identity commitment, and sends the bid ciphertext to the matching party. The matching party divides the transaction list into multiple ciphertext blocks. Within each ciphertext block, a transaction is randomly selected as the benchmark transaction. Based on the bid ciphertext, each transaction is secretly compared with the benchmark transaction to obtain a ranking result. Based on the ranking result, the local optimal transaction corresponding to the maximum bid amount in each ciphertext block is selected, and the maximum bid amount among all the local optimal transactions is selected as the final transaction amount. The matching party uses its private key to sign the identity commitment of the electricity buyer, obtains the signature value, and sends it to the electricity buyer so that the electricity buyer can conduct offline transactions with the seller based on the signature value.

[0009] Furthermore, the authority center also generates a master private key and a comparison key of the electricity buyer, sends the comparison key to the matching party, and sends the master private key and the comparison key of the electricity buyer to the electricity buyer.

[0010] Furthermore, the process of generating the public parameters includes: selecting a generator from a cyclic group, selecting a random number from an integer field, and selecting a first hash function and a second hash function; constructing initial public parameters based on the random number, the first hash function, and the second hash function; selecting an arbitrary key from the integer field, setting a pseudo-random function, and calculating the public parameters in combination with the initial public parameters.

[0011] Furthermore, the process of generating the public-private key pair of the matching party includes: the authority center randomly selects a random number from the integer field as the private key of the matching party; and generates the public key of the matching party according to the private key of the matching party.

[0012] Furthermore, the process of generating the electricity selling information includes: the electricity seller uses the matching party's public key to The electricity sales information is obtained by encrypting the electricity sales information; the electricity sales information includes the electricity type and the time when it can be sold.

[0013] Furthermore, the bid amount is encrypted to obtain a secret bid amount; and a bid ciphertext is generated according to the secret bid amount and the identity commitment. The method includes: Express the bid amount in binary form, decompose the master private key, and generate a random permutation function; The electricity buyer chooses two random numbers from the integer domain , encrypt each bit of the bid amount to obtain the first encrypted value ; Calculate the first encrypted value by hash function Two hash values 、 ; Use hash value 、 and random numbers , calculate the second encrypted value , according to the hash value 、 and the second encrypted value , calculate the third encrypted value ; The buyer of electricity uses two hash values 、 , two random numbers , the third encrypted value , hash key, calculate the fourth encrypted value 、 ; According to the fourth encryption value 、 and compare the keys, and XOR the third encrypted value , get the fifth encrypted value ; According to the fifth encryption value and the fourth encrypted value 、 , generate a confidential bidding amount.

[0014] Furthermore, the method of confidentially comparing each transaction with a benchmark transaction to obtain a ranking result includes: Compare each transaction with the benchmark transaction in a confidential manner. If the benchmark transaction is greater than the current transaction, move the current transaction to the left of the benchmark transaction. If the benchmark transaction is less than the current transaction, move the current transaction to the right of the benchmark transaction. If the benchmark transaction is equal to the current transaction, keep the order unchanged. The matching party recursively distributes and sorts the data on the left and right sides of the benchmark transaction in each ciphertext block until all transactions are sorted, and obtains the sorting result of each ciphertext block.

[0015] Furthermore, the method of confidentially comparing each transaction with a benchmark transaction further includes: The matching party uses the comparison key to decrypt the bid ciphertext of the benchmark transaction and the bid ciphertext of the transaction to be compared, and obtains the third encrypted value of each bit in the benchmark transaction bid amount. and the third encrypted value of each digit in the transaction bid amount to be compared ; Based on the third encrypted value of each bit in the benchmark transaction bid amount And the confidential bid amount corresponding to the basic transaction, calculate the first benchmark transaction confidential comparison value ; According to the third encrypted value of each bit in the transaction bid amount to be compared And the confidential bid amount corresponding to the transaction to be compared, calculate the confidential comparison value of the first transaction to be compared ; like , indicating the first encrypted value of the benchmark transaction bid amount The first encrypted value that is greater than the transaction bid amount to be compared ,return ; Otherwise, recalculate the second benchmark transaction confidentiality comparison value and the second transaction secret comparison value to be compared ;like , the first encrypted value of the benchmark transaction bid amount The first encrypted value that is less than the bid amount of the transaction to be compared ,return ; like ,or , neither of them holds true, then the first encrypted value of the benchmark transaction bid amount The first encrypted value equal to the bid amount of the transaction to be compared ,generate .

[0016] The second aspect of the present invention provides a power grid privacy-enhanced transaction secret matching system based on sequence-revealing encryption.

[0017] A power grid privacy-enhanced transaction secret matching system based on sequence-revealing encryption, comprising: An initialization module, configured to: generate a public-private key pair of the matching party by the authority center, disclose public parameters and the matching party's public key, and send the public-private key pair of the matching party to the matching party; The electricity selling information publishing module is configured to: the electricity seller uploads the electricity selling information to the matching party, and the matching party broadcasts the electricity selling information after receiving it; The bidding ciphertext generation module is configured to: the electricity buyer selects the target electricity seller according to preset conditions, encrypts the bidding amount to obtain the encrypted bidding amount; generates the bidding ciphertext based on the encrypted bidding amount and identity commitment; and sends the bidding ciphertext to the matching party; The matching module is configured to: divide the transaction list into multiple ciphertext blocks, randomly select a transaction in each ciphertext block as a benchmark transaction, perform a secret comparison between each transaction and the benchmark transaction based on the bid ciphertext, and obtain a ranking result; select the local optimal transaction corresponding to the maximum bid amount in each ciphertext block based on the ranking result, and select the maximum bid amount among all local optimal transactions as the final transaction amount; The transaction generation module is configured to: the matching party uses its private key to sign the identity commitment of the electricity buyer, obtain the signature value, and send it to the electricity buyer, so that the electricity buyer can conduct an offline transaction with the seller based on the signature value.

[0018] Furthermore, the authority center also generates a master private key and a comparison key of the electricity buyer, sends the comparison key to the matching party, and sends the master private key and the comparison key of the electricity buyer to the electricity buyer.

[0019] Furthermore, the process of generating the public parameters includes: selecting a generator from a cyclic group, selecting a random number from an integer field, and selecting a first hash function and a second hash function; constructing initial public parameters based on the random number, the first hash function, and the second hash function; selecting an arbitrary key from the integer field, setting a pseudo-random function, and calculating the public parameters in combination with the initial public parameters.

[0020] Furthermore, the process of generating the public-private key pair of the matching party includes: the authority center randomly selects a random number from the integer field as the private key of the matching party; and generates the public key of the matching party according to the private key of the matching party.

[0021] Furthermore, the process of generating the electricity selling information includes: the electricity seller uses the matching party's public key to The electricity sales information is obtained by encrypting the electricity sales information; the electricity sales information includes the electricity type and the time when it can be sold.

[0022] The third aspect of the present invention provides a power grid privacy-enhanced transaction secret matching system based on sequence-revealing encryption.

[0023] A power grid privacy-enhanced transaction matching system based on sequence encryption includes: an authority center, a matching party, an electricity seller, and an electricity buyer. The authority center is used to generate the public and private key pair of the matching party, disclose the public parameters and the matching party's public key, and send the matching party's public and private key pair to the matching party; The electricity seller is used to upload the electricity selling information to the matching party so that the matching party can broadcast the electricity selling information after receiving it; The electricity buyer is used to screen target electricity sellers based on preset conditions, encrypt the bid amount to obtain the secret bid amount, generate the bid ciphertext based on the secret bid amount and identity commitment, and send the bid ciphertext to the matching party; The matching party is used to divide the transaction list into multiple ciphertext blocks, randomly select a transaction in each ciphertext block as the benchmark transaction, and compare each transaction with the benchmark transaction in a secret state based on the bidding ciphertext to obtain the sorting result; select the local optimal transaction corresponding to the maximum bidding amount in each ciphertext block based on the sorting result, and screen the maximum bidding amount among all local optimal transactions as the final transaction amount; use its private key to sign the identity commitment of the buyer, obtain the signature value, and send it to the buyer, so that the buyer can conduct offline transactions with the seller based on the signature value.

[0024] A fourth aspect of the present invention provides a computer device, comprising: a processor adapted to execute a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps in the power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption as described in the first aspect above are implemented.

[0025] The fifth aspect of the present invention provides a computer-readable storage medium storing a computer program, which is suitable for being loaded by a processor and executing the steps in the power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption as described in the first aspect above.

[0026] A sixth aspect of the present invention provides a computer program product or computer program.

[0027] The present invention provides a computer program product or computer program, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the power grid privacy-enhancing transaction secret state matching method based on sequence-revealing encryption as described in the first aspect above.

[0028] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a power grid privacy-enhanced transaction confidential matching method based on sequence-revealing encryption, comprising: system initialization, completion of system parameter generation and buyer identity registration; the electricity seller publishes electricity resource market transaction information; the electricity buyer combines sequence-revealing encryption with a structure-preserving algorithm to generate a confidential and anonymous bidding token; the transaction matching center verifies the legitimacy of the bidding token, blocks the transaction list, and combines a quick sorting algorithm to perform maximum transaction volume matching on the confidential bidding token, returning the authenticated bidding matching result; after the electricity buyer receives the successful bidding matching result, it conducts an electricity resource transaction with the electricity seller. While protecting the privacy of the transaction amount and the privacy of the electricity seller's identity, the present invention also hides the distribution characteristics of the bidding data of both the buyer and the seller, effectively preventing external inference attacks, and realizing a privacy-enhanced maximum transaction volume matching mechanism. This method ensures the openness and transparency of the matching process, and improves the privacy, security, and reliability of the market-based transaction of electricity resources.

[0029] The present invention adopts asymmetric decryption to generate an independent public-private key pair for each electricity buyer, realizing key isolation. That is, each electricity buyer can only decrypt its own data and cannot access the ciphertext information of other users. It also realizes resistance to conspiracy attacks. Even if the private keys of some participants are leaked, the overall security of the system will not be affected.

[0030] The present invention designs parameter-hidden decryption encryption and combines it with the Schnorr recognition algorithm to avoid bilinear pairing operations, effectively masking data distribution characteristics. Attackers cannot infer the plaintext content through distribution statistics. It also reduces computing and storage overhead and is suitable for deployment in power grid terminal equipment.

[0031] The present invention uses cryptographic technologies such as parameter-hidden sequence-revealing encryption algorithm, structure-preserving hash, and quick sort to design a parameter-hidden sequence-revealing encryption power grid privacy transaction secret matching method and system, which achieves the privacy of bidding amount and data distribution, and has low computing and communication overhead, and is suitable for use in resource-constrained devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0033] Figure 1 This is a flow chart of a method for matching power grid privacy-enhanced transactions based on sequence-revealing encryption, according to an embodiment of the present invention; Figure 2 1 is a schematic diagram illustrating the interaction between the electricity seller, the matching party, and the electricity buyer according to an embodiment of the present invention; Figure 3 1 is a structural diagram of a power grid privacy-enhanced transaction secret matching system based on sequence-revealing encryption according to an embodiment of the present invention; Figure 4 It is a structural diagram of a computer device shown in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0035] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0036] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0037] In order to facilitate understanding of the technical solution of the present invention, some technical terms involved in the present invention are introduced below.

[0038] Order-Revealing Encryption (ORE) is an encryption technique that allows the order of ciphertext to be directly compared with its corresponding plaintext without decrypting it, while ensuring security.

[0039] Based on this, this embodiment provides a power grid privacy-enhanced transaction secret matching method based on sequence encryption. Figure 1 This is a flow chart of a power grid privacy-enhanced transaction secret matching method based on sequence encryption according to an embodiment of the present invention. Figure 1 As shown, the method of the present invention includes: The authority generates the public-private key pair of the matching party, discloses the public parameters and the matching party's public key, and sends the matching party's public-private key pair to the matching party; The electricity seller uploads the electricity selling information to the matching party, and the matching party broadcasts the electricity selling information after receiving it; The electricity buyer selects the target electricity seller based on the preset conditions, encrypts the bid amount to obtain the secret bid amount, generates the bid ciphertext based on the secret bid amount and identity commitment, and sends the bid ciphertext to the matching party. The matching party divides the transaction list into multiple ciphertext blocks. Within each ciphertext block, a transaction is randomly selected as the benchmark transaction. Based on the bid ciphertext, each transaction is secretly compared with the benchmark transaction to obtain a ranking result. Based on the ranking result, the local optimal transaction corresponding to the maximum bid amount in each ciphertext block is selected, and the maximum bid amount among all the local optimal transactions is selected as the final transaction amount. The matching party uses its private key to sign the identity commitment of the electricity buyer, obtains the signature value, and sends it to the electricity buyer so that the electricity buyer can conduct offline transactions with the seller based on the signature value.

[0040] The entities in this embodiment include the authority center , electricity buyers , electricity seller , matching party The authoritative center initializes the system and generates legal public and private key pairs for users. The electricity seller publishes the electricity selling information, the electricity buyer uploads the confidential bidding amount, and the matching party analyzes and compares the transaction data to determine whether the transaction conditions are met and complete the transaction matching with the maximum transaction volume. The algorithm is divided into five stages: initialization, electricity selling information release, bidding ciphertext generation, matching, and transaction generation. Figure 2 The specific steps are as follows: Step (1): Initialization phase In this phase, the authority center initializes the system and generates the public and private key pairs of the matching parties. Input security parameters , output , perform the following steps: Step (1-1): From the cyclic group Select generators from , and from the integer domain Pick a random number , choose two hash functions .calculate , then the public parameters for , the hash key is , the comparison key is c .in, Indicates system security parameters.

[0041] Step (1-2): From the integer domain Optional key , set the pseudo-random function to ,but .in, Represents a pseudorandom function ,in is the key space, m For message space, i For the message m No. i Bit, Represents a string and string The natural connection, express Bit length message m of i bit prefix, i.e. = ; express Bit length message No. i Bit, par For public parameters, msk is the master private key, ck For comparison keys. par The public (msk, ck) is held by the buyer and used to generate ciphertext data; the ck matching party holds it and decrypts the data in step (4).

[0042] Steps (1-3): Random selection of authoritative centers , generate the matching party's legal public key as .

[0043] Steps (1-4): The authoritative center discloses public parameters and the matching party's public key , the master private key is sent through a secure channel and compare keys Sent to the electricity buyer and the key will be compared and public-private key pairs Send to matching parties.

[0044] The present invention adopts asymmetric decryption to generate an independent public-private key pair for each electricity buyer, realizing key isolation. That is, each electricity buyer can only decrypt its own data and cannot access the ciphertext information of other users. It also realizes resistance to conspiracy attacks. Even if the private keys of some participants are leaked, the overall security of the system will not be affected.

[0045] Step (2): Electricity sales information release stage At this stage, the electricity seller Execute, input , output , perform the following steps: Step (2-1): Electricity seller The identity And electricity related information Q (such as electricity type, sale time, etc.), use the matching party's public key to encrypt the electricity sales information ; Enc represents the encryption algorithm, such as RSA encryption. Upload to the matching party ; Step (2-2): Matching After receiving the information, the seller uses the private key sk to decrypt the information. Electricity sales information ,right Broadcast to ensure that all electricity buyers can obtain this information and participate in the bidding.

[0046] Step (3): Bidding ciphertext generation stage This stage is executed by the electricity buyer R, input , output c, the execution steps are as follows: Step (3-1): Buyer First, eligible electricity sellers are screened based on preset conditions (such as geographic location within 50 kilometers), and the bidding amount bal is expressed in binary form: . Then the master private key Decompose into , and generates a pseudo-random permutation function ,right Every one of Execute steps (3-2) and (3-3); Step (3-2): The electricity buyer obtains the value from the integer domain. Pick two random numbers , for the bidding amount Each bit is encrypted , then through the hash function calculate Two hash values Using hash values 、 and random numbers ,calculate , then hashed ;in, The encrypted value representing the bid amount bal; express A random value of .

[0047] Step (3-3): Use the Schnorr recognition algorithm to calculate The specific process is as follows: The electricity buyer calculates , and the random number Randomize . Will compare and 、 Perform hash operation and XOR have to Finally, the electricity buyer generates a secret bidding amount ;in, Represents the intermediate result of encryption, express A random value of .

[0048] Step (3-4): The buyer of electricity is responsible for his or her identity Make a commitment , and then all the generated bidding ciphertexts Send to matching parties.

[0049] The present invention hides parameters during the bidding ciphertext generation stage, effectively concealing data distribution characteristics, and attackers cannot infer plaintext content through distribution statistics.

[0050] Step (4): Matching phase This stage is performed by the matching party P, and the transaction list is input. , output the optimal transaction , the specific steps are as follows: Step (4-1): Select the benchmark transaction Step (4-1-1): The matching party lists the transactions by time, region and other criteria. The first transaction in each block is randomly selected as the benchmark transaction, and the other transactions are cryptographically compared with the benchmark transaction, and finally these transactions are sorted.

[0051] Step (4-1-2): For example, suppose a transaction list contains six buyers, A, B, C, D, E, and F, and the transaction initiated by buyer A is the base transaction. The ciphertext of A is , A's secret bid amount . B's ciphertext is , B's secret bid amount .

[0052] Step (4-1-3): The matching party performs step (2) to perform a confidential comparison between A and B, and then continues to compare A with C, D, E, and F, dividing these transactions into two groups: one group with a bid amount greater than the benchmark transaction (A), and the other group with a bid amount less than the benchmark transaction (A); Step (4-2): Comparison of benchmark transaction confidentiality Step (4-2-1): For each of the two bid amounts For matching, the matching parties compare the keys Restore encrypted value ; Step (4-2-2): Next, the matching party calculates the secret comparison value .

[0053] Step (4-2-3): If ,show Greater than ,return ; Step (4-2-4): Otherwise, the matching party calculates , like ,show Less than ,return .

[0054] Step (4-2-5): If both step (4-2-3) and step (4-2-4) are not true, it means equal , the matching party generates .

[0055] Step (4-3): Recursive sorting and swapping Through the comparison in step (4-2), the matching party can determine the size relationship between the benchmark transaction (A) and other transactions (such as B, C, D, E, and F). These transactions are then divided into two groups: one with a bid amount greater than the benchmark transaction, and the other with a bid amount less than the benchmark transaction. Next, these two groups are recursively sorted until all transactions are sorted by bid amount into a single ordered list.

[0056] Step (4-4): Determine the optimal transaction After completing the sorting in step (4-3), the matching party can select the local optimal transaction from each block (that is, the transaction with the largest bid amount in each block). Finally, all the local optimal transactions are sorted and the transaction with the largest bid amount is selected as the final transaction. .

[0057] Traditional sorting requires pairwise comparisons of adjacent elements, resulting in an average time complexity of O(n²). This invention combines decryption with quick sort, reducing the average time complexity of the quick sort algorithm to O(n log n). (The recursive depth is log n layers, with each layer requiring O(n) comparisons, for a total of O(n log n) comparisons.) Therefore, this invention combines decryption with quick sort, using quick sort to select benchmark transaction items, reducing the comparison complexity from O(n²) to O(n log n). Furthermore, the decryption mechanism is embedded in the benchmark comparison process, ensuring that the entire sorting process is completed in ciphertext.

[0058] Step (5): Transaction generation phase Input at this stage , output 0 or 1, the execution steps are as follows: Step (5-1): The matching party matches the transaction and uses its private key sk to sign the identity commitment of the buyer. , the signature value Send to the electricity buyer; Step (5-2): The buyer of electricity receives the signature value , conduct offline transactions with the seller. Output 1 if the transaction is successful, otherwise output 0.

[0059] The present invention uses cryptographic technologies such as parameter-hidden sequence-revealing encryption algorithm, structure-preserving hash, and quick sort to design a parameter-hidden sequence-revealing encryption power grid privacy transaction secret matching method and system, which achieves the privacy of bidding amount and data distribution, and has low computing and communication overhead, and is suitable for use in resource-constrained devices.

[0060] To verify the present invention, we conducted experiments on a desktop computer with an Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz, 16GB RAM, and Ubuntu 18.04 LTS. We compared the present invention with the classic parameter hiding and decryption scheme, and obtained the following experimental results: Table 1 Comparison of ciphertext size and running time between the sequence-unveiling encryption scheme of the present invention and the prior art

[0061] It can be seen that compared with the current advanced parameter-hidden sequence-uncovering encryption algorithm, the present invention improves encryption and comparison efficiency by more than two times, and reduces the ciphertext size by about 31.25%; Combination of the above Figure 1 The power grid privacy enhanced transaction secret matching method based on sequence-revealing encryption provided by an embodiment of the present invention is introduced in detail. Next, the power grid privacy enhanced transaction secret matching system based on sequence-revealing encryption provided by an embodiment of the present invention will be introduced in conjunction with the accompanying drawings.

[0062] Figure 3 This is a schematic diagram of the structure of the power grid privacy enhanced transaction secret matching system based on sequence encryption shown in an embodiment of the present invention, referring to Figure 3 , the system of the present invention comprises: An initialization module, configured to: generate a public-private key pair of the matching party by the authority center, disclose public parameters and the matching party's public key, and send the public-private key pair of the matching party to the matching party; The electricity selling information publishing module is configured to: the electricity seller uploads the electricity selling information to the matching party, and the matching party broadcasts the electricity selling information after receiving it; The bidding ciphertext generation module is configured to: the electricity buyer selects the target electricity seller according to preset conditions, encrypts the bidding amount to obtain the encrypted bidding amount; generates the bidding ciphertext based on the encrypted bidding amount and identity commitment; and sends the bidding ciphertext to the matching party; The matching module is configured to: divide the transaction list into multiple ciphertext blocks, randomly select a transaction in each ciphertext block as a benchmark transaction, perform a secret comparison between each transaction and the benchmark transaction based on the bid ciphertext, and obtain a ranking result; select the local optimal transaction corresponding to the maximum bid amount in each ciphertext block based on the ranking result, and select the maximum bid amount among all local optimal transactions as the final transaction amount; The transaction generation module is configured to: the matching party uses its private key to sign the identity commitment of the electricity buyer, obtain the signature value, and send it to the electricity buyer, so that the electricity buyer can conduct an offline transaction with the seller based on the signature value.

[0063] This embodiment uses sequence encryption and signature technology to encrypt and compare transaction data. While protecting the privacy of transaction amounts and seller identities, it queries and sorts transactions to achieve maximum transaction volume matching. This solution mainly includes the following five modules: 1. Initialization module (1) Generate public parameters and master private key: The authority center initializes the system and selects the generator , and from the integer domain Pick a random number , choose two hash functions .calculate The mapping generates public parameters and master private key.

[0064] (2) Generate the user's public and private key pair: the authority center selects a random number as the buyer's private key , calculate the corresponding public key , the public and private key pairs Sent to the electricity buyer through a secure channel.

[0065] 2. Electricity sales information release module (1) Packaging of electricity sales information: The electricity seller packages its excess electricity information and related auxiliary information (such as electricity type, sales time, etc.) into a message , and upload it to the transaction matching party.

[0066] (2) Public electricity selling information: The matching party broadcasts the information uploaded by the electricity seller to all participants, ensuring that all electricity buyers can obtain the information and participate in the bidding.

[0067] 3. Bidding ciphertext generation module In the bidding ciphertext generation module, the electricity buyer selects the target electricity seller based on preset conditions (such as geographic location within 50km) and generates the ciphertext according to the following steps: (1) The buyer uses a parameter-hidden sequence encryption algorithm to encrypt the bidding amount. Encryption is performed and then hashed to preserve the structure. .

[0068] (2) The electricity buyer calculates a random value and uses an XOR operation to encrypt the bid amount. Combined with the identity commitment, the bidding ciphertext is finally generated The ciphertext It is used to protect the privacy of the bidding amount and identity of the electricity buyer.

[0069] (3) Finally, the electricity buyer will bid the ciphertext Send to matching parties.

[0070] 4. Matching module In the matching module, the matching party divides the transaction list into multiple ciphertext blocks based on criteria such as time or region. Within each block, the local optimal transaction is selected using a quick sort and parameter-hidden decryption comparison algorithm. Finally, the local optimal transactions are sorted and the final transaction amount is selected.

[0071] (1) Selecting benchmark transactions: The matching party divides the transaction list into multiple ciphertext blocks by time or region, and randomly selects a transaction in each block through quick sorting. As a benchmark transaction. The matching party is based on the ciphertext , perform confidential comparison on two transactions.

[0072] (2) Secret comparison: If the return value This indicates , at this time will The corresponding transaction moves to the left of the benchmark; if the return value This indicates ,Will The corresponding transaction moves to the right of the benchmark; if the return value , the order remains unchanged.

[0073] (3) Recursive sorting: The matching party will recursively distribute and sort the left and right parts of the benchmark transaction in each block until all transactions are sorted. Finally, the local optimal transactions are sorted again, and the transaction with the highest bid amount is selected to determine the final transaction amount.

[0074] 5. Transaction generation module (1) Signature generation: After the sorting is completed and the maximum transaction volume is determined, the matching party matches the successful transaction. The matching party uses its private key to sign the identity of the buyer and generate a signature. , and the signature value Sent to the electricity buyer.

[0075] (2) Offline confirmation: After receiving the signature, the buyer conducts an offline transaction with the seller by verifying the signature to ensure the authenticity and security of the transaction.

[0076] This embodiment also provides a power grid privacy-enhanced transaction matching system based on sequence encryption, including: an authority center, a matching party, an electricity seller, and an electricity buyer. The authority center is used to generate the public and private key pair of the matching party, disclose the public parameters and the matching party's public key, and send the matching party's public and private key pair to the matching party; The electricity seller is used to upload the electricity selling information to the matching party so that the matching party can broadcast the electricity selling information after receiving it; The electricity buyer is used to screen target electricity sellers based on preset conditions, encrypt the bid amount to obtain the secret bid amount, generate the bid ciphertext based on the secret bid amount and identity commitment, and send the bid ciphertext to the matching party; The matching party is used to divide the transaction list into multiple ciphertext blocks, randomly select a transaction in each ciphertext block as the benchmark transaction, and compare each transaction with the benchmark transaction in a secret state based on the bidding ciphertext to obtain the sorting result; select the local optimal transaction corresponding to the maximum bidding amount in each ciphertext block based on the sorting result, and screen the maximum bidding amount among all local optimal transactions as the final transaction amount; use its private key to sign the identity commitment of the buyer, obtain the signature value, and send it to the buyer, so that the buyer can conduct offline transactions with the seller based on the signature value.

[0077] According to an embodiment of the present invention, the power grid privacy enhanced transaction secret matching system based on sequence encryption can correspond to the method described in the embodiment of the present invention, and the above and other operations and / or functions of each module of the power grid privacy enhanced transaction secret matching system based on sequence encryption are respectively to achieve Figure 1 For the sake of brevity, the corresponding processes of each method in are not repeated here.

[0078] See also Figure 4The computer device shown in the figure includes a processor, a communication interface, and a computer-readable storage medium. The processor, communication interface, and computer-readable storage medium can be connected via a bus or other means. The communication interface is used to receive and transmit data. The computer-readable storage medium can be stored in the computer device's memory, storing a computer program comprising program instructions. The processor is used to execute the program instructions stored in the computer-readable storage medium. The processor (also known as the CPU (Central Processing Unit)) is the computing and control core of the computer device and is adapted to implement one or more instructions, specifically loading and executing one or more instructions to implement the corresponding steps in an embodiment of a method for matching power grid privacy-enhanced transactions based on sequence-decoding encryption.

[0079] This embodiment provides a computer-readable storage medium (Memory). This computer-readable storage medium is a memory device within a computer device that is used to store programs and data. It should be understood that the computer-readable storage medium herein may include both built-in storage media within the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the processing system of the computer device. Furthermore, the storage space also stores one or more instructions suitable for being loaded and executed by the processor. These instructions may be one or more computer programs (including program code). It should be noted that the computer-readable storage medium herein may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device; alternatively, it may be at least one computer-readable storage medium located remotely from the processor.

[0080] In one embodiment, one or more instructions are stored in the computer-readable storage medium; the processor loads and executes the one or more instructions stored in the computer-readable storage medium to implement the corresponding steps in the above-mentioned embodiment of the power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption.

[0081] This embodiment provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding steps of the embodiment of the power grid privacy-enhancing transaction secret matching method based on sequence-decoding encryption.

[0082] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0083] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0084] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0086] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0087] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A power grid privacy-enhanced transaction secret matching method based on sequence encryption, characterized in that: include: The authority generates the public-private key pair of the matching party, discloses the public parameters and the matching party's public key, and sends the matching party's public-private key pair to the matching party; The electricity seller uploads the electricity selling information to the matching party, and the matching party broadcasts the electricity selling information after receiving it; The electricity buyer selects the target electricity seller based on the preset conditions, encrypts the bid amount to obtain the secret bid amount, generates the bid ciphertext based on the secret bid amount and identity commitment, and sends the bid ciphertext to the matching party. The matching party divides the transaction list into multiple ciphertext blocks. Within each ciphertext block, a transaction is randomly selected as the benchmark transaction. Based on the bid ciphertext, each transaction is secretly compared with the benchmark transaction to obtain a ranking result. Based on the ranking result, the local optimal transaction corresponding to the maximum bid amount in each ciphertext block is selected, and the maximum bid amount among all the local optimal transactions is selected as the final transaction amount. The matching party uses its private key to sign the identity commitment of the electricity buyer, obtains the signature value, and sends it to the electricity buyer so that the electricity buyer can conduct offline transactions with the seller based on the signature value.

2. The power grid privacy-enhanced transaction secret matching method based on sequence-unveiling encryption according to claim 1 is characterized in that: The authority center also generates the master private key and comparison key of the electricity buyer, sends the comparison key to the matching party, and sends the master private key and comparison key of the electricity buyer to the electricity buyer; or, The process of generating the public parameter includes: selecting a generator from a cyclic group, selecting a random number from an integer field, and selecting a first hash function and a second hash function; Initial public parameters are constructed according to a random number, a first hash function, and a second hash function. A key is randomly selected from an integer field, a pseudo-random function is set, and the public parameters are calculated in combination with the initial public parameters.

3. The power grid privacy-enhanced transaction secret matching method based on sequence-unveiling encryption according to claim 1 is characterized in that: The process of generating the public-private key pair of the matching party includes: the authority center randomly selects a random number from the integer field as the private key of the matching party; and generates the public key of the matching party according to the private key of the matching party.

4. The power grid privacy-enhanced transaction secret matching method based on sequence-unveiling encryption according to claim 1 is characterized in that: The process of generating the electricity selling information includes: The electricity sales information is obtained by encrypting the electricity sales information; the electricity sales information includes the electricity type and the time when it can be sold.

5. The power grid privacy-enhanced transaction secret matching method based on sequence-unveiling encryption according to claim 1 is characterized in that: The bidding amount is encrypted to obtain a secret bidding amount; Generate bidding ciphertext based on the secret bid amount and identity commitment; the method includes: Express the bid amount in binary form, decompose the master private key, and generate a random permutation function; The electricity buyer chooses two random numbers from the integer domain , encrypt each bit of the bid amount to obtain the first encrypted value ; Calculate the first encrypted value by hash function Two hash values 、 ; Use hash value 、 and random numbers , calculate the second encrypted value , according to the hash value 、 and the second encrypted value , calculate the third encrypted value ; The buyer of electricity uses two hash values 、 , two random numbers , the third encrypted value , hash key, calculate the fourth encrypted value 、 ; According to the fourth encryption value 、 and compare the keys, and XOR the third encrypted value , get the fifth encrypted value ; According to the fifth encryption value and the fourth encrypted value 、 , generate a confidential bidding amount.

6. The power grid privacy-enhanced transaction secret matching method based on sequence-unveiling encryption according to claim 1 is characterized in that: The method comprises the following steps: performing a secret comparison between each transaction and a benchmark transaction to obtain a ranking result; if the benchmark transaction is greater than the current transaction, the current transaction is moved to the left of the benchmark transaction; if the benchmark transaction is less than the current transaction, the current transaction is moved to the right of the benchmark transaction; if the benchmark transaction is equal to the current transaction, the ranking is maintained unchanged; The matching party recursively distributes and sorts the data on the left and right sides of the benchmark transaction in each ciphertext block until all transactions are sorted, and obtains the sorting result of each ciphertext block.

7. The power grid privacy-enhanced transaction secret matching method based on sequence-unveiling encryption according to claim 6 is characterized in that: The method of confidentially comparing each transaction with the benchmark transaction further comprises: The matching party uses the comparison key to decrypt the bid ciphertext of the benchmark transaction and the bid ciphertext of the transaction to be compared, and obtains the third encrypted value of each bit in the benchmark transaction bid amount. and the third encrypted value of each digit in the transaction bid amount to be compared ; Based on the third encrypted value of each bit in the benchmark transaction bid amount And the confidential bid amount corresponding to the basic transaction, calculate the first benchmark transaction confidential comparison value ; According to the third encrypted value of each bit in the transaction bid amount to be compared And the confidential bid amount corresponding to the transaction to be compared, calculate the confidential comparison value of the first transaction to be compared ; like , indicating the first encrypted value of the benchmark transaction bid amount The first encrypted value that is greater than the transaction bid amount to be compared ,return ; Otherwise, recalculate the second benchmark transaction confidentiality comparison value and the second transaction secret comparison value to be compared ;like , the first encrypted value of the benchmark transaction bid amount The first encrypted value that is less than the bid amount of the transaction to be compared ,return ; like ,or , neither of them holds true, then the first encrypted value of the benchmark transaction bid amount The first encrypted value equal to the bid amount of the transaction to be compared ,generate .

8. A power grid privacy-enhanced transaction matching system based on sequence encryption, characterized by: include: An initialization module, configured to: generate a public-private key pair of the matching party by the authority center, disclose public parameters and the matching party's public key, and send the public-private key pair of the matching party to the matching party; The electricity selling information publishing module is configured to: the electricity seller uploads the electricity selling information to the matching party, and the matching party broadcasts the electricity selling information after receiving it; The bidding ciphertext generation module is configured to: the electricity buyer selects the target electricity seller according to preset conditions, encrypts the bidding amount to obtain the encrypted bidding amount; generates the bidding ciphertext based on the encrypted bidding amount and identity commitment; and sends the bidding ciphertext to the matching party; The matching module is configured to: divide the transaction list into multiple ciphertext blocks, randomly select a transaction in each ciphertext block as a benchmark transaction, perform a secret comparison between each transaction and the benchmark transaction based on the bid ciphertext, and obtain a ranking result; select the local optimal transaction corresponding to the maximum bid amount in each ciphertext block based on the ranking result, and select the maximum bid amount among all local optimal transactions as the final transaction amount; The transaction generation module is configured to: the matching party uses its private key to sign the identity commitment of the electricity buyer, obtain the signature value, and send it to the electricity buyer, so that the electricity buyer can conduct an offline transaction with the seller based on the signature value.

9. The power grid privacy-enhanced transaction secret matching system based on sequence-revealing encryption according to claim 8 is characterized in that: The authority center also generates the master private key and comparison key of the electricity buyer, sends the comparison key to the matching party, and sends the master private key and comparison key of the electricity buyer to the electricity buyer; or, The process of generating the public parameters includes: selecting a generator from a cyclic group, selecting a random number from an integer field, selecting a first hash function and a second hash function; constructing an initial public parameter based on the random number, the first hash function and the second hash function; selecting an arbitrary key from the integer field, setting a pseudorandom function, and calculating the public parameter in combination with the initial public parameter; or, The process of generating the public and private key pair of the matching party includes: the authority center randomly selects a random number from the integer domain as the private key of the matching party; and generates the public key of the matching party based on the private key of the matching party; or, The process of generating the electricity selling information includes: The electricity sales information is obtained by encrypting the electricity sales information; the electricity sales information includes the electricity type and the time when it can be sold.

10. A power grid privacy-enhanced transaction matching system based on sequence encryption, characterized in that: include: Authoritative center, matching party, electricity seller and electricity buyer, The authority center is used to generate the public and private key pair of the matching party, disclose the public parameters and the matching party's public key, and send the matching party's public and private key pair to the matching party; The electricity seller is used to upload the electricity selling information to the matching party so that the matching party can broadcast the electricity selling information after receiving it; The electricity buyer is used to screen target electricity sellers based on preset conditions, encrypt the bid amount to obtain the secret bid amount, generate the bid ciphertext based on the secret bid amount and identity commitment, and send the bid ciphertext to the matching party; The matching party is used to divide the transaction list into multiple ciphertext blocks, randomly select a transaction in each ciphertext block as the benchmark transaction, and compare each transaction with the benchmark transaction in a secret state based on the bidding ciphertext to obtain the sorting result; select the local optimal transaction corresponding to the maximum bidding amount in each ciphertext block based on the sorting result, and screen the maximum bidding amount among all local optimal transactions as the final transaction amount; use its private key to sign the identity commitment of the buyer, obtain the signature value, and send it to the buyer, so that the buyer can conduct offline transactions with the seller based on the signature value.

11. A computer device, characterized in that: a processor adapted to execute a computer program; A computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by the processor, implements the steps of the power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption as described in any one of claims 1 to 7.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is suitable for being loaded by a processor and executing the steps in the power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption as described in any one of claims 1 to 7.

13. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the steps in the power grid privacy-enhanced transaction secret matching method based on sequence-revealing encryption as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Data element ciphertext sorting method and device, equipment, medium and product

    CN121644091A