Multi-strategy encrypted transaction data processing method, system and equipment and storage medium
By adopting multi-strategy encryption transaction data processing method in V2G network, the problems of high cost, low efficiency and opaque price encryption transmission in electric vehicle payment transactions are solved, and more efficient, secure and transparent transaction data processing is achieved.
Patent Information
- Application Number
- CN202510235205.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-28
AI Technical Summary
In the existing V2G network, there are problems such as high cost of encryption transmission, low efficiency and insufficient price when paying for electric vehicles.
Using multi-strategy encryption transaction data processing method, select smart contracts through encryption policies to determine the encryption algorithm based on data call requests, edge computing nodes encrypt transaction data according to target encryption policy, and verify transaction data through collaborative mechanisms.
While ensuring the security of transaction data, it improves transmission efficiency, reduces transmission costs, and records transaction prices through blockchain to ensure its fairness and transparency.
Smart Images

Figure CN120074933A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of V2G networks, and particularly to a method, system, device, and storage medium for processing transaction data with multi-strategy encryption. Background Art
[0002] The V2G (Vehicle-to-Grid) network is a two-way energy exchange technology between electric vehicles and the power grid. Electric vehicles access the V2G network through dedicated parking facilities and provide auxiliary services to the smart grid under the control of a local aggregator. Electric vehicles have three states: charging, discharging, and distributed discharging. Charging is initiated by the electric vehicle, and power is transmitted from the smart grid to the electric vehicle, and the electric vehicle needs to pay electricity bills to the smart grid. Discharging is initiated by the smart grid when the grid is overloaded during peak user demand periods. Electric vehicles can relieve power shortages by discharging electricity to the grid and obtain economic rewards from the smart grid. Distributed discharging is initiated by one or more electric vehicles when the battery capacity is below a certain threshold. Different from the charging state, electric vehicles with sufficient power will temporarily act as energy suppliers for electric vehicles with insufficient power, and the latter needs to pay electricity bills to the suppliers.
[0003] In the existing V2G network, when electric vehicles conduct payment transactions, it is necessary to ensure the security of user sensitive information during data sharing. Therefore, most current payment mechanisms are based on blockchain. Although the information transmission mechanism based on blockchain has a trusted entity to ensure security, the existing transaction mechanisms still have the following problems:
[0004] (1) High cost of encrypted transmission: The existing transaction solutions use the same encryption protocol during data transmission, which will cause some data with large amounts but low security to consume a large amount of costs.
[0005] (2) Low efficiency of encrypted transmission: The existing transaction solutions use one transmission encryption protocol for information transmission with different data volumes, which will cause the transmission speed of some data that is not suitable for this protocol to be extremely slow.
[0006] (3) Lack of price transparency: After the transaction, the price result has not been fairly audited and publicly recorded, and the transaction price result is not fair and transparent enough. Summary of the Invention
[0007] In order to improve the transmission efficiency and reduce the transmission cost while ensuring the security of transaction data, the present application provides a method, system, device, and storage medium for processing transaction data with multi-strategy encryption.
[0008] To achieve the above object of the present invention, the present invention provides a method for processing transaction data with multi-strategy encryption.
[0009] A transaction data processing method with multi-strategy encryption provided by the present invention includes:
[0010] Obtain transaction data and a data call request;
[0011] Input the transaction data and the data call request into an encryption strategy selection smart contract. The encryption strategy selection smart contract determines the call information of the transaction data according to the data call request, screens out the encryption algorithms that meet the screening conditions from a preset encryption algorithm library as the target encryption strategy, and outputs the target encryption strategy;
[0012] Send the target encryption strategy to the edge computing node to control the edge computing node to encrypt the transaction data according to the target encryption strategy to obtain encrypted transaction data.
[0013] Optionally, the call information includes the amount of data called and the quantified value of data call security. The encryption algorithm library includes symmetric encryption algorithms, asymmetric encryption algorithms, and hybrid encryption algorithms;
[0014] Screening out the encryption algorithms that meet the screening conditions from the encryption algorithm library as the target encryption strategy according to the call information includes:
[0015] Compare the amount of data called with the reference value of the amount of data, and compare the quantified value of data call security with the reference value of data security:
[0016] If the amount of data called is less than the reference value of the amount of data and the quantified value of data call security is less than the reference value of data security, then select a symmetric encryption algorithm as the target encryption strategy;
[0017] If the amount of data called is less than the reference value of the amount of data and the quantified value of data call security is greater than or equal to the reference value of data security, then select an asymmetric encryption algorithm as the target encryption strategy;
[0018] If the amount of data called is greater than or equal to the reference value of the amount of data, then select a hybrid encryption algorithm as the target encryption strategy.
[0019] Optionally, when a symmetric encryption algorithm is selected as the target encryption strategy, the process of the edge computing node encrypting the transaction data includes:
[0020] Monitor the first encryption instruction, and generate a set of round keys {K 0 , K 1 , …, K n} = KeyExpansion(K);
[0021] where K represents the symmetric key, KeyExpansion(.) is the key expansion function, K 0 represents the round key of the initial round, and K 1Denote the round key of the first round as K n Denote the round key of the nth round, where n represents the total number of rounds;
[0022] Initial round execution P represents the original plaintext, Denote the exclusive-or operation, P (0) Denote the intermediate result of the plaintext after the initial round processing;
[0023] For each round i (1 ≤ i ≤ n - 1), perform the following operations:
[0024] P (i) = AddRoundKey(MixColumns(ShiftRows(SubBytes(P (i-1) ))), K i ),
[0025] P (i) Denote the intermediate result of the plaintext after the ith round processing, K i Denote the round key of the ith round, P (i-1) Denote the intermediate result of the plaintext after the (i - 1)th round processing, AddRoundKey(., K i ) denotes the exclusive-or operation with the round key K i MixColumns(.) denotes the column mixing operation, ShiftRows(.) denotes the row shifting operation, SubBytes(.) denotes the byte substitution operation;
[0026] Final round execution: C = AddRoundKey(ShiftRows(SubBytes(P (n-1) )), K n ), AddRoundKey(., K n ) denotes the exclusive-or operation with the round key K n P (n-1) Denote the intermediate result of the plaintext after the (n - 1)th round processing.
[0027] Optionally, when an asymmetric encryption algorithm is selected as the target encryption strategy, the process of the edge computing node encrypting the transaction data includes:
[0028] Monitor the second encryption instruction. After detecting the second encryption instruction, randomly select two relatively prime numbers p and q, and calculate N = p * q, where "*" represents the multiplication operation;
[0029] Calculate the Euler's totient function of N
[0030] Randomly select an integer E, with the condition that and E is relatively prime to ;
[0031] Calculate the modular multiplicative inverse D of E with respect to to obtain the public key (E, N) and the private key (D, N).
[0032] Optionally, when the hybrid encryption algorithm is selected as the target encryption strategy, the steps for the edge computing node to encrypt the transaction data include:
[0033] Monitor the third encryption instruction, and generate a symmetric key K = GenerateKey() after detecting the third encryption instruction. The GenerateKey() function is used to generate one or more random or pseudo-random byte sequences;
[0034] Create an encryption and decryption multi-threaded pool ThreadPool CP , and input the original plaintext P to be encrypted into the encryption and decryption multi-threaded pool for hybrid encryption, and output the ciphertext C = (C 1 , C 2 ); C 1 represents the encrypted plaintext, C 1 = E 1 (K, P), where E 1 (.) represents the encryption operation, and K represents the symmetric key; C 2 represents the encrypted symmetric key, C 2 = K E mod N, where N = p * q, N represents the product of two relatively prime numbers p and q, E represents a random integer, and "*" represents the multiplication operation.
[0035] Optionally, the method further includes:
[0036] The edge computing node uses a cooperation mechanism to mobilize both trading parties to verify the encrypted transaction data.
[0037] Optionally, the trading parties include an electric vehicle party and a power grid party. The edge computing node uses a cooperation mechanism to mobilize the trading parties to verify the encrypted transaction data, including:
[0038] The edge computing node verifies the identity information of the electric vehicle party and the power grid party, and sends a verification instruction to the electric vehicle party and the power grid party when the identity information of both the electric vehicle party and the power grid party is verified;
[0039] Receive the first verification result obtained by the electric vehicle party in response to the verification instruction to verify the encrypted transaction data;
[0040] Receive the second verification result obtained by the power grid party in response to the verification instruction to verify the encrypted transaction data;
[0041] Compare the first verification result and the second verification result. If both the first verification result and the second verification result are verified to pass, record the transaction data on the blockchain.
[0042] To solve the above problems, the present invention also provides a transaction data processing system with multi-strategy encryption. The system includes an electric vehicle, a power grid, an edge computing node, and a processing center;
[0043] Both the electric vehicle and the power grid are used to send transaction data and data call requests;
[0044] The processing center is used to execute the above-mentioned transaction data processing method with multi-strategy encryption;
[0045] The processing center includes an encryption strategy selection smart contract and a blockchain system,
[0046] The encryption strategy selection smart contract is used to determine the call information of the transaction data according to the data call request, and screen out the encryption algorithms that meet the screening conditions from the preset encryption algorithm library as the target encryption strategy, and output the target encryption strategy;
[0047] The blockchain system is used to store the encrypted transaction data;
[0048] The edge computing node is used to encrypt the transaction data according to the target encryption strategy and output the encrypted transaction data.
[0049] To solve the above problems, the present invention also provides an electronic device, which includes:
[0050] At least one processor; and,
[0051] A memory communicatively connected to the at least one processor; wherein,
[0052] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned transaction data processing method with multi-strategy encryption.
[0053] To solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned transaction data processing method with multi-strategy encryption.
[0054] In summary, the present application includes the following beneficial technical effects:
[0055] The encryption policy selection smart contract can determine the call information of transaction data according to the data call request, screen out the encryption algorithms that meet the screening conditions from the preset encryption algorithm library as the target encryption policy, and synchronize them to the edge computing nodes; for transaction data of different data volumes or different security levels, different encryption algorithms are used to encrypt the transaction data, achieving faster transmission speed while ensuring the security of transaction data transmission and effectively reducing the data transmission cost.
[0056] The edge computing node uses the cooperation mechanism to mobilize both parties of the transaction to verify the encrypted transaction data, and through secure multi-party computing technology, multiple parties participate in the calculation and verification of the encrypted transaction data and record it on the blockchain, ensuring the fairness, transparency, and immutability of the transaction price, and further improving the security of the data. Brief Description of the Drawings
[0057] Figure 1 It is a schematic flowchart of the method for processing transaction data with multi-strategy encryption provided by an embodiment of the present invention;
[0058] Figure 2 It is the test result of the data processing performance of three encryption algorithms in the preset encryption algorithm library;
[0059] Figure 3 It is a schematic flowchart of the step of screening out the encryption algorithms that meet the screening conditions from the encryption algorithm library according to the call information provided by an embodiment of the present invention;
[0060] Figure 4 It is a schematic flowchart of the processing process of the privacy protection power price cooperation mechanism based on trusted identity of the present invention;
[0061] Figure 5 It is the overall framework diagram of the multi-strategy encryption transaction data processing system provided by an embodiment of the present invention;
[0062] Figure 6 It is a schematic structural diagram of an electronic device for implementing the method for processing transaction data with multi-strategy encryption provided by an embodiment of the present invention.
[0063] Reference Signs: 10, processor; 11, memory; 12, communication bus; 13, communication interface.
[0064] The realization, functional features, and advantages of the objectives of the present invention will be further described in conjunction with the embodiments and with reference to the drawings. Detailed Embodiments
[0065] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.
[0066] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
[0067] In the description of the present invention, unless otherwise specified and defined, it should be noted that the terms "mounted", "connected", "coupled" should be understood in a broad sense. For example, it may be a mechanical connection or an electrical connection, or may be the communication inside two elements. It may be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms can be understood according to specific circumstances.
[0068] Refer to Figure 1 As shown, it is a schematic flowchart of a multi-strategy encrypted transaction data processing method provided by an embodiment of the present invention. In this embodiment, the multi-strategy encrypted transaction data processing method includes:
[0069] S1. Obtain transaction data and a data call request.
[0070] The transaction data includes charging and discharging data (such as the electricity amount obtained by an electric vehicle from the power grid or the electricity amount fed back by the electric vehicle to the power grid), electricity price and cost data (such as the electricity price information when the electric vehicle charges or the revenue information obtained by the electric vehicle discharging to the power grid), vehicle data (such as the vehicle identity information participating in V2G (Vehicle-to-Grid) transactions), battery state data (such as key parameters of the remaining battery power, health status, temperature, etc.), and power grid data (such as the load condition of the power grid, electricity price fluctuation condition), etc.
[0071] A data call request refers to an instruction used to guide or control specific operations or behaviors in the process of encrypting transaction data. The data call request includes various contents such as data transmission instructions and access control instructions. Among them, the data transmission instruction is an instruction used to guide how the encrypted transaction data is securely transmitted in the network, such as data encapsulation, routing selection, security protocols, etc.; the access control instruction is used to restrict the access rights to transaction data and control instructions; the data call request may also include other action information related to the transmission and encryption of transaction data, which will not be listed one by one in this embodiment.
[0072] S2. Input the transaction data and the data call request into the encryption policy selection smart contract. The encryption policy selection smart contract determines the call information of the transaction data according to the data call request, screens out the encryption algorithm that meets the screening conditions from the preset encryption algorithm library as the target encryption policy, and outputs the target encryption policy.
[0073] The call information includes the call data volume and the call data security quantification value. The call data security quantification value is used to characterize the security required for the transaction data to be processed during transmission and sharing. The encryption algorithm library includes symmetric encryption algorithms, asymmetric encryption algorithms, and hybrid encryption algorithms.
[0074] Figure 2 In (a) shows the data processing performance test results of the symmetric encryption algorithm. Figure 2 In (b) shows the data processing performance test results of the asymmetric encryption algorithm. Figure 2 In (c) shows the data processing performance test results of the hybrid encryption algorithm. Figure 2 The abscissa of the three figures in represents the data volume to be processed, and the unit of the data volume is byte. Figure 2 The ordinate of the three figures in represents the processing time, and the unit of the processing time is second (s); the symmetric encryption algorithm is relatively simple, and the encryption and decryption processes are efficient, suitable for processing large data volumes, but the security is insufficient; the asymmetric encryption algorithm has high security, but the encryption and decryption speed is slow; the hybrid encryption algorithm combines the advantages of symmetric and asymmetric encryption. In the hybrid encryption algorithm, symmetric encryption is responsible for encrypting data, which improves the encryption and decryption speed; asymmetric encryption is responsible for encrypting the symmetric encryption key, which enhances the security, but the implementation is relatively complex. According to Figure 2 It can be seen from the performance test results of the encryption algorithms, asymmetric encryption algorithms, and hybrid encryption algorithms shown: Information with a small data volume and low security requirements is suitable for using the symmetric encryption algorithm; information with a small data volume and high security requirements is suitable for the asymmetric encryption algorithm; information with a large data volume and certain security requirements is suitable for the hybrid encryption algorithm.
[0075] Refer to Figure 3, denote the encryption policy corresponding to the symmetric encryption algorithm as Algorithm 1 Policy, the encryption policy corresponding to the asymmetric encryption algorithm as Algorithm 2 Policy, and the encryption policy corresponding to the hybrid encryption algorithm as Algorithm 3 Policy; denote the amount of data called as D C , denote the quantified value of the security of the called data as S C ;
[0076] Based on the above analysis, the steps of screening out the encryption algorithm that meets the screening conditions from the encryption algorithm library according to the call information as the target encryption policy include:
[0077] Compare the amount of data called with the reference value of the amount of data, and compare the quantified value of the security of the called data with the reference value of the data security:
[0078] If the amount of data called is less than the reference value of the amount of data and the quantified value of the security of the called data is less than the reference value of the data security, then the encryption policy selection smart contract outputs to the edge computing node to select the symmetric encryption algorithm as the target encryption policy;
[0079] If the amount of data called is less than the reference value of the amount of data and the quantified value of the security of the called data is greater than or equal to the reference value of the data security, then the encryption policy selection smart contract outputs to the edge computing node to select the asymmetric encryption algorithm as the target encryption policy;
[0080] If the amount of data called is greater than or equal to the reference value of the amount of data, then the encryption policy selection smart contract outputs to the edge computing node to select the hybrid encryption algorithm as the target encryption policy.
[0081] In this embodiment, set the reference value of the amount of data to 1MB, and set the reference value of the data security to 0; the full English name of MB is Megabyte, and MB is one of the computer storage units, representing megabytes; in this embodiment, when setting the quantified value of the security of the called data, the following principle can be followed: if the transaction data to be processed is related to the transaction amount and identity information, then set the quantified value of the security of the called data to be greater than 0, otherwise set the quantified value of the security of the called data to be less than 0.
[0082] In the preferred implementation manner of this embodiment, if the amount of data called is greater than 10MB, then pack the encrypted data to be called into blocks, and the amount of each block is less than or equal to 10MB. For each block, select the hybrid encryption algorithm as the target encryption policy.
[0083] S3. Send the target encryption policy to the edge computing node to control the edge computing node to encrypt the transaction data according to the target encryption policy to obtain the encrypted transaction data.
[0084] Specifically, when the symmetric encryption algorithm is selected as the target encryption policy, the process of the edge computing node encrypting the transaction data includes:
[0085] Monitor the first encryption instruction, and generate a set of round keys {K 0 , K 1 , …, K n} = KeyExpansion(K);
[0086] where K represents the symmetric key, KeyExpansion(.) is the key expansion function, K 0 represents the round key of the initial round, K 1 represents the round key of the first round, K n represents the round key of the nth round, and n represents the total number of rounds;
[0087] The initial round executes P represents the original plaintext, represents the XOR operation, P (0) represents the intermediate result of the plaintext after the initial round processing;
[0088] For each main round i (1 ≤ i ≤ n - 1), perform the following operations:
[0089] P (i) = AddRoundKey(MixColumns(ShiftRows(SubBytes(P (i-1) ))), K i ),
[0090] P (i) represents the intermediate result of the plaintext after the ith round of processing, K i represents the round key of the ith round, i represents the round number index of the main round, and the round number index of the main round in the encryption process refers to the way of numbering or identifying the main encryption rounds in the encryption algorithm, P (i-1) represents the intermediate result of the plaintext after the (i - 1)th round of processing, AddRoundKey(., K i ) represents the XOR operation with the round key K i , MixColumns(.) represents the column mixing operation, ShiftRows(.) represents the row shift operation, and SubBytes(.) represents the byte substitution operation.
[0091] The final round executes: C = AddRoundKey(ShiftRows(SubBytes(P (n-1) )), K n ), AddRoundKey(., K n ) represents the XOR operation with the round key K n , P (n-1) represents the intermediate result of the plaintext after the (n - 1)th round of processing.
[0092] The decryption steps of the symmetric encryption algorithm include generating a set of round keys {K 0 ,K 1 ,…,K n} = KeyExpansion(K).
[0093] The generation process of the set of round keys is as follows:
[0094] In the initial round, execute
[0095] C (n) represents the output result of the initial round in the decryption process, C represents the final ciphertext generated after encryption,
[0096] For each main round i (1 ≤ i ≤ n - 1), perform the following operations:
[0097] C (i-1) =
[0098] InvSubBytes(InvShiftRows(InvMixColumns(AddRoundKey(C (i) ,K i )))),
[0099] where C (i-1) represents the intermediate ciphertext result after being processed by the (i - 1)-th round, InvSubBytes(.) represents the inverse byte substitution operation, InvShiftRows(.) represents the inverse row shift operation, and InvMixColumns(.) represents the inverse column mixing operation,
[0100] In the final round, execute:
[0101] P = InvSubBytes(InvShiftRows((AddRoundKey(C (1) ,K 0 ))), where P represents the final plaintext.
[0102] Furthermore, when choosing an asymmetric encryption algorithm as the target encryption strategy, the process of the edge computing node encrypting the transaction data includes:
[0103] Monitor the second encryption instruction. After detecting the second encryption instruction, randomly select two relatively prime numbers p and q, and calculate N = p * q, where "*" represents the multiplication operation;
[0104] Calculate the Euler's totient function of N
[0105] Randomly select an integer E, with the condition that and E is relatively prime to ; Calculate E for Modular multiplicative inverse D of denotes performing a modulo operation on to finally obtain the public key (E, N) and the private key (D, N).
[0106] In the asymmetric encryption algorithm, the encrypted ciphertext C = P E mod N, and the decrypted plaintext P = C D mod N.
[0107] Furthermore, when the hybrid encryption algorithm is selected as the target encryption strategy, the process of the edge computing node encrypting the transaction data includes:
[0108] Monitoring the third encryption instruction, and generating a symmetric key K = GenerateKey() after detecting the third encryption instruction. The GenerateKey() function is used to generate one or more random or pseudo-random byte sequences;
[0109] Creating an encryption and decryption multi-threaded pool ThreadPool CP , and placing the original plaintext P to be encrypted in the encryption and decryption information multi-thread to perform hybrid encryption in multiple threads, and outputting the ciphertext C = (C 1 , C 2 ); C 1 represents the encrypted plaintext, C 1 = E 1 (K, P), E 1 (.) represents the encryption operation, and K represents the symmetric key; C 2 represents the encrypted symmetric key, C 2 = K E mod N, N = p * q, N represents the product of two relatively prime numbers, and E represents a random integer.
[0110] When decrypting with the hybrid encryption algorithm, decrypt using the decryption symmetric key. The expression for the decryption symmetric key K is
[0111] Decrypt the ciphertext P = D 1 (K, C 1 ), in this formula, D 1 (.) represents the encryption operation, K represents the decryption symmetric key, and C 1 represents the encrypted plaintext.
[0112] In another embodiment of the present application, the method for processing multi-strategy encrypted transaction data further includes:
[0113] The edge computing node uses a cooperation mechanism to mobilize both parties of the transaction to verify the encrypted transaction data.
[0114] The trading parties include the electric vehicle party and the power grid party. The edge computing node uses a collaboration mechanism to mobilize the trading parties to verify the encrypted trading data, including:
[0115] The edge computing node verifies the identity information of the electric vehicle party and the power grid party, and sends a verification instruction to the electric vehicle party and the power grid party when both the identity information of the electric vehicle party and the power grid party are verified;
[0116] Receive the first verification result obtained by the electric vehicle party in response to the verification instruction to verify the encrypted trading data;
[0117] Receive the second verification result obtained by the power grid party in response to the verification instruction to verify the encrypted trading data;
[0118] Compare the first verification result and the second verification result. If both the first verification result and the second verification result are verified, record the trading data on the blockchain.
[0119] For the convenience of understanding by those skilled in the art, the following describes the process of using the collaboration mechanism to mobilize the trading parties to verify the encrypted trading data in combination with specific examples.
[0120] Refer to Figure 4 , taking the trading scenario where an electric vehicle obtains economic rewards by selling electricity to the power grid as an example, the processing flow of the privacy protection electricity price collaboration mechanism based on trusted identity includes:
[0121] S401. Parameter definition.
[0122] In the trading scenario where an electric vehicle obtains economic rewards by selling electricity to the power grid, the trading data includes the electricity quantity E avail (unit: kWh) available for sale by the electric vehicle, the minimum selling electricity price P min (unit: yuan / kWh) acceptable to the electric vehicle, the current electricity demand D need (unit: kWh) of the power grid, and the maximum purchase electricity price P max (yuan / kWh) willing to be paid by the power grid and the time peak-valley coefficient T. The time peak-valley coefficient is a correction coefficient used to reflect the electricity price fluctuation in the current time period, and its value range is [0,1].
[0123] Define the calculation model of the trading price P:
[0124]
[0125] Among them, w 1 is the first weight coefficient, w 2 is the second weight coefficient, w 1 reflects the influence of the electric vehicle party, w 2React to the influence of the grid side. The weight calculation is based on the available power supply and the required power consumption:
[0126] S402. Initialize the cooperation mechanism.
[0127] Initializing the cooperation mechanism is a preparatory work in the early stage of the cooperation mechanism, which defines some operation rules in the cooperation mechanism:
[0128] Cooperative addition calculation: [x + y] i = [x] i + [y] i mod q, where x and y are two values participating in the addition operation. Here, i represents the identifier of the participating party, and the value of i is A or B. A represents the electric vehicle side, and B represents the grid side. [x] i represents the secret share of x held by the participating party i, and [y] i represents the secret share of y held by the participating party i.
[0129] The purpose of the cooperative multiplication calculation is to generate multiplication triples. When performing cooperative division calculation, the Newton iteration method should be used. When calculating first calculate the reciprocal y -1 of y, and then calculate z = x * y -1 .
[0130] S403. Integrate the functions of the registration authority for edge computing nodes.
[0131] Edge computing nodes can issue certificates and manage identity authentication affairs within the local area.
[0132] S404. Identity authentication.
[0133] Specifically, the identity authentication process of the two trading parties (the electric vehicle side and the grid side) includes:
[0134] 404.1: RA setup.
[0135] The full English name of RA is Registration Authority, which represents the registration authority.
[0136] The registration authority holds a key pair (pk, sk), where pk represents the public key and sk represents the private key;
[0137] The registration authority RA is responsible for maintaining the certificate repository, which stores the user's private key sk and identity information, and obtains the public key pk through public channels.
[0138] 404.2: Electric vehicle party account registration.
[0139] Specifically, the registration steps of the electric vehicle party include:
[0140] a. Generate a key pair (pk A , sk A ), where pk A represents the public key of the electric vehicle party, and sk A represents the private key of the electric vehicle party.
[0141] b. The electric vehicle party submits the public key pk A and the identity information ID of the electric vehicle A .
[0142] The identity information ID of the electric vehicle A includes the vehicle license plate and personal ID card, etc.
[0143] c. Obtain the signature of the RA for the electric vehicle party: σ A = sign(sk, pk A ).
[0144] d. Generate a legal account based on the signature of the electric vehicle party and the public key pk of the electric vehicle party A : account A = (pk A , σ A ).
[0145] 404.3: Grid party account registration.
[0146] Specifically, the registration steps of the grid party include:
[0147] a. Generate a key pair (pk B , sk B ), where pk B represents the public key of the grid party, and sk B represents the private key of the grid party.
[0148] b. The grid party submits the public key pk B and the identity information ID of the grid B .
[0149] The identity information of the grid includes the grid operation license, etc.
[0150] c. Obtain the signature of the RA for the grid party: σ B = sign(sk, pk B ).
[0151] d. Generate a legal account based on the signature of the grid party and: account B = (pk B , σ B ).
[0152] 404.4: Account authentication.
[0153] a. The electric vehicle party and the power grid party exchange their respective account information (account A and account B ).
[0154] b. The electric vehicle party verifies the power grid party's account: ν B = Verify(pk, pk B , σ B ),
[0155] v B is a boolean value output by the electric vehicle party, and the value of v B is 0 or 1; Verify(.) is a verification parameter. If the value input to the Verify(.) function is correct, the output result of Verify(.) is 1; if the value input to the Verify(.) function is incorrect, the output result of Verify(.) is 0.
[0156] c. The power grid party verifies the electric vehicle party's account: v A = Verify(pk, pk A , σ A ),
[0157] v B is a boolean value output by the power grid party, and the value of v B is 0 or 1.
[0158] 404.5: Session establishment.
[0159] a. After successful verification (v A = v B = 1), a session key is generated.
[0160] b. All subsequent collaborative communications between the electric vehicle party and the power grid party use the session key for encryption.
[0161] c. The sender S prepares the message message to be sent, signs the message using its own private key sk S to generate the signature σ S = sign(sk S , message), and sends the message and the signature together to the receiver R.
[0162] sk S represents the private key of the sender S. When the electric vehicle party sends information to the power grid party, the electric vehicle party is the sender S and the power grid party is the receiver R; when the power grid party sends information to the electric vehicle party, the power grid party is the sender S and the electric vehicle party is the receiver R.
[0163] d. After the receiver R receives it, the following operations are performed:
[0164] Obtain the public key (pk) of the sender S );
[0165] Use the public key pk of the sender S to verify the message signature v S = Verify(pk, pk S , σ S );
[0166] If the verification passes (v S = 1), it indicates that the message truly comes from this user and has not been tampered with.
[0167] S405: After the verification passes, the processing steps of the electric vehicle party include:
[0168] Generate a random number and and use and to calculate the secret share where q is a randomly generated prime number q (for modular arithmetic), and l is the decimal precision; in this embodiment, q is a random prime number that satisfies q > 10 6 .
[0169]
[0170] Send [E avail B , [P min B to the grid party. [E avail B is the secret share of the electricity that the tram can sell (sent by the electric vehicle party to the grid party), and [P min B is the secret share of the lowest electricity selling price (sent by the electric vehicle party to the grid party).
[0171] S406: After the verification passes, the processing steps of the grid party include:
[0172] Generate a random number and use to calculate the secret share
[0173]
[0174] Send [D need A , [P max A to the electric vehicle party. [D need A The secret share representing the current electricity demand of the power grid (sent from the power grid side to the electric vehicle side), [P max A The secret share representing the maximum electricity purchase price that the power grid is willing to pay (sent from the power grid side to the electric vehicle side).
[0175] S407: Calculate the weight.
[0176] The electric vehicle side and the power grid side locally calculate the total share: [S] A =[E avail A +[D need A mod q, [S] B =[E avail B +[D need B mod q
[0177] Each party calculates the numerator share: [N 1 A =[E avail A , [N 1 B =[E avail B , [N 2 A =[D need A , [N 2 B =[D need B ;
[0178] Perform collaborative division calculation
[0179] Step 408: Calculate the weighted price.
[0180] Perform collaborative multiplication calculation w 1 ×P min :
[0181] [C 1 A , [C 1 B =Multiply([w 1 A , [w 1 B, [P min A , [P min B )
[0182] [C1 A ,[C 1 B represents the result of the secret share multiplication operation of the minimum electricity selling price of the electric vehicle party and the power grid party;
[0183] Perform collaborative multiplication calculation w 2 ×P max :
[0184] [C 2 A ,[C 2 B =Multiply([w 2 A ,[w 2 B ,[P max A ,[P max B )
[0185] [C 2 A ,[C 2 B represents the result of the secret share multiplication operation of the maximum electricity purchase price of the electric vehicle party and the power grid party.
[0186] Sum to get the weighted average:
[0187] [P weighted A =[C 1 A +[C 2 A mod q
[0188] [P weighted B =[C 1 B +[C 2 B mod q
[0189] [P weighted A is the secret share of the weighted average price (held by the electric vehicle party), [P weighted B is the secret share of the weighted average price (held by the power grid party).
[0190] S409: Calculate the final transaction price.
[0191] [P final A =[P weighted A × (1 + T) mod q
[0192] [P final B = [P weighted B × (1 + r) mod q
[0193] [P final A is the final transaction price held by the electric vehicle party (held by the electric vehicle party), [P final B is the final transaction price held by the power grid party.
[0194] The electric vehicle party sends [P final A to the power grid party, and the power grid party sends [P final B to the electric vehicle party.
[0195] Calculate the transaction price P = ([P final A + [P final B ) ÷ 10 2l mod q.
[0196] S410: Send the price result to the smart contract and record it on the blockchain.
[0197] Refer to Figure 5 , based on the same inventive concept, an embodiment of the present invention provides a multi-strategy encrypted transaction data processing system.
[0198] The multi-strategy encrypted transaction data processing system described in the present invention can be loaded into an electronic device. According to the functions achieved, the multi-strategy encrypted transaction data processing system includes an electric vehicle, a power grid, an edge computing node, and a processing center;
[0199] Both the electric vehicle and the power grid are used to send transaction data and data call requests;
[0200] The processing center is used to execute the multi-strategy encrypted transaction data processing method of the above embodiment; the processing center includes an encryption strategy selection smart contract and a blockchain system. The encryption strategy selection smart contract is used to determine the call information of the transaction data according to the data call request, and screen out the encryption algorithm that meets the screening conditions from the preset encryption algorithm library as the target encryption strategy, and output the target encryption strategy; the blockchain system is used to store the encrypted transaction data;
[0201] The edge computing node is used to encrypt the transaction data according to the target encryption strategy and output the encrypted transaction data.
[0202] The module described in the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
[0203] The various change modes and specific examples in the multi-strategy encryption-based transaction data processing method provided in the above embodiments are equally applicable to the multi-strategy encryption-based transaction data processing system in this embodiment. Through the foregoing detailed description of the multi-strategy encryption-based transaction data processing method, those skilled in the art can clearly know the implementation method of the multi-strategy encryption-based transaction data processing system in this embodiment. For the sake of brevity of the specification, it will not be elaborated herein.
[0204] This application also discloses an electronic device, such as Figure 6 shown, which is a schematic structural diagram of an electronic device for the multi-strategy encryption-based transaction data processing method provided in an embodiment of the present invention. The electronic device may include at least one processor 10, a memory 11 communicatively connected to at least one processor, a communication bus 12, and a communication interface 13, and may further include a computer program stored in the memory 11 and executable on the processor 10, such as a program for the multi-strategy encryption-based transaction data processing method.
[0205] Among them, the processor 10 may be composed of integrated circuits in some embodiments. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple packaged integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting various components of the entire electronic device through various interfaces and lines, and by running or executing programs or modules stored in the memory 11 (such as executing the multi-strategy encryption-based transaction data processing method, etc.), and calling data stored in the memory 11, to execute various functions of the electronic device and process data.
[0206] The memory 11 includes at least one type of readable storage medium, which includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 can be an internal storage unit of the electronic device in some embodiments, such as the mobile hard disk of the electronic device. The memory 11 can also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the electronic device. Further, the memory 11 can also include both an internal storage unit and an external storage device of the electronic device. The memory 11 can be used not only to store application software installed on the electronic device and various types of data, such as the code of the multi-strategy encrypted transaction data processing method program, etc., but also to temporarily store data that has been output or will be output.
[0207] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is set to realize the connection and communication between the memory 11 and at least one processor 10, etc.
[0208] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), and is usually used to establish a communication connection between this electronic device and other electronic devices. The user interface can be a display, an input unit (such as a keyboard), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. Among them, the display can also be appropriately referred to as a display screen or a display unit, and is used to display the information processed in the electronic device and to display a visual user interface.
[0209] Figure 6 Only the electronic device with components is shown. Those skilled in the art can understand that Figure 6The structures shown do not constitute a limitation on the electronic device, and it may include fewer or more components than those shown, or combine certain components, or have different component arrangements.
[0210] For example, although not shown, the electronic device may further include a power source (such as a battery) for powering each component. Preferably, the power source can be logically connected to at least one processor 10 through a power management device, so as to implement functions such as charging management, discharging management, and power consumption management through the power management device. The power source may also include any components such as one or more DC or AC power sources, a recharge device, a power failure detection circuit, a power converter or inverter, a power status indicator, etc. The electronic device may also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be elaborated here.
[0211] It should be understood that the embodiments are for illustrative purposes only and are not limited by this structure in the scope of the patent application.
[0212] Furthermore, if the modules / units integrated in the electronic device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile.
[0213] The embodiments of the present application provide a computer-readable storage medium, for example, including: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory). The computer-readable storage medium stores a computer program that can be loaded and executed by a processor to perform the multi-strategy encryption-based transaction data processing method in the above embodiments.
[0214] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", "one implementation manner", "one preferred implementation manner", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0215] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and purposes of the present invention, and the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A multi-strategy encrypted transaction data processing method, characterized in that: The method comprises: Obtain transaction data and data call requests; Input the transaction data and data call request into the encryption strategy selection smart contract. The encryption strategy selection smart contract determines the call information of the transaction data according to the data call request, selects the encryption algorithm that meets the screening conditions from the preset encryption algorithm library as the target encryption strategy according to the call information, and outputs the target encryption strategy; The target encryption policy is sent to the edge computing node to control the edge computing node to encrypt the transaction data according to the target encryption policy to obtain encrypted transaction data.
2. The multi-strategy encrypted transaction data processing method according to claim 1, characterized in that: The call information includes the call data volume and the call data security quantification value, and the encryption algorithm library includes symmetric encryption algorithm, asymmetric encryption algorithm and hybrid encryption algorithm; According to the call information, the encryption algorithm that meets the screening conditions is filtered out from the encryption algorithm library as the target encryption strategy, including: Compare the call data volume and the data volume reference value, and compare the call data security quantification value and the data security reference value: If the amount of data called is less than the data amount reference value and the quantitative value of the data security called is less than the data security reference value, the symmetric encryption algorithm is selected as the target encryption strategy; If the amount of data being called is less than the reference value of the amount of data and the quantified value of the security of the data being called is greater than or equal to the reference value of the security of the data, then an asymmetric encryption algorithm is selected as the target encryption strategy; If the amount of data called is greater than or equal to the reference value of the data amount, the hybrid encryption algorithm is selected as the target encryption strategy.
3. The multi-strategy encrypted transaction data processing method according to claim 2, characterized in that: When the symmetric encryption algorithm is selected as the target encryption strategy, the process of edge computing nodes encrypting transaction data includes: Monitor the first encryption instruction, and generate a round key set {K0, K1, ..., K n } = KeyExpansion(K); Where K represents the symmetric key, KeyExpansion(.) is the key expansion function, K0 represents the round key of the initial round, K1 represents the round key of the first round, and K n represents the round key of the nth round, where n represents the total number of rounds; Initial round execution P represents the original plaintext, represents the XOR operation, P (0) Represents the plaintext intermediate result after the initial round of processing; For each round i (1≤i≤n-1), perform the following operations: P (i) =AddRoundKey(MixColumns(ShiftRows(SubBytes(P (i-1 )))),K i ), P (i) represents the intermediate result of the plaintext after the i-th round of processing, K i represents the round key of round i, P (i-1) Indicates the plaintext intermediate result after the i-1th round of processing, AddRoundKey(.,K i ) represents the round key K i Perform XOR operation, MixColumns(.) represents column mixing operation, ShiftRows(.) represents row shift operation, and SubBytes(.) represents byte substitution operation; Final round execution: C = AddRoundKey (ShiftRows (SubBytes (P (n-1) )),K n ), AddRoundKey(.,K n ) represents the round key K n Perform XOR operation, P (n-1) Represents the plaintext intermediate result after the n-1th round of processing.
4. The multi-strategy encrypted transaction data processing method according to claim 2, characterized in that: When an asymmetric encryption algorithm is selected as the target encryption strategy, the process of edge computing nodes encrypting transaction data includes: Monitor the second encryption instruction, randomly select two coprime numbers p and q after monitoring the second encryption instruction, and calculate N=p*q, where "*" represents a multiplication operation; Calculate the Euler function of N Randomly select an integer E, provided that And E and mutually prime; Calculate E for The modular inverse element D of , we get the public key (E, N) and the private key (D, N) 。 5. The multi-strategy encrypted transaction data processing method according to claim 2, characterized in that: When the hybrid encryption algorithm is selected as the target encryption strategy, the process of edge computing nodes encrypting transaction data includes: Monitoring a third encryption instruction, and generating a symmetric key K=GenerateKey() after the third encryption instruction is monitored, where the GenerateKey() function is used to generate one or more random or pseudo-random byte sequences; Create a multi-thread pool ThreadPool for encryption and decryption CP , the original plaintext P to be encrypted is input into the encryption and decryption multi-thread pool for mixed encryption, and the ciphertext C = (C1, C2); C1 represents the encrypted plaintext, C1 = E1 (K, P), E1 (.) represents the encryption operation, K represents the symmetric key; C2 represents the encrypted symmetric key, C2 = K E mod N, N = p*q, "*" represents a multiplication operation, N represents the product of two coprime numbers p and q, and E represents a random integer.
6. The multi-strategy encrypted transaction data processing method according to any one of claims 1 to 5, characterized in that: The method further comprises: The edge computing nodes use a collaborative mechanism to mobilize both parties to verify the encrypted transaction data.
7. The multi-strategy encrypted transaction data processing method according to claim 6, characterized in that: The transaction parties include the electric vehicle party and the power grid party. The edge computing node uses a collaborative mechanism to mobilize the transaction parties to verify the encrypted transaction data, including: The edge computing node verifies the identity information of the electric vehicle party and the power grid party, and sends a verification instruction to the electric vehicle party and the power grid party when the identity information of the electric vehicle party and the power grid party are both verified; Receiving a first verification result obtained by the electric vehicle party verifying the encrypted transaction data in response to the verification instruction; receiving a second verification result obtained by the power grid party in response to the verification instruction to verify the encrypted transaction data; The first verification result and the second verification result are compared. If both the first verification result and the second verification result are verified to be passed, the transaction data is recorded in the blockchain.
8. A multi-strategy encrypted transaction data processing system, characterized in that: including electric vehicles, power grids, edge computing nodes and processing centers; Both electric vehicles and the power grid are used to send transaction data and data call requests; A processing center, used to execute the multi-strategy encrypted transaction data processing method according to any one of claims 1 to 7; The processing center includes the encryption strategy selection smart contract and blockchain system. The encryption strategy selection smart contract is used to determine the call information of the transaction data according to the data call request, and select the encryption algorithm that meets the screening conditions from the preset encryption algorithm library as the target encryption strategy according to the call information, and output the target encryption strategy; The blockchain system is used to store encrypted transaction data; The edge computing node is used to encrypt the transaction data according to the target encryption strategy and output the encrypted transaction data.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor (10); and, a memory (11) communicatively connected to the at least one processor (10); Wherein, the memory (11) stores a computer program that can be executed by the at least one processor (10), and the computer program is executed by the at least one processor (10) so that the at least one processor (10) can execute the multi-strategy encrypted transaction data processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program; when the computer program is executed by a processor, the multi-strategy encrypted transaction data processing method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data encryption method, node equipment and storage medium
CN111310206A
Information transmission encryption method and system based on Internet of Things
CN115766233A
Charging transaction data processing method and device based on V2G, and storage medium
CN118982353A
Encryption management in an information handling system
US20100146582A1
Cited By
Energy data dynamic encryption method and system based on edge computing
CN120896748A