CN111768188A - Dynamic power grid charging method and device, computer equipment and storage medium - Google Patents

Dynamic power grid charging method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111768188A
CN111768188A CN202010574976.5A CN202010574976A CN111768188A CN 111768188 A CN111768188 A CN 111768188A CN 202010574976 A CN202010574976 A CN 202010574976A CN 111768188 A CN111768188 A CN 111768188A
Authority
CN
China
Prior art keywords
intelligent electric
verification
data
electric meter
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010574976.5A
Other languages
Chinese (zh)
Other versions
CN111768188B (en
Inventor
周勇
赵健
熊俊杰
徐本安
王志敏
苏聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sunwin Intelligent Co Ltd
Original Assignee
Shenzhen Sunwin Intelligent Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sunwin Intelligent Co Ltd filed Critical Shenzhen Sunwin Intelligent Co Ltd
Priority to CN202010574976.5A priority Critical patent/CN111768188B/en
Publication of CN111768188A publication Critical patent/CN111768188A/en
Application granted granted Critical
Publication of CN111768188B publication Critical patent/CN111768188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/14Payment architectures specially adapted for billing systems
    • G06Q20/145Payments according to the detected use or quantity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • General Engineering & Computer Science (AREA)
  • Tourism & Hospitality (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • Medical Informatics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a dynamic power grid charging method, a device, computer equipment and a storage medium, wherein the method comprises the steps of generating a private key of electric power and a private key of an intelligent electric meter; acquiring a data packet; aggregating the data packets and obtaining decrypted data; generating an electric bill, and verifying the electric bill by both sides; judging whether the verification results are successful or not; if yes, dividing the intelligent electric meter into two groups to obtain an aggregation verification parameter; judging whether error data sent by the intelligent ammeter exists or not; if yes, judging whether the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one or not; if not, dividing the intelligent electric meters with the error data sent by the intelligent electric meters into two groups, calculating the aggregation verification parameters of the two groups, and judging the error data sent by the intelligent electric meters. According to the invention, the data leakage risk is reduced during the charging of the power grid, the privacy of a user is protected, and the specific position of a fault ammeter can be quickly determined when the ammeter has a fault.

Description

Dynamic power grid charging method and device, computer equipment and storage medium
Technical Field
The invention relates to a power grid information processing method, in particular to a dynamic power grid charging method, a dynamic power grid charging device, computer equipment and a storage medium.
Background
The smart city is characterized in that technologies such as cloud computing, big data processing and the Internet of things are utilized to coordinate and fuse all departments and various resources in the city, and more accurate and real-time data service is provided, so that management efficiency and capacity of city and enterprise managers are improved, and living standard of residents is improved. The smart city is a system engineering taking data as a core, and the smart city cannot operate in real time, accurately and reliably.
The power supply is an extremely important condition for supporting urban operation, and in the context of smart cities, the management problem in urban power supply can be solved with the support of a large amount of data. Through the real-time power consumption to the whole city of control, can effectively hold electric power supply and demand balance, less wasting of resources. Meanwhile, the monthly electricity consumption of the user is counted, so that unnecessary expenses caused by manual meter reading can be avoided, and electronic payment of the user is realized. However, there are still some problems to be solved in the control and management of the power grid in the smart city. Firstly, the real-time electricity of the user only needs to be acquired by the user, and the power company only needs to know the real-time electricity of the whole city and the monthly electricity consumption of the user. Second, the accuracy of the monthly bill of the user cannot be checked online, which may cause a dispute between the user and the electric power company. Third, when the electricity meter of a certain user counts or transmits wrong electricity data due to a fault, it is difficult for the electric power company to perform troubleshooting, i.e., to determine a specific location of the faulty electricity meter.
Therefore, it is necessary to design a new method to reduce the risk of data leakage during the power grid charging, protect the privacy of the user, and quickly determine the specific location of the faulty meter when the meter fails.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a dynamic power grid charging method, a device, computer equipment and a storage medium.
In order to achieve the purpose, the invention adopts the following technical scheme: the dynamic power grid charging method comprises the following steps:
creating and initializing system parameters to obtain an electric power private key and an intelligent electric meter private key;
acquiring a power consumption data ciphertext which is obtained from an intelligent electric meter and encrypted by using a private key of the intelligent electric meter to obtain a data packet;
aggregating the data packets, and processing the data packets by adopting an electric power private key and an intelligent electric meter private key to obtain decrypted data;
generating an electric charge bill according to the decrypted data, verifying the electric charge bill to obtain a first verification result, and sending the electric charge bill to the intelligent electric meter for the intelligent electric meter to verify to obtain a second verification result;
judging whether the first verification result and the second verification result are both successful in verification;
if the first verification result and the second verification result are both successful in verification, dividing the intelligent electric meter into two groups, and acquiring aggregation verification parameters corresponding to the two groups;
judging whether error data sent by the intelligent electric meter exist or not according to the aggregation verification parameters corresponding to the two groups;
if the intelligent electric meter sends the error data, judging whether the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending the error data is one or not;
if the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending error data is not one, dividing the intelligent electric meters with the intelligent electric meter sending error data into two groups, respectively calculating aggregation verification parameters corresponding to the two groups, and executing the step of judging that the intelligent electric meter sending error data exists according to the aggregation verification parameters corresponding to the two groups;
if the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one, taking the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters as the intelligent electric meters sending the error data, generating notification information and sending the notification information to the terminal;
and if no error data is sent by the intelligent electric meter, entering an ending step.
The further technical scheme is as follows: the creating and initializing system parameters to obtain an electric power private key and an intelligent electric meter private key comprises the following steps:
setting an elliptic curve to obtain a first parameter, selecting a point on the elliptic curve to obtain a second parameter, selecting two prime numbers to obtain a third parameter and a fourth parameter, and calculating the product of the third parameter and the fourth parameter to obtain a system parameter;
acquiring the total number of the intelligent electric meters, and selecting two random numbers to obtain a private key of the intelligent electric meter;
and calculating the electric power private key according to the intelligent electric meter private key and the system parameters.
The further technical scheme is as follows: the data packet is aggregated, and the data packet is processed by adopting an electric power private key and an intelligent electric meter private key to obtain decrypted data, including:
aggregating the data packets to obtain an aggregated ciphertext;
defining two assignment parameters, and calculating parameters for converting the aggregation ciphertext according to the two assignment parameters, the electric power private key and the intelligent electric meter private key to obtain conversion parameters;
and decrypting the aggregated ciphertext according to the conversion parameter and the second parameter to obtain decrypted data.
The further technical scheme is as follows: the generating of the electric bill according to the decryption data and the verifying of the electric bill to obtain a first verification result, and the sending of the electric bill to the smart electric meter for the smart electric meter to verify to obtain a second verification result include:
calculating the sum of all the decrypted data to obtain an electric bill;
and acquiring part of the charging verification parameters from the intelligent electric meter, wherein,
Figure BDA0002550651210000031
Mifor part of the charging verification parameter, k1,iAnd k2,iIs a private key of the smart meter, F1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, T is the total number of times, and j is a certain time period;
according to
Figure BDA0002550651210000032
Generating a charging verification parameter, wherein SiFor charging verification parameters, Pi,jIs a data packet;
judgment Si=Mi+G·βiIf it is true, where G is the second parameter, βiBilling for electricity charge;
if Si=Mi+G·βiIf yes, the first verification result is verification success;
sending the electric bill to the intelligent electric meter for the intelligent electric meter to judge Si=Mi+G·βiWhether or not it is true, when Si=Mi+G·βiIf yes, the second verification result is verification success, when S isi=Mi+G·βiIf not, the second verification result is verification failure.
The further technical scheme is as follows: the aggregation verification parameter comprises a parameter U1、U2、V1、V2Wherein, in the step (A),
Figure BDA0002550651210000033
Figure BDA0002550651210000034
k1,i、k2,irespectively are private keys of the intelligent electric meter; n is the total number of the intelligent electric meters; f1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), the parameter H represents a one-way hash function, Pi,jIs a data packet; m isi,jThe electricity consumption data related to the time period j are counted for the intelligent electric meter i; and i is the intelligent ammeter.
The further technical scheme is as follows: the step of judging whether error data sent by the intelligent electric meter exists or not according to the aggregation verification parameters corresponding to the two groups comprises the following steps:
dividing all the data packets into two groups according to the two groups of intelligent electric meters, and respectively calculating corresponding aggregation ciphertexts for the two groups of data packets to obtain the aggregation ciphertexts of the first group of data packets and the aggregation ciphertexts of the second group of data packets; wherein the content of the first and second substances,
Figure BDA0002550651210000041
A1aggregate ciphertext for a first set of packets, A2Is the aggregation ciphertext of the first group of data packets, i is the intelligent electric meter, N is the total number of the intelligent electric meters, Pi,jIs a corresponding group of data packets;
judging V according to the aggregation ciphertext of the first group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters1·G+U1=A1Whether the result is true or not;
if V1·G+U1=A1If the data packet is not true, the intelligent electric meter corresponding to the first group of data packets has error data sent by the intelligent electric meter;
if V1·G+U1=A1If the data packet is true, the intelligent electric meter corresponding to the first group of data packets does not have the problem that the intelligent electric meter sends wrong data;
judging V according to the aggregation ciphertext of the second group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters2·G+U2=A2Whether the result is true or not;
if V2·G+U2=A2If not, the second data packet corresponds toThe intelligent electric meter sends error data;
if V2·G+U2=A2If the data packet is true, the intelligent electric meter corresponding to the second group of data packets does not have the intelligent electric meter to send error data.
The further technical scheme is as follows: the electricity consumption data ciphertext adopts Pi,j=(mi,j·tj)G+k1,iF1,j+k2,iF2,jObtaining, wherein mi,jData of electricity consumption in relation to time period j, F, counted for a smart meter i1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, G is a second parameter, t isjThe electricity price of the intelligent electric meter in a certain time period.
The invention also provides a dynamic power grid charging device, which comprises:
the parameter setting unit is used for creating and initializing system parameters to obtain an electric power private key and an intelligent electric meter private key;
the data packet obtaining unit is used for obtaining an electricity consumption data ciphertext which is obtained from the intelligent electric meter and encrypted by using a private key of the intelligent electric meter so as to obtain a data packet;
the aggregation unit is used for aggregating the data packets and processing the data packets by adopting an electric power private key and an intelligent electric meter private key to obtain decrypted data;
the verification unit is used for generating an electric bill according to the decrypted data, verifying the electric bill to obtain a first verification result, and sending the electric bill to the intelligent electric meter for verification of the intelligent electric meter to obtain a second verification result;
the result judging unit is used for judging whether the first verification result and the second verification result are both successful in verification;
the intelligent electric meter comprises a dividing unit, a verification unit and a verification unit, wherein the dividing unit is used for dividing the intelligent electric meter into two groups and acquiring aggregation verification parameters corresponding to the two groups if the first verification result and the second verification result are both successful in verification;
the error judgment unit is used for judging whether error data sent by the intelligent electric meter exist or not according to the aggregation verification parameters corresponding to the two groups;
the quantity judging unit is used for judging whether the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one or not if the error data sent by the intelligent electric meters exist;
the resetting unit is used for dividing the intelligent electric meters with the error data sent by the intelligent electric meters into two groups if the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is not one, respectively calculating the aggregation verification parameters corresponding to the two groups, and executing the judgment of the existence of the error data sent by the intelligent electric meters according to the aggregation verification parameters corresponding to the two groups;
and the generating unit is used for taking the intelligent ammeter in the group corresponding to the intelligent ammeter sending error data as the intelligent ammeter sending the error data and generating notification information to be sent to the terminal if the number of the intelligent ammeters in the group corresponding to the intelligent ammeter sending error data is one.
The invention also provides computer equipment which comprises a memory and a processor, wherein the memory is stored with a computer program, and the processor realizes the method when executing the computer program.
The invention also provides a storage medium storing a computer program which, when executed by a processor, is operable to carry out the method as described above.
Compared with the prior art, the invention has the beneficial effects that: according to the method, the power private key and the intelligent electric meter private key are obtained by setting system parameters, the encrypted power consumption data cryptographs from the intelligent electric meter are collected and are decrypted after being aggregated, the power grid cost is dynamically calculated, the power bill is obtained, the authenticity of the power bill is verified by two parties in an interactive mode, the risk of data leakage is reduced during power grid charging, the privacy of a user is protected, when the intelligent electric meter sends error data, the intelligent electric meter sending the error data is determined in a one-time equation verification mode, and the specific position of a fault electric meter can be rapidly determined when the electric meter fails.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a dynamic power grid charging method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a dynamic power grid charging method according to an embodiment of the present invention;
fig. 3 is a sub-flow diagram of a dynamic power grid charging method according to an embodiment of the present invention;
fig. 4 is a sub-flow diagram of a dynamic power grid charging method according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of a dynamic power grid charging apparatus provided in an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic view of an application scenario of a dynamic power grid charging method according to an embodiment of the present invention. Fig. 2 is a schematic flowchart of a dynamic power grid charging method according to an embodiment of the present invention. The dynamic power grid charging method is applied to a server. The server performs data interaction with the terminal and the plurality of intelligent electric meters, performs data packet aggregation and decryption after acquiring data packets encrypted by the intelligent electric meters, calculates the power grid cost again, generates bills and sends the bills to the intelligent electric meters, verifies authenticity of the whole bills with the intelligent electric meters, detects and determines the intelligent electric meters which send errors in the process, and feeds back results to the terminal.
Fig. 2 is a flowchart illustrating a dynamic power grid charging method according to an embodiment of the present invention. As shown in fig. 2, the method includes the following steps S110 to S200.
And S110, creating and initializing system parameters to obtain a power private key and a smart meter private key.
In this embodiment, the power private key is a key used for encrypting data sent by a server; the private key of the smart meter is a key used for encrypting data transmitted by the smart meter, including power consumption data and the like. The created parameters need to be agreed upon by the server and the smart meter parties and applied in later interactions.
In an embodiment, referring to fig. 3, the step S110 may include steps S111 to S113.
S111, setting an elliptic curve to obtain a first parameter, selecting a point on the elliptic curve to obtain a second parameter, selecting two prime numbers to obtain a third parameter and a fourth parameter, and calculating the product of the third parameter and the fourth parameter to obtain a system parameter;
s112, acquiring the total number of the intelligent electric meter, and selecting two random numbers to obtain a private key of the intelligent electric meter;
and S113, calculating a power private key according to the smart meter private key and the system parameters.
The method comprises the steps of setting a first parameter psi as an elliptic curve, setting a second parameter G as a point on the elliptic curve psi, setting a third parameter p and a fourth parameter q as two arbitrary large prime numbers, calculating a system parameter N ═ pq, and disclosing the system parameter N, setting the parameter N as the total number of smart meters managed by a power company, and setting a parameter i ∈ [1, N]Representing any one of the intelligent electric meters, and randomly selecting a parameter ki,1And ki,2As the private key for meter i. The following parameter d is calculated1,d2As private key of the electric power company:
Figure BDA0002550651210000071
and S120, obtaining a power consumption data ciphertext which is obtained from the intelligent electric meter and is encrypted by the intelligent electric meter private key to obtain a data packet.
In this embodiment, the data packet refers to the electricity consumption data which comes from the smart meter and is encrypted by the smart meter.
Specifically, the electricity consumption data ciphertext adopts Pi,j=(mi,j·tj)G+k1,iF1,j+k2,iF2,jObtaining, wherein mi,jData of electricity consumption in relation to time period j, F, counted for a smart meter i1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, G is a second parameter, t isjIs a certain oneThe electricity price of the intelligent electric meter in the time period.
The electric meter periodically encrypts the electricity consumption of the user in the previous time period and then sends the encrypted electricity consumption to the server, wherein the assumed parameter T is the total number of the time periods contained in a settlement period of the electric power company, the assumed parameter j is any one of the time periods, and the assumed parameter m isi,jAnd (4) counting electricity consumption data related to the time period j for the intelligent electricity meter i. Two functions are defined:
F1,j=FΨ(j||1),F2,j=FΨ(j | |2), wherein the function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), the parameter H represents a one-way hash function.
Defining a parameter ti,jCalculating parameter P for electricity price of user i in time period j by using intelligent ammeteri,jAs a power consumption data ciphertext: pi,j=(mi,j·tj)G+k1,iF1,j+k2,iF2,jAnd cipher text P of power consumption datai,jAnd sending the data to a server.
The smart electric meter and the power company are directly interacted without depending on third-party equipment, and the risk of data leakage is reduced. The electric company cannot know the real-time electricity utilization condition of each intelligent electric meter, but can know the total real-time electricity utilization condition of all users, and the privacy of the users is protected.
And S130, aggregating the data packets, and processing the data packets by adopting the electric power private key and the intelligent electric meter private key to obtain decrypted data.
In this embodiment, the decrypted data refers to data obtained by decrypting the acquired data packet by the server. And (4) receiving the electricity consumption data ciphertext { P) sent by each intelligent electric meter in the time period ji,j}i∈[1,N]Then, the server carries out aggregation processing on the data packets, and then carries out decryption calculation.
In an embodiment, referring to fig. 4, the step S130 may include steps S131 to S133.
S131, aggregating the data packets to obtain an aggregated ciphertext.
In this embodiment, the aggregation ciphertext refers to the data formed by aggregating the data packets.
In particular, parameters are calculated
Figure BDA0002550651210000081
Figure BDA0002550651210000082
As an aggregate ciphertext.
S132, defining two assignment parameters, and calculating parameters for converting the aggregation ciphertext according to the two assignment parameters, the electric power private key and the intelligent electric meter private key to obtain conversion parameters.
In the present embodiment, the conversion parameter refers to a parameter for converting the aggregate ciphertext.
Two assignment parameters r are defined1,r2So that the equation r becomes r1+r2And F1=G·r1,F2=G·r2If yes, calculating the parameter C as the transformation aggregation ciphertext,
Figure BDA0002550651210000083
Figure BDA0002550651210000084
s133, decrypting the aggregated ciphertext according to the conversion parameter and the second parameter to obtain decrypted data.
In particular, utilize
Figure BDA0002550651210000085
The sum of the power consumption of all users in the time period j can be recovered. Where the function Φ (x, y) is defined as Φ (x, y) — x/y, and the parameter λ is defined as λ lcm (p +2, q + 2).
In the embodiment, floating electricity price charging can be performed for each different user, so that the intelligent electric meter is supported to calculate the electricity price in real time according to the peak-valley electricity price, different levels of electricity prices can be set for different users such as high-energy-consumption enterprises, business places, residents and the like, any electricity price floating at any time is supported, and stronger flexibility is provided; the security of the adopted encryption and decryption algorithm is based on the problem of discrete logarithm mathematic difficulty on an elliptic curve, and the encryption and decryption algorithm has higher security under the same key length, so that the security of data transmission is improved.
And S140, generating an electric bill according to the decrypted data, verifying the electric bill to obtain a first verification result, and sending the electric bill to the intelligent electric meter for verification of the intelligent electric meter to obtain a second verification result.
In this embodiment, the first verification result refers to a result obtained by verifying the authenticity of the electric bill by the server; the second verification result refers to a result obtained by verifying the authenticity of the electric bill by the intelligent electric meter. After a settlement period is finished, the server outputs the corresponding electric bill for each intelligent electric meter, the server sends the bill to the intelligent electric meters, bill verification is completed through interaction with the intelligent electric meters, and the bill of the user can be verified in an interactive mode.
In one embodiment, the step S140 may include steps S141 to S146.
And S141, calculating the sum of all the decrypted data to obtain the electric bill.
In particular, parameters are calculated
Figure BDA0002550651210000091
As an electricity bill for each smart meter.
S142, obtaining part of the billing verification parameters from the intelligent electric meter, wherein,
Figure BDA0002550651210000092
Figure BDA0002550651210000093
Mifor part of the charging verification parameter, k1,iAnd k2,iIs a private key of the smart meter, F1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), the parameter H represents a one-way hash function, and T isThe total time, j is a certain time period;
s143, according to
Figure BDA0002550651210000094
Generating a charging verification parameter, wherein SiFor charging verification parameters, Pi,jIs a data packet;
s144, judgment Si=Mi+G·βiIf it is true, where G is the second parameter, βiBilling for electricity charge;
s145, if Si=Mi+G·βiIf yes, the first verification result is verification success;
s146, sending the electric bill to the intelligent electric meter so that the intelligent electric meter can judge Si=Mi+G·βiWhether or not it is true, when Si=Mi+G·βiIf yes, the second verification result is verification success, when S isi=Mi+G·βiIf not, the second verification result is verification failure.
And if the verification equation of any party is not established, the electric bill is invalid so as to play a role of supervision on the two parties.
S150, judging whether the first verification result and the second verification result are both successful in verification;
if any one of the first verification result and the second verification result is verification failure, entering an end step;
and S160, if the first verification result and the second verification result are both successful in verification, dividing the intelligent electric meter into two groups, and acquiring the aggregation verification parameters corresponding to the two groups.
In this embodiment, the aggregation verification parameter is a parameter for verifying whether the smart meter transmits error data.
Specifically, the aggregation verification parameter includes a parameter U1、U2、V1、V2Wherein, in the step (A),
Figure BDA0002550651210000101
Figure BDA0002550651210000102
Figure BDA0002550651210000103
k1,i、k2,irespectively are private keys of the intelligent electric meter; n is the total number of the intelligent electric meters; f1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), the parameter H represents a one-way hash function, Pi,jIs a data packet; m isi,jThe electricity consumption data related to the time period j are counted for the intelligent electric meter i; and i is the intelligent ammeter.
And S170, judging whether error data sent by the intelligent electric meter exist or not according to the aggregation verification parameters corresponding to the two groups.
Specifically, it may be determined whether there is data in which the smart meter transmits an error by comparing the total amount of power consumption with the sum of power consumption amounts of all users.
In one embodiment, the step S170 may include steps S171 to S177.
S171, dividing all the data packets into two groups according to the two groups of intelligent electric meters, and calculating corresponding aggregation ciphertexts for the two groups of data packets respectively to obtain the aggregation ciphertexts of the first group of data packets and the aggregation ciphertexts of the second group of data packets; wherein the content of the first and second substances,
Figure BDA0002550651210000104
A1aggregate ciphertext for a first set of packets, A2Is the aggregation ciphertext of the first group of data packets, i is the intelligent electric meter, N is the total number of the intelligent electric meters, Pi,jIs a corresponding group of data packets;
s172, judging V according to the aggregation ciphertext of the first group of data packets and the aggregation verification parameter of the group where the corresponding intelligent electric meter is located1·G+U1=A1Whether the result is true or not;
s173, if V1·G+U1=A1If not, the intelligent electric meter corresponding to the first group of data packets has error data sent by the intelligent electric meter, and step S175 is executed;
s174, if V1·G+U1=A1If yes, the smart meter corresponding to the first group of data packets does not have the smart meter sending error data, and step S175 is executed;
s175, judging V according to the aggregation ciphertext of the second group of data packets and the aggregation verification parameter of the group where the corresponding intelligent electric meter is located2·G+U2=A2Whether the result is true or not;
s176, if V2·G+U2=A2If the data is not true, the intelligent electric meter corresponding to the second data packet sends error data;
s177, if V2·G+U2=A2If the data packet is true, the intelligent electric meter corresponding to the second group of data packets does not have the intelligent electric meter to send error data.
When the server receives the total data of the power consumption, the server can calculate and verify whether the data is wrong or not through a one-time equation, and if the data is wrong, the server can calculate and verify whether the data is wrong or not through log2nThe electric meter sending error data is searched out through the quadratic calculation, when the electric meter fails, the specific position of the failed electric meter can be quickly determined, and the practicability is high.
S180, if the intelligent electric meter sends the error data, judging whether the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending the error data is one;
s190, if the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending the error data is not one, dividing the intelligent electric meters with the intelligent electric meter sending the error data into two groups, respectively calculating aggregation verification parameters corresponding to the two groups, and executing the step S170;
s200, if the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one, taking the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters as the intelligent electric meters sending the error data, generating notification information and sending the notification information to the terminal;
and continuously dividing the group where the intelligent electric meter with the non-established verification equation is located into two sub-groups until the intelligent electric meter with the non-established verification is found out, wherein the intelligent electric meter is the intelligent electric meter for sending abnormal data.
And if no error data is sent by the intelligent electric meter, entering an ending step.
According to the dynamic power grid charging method, the power private key and the smart meter private key are obtained by setting system parameters, the encrypted power consumption data cryptographs from the smart meter are collected and are aggregated and then decrypted, the power grid cost is dynamically calculated, the power bill is obtained, the authenticity of the power bill is verified in a mutual mode for two parties, the risk of data leakage is reduced during power grid charging, the privacy of a user is protected, when the smart meter sends error data, the smart meter sending the error data is determined in a one-time equation verification mode, and when the smart meter fails, the specific position of the failed meter can be rapidly determined.
Fig. 5 is a schematic block diagram of a dynamic power grid charging apparatus 300 according to an embodiment of the present invention. As shown in fig. 5, the present invention also provides a dynamic power grid charging apparatus 300 corresponding to the above dynamic power grid charging method. The dynamic grid charging apparatus 300 includes a unit for performing the above dynamic grid charging method, and the apparatus may be configured in a server. Specifically, referring to fig. 5, the dynamic grid charging apparatus 300 includes a parameter setting unit 301, a packet obtaining unit 302, an aggregation unit 303, a verification unit 304, a result judgment unit 305, a dividing unit 306, an error judgment unit 307, a quantity judgment unit 308, a resetting unit 309, and a generation unit 310.
The parameter setting unit 301 is configured to create and initialize system parameters to obtain an electric power private key and an intelligent electric meter private key; the data packet obtaining unit 302 is configured to obtain an electricity consumption data ciphertext which is obtained from the smart meter and encrypted by using a smart meter private key, so as to obtain a data packet; the aggregation unit 303 is configured to aggregate the data packets, and perform data packet processing by using the electric power private key and the smart meter private key to obtain decrypted data; the verification unit 304 is configured to generate an electric bill according to the decrypted data, verify the electric bill to obtain a first verification result, and send the electric bill to the smart meter for verification by the smart meter to obtain a second verification result; a result determination unit 305, configured to determine whether both the first verification result and the second verification result are successful; the dividing unit 306 is configured to divide the smart meter into two groups and obtain aggregation verification parameters corresponding to the two groups if the first verification result and the second verification result are both successful in verification; an error judgment unit 307, configured to judge whether there is error data sent by the smart meter according to the aggregation verification parameters corresponding to the two groups; the quantity judging unit 308 is configured to, if there is error data sent by the smart electric meters, judge whether the number of the smart electric meters in the group corresponding to the error data sent by the smart electric meters is one; a resetting unit 309, configured to, if the number of the smart meters in the group corresponding to the smart meter sending error data is not one, divide the smart meters having the smart meter sending error data into two groups, respectively calculate aggregation verification parameters corresponding to the two groups, and execute the determining that there is the smart meter sending error data according to the aggregation verification parameters corresponding to the two groups; and a generating unit 310, configured to, if there is one in-group smart meter corresponding to the smart meter sending error data, use the in-group smart meter corresponding to the smart meter sending error data as the smart meter sending error data, and generate notification information to send to the terminal.
In an embodiment, the parameter setting unit 301 includes a setting subunit, an electric meter private key obtaining subunit, and an electric power private key obtaining subunit.
A setting subunit, configured to set an elliptic curve to obtain a first parameter, select a point on the elliptic curve to obtain a second parameter, select two prime numbers to obtain a third parameter and a fourth parameter, and calculate a product of the third parameter and the fourth parameter to obtain a system parameter; the electric meter private key obtaining subunit is used for obtaining the total number of the intelligent electric meters and selecting two random numbers to obtain the intelligent electric meter private key; and the electric power private key obtaining subunit is used for calculating the electric power private key according to the intelligent electric meter private key and the system parameters.
In an embodiment, the aggregation unit 303 includes an aggregation ciphertext obtaining subunit, a transformation parameter obtaining subunit, and a decryption subunit.
The aggregation ciphertext obtaining subunit is used for aggregating the data packets to obtain an aggregation ciphertext; the conversion parameter obtaining subunit is used for defining two assignment parameters and calculating parameters for converting the aggregation ciphertext according to the two assignment parameters, the electric power private key and the intelligent electric meter private key so as to obtain conversion parameters; and the decryption subunit is used for decrypting the aggregated ciphertext according to the conversion parameter and the second parameter to obtain decrypted data.
In one embodiment, the verification unit 304 includes a bill generation subunit, a verification parameter obtaining subunit, a charging verification subunit, a verification judgment subunit, and a bill sending subunit.
The bill generation subunit is used for calculating the sum of all the decrypted data to obtain an electric bill; a verification parameter obtaining subunit, configured to obtain a part of the charging verification parameters from the smart meter, wherein,
Figure BDA0002550651210000131
Figure BDA0002550651210000132
Mifor part of the charging verification parameter, k1,iAnd k2,iIs a private key of the smart meter, F1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, T is the total number of times, j is a certain time period, and a charging verification subunit configured to verify the charging according to
Figure BDA0002550651210000133
Generating a charging verification parameter, wherein SiFor charging verification parameters, Pi,jIs a data packet; a verification judgment subunit for judging Si=Mi+G·βiWhether or not, wherein G is the secondTwo parameters, βiBilling for electricity charge; if Si=Mi+G·βiIf yes, the first verification result is verification success; the bill sending subunit is used for sending the electric bill to the intelligent electric meter so that the intelligent electric meter can judge Si=Mi+G·βiWhether or not it is true, when Si=Mi+G·βiIf yes, the second verification result is verification success, when S isi=Mi+G·βiIf not, the second verification result is verification failure.
In one embodiment, the error determination unit 307 includes an electric meter sub-unit, a first determination sub-unit, and a second determination sub-unit.
The electric meter dividing subunit is used for dividing all the data packets into two groups according to the two groups of intelligent electric meters, and calculating corresponding aggregation ciphertexts for the two groups of data packets respectively to obtain the aggregation ciphertexts of the first group of data packets and the aggregation ciphertexts of the second group of data packets; wherein the content of the first and second substances,
Figure BDA0002550651210000134
A1aggregate ciphertext for a first set of packets, A2Is the aggregation ciphertext of the first group of data packets, i is the intelligent electric meter, N is the total number of the intelligent electric meters, Pi,jIs a corresponding group of data packets; a first judging subunit, configured to judge V according to the aggregation ciphertext of the first group of data packets and the aggregation verification parameter of the group in which the corresponding smart meter is located1·G+U1=A1Whether the result is true or not; if V1·G+U1=A1If the data packet is not true, the intelligent electric meter corresponding to the first group of data packets has error data sent by the intelligent electric meter; if V1·G+U1=A1If the data packet is true, the intelligent electric meter corresponding to the first group of data packets does not have the problem that the intelligent electric meter sends wrong data; a second judging subunit, configured to judge V according to the aggregation ciphertext of the second group of data packets and the aggregation verification parameter of the group in which the corresponding smart meter is located2·G+U2=A2Whether the result is true or not; if V2·G+U2=A2If the data packet is not true, the intelligent electric meter corresponding to the second data packet is stored in the memorySending error data at the intelligent electric meter; if V2·G+U2=A2If the data packet is true, the intelligent electric meter corresponding to the second group of data packets does not have the intelligent electric meter to send error data.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation processes of the dynamic grid charging apparatus 300 and each unit may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and brevity of description, no further description is provided herein.
The dynamic grid charging apparatus 300 may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 6.
Referring to fig. 6, fig. 6 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 6, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032 include program instructions that, when executed, cause the processor 502 to perform a dynamic grid charging method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 may be enabled to perform a dynamic grid charging method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 6 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
creating and initializing system parameters to obtain an electric power private key and an intelligent electric meter private key; acquiring a power consumption data ciphertext which is obtained from an intelligent electric meter and encrypted by using a private key of the intelligent electric meter to obtain a data packet; aggregating the data packets, and processing the data packets by adopting an electric power private key and an intelligent electric meter private key to obtain decrypted data; generating an electric charge bill according to the decrypted data, verifying the electric charge bill to obtain a first verification result, and sending the electric charge bill to the intelligent electric meter for the intelligent electric meter to verify to obtain a second verification result; judging whether the first verification result and the second verification result are both successful in verification; if the first verification result and the second verification result are both successful in verification, dividing the intelligent electric meter into two groups, and acquiring aggregation verification parameters corresponding to the two groups; judging whether error data sent by the intelligent electric meter exist or not according to the aggregation verification parameters corresponding to the two groups; if the intelligent electric meter sends the error data, judging whether the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending the error data is one or not; if the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending error data is not one, dividing the intelligent electric meters with the intelligent electric meter sending error data into two groups, respectively calculating aggregation verification parameters corresponding to the two groups, and executing the step of judging that the intelligent electric meter sending error data exists according to the aggregation verification parameters corresponding to the two groups; if the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one, taking the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters as the intelligent electric meters sending the error data, generating notification information and sending the notification information to the terminal; and if no error data is sent by the intelligent electric meter, entering an ending step.
Wherein the aggregation verification parameter comprises a parameter U1、U2、V1、V2Wherein, in the step (A),
Figure BDA0002550651210000151
Figure BDA0002550651210000152
Figure BDA0002550651210000153
k1,i、k2,irespectively are private keys of the intelligent electric meter; n is the total number of the intelligent electric meters; f1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), the parameter H represents a one-way hash function, Pi,jIs a data packet; m isi,jThe electricity consumption data related to the time period j are counted for the intelligent electric meter i; and i is the intelligent ammeter.
The electricity consumption data ciphertext adopts Pi,j=(mi,j·tj)G+k1,iF1,j+k2,iF2,jObtaining, wherein mi,jData of electricity consumption in relation to time period j, F, counted for a smart meter i1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, G is a second parameter, t isjThe electricity price of the intelligent electric meter in a certain time period.
In an embodiment, when the processor 502 implements the steps of creating and initializing system parameters to obtain the power private key and the smart meter private key, the following steps are specifically implemented:
setting an elliptic curve to obtain a first parameter, selecting a point on the elliptic curve to obtain a second parameter, selecting two prime numbers to obtain a third parameter and a fourth parameter, and calculating the product of the third parameter and the fourth parameter to obtain a system parameter; acquiring the total number of the intelligent electric meters, and selecting two random numbers to obtain a private key of the intelligent electric meter; and calculating the electric power private key according to the intelligent electric meter private key and the system parameters.
In an embodiment, when the processor 502 implements the aggregating of the data packets and performs data packet processing by using the electric power private key and the smart meter private key to obtain decrypted data, the following steps are specifically implemented:
aggregating the data packets to obtain an aggregated ciphertext; defining two assignment parameters, and calculating parameters for converting the aggregation ciphertext according to the two assignment parameters, the electric power private key and the intelligent electric meter private key to obtain conversion parameters; and decrypting the aggregated ciphertext according to the conversion parameter and the second parameter to obtain decrypted data.
In an embodiment, when the processor 502 performs the steps of generating the electricity bill according to the decrypted data, verifying the electricity bill to obtain the first verification result, and sending the electricity bill to the smart meter for verification by the smart meter to obtain the second verification result, the following steps are specifically performed:
calculating the sum of all the decrypted data to obtain an electric bill; and acquiring part of the charging verification parameters from the intelligent electric meter, wherein,
Figure BDA0002550651210000161
Mifor part of the charging verification parameter, k1,iAnd k2,iIs a private key of the smart meter, F1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, T is the total number of times, j is a certain time period, according to
Figure BDA0002550651210000162
Generating a charging verification parameter, wherein SiFor charging verification parameters, Pi,jIs a data packet; judgment Si=Mi+G·βiIf it is true, where G is the second parameter, βiBilling for electricity charge; if Si=Mi+G·βiIf yes, the first verification result is verification success; will generate electricitySending the bill to the intelligent electric meter for the intelligent electric meter to judge Si=Mi+G·βiWhether or not it is true, when Si=Mi+G·βiIf yes, the second verification result is verification success, when S isi=Mi+G·βiIf not, the second verification result is verification failure.
In an embodiment, when the step of determining whether there is error data sent by the smart meter according to the aggregation verification parameters corresponding to the two groups is implemented by the processor 502, the following steps are specifically implemented:
dividing all the data packets into two groups according to the two groups of intelligent electric meters, and respectively calculating corresponding aggregation ciphertexts for the two groups of data packets to obtain the aggregation ciphertexts of the first group of data packets and the aggregation ciphertexts of the second group of data packets; wherein the content of the first and second substances,
Figure BDA0002550651210000163
A1aggregate ciphertext for a first set of packets, A2Is the aggregation ciphertext of the first group of data packets, i is the intelligent electric meter, N is the total number of the intelligent electric meters, Pi,jIs a corresponding group of data packets; judging V according to the aggregation ciphertext of the first group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters1·G+U1=A1Whether the result is true or not; if V1·G+U1=A1If the data packet is not true, the intelligent electric meter corresponding to the first group of data packets has error data sent by the intelligent electric meter; if V1·G+U1=A1If the data packet is true, the intelligent electric meter corresponding to the first group of data packets does not have the problem that the intelligent electric meter sends wrong data; judging V according to the aggregation ciphertext of the second group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters2·G+U2=A2Whether the result is true or not; if V2·G+U2=A2If the data is not true, the intelligent electric meter corresponding to the second data packet sends error data; if V2·G+U2=A2If the data packet is true, the intelligent electric meter corresponding to the second group of data packets does not have the intelligent electric meter to send error data.
It should be understood that, in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program, when executed by a processor, causes the processor to perform the steps of:
creating and initializing system parameters to obtain an electric power private key and an intelligent electric meter private key; acquiring a power consumption data ciphertext which is obtained from an intelligent electric meter and encrypted by using a private key of the intelligent electric meter to obtain a data packet; aggregating the data packets, and processing the data packets by adopting an electric power private key and an intelligent electric meter private key to obtain decrypted data; generating an electric charge bill according to the decrypted data, verifying the electric charge bill to obtain a first verification result, and sending the electric charge bill to the intelligent electric meter for the intelligent electric meter to verify to obtain a second verification result; judging whether the first verification result and the second verification result are both successful in verification; if the first verification result and the second verification result are both successful in verification, dividing the intelligent electric meter into two groups, and acquiring aggregation verification parameters corresponding to the two groups; judging whether error data sent by the intelligent electric meter exist or not according to the aggregation verification parameters corresponding to the two groups; if the intelligent electric meter sends the error data, judging whether the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending the error data is one or not; if the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending error data is not one, dividing the intelligent electric meters with the intelligent electric meter sending error data into two groups, respectively calculating aggregation verification parameters corresponding to the two groups, and executing the step of judging that the intelligent electric meter sending error data exists according to the aggregation verification parameters corresponding to the two groups; if the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one, taking the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters as the intelligent electric meters sending the error data, generating notification information and sending the notification information to the terminal; and if no error data is sent by the intelligent electric meter, entering an ending step.
Wherein the aggregation verification parameter comprises a parameter U1、U2、V1、V2Wherein, in the step (A),
Figure BDA0002550651210000181
Figure BDA0002550651210000182
Figure BDA0002550651210000183
k1,i、k2,irespectively are private keys of the intelligent electric meter; n is the total number of the intelligent electric meters; f1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), the parameter H represents a one-way hash function, Pi,jIs a data packet; m isi,jThe electricity consumption data related to the time period j are counted for the intelligent electric meter i; and i is the intelligent ammeter.
The electricity consumption data ciphertext adopts Pi,j=(mi,j·tj)G+k1,iF1,j+k2,iF2,jObtaining, wherein,mi,jdata of electricity consumption in relation to time period j, F, counted for a smart meter i1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, G is a second parameter, t isjThe electricity price of the intelligent electric meter in a certain time period.
In an embodiment, when the processor executes the computer program to implement the steps of creating and initializing system parameters to obtain the power private key and the smart meter private key, the following steps are specifically implemented:
setting an elliptic curve to obtain a first parameter, selecting a point on the elliptic curve to obtain a second parameter, selecting two prime numbers to obtain a third parameter and a fourth parameter, and calculating the product of the third parameter and the fourth parameter to obtain a system parameter; acquiring the total number of the intelligent electric meters, and selecting two random numbers to obtain a private key of the intelligent electric meter; and calculating the electric power private key according to the intelligent electric meter private key and the system parameters.
In an embodiment, when the processor executes the computer program to aggregate the data packets and performs data packet processing by using the power private key and the smart meter private key to obtain decrypted data, the following steps are specifically implemented:
aggregating the data packets to obtain an aggregated ciphertext; defining two assignment parameters, and calculating parameters for converting the aggregation ciphertext according to the two assignment parameters, the electric power private key and the intelligent electric meter private key to obtain conversion parameters; and decrypting the aggregated ciphertext according to the conversion parameter and the second parameter to obtain decrypted data.
In an embodiment, when the processor executes the computer program to generate the electricity bill according to the decrypted data, verify the electricity bill to obtain a first verification result, and send the electricity bill to the smart meter for verification by the smart meter to obtain a second verification result, the following steps are specifically implemented:
calculate allDecrypting the sum of the data to obtain an electric bill; and acquiring part of the charging verification parameters from the intelligent electric meter, wherein,
Figure BDA0002550651210000191
Mifor part of the charging verification parameter, k1,iAnd k2,iIs a private key of the smart meter, F1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, T is the total number of times, j is a certain time period, according to
Figure BDA0002550651210000192
Generating a charging verification parameter, wherein SiFor charging verification parameters, Pi,jIs a data packet; judgment Si=Mi+G·βiIf it is true, where G is the second parameter, βiBilling for electricity charge; if Si=Mi+G·βiIf yes, the first verification result is verification success; sending the electric bill to the intelligent electric meter for the intelligent electric meter to judge Si=Mi+G·βiWhether or not it is true, when Si=Mi+G·βiIf yes, the second verification result is verification success, when S isi=Mi+G·βiIf not, the second verification result is verification failure.
In an embodiment, when the processor executes the computer program to determine whether there is an error data transmission step of the smart meter according to the aggregation verification parameters corresponding to the two groups, the following steps are specifically implemented:
dividing all the data packets into two groups according to the two groups of intelligent electric meters, and respectively calculating corresponding aggregation ciphertexts for the two groups of data packets to obtain the aggregation ciphertexts of the first group of data packets and the aggregation ciphertexts of the second group of data packets; wherein the content of the first and second substances,
Figure BDA0002550651210000193
A1aggregating encryption for a first set of packetsText, A2Is the aggregation ciphertext of the first group of data packets, i is the intelligent electric meter, N is the total number of the intelligent electric meters, Pi,jIs a corresponding group of data packets; judging V according to the aggregation ciphertext of the first group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters1·G+U1=A1Whether the result is true or not; if V1·G+U1=A1If the data packet is not true, the intelligent electric meter corresponding to the first group of data packets has error data sent by the intelligent electric meter; if V1·G+U1=A1If the data packet is true, the intelligent electric meter corresponding to the first group of data packets does not have the problem that the intelligent electric meter sends wrong data; judging V according to the aggregation ciphertext of the second group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters2·G+U2=A2Whether the result is true or not; if V2·G+U2=A2If the data is not true, the intelligent electric meter corresponding to the second data packet sends error data; if V2·G+U2=A2If the data packet is true, the intelligent electric meter corresponding to the second group of data packets does not have the intelligent electric meter to send error data.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. The dynamic power grid charging method is characterized by comprising the following steps:
creating and initializing system parameters to obtain an electric power private key and an intelligent electric meter private key;
acquiring a power consumption data ciphertext which is obtained from an intelligent electric meter and encrypted by using a private key of the intelligent electric meter to obtain a data packet;
aggregating the data packets, and processing the data packets by adopting an electric power private key and an intelligent electric meter private key to obtain decrypted data;
generating an electric charge bill according to the decrypted data, verifying the electric charge bill to obtain a first verification result, and sending the electric charge bill to the intelligent electric meter for the intelligent electric meter to verify to obtain a second verification result;
judging whether the first verification result and the second verification result are both successful in verification;
if the first verification result and the second verification result are both successful in verification, dividing the intelligent electric meter into two groups, and acquiring aggregation verification parameters corresponding to the two groups;
judging whether error data sent by the intelligent electric meter exist or not according to the aggregation verification parameters corresponding to the two groups;
if the intelligent electric meter sends the error data, judging whether the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending the error data is one or not;
if the number of the intelligent electric meters in the group corresponding to the intelligent electric meter sending error data is not one, dividing the intelligent electric meters with the intelligent electric meter sending error data into two groups, respectively calculating aggregation verification parameters corresponding to the two groups, and executing the step of judging that the intelligent electric meter sending error data exists according to the aggregation verification parameters corresponding to the two groups;
if the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one, taking the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters as the intelligent electric meters sending the error data, generating notification information and sending the notification information to the terminal;
and if no error data is sent by the intelligent electric meter, entering an ending step.
2. The dynamic power grid billing method of claim 1, wherein the creating and initializing system parameters to obtain the private power key and the private smart meter key comprises:
setting an elliptic curve to obtain a first parameter, selecting a point on the elliptic curve to obtain a second parameter, selecting two prime numbers to obtain a third parameter and a fourth parameter, and calculating the product of the third parameter and the fourth parameter to obtain a system parameter;
acquiring the total number of the intelligent electric meters, and selecting two random numbers to obtain a private key of the intelligent electric meter;
and calculating the electric power private key according to the intelligent electric meter private key and the system parameters.
3. The dynamic power grid billing method of claim 2, wherein the aggregating the data packets and performing data packet processing using the power private key and the smart meter private key to obtain decrypted data comprises:
aggregating the data packets to obtain an aggregated ciphertext;
defining two assignment parameters, and calculating parameters for converting the aggregation ciphertext according to the two assignment parameters, the electric power private key and the intelligent electric meter private key to obtain conversion parameters;
and decrypting the aggregated ciphertext according to the conversion parameter and the second parameter to obtain decrypted data.
4. The dynamic power grid billing method of claim 3, wherein the generating and verifying the electricity bill according to the decrypted data to obtain a first verification result, and sending the electricity bill to the smart meter for verification by the smart meter to obtain a second verification result comprises:
calculating the sum of all the decrypted data to obtain an electric bill;
and acquiring part of the charging verification parameters from the intelligent electric meter, wherein,
Figure FDA0002550651200000021
Mifor part of the charging verification parameter, k1,iAnd k2,iIs a private key of the smart meter, F1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, T is the total number of times, and j is a certain time period;
according to
Figure FDA0002550651200000022
Generating a charging verification parameter, wherein SiFor charging verification parameters, Pi,jIs a data packet;
judgment Si=Mi+G·βiIf it is true, where G is the second parameter, βiBilling for electricity charge;
if Si=Mi+G·βiIf yes, the first verification result is verification success;
sending the electric bill to the intelligent electric meter for the intelligent electric meter to judge Si=Mi+G·βiWhether or not it is true, when Si=Mi+G·βiIf yes, the second verification result is verification success, when S isi=Mi+G·βiIf not, the second verification result is verification failure.
5. The dynamic power grid charging method of claim 1, wherein the aggregated validation parameter comprises a parameter U1、U2、V1、V2Wherein, in the step (A),
Figure FDA0002550651200000023
Figure FDA0002550651200000031
k1,i、k2,irespectively are private keys of the intelligent electric meter; n is the total number of the intelligent electric meters; f1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), ginsengThe number H represents a one-way hash function; pi,jIs a data packet; m isi,jThe electricity consumption data related to the time period j are counted for the intelligent electric meter i; and i is the intelligent ammeter.
6. The dynamic power grid charging method according to claim 5, wherein the determining whether there is error data sent by the smart meter according to the aggregated verification parameters corresponding to the two groups comprises:
dividing all the data packets into two groups according to the two groups of intelligent electric meters, and respectively calculating corresponding aggregation ciphertexts for the two groups of data packets to obtain the aggregation ciphertexts of the first group of data packets and the aggregation ciphertexts of the second group of data packets; wherein the content of the first and second substances,
Figure FDA0002550651200000032
A1aggregate ciphertext for a first set of packets, A2Is the aggregation ciphertext of the first group of data packets, i is the intelligent electric meter, N is the total number of the intelligent electric meters, Pi,jIs a corresponding group of data packets;
judging V according to the aggregation ciphertext of the first group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters1·G+U1=A1Whether the result is true or not;
if V1·G+U1=A1If the data packet is not true, the intelligent electric meter corresponding to the first group of data packets has error data sent by the intelligent electric meter;
if V1·G+U1=A1If the data packet is true, the intelligent electric meter corresponding to the first group of data packets does not have the problem that the intelligent electric meter sends wrong data;
judging V according to the aggregation ciphertext of the second group of data packets and the corresponding aggregation verification parameter of the group of the intelligent electric meters2·G+U2=A2Whether the result is true or not;
if V2·G+U2=A2If the data is not true, the intelligent electric meter corresponding to the second data packet sends error data;
if V2·G+U2=A2If it is true, thenAnd the intelligent electric meters corresponding to the two groups of data packets do not have the problem that the intelligent electric meters send error data.
7. The dynamic power grid billing method of claim 2, wherein the power consumption data cryptograph employs Pi,j=(mi,j·tj)G+k1,iF1,j+k2,iF2,jObtaining, wherein mi,jData of electricity consumption in relation to time period j, F, counted for a smart meter i1,j=FΨ(j||1),F2,j=FΨ(j | |2), function FΨ(a) (min ({ b | | b ≧ H (a) ∩ (b, y) ∈ Ψ }), y), where the parameter H represents a one-way hash function, G is a second parameter, t isjThe electricity price of the intelligent electric meter in a certain time period.
8. Dynamic electric wire netting charging device, its characterized in that includes:
the parameter setting unit is used for creating and initializing system parameters to obtain an electric power private key and an intelligent electric meter private key;
the data packet obtaining unit is used for obtaining an electricity consumption data ciphertext which is obtained from the intelligent electric meter and encrypted by using a private key of the intelligent electric meter so as to obtain a data packet;
the aggregation unit is used for aggregating the data packets and processing the data packets by adopting an electric power private key and an intelligent electric meter private key to obtain decrypted data;
the verification unit is used for generating an electric bill according to the decrypted data, verifying the electric bill to obtain a first verification result, and sending the electric bill to the intelligent electric meter for verification of the intelligent electric meter to obtain a second verification result;
the result judging unit is used for judging whether the first verification result and the second verification result are both successful in verification;
the intelligent electric meter comprises a dividing unit, a verification unit and a verification unit, wherein the dividing unit is used for dividing the intelligent electric meter into two groups and acquiring aggregation verification parameters corresponding to the two groups if the first verification result and the second verification result are both successful in verification;
the error judgment unit is used for judging whether error data sent by the intelligent electric meter exist or not according to the aggregation verification parameters corresponding to the two groups;
the quantity judging unit is used for judging whether the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is one or not if the error data sent by the intelligent electric meters exist;
the resetting unit is used for dividing the intelligent electric meters with the error data sent by the intelligent electric meters into two groups if the number of the intelligent electric meters in the group corresponding to the error data sent by the intelligent electric meters is not one, respectively calculating the aggregation verification parameters corresponding to the two groups, and executing the judgment of the existence of the error data sent by the intelligent electric meters according to the aggregation verification parameters corresponding to the two groups;
and the generating unit is used for taking the intelligent ammeter in the group corresponding to the intelligent ammeter sending error data as the intelligent ammeter sending the error data and generating notification information to be sent to the terminal if the number of the intelligent ammeters in the group corresponding to the intelligent ammeter sending error data is one.
9. A computer device, characterized in that the computer device comprises a memory, on which a computer program is stored, and a processor, which when executing the computer program implements the method according to any of claims 1 to 7.
10. A storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
CN202010574976.5A 2020-06-22 2020-06-22 Dynamic power grid charging method and device, computer equipment and storage medium Active CN111768188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010574976.5A CN111768188B (en) 2020-06-22 2020-06-22 Dynamic power grid charging method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010574976.5A CN111768188B (en) 2020-06-22 2020-06-22 Dynamic power grid charging method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111768188A true CN111768188A (en) 2020-10-13
CN111768188B CN111768188B (en) 2022-11-18

Family

ID=72721510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010574976.5A Active CN111768188B (en) 2020-06-22 2020-06-22 Dynamic power grid charging method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111768188B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105096134A (en) * 2014-03-28 2015-11-25 恩塞拉多斯Ip控股有限责任公司 Security scheme for authenticating digital entities and aggregate object origins
CN107707360A (en) * 2017-11-10 2018-02-16 西安电子科技大学 Isomerization polymerization label decryption method under environment of internet of things
CN110110537A (en) * 2019-05-08 2019-08-09 西安电子科技大学 The polymerization of multidimensional data encryption and decryption in smart grid

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105096134A (en) * 2014-03-28 2015-11-25 恩塞拉多斯Ip控股有限责任公司 Security scheme for authenticating digital entities and aggregate object origins
CN107707360A (en) * 2017-11-10 2018-02-16 西安电子科技大学 Isomerization polymerization label decryption method under environment of internet of things
CN110110537A (en) * 2019-05-08 2019-08-09 西安电子科技大学 The polymerization of multidimensional data encryption and decryption in smart grid

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王彩芬等: "基于WSN的全同态数据加密聚合方案", 《计算机工程》 *

Also Published As

Publication number Publication date
CN111768188B (en) 2022-11-18

Similar Documents

Publication Publication Date Title
Xu et al. Verifynet: Secure and verifiable federated learning
CN111259070B (en) Method and related device for storing and acquiring service data
CN110337665B (en) System and method for information protection
US8667292B2 (en) Privacy-preserving metering with low overhead
Rial et al. Privacy-preserving smart metering
CN110730963B (en) System and method for information protection
CN110795767B (en) Electric power transaction method, device and system and trusted cloud platform
JP2020502856A (en) System and method for information protection
JP2018514850A (en) Energy resource network
CN104468476B (en) Method and apparatus without certificate multi-proxy signature
CN111989891A (en) Data processing method, related device and block chain system
Borges et al. EPPP4SMS: efficient privacy-preserving protocol for smart metering systems and its simulation using real-world data
CN112288434B (en) Privacy transaction method, device, zero knowledge proof system and privacy transaction architecture model
CA2976037A1 (en) Verifying electronic transactions
US11133936B1 (en) Methods and systems for introducing self-contained intent functionality into decentralized computer networks
CN115114658B (en) Verifiable data transaction method, device, equipment and medium based on blockchain
WO2020160391A1 (en) An efficient, environmental and consumer friendly consensus method for cryptographic transactions
US20220052921A1 (en) Methods and systems for introducing self-contained intent functionality into decentralized computer networks
CN114358766A (en) Method, equipment and blockchain system for trading green electric certificates
CN114358969A (en) Green power confirmation method, green power confirmation equipment and computer readable storage medium
CN115242553A (en) Data exchange method and system supporting secure multi-party computation
CN111786978B (en) Electric power data aggregation acquisition method and device, computer equipment and storage medium
Wang et al. Privacy-preserving energy storage sharing with blockchain and secure multi-party computation
CN111768188B (en) Dynamic power grid charging method and device, computer equipment and storage medium
CN115580484B (en) Safe joint calculation method and system applicable to energy consumption data and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant