A method and device for encrypting power quality data

By using historical data from a preset time period as the key for power quality data encryption and adjusting the key's validity period using a decreasing time window, the problem of low security in existing power quality data encryption technologies is solved. This achieves dynamic, non-periodic encryption of data, improving data security and reliability.

CN116170193BActive Publication Date: 2025-01-10GUANGDONG POWER GRID CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310085854.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-18
Publication Date
2025-01-10
Estimated Expiration
2043-01-18

AI Technical Summary

Technical Problem

Existing methods for encrypting power quality data have low security, and once the key is cracked, all data is compromised, making the data susceptible to tampering and leakage.

Method used

Historical power quality data within a preset time period is used as the key, and an encryption function is used to encrypt real-time power quality data. The validity period of the key is dynamically adjusted by decreasing the time window to ensure that different types of data are encrypted with different keys.

Benefits of technology

It improves the security of power quality data encryption, avoids the risk of data breach, ensures that the security of different data types is not affected, and guarantees the continuous security of data through dynamic encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116170193B_ABST
    Figure CN116170193B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for encrypting power quality data, the method comprising: obtaining first historical power quality data of a preset time segment; using the first historical power quality data as a key and combining an encryption function to encrypt real-time power quality data to be encrypted; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted; calculating a decreasing time window of the preset time segment, and stopping encryption when the decreasing time window decreases to zero. The embodiment of the present invention can effectively improve the security of power quality data encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data encryption, and in particular to a method and device for encrypting power quality data. Background Art

[0002] In recent years, in order to cope with the problems of fossil energy depletion and environmental changes, renewable energy, mainly photovoltaic and wind power, has been vigorously developed. At the same time, the proportion of nonlinear loads on the user side has also continued to increase, resulting in increasingly serious power quality problems in the power grid, such as excessive harmonics. At present, the power quality indicators on the power supply side and the user side are mainly monitored by installing power quality monitoring terminals. However, due to property rights reasons, data transmission is usually based on public networks such as 4G, and unified collection is carried out on the power grid side, that is, the system side, which may lead to security issues such as data being attacked and tampered with.

[0003] In order to resist external attacks, in addition to existing hardware methods such as firewalls and network isolation, the common means is data encryption. The current power quality data encryption method is to encrypt all data in a time period, that is, all objects to be encrypted are treated as a whole, and then encrypted with the same key. Once the key is compromised, all data will be compromised.

[0004] From the above, it can be seen that the existing power quality data encryption method has the problem of low security. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for encrypting power quality data, which can effectively improve the security of power quality data encryption.

[0006] A first aspect of an embodiment of the present application provides a method for encrypting power quality data, including:

[0007] Acquire first historical power quality data of a preset time period;

[0008] The first historical power quality data is used as a key and combined with an encryption function to encrypt the real-time power quality data to be encrypted; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted;

[0009] Calculate the decreasing time window of the preset time segment, and stop encryption when the decreasing time window decreases to zero.

[0010] In a possible implementation of the first aspect, obtaining first historical power quality data in a preset time period is specifically:

[0011] Acquire first random period data sent by the power quality monitoring terminal and second random period data sent by the power quality master station system;

[0012] Selecting a key sending end from a power quality monitoring terminal and a power quality master station system according to the first random period data and the second random period data;

[0013] The third random time period data sent by the key sending end is obtained, the third random time period data is used as a preset time segment, and the corresponding first historical power quality data is obtained from the historical power quality database according to the preset time segment.

[0014] In a possible implementation manner of the first aspect, a key sending end is selected from a power quality monitoring terminal and a power quality master station system according to the first random period data and the second random period data, specifically:

[0015] When the start time of the first random period data is earlier than the start time of the second random period data, selecting the power quality monitoring terminal as the selected key sending terminal;

[0016] When the start time of the first random period data is later than the start time of the second random period data, selecting the power quality master station system as the selected key sending end;

[0017] When the start time of the first random period data is equal to the start time of the second random period data, the random period data respectively sent by the power quality monitoring terminal and the power quality master station system are reacquired.

[0018] In a possible implementation manner of the first aspect, calculating the decreasing time window of the preset time segment is specifically:

[0019] ;

[0020] in, is the decreasing time window; Indicates the start time of the preset time period under the premise that the power quality master station system acts as the key sending end; Indicates the end time of the preset time segment under the premise that the power quality master station system is used as the key sending end; n indicates the number of decreasing time windows; Indicates the power quality statistics interval.

[0021] In a possible implementation of the first aspect, the first historical power quality data is used as a key and an encryption function is combined to encrypt the real-time power quality data to be encrypted, specifically:

[0022] Calculate the corresponding maximum value, minimum value, 95% probability value and average value according to the first historical power quality data;

[0023] From the corresponding maximum value, minimum value, 95 probability value and average value, any one is obtained as a key, and the real-time power quality data to be encrypted is encrypted in combination with the encryption function;

[0024] The encryption function is as follows:

[0025] ;

[0026] Among them, x real Indicates the real-time power quality data to be encrypted; x seg represents the key; x eny Indicates the encrypted power quality data.

[0027] In a possible implementation manner of the first aspect, the types of power quality data include:

[0028] Voltage, current and power.

[0029] In a possible implementation manner of the first aspect, the method further includes: performing decryption processing on the encrypted power quality data according to the encrypted power quality data and the decryption function, specifically:

[0030] ;

[0031] Among them, x a Indicates the decrypted data; x seg represents the key; x eny Indicates the encrypted power quality data.

[0032] A second aspect of an embodiment of the present application provides a power quality data encryption device, including: an acquisition module, an encryption module and a stop module;

[0033] The acquisition module is used to acquire first historical power quality data in a preset time period;

[0034] The encryption module is used to use the first historical power quality data as a key and combine with the encryption function to encrypt the real-time power quality data to be encrypted; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted;

[0035] The stop module is used to calculate the decreasing time window of the preset time segment, and when the decreasing time window decreases to zero, the encryption is stopped.

[0036] In a possible implementation manner of the second aspect, obtaining first historical power quality data in a preset time period is specifically:

[0037] Acquire first random period data sent by the power quality monitoring terminal and second random period data sent by the power quality master station system;

[0038] Selecting a key sending end from a power quality monitoring terminal and a power quality master station system according to the first random period data and the second random period data;

[0039] The third random time period data sent by the key sending end is obtained, the third random time period data is used as a preset time segment, and the corresponding first historical power quality data is obtained from the historical power quality database according to the preset time segment.

[0040] In a possible implementation manner of the second aspect, a key sending end is selected from a power quality monitoring terminal and a power quality master station system according to the first random period data and the second random period data, specifically:

[0041] When the start time of the first random period data is earlier than the start time of the second random period data, selecting the power quality monitoring terminal as the selected key sending terminal;

[0042] When the start time of the first random period data is later than the start time of the second random period data, selecting the power quality master station system as the selected key sending end;

[0043] When the start time of the first random period data is equal to the start time of the second random period data, the random period data respectively sent by the power quality monitoring terminal and the power quality master station system are reacquired.

[0044] Compared with the prior art, an embodiment of the present invention provides a method and device for encrypting power quality data, the method comprising: obtaining first historical power quality data of a preset time segment; using the first historical power quality data as a key and combining it with an encryption function to encrypt real-time power quality data to be encrypted; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted; calculating a decreasing time window of the preset time segment, and stopping encryption when the decreasing time window decreases to zero.

[0045] Its beneficial effect lies in that: the embodiment of the present invention uses the first historical power quality data of a preset time segment as a key, and encrypts the real-time power quality data to be encrypted in combination with an encryption function, wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted, and simultaneously calculates the decreasing time window of the preset time segment, and stops the encryption when the decreasing time window decreases to zero. The embodiment of the present invention uses the first historical power quality data of the same type as the real-time power quality data to be encrypted as a key, and encrypts the real-time power quality data to be encrypted in combination with an encryption function, realizing the process of encrypting data using different keys for different data types, and can avoid the problem in the prior art that all objects to be encrypted are treated as a whole and encrypted with the same key, resulting in data being easily hacked and leaked. If a certain type of data is hacked, the security and reliability of other types of data are not affected, thereby effectively improving the security of power quality data encryption. At the same time, the decreasing time window of the preset time segment is calculated. As time goes by, when the decreasing time window decreases to zero, the encryption is stopped. The decreasing time window determines the validity period of the key. Through the change of the decreasing time window, dynamic and non-periodic encryption is achieved, thereby effectively ensuring the security of power quality data encryption.

[0046] Furthermore, since the historical data of the power quality monitoring terminal is iteratively stored in a first-in-first-out manner, the encryption library can be continuously updated, further improving the security of the power quality data. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a flow chart of a method for encrypting power quality data provided by one embodiment of the present invention;

[0048] Figure 2 It is a structural schematic diagram of a power quality data encryption device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Reference Figure 1 , is a flow chart of a method for encrypting power quality data provided by an embodiment of the present invention, including S101-S103:

[0051] S101: Acquire first historical power quality data in a preset time period.

[0052] In this embodiment, the obtaining of the first historical power quality data in a preset time period is specifically:

[0053] Acquire first random period data sent by the power quality monitoring terminal and second random period data sent by the power quality master station system;

[0054] According to the first random period data and the second random period data, a key sending end is selected from the power quality monitoring terminal and the power quality master station system;

[0055] The third random time period data sent by the key sending end is obtained, the third random time period data is used as the preset time segment, and the corresponding first historical power quality data is obtained from the historical power quality database according to the preset time segment.

[0056] In a specific embodiment, the selecting of a key sending end from the power quality monitoring terminal and the power quality master station system according to the first random period data and the second random period data is specifically:

[0057] When the start time of the first random period data is earlier than the start time of the second random period data, selecting the power quality monitoring terminal as the selected key sending end;

[0058] When the start time of the first random period data is later than the start time of the second random period data, selecting the power quality master station system as the selected key sending end;

[0059] When the start time of the first random period data is equal to the start time of the second random period data, the random period data respectively sent by the power quality monitoring terminal and the power quality master station system are reacquired.

[0060] S102: Using the first historical power quality data as a key and combining it with an encryption function to encrypt the real-time power quality data to be encrypted.

[0061] The type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted.

[0062] Furthermore, the types of power quality data include: voltage, current and power. Therefore, the types of the first historical power quality data and the types of the real-time power quality data to be encrypted both include voltage, current and power.

[0063] In this embodiment, the first historical power quality data is used as a key and an encryption function is combined to encrypt the real-time power quality data to be encrypted, specifically:

[0064] Calculate the corresponding maximum value, minimum value, 95% probability value and average value according to the first historical power quality data;

[0065] From the corresponding maximum value, minimum value, 95 probability value and average value, any one is obtained as the key, and the real-time power quality data to be encrypted is encrypted in combination with the encryption function;

[0066] The encryption function is specifically:

[0067] ;

[0068] Among them, x real represents the real-time power quality data to be encrypted; x seg represents the key; x eny Indicates the encrypted power quality data.

[0069] S103: Calculate the decreasing time window of the preset time segment, and stop encryption when the decreasing time window decreases to zero.

[0070] In this embodiment, the calculation of the decreasing time window of the preset time segment is specifically as follows:

[0071] ;

[0072] in, is the decrementing time window; Indicates the starting time of the preset time section under the premise that the power quality master station system serves as the key sending end; represents the end time of the preset time segment under the premise that the power quality master station system serves as the key sending end; n represents the number of decreasing time windows; Indicates the power quality statistics interval.

[0073] In this embodiment, it further includes: decrypting the encrypted power quality data according to the encrypted power quality data and the decryption function, specifically:

[0074] ;

[0075] Among them, x a Indicates the decrypted data; x seg represents the key; x eny Indicates the encrypted power quality data.

[0076] In a preferred embodiment, the specific process of power quality data encryption is further described:

[0077] At present, the power quality monitoring terminal can save at least 3 months of data, and the power quality monitoring terminal data is also transmitted to the power quality master station system in real time. Based on this, it can be considered that both the system side and the terminal side can know the power quality data (such as voltage, current, harmonics, frequency, etc.) of the last 3 months, and use this as the data basis for the power quality data encryption method. The specific steps are:

[0078] Step 1: Determine the encryption period.

[0079] Considering that the power quality monitoring terminal can store limited historical data, but at least for 3 months, a certain period of data within 3 months is randomly selected for data encryption (it should be noted that due to the limited storage space of the power quality monitoring terminal, the first-in-first-out method is usually used to store the historical data of the last 3 months, and the historical data is the encryption key since the present invention. It can be considered that the encryption library is dynamic and updated in real time, thereby greatly improving the encryption reliability). To this end, the power quality monitoring terminal and the power quality master station system randomly select a time segment and send it to each other. Among them, the time segment sent by the power quality monitoring terminal to the power quality master station system is recorded as the first random time segment data: ; The time segment sent by the power quality master station system to the power quality monitoring terminal is recorded as the second random time segment data: .in, Indicates the start time of the first random period of time data, Indicates the end time of the first random period of time data; Indicates the start time of the second random period data, Indicates the end time of the second random period data.

[0080] Formula (1) and formula (2) represent random(T last ,T 0 ) Randomly in [T last ,T 0 ] generates a time segment, T last Indicates the agreed time for the power quality monitoring terminal to store historical data, T 0 Indicates the current time.

[0081] ; (1)

[0082] ; (2)

[0083] Step 2: Power quality master station system and power quality monitoring terminal are based on , comparison.

[0084] Specifically, if formula (3) is satisfied, the power quality monitoring terminal determines the selection of the encryption segment (that is, when the start time of the first random period of time data is earlier than the start time of the second random period of time data, the power quality monitoring terminal is selected as the selected key sending end); otherwise, the power quality master station system determines (when the start time of the first random period of time data is later than the start time of the second random period of time data, the power quality master station system is selected as the selected key sending end).

[0085] If they are exactly equal, this comparison is invalid, and the power quality monitoring terminal and the power quality master station system need to randomly generate a time segment again (that is, when the start time of the first random time segment data is equal to the start time of the second random time segment data, re-acquire the random time segment data sent by the power quality monitoring terminal and the power quality master station system respectively), and then compare. Of course, it is also possible to determine whether the power quality monitoring terminal or the power quality master station system determines the time encryption segment based on the comparison of the segment end time.

[0086] ; (3)

[0087] Step 3: Determine the key.

[0088] The key sending end is determined by step 2, that is, it is determined whether the power quality master station system or the power quality monitoring terminal has the right to select and add specific encrypted segment data. If it is determined based on step 2 that the power quality master station system has the decision right, that is, the power quality master station system is determined to be the key sending end, at this time, the power quality monitoring terminal and the power quality master station system will randomly generate a time segment respectively and send it to each other at the same time, refer to step 1 for details.

[0089] Among them, the time period that the power quality monitoring terminal sends to the power quality master station system is recorded as: , the time segment sent by the power quality master station system to the power quality monitoring terminal is recorded as: However, at this time, only the time segment given by the key sender (i.e., the third random time segment data) is valid, and the power quality master station system has the right to decide and selects As the encrypted data segment (i.e. the preset time segment), the power quality monitoring terminal sends Just to distract possible attackers.

[0090] Step 4: Decremental aperiodic encryption based on a determined time period.

[0091] If step 3 confirms as the preset time segment; then the decreasing time window of the preset time segment (i.e., encrypted data) is . In decreasing time window The form of determines the encryption length and period, n represents the nth encryption window, that is, as time goes by, Continuously decreasing, when When it is less than or equal to 0, the periodic encryption ends. See formula (4) for details. Of course, (n-1) in the formula can be replaced by a more complex method, such as 2 n . Indicates the power quality statistical interval, usually 3 minutes.

[0092] ; (4)

[0093] For example, suppose step 3 determines As a preset time segment, if Specifically, it is [10:33 on September 1, 2021, 14:36 ​​on September 1, 2021]. If the current time is 10:09 on September 22, 2021, the first window selects the data corresponding to [10:33 on September 1, 2021, 14:36 ​​on September 1, 2021] for encryption, that is, at [10:09 on September 22, 2021, 14:36 ​​on September 22, 2021] The encryption is performed using the time [10:33 on September 1, 2021, 14:36 ​​on September 1, 2021] within the time period [4:12 on September 22, 2021], and then from 14:12 on September 22, 2021, the corresponding time segment and data are encrypted using [10:33 on September 1, 2021, 14:33 on September 1, 2021] until the time window is less than 0, and the entire cycle ends. Based on steps 1 and 2, the next encryption cycle of indefinite duration is entered. That is, the corresponding first historical power quality data is obtained from the historical power quality database as the key according to the preset time segment, but the preset time segment uses a sliding method to ensure dynamic and non-periodic encryption. Mainly look at formula (4) to determine the effective use period of the key.

[0094] Step 5: Data encryption.

[0095] If step 3 confirms As a preset time period. Power quality monitoring terminal reads The first historical power quality data corresponding to the segment is randomly selected as the maximum value, minimum value, 95 probability value or average value of the first historical power quality data as the key and encrypted. For details, see the encryption function of formula (5). Of course, formula (5) can also replace other more complex encryption functions. Where x eny Indicates the encrypted power quality data; x real Represents the data before encryption, that is, the real-time power quality data to be encrypted; x seg Indicates the power quality data corresponding to the segment, that is, the key.

[0096] ; (5)

[0097] For example, assuming that the second harmonic voltage data corresponding to the preset time segment is determined to be [1.1, 1.4, 1.5], and the second harmonic currently generated is 1.2, then the encrypted data is 2 1.2-1.1 , then passed After one minute, the harmonic data is 0.7, and the encrypted data is 2 0.7-1.4 , and so on.

[0098] Step 6: The power quality master station system receives the encrypted data and data type (select the maximum value, minimum value, 95 probability value or average value of the corresponding data type for encryption, such as the fundamental voltage selects the corresponding segment fundamental current, and the third harmonic current selects the corresponding segment fundamental current). Based on this, different data types use different encryption objects (i.e. different encryption keys), which greatly improves data security compared to the traditional key generation based on the monitoring terminal. In other words, the power quality device has hundreds of types of data, such as voltage, current, and power. When encrypting, the current voltage can be encrypted with the historical voltage, that is, the power quality data of the same time period is encrypted with hundreds of keys; the current encryption method is not so delicate. Once the key is cracked, all the data is cracked. The method of the present invention avoids this problem, that is, it is necessary to crack hundreds of keys to crack them all, which significantly increases the difficulty, so the security is also improved. According to step 3, determine the corresponding x for the segment reading seg , and then decrypt the data based on formula (6).

[0099] ; (6)

[0100] Among them, x a Indicates the decrypted data, which is the same as the real-time power quality data to be encrypted; x seg represents the key; x eny Indicates the encrypted power quality data.

[0101] At the same time, in order to prevent the encrypted object data of the power quality monitoring terminal from being stolen within a certain period, once the power quality monitoring terminal triggers an event (including monitoring line steady-state events, monitoring line transient events, terminal restart, terminal upgrade and other events), the use of the currently determined encrypted object data will be immediately terminated, and the event will be provided to the master station side, and steps 1-2 will be re-executed to select new encrypted object data.

[0102] In addition, once the data decrypted by the master station based on step 6 contains a large error, it can be determined that the corresponding power quality data is under attack, and the communication with the corresponding power quality monitoring terminal is terminated. For example, if the voltage level of the monitored object is 35kV, the encrypted voltage is 5.9kV, and the transmission network is determined to be unreliable. The communication between the corresponding power quality monitoring terminal and the master station can be restored only after the investigation and rectification is completed.

[0103] For further explanation of the power quality data encryption device, please refer to Figure 2 , Figure 2 It is a structural diagram of a power quality data encryption device provided by an embodiment of the present invention, comprising: an acquisition module 201, an encryption module 202 and a stop module 203;

[0104] Wherein, the acquisition module 201 is used to acquire first historical power quality data of a preset time period;

[0105] The encryption module 202 is used to use the first historical power quality data as a key and combine it with an encryption function to encrypt the real-time power quality data to be encrypted; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted;

[0106] The stop module 203 is used to calculate the decreasing time window of the preset time segment, and stop encryption when the decreasing time window decreases to zero.

[0107] In this embodiment, the obtaining of the first historical power quality data in a preset time period is specifically:

[0108] Acquire first random period data sent by the power quality monitoring terminal and second random period data sent by the power quality master station system;

[0109] According to the first random period data and the second random period data, a key sending end is selected from the power quality monitoring terminal and the power quality master station system;

[0110] The third random time period data sent by the key sending end is obtained, the third random time period data is used as the preset time segment, and the corresponding first historical power quality data is obtained from the historical power quality database according to the preset time segment.

[0111] In this embodiment, the key sending end is selected from the power quality monitoring terminal and the power quality master station system according to the first random period data and the second random period data, specifically:

[0112] When the start time of the first random period data is earlier than the start time of the second random period data, selecting the power quality monitoring terminal as the selected key sending end;

[0113] When the start time of the first random period data is later than the start time of the second random period data, selecting the power quality master station system as the selected key sending end;

[0114] When the start time of the first random period data is equal to the start time of the second random period data, the random period data respectively sent by the power quality monitoring terminal and the power quality master station system are reacquired.

[0115] In this embodiment, the calculation of the decreasing time window of the preset time segment is specifically as follows:

[0116] ;

[0117] in, is the decrementing time window; Indicates the starting time of the preset time section under the premise that the power quality master station system serves as the key sending end; represents the end time of the preset time segment under the premise that the power quality master station system serves as the key sending end; n represents the number of decreasing time windows; Indicates the power quality statistics interval.

[0118] In a specific embodiment, the first historical power quality data is used as a key and an encryption function is combined to encrypt the real-time power quality data to be encrypted, specifically:

[0119] Calculate the corresponding maximum value, minimum value, 95% probability value and average value according to the first historical power quality data;

[0120] From the corresponding maximum value, minimum value, 95 probability value and average value, any one is obtained as the key, and the real-time power quality data to be encrypted is encrypted in combination with the encryption function;

[0121] The encryption function is specifically:

[0122] ;

[0123] Among them, x real represents the real-time power quality data to be encrypted; x seg represents the key; x eny Indicates the encrypted power quality data.

[0124] In a specific embodiment, the types of power quality data include:

[0125] Voltage, current and power.

[0126] In a specific embodiment, the method further includes: performing a decryption process on the encrypted power quality data according to the encrypted power quality data and the decryption function, specifically:

[0127] ;

[0128] Among them, x a Indicates the decrypted data; x seg represents the key; x eny Indicates the encrypted power quality data.

[0129] The embodiment of the present invention obtains first historical power quality data of a preset time segment through an acquisition module; uses the first historical power quality data as a key through an encryption module, and encrypts the real-time power quality data to be encrypted in combination with an encryption function; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted; calculates a decreasing time window of the preset time segment through a stop module, and stops encryption when the decreasing time window decreases to zero.

[0130] The embodiment of the present invention uses the first historical power quality data of a preset time segment as a key, and encrypts the real-time power quality data to be encrypted in combination with an encryption function, wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted, and simultaneously calculates the decreasing time window of the preset time segment, and stops the encryption when the decreasing time window decreases to zero. The embodiment of the present invention uses the first historical power quality data of the same type as the real-time power quality data to be encrypted as a key, and encrypts the real-time power quality data to be encrypted in combination with an encryption function, realizing the process of encrypting data using different keys for different data types, and can avoid the problem in the prior art that all objects to be encrypted are treated as a whole and encrypted with the same key, resulting in the data being easily hacked and leaked. If a certain type of data is hacked, the security and reliability of other types of data are not affected, thereby effectively improving the security of power quality data encryption. At the same time, the decreasing time window of the preset time segment is calculated. As time goes by, when the decreasing time window decreases to zero, the encryption is stopped. The decreasing time window determines the validity period of the key. Through the change of the decreasing time window, dynamic and non-periodic encryption is achieved, thereby effectively ensuring the security of power quality data encryption.

[0131] Furthermore, since the historical data of the power quality monitoring terminal is iteratively stored in a first-in-first-out manner, the encryption library can be continuously updated, further improving the security of the power quality data.

[0132] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for encrypting power quality data, characterized in that: include: Acquire first historical power quality data of a preset time period; The first historical power quality data is used as a key and combined with an encryption function to encrypt the real-time power quality data to be encrypted; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted; Calculating a decreasing time window of the preset time segment, and stopping encryption when the decreasing time window decreases to zero; The obtaining of the first historical power quality data in a preset time period is specifically: Acquire first random period data sent by the power quality monitoring terminal and second random period data sent by the power quality master station system; According to the first random period data and the second random period data, a key sending end is selected from the power quality monitoring terminal and the power quality master station system; Acquire the third random time period data sent by the key sending end, use the third random time period data as the preset time segment, and acquire the corresponding first historical power quality data from the historical power quality database according to the preset time segment; The first historical power quality data is used as a key and an encryption function is combined to encrypt the real-time power quality data to be encrypted, specifically: Calculate the corresponding maximum value, minimum value, 95% probability value and average value according to the first historical power quality data; From the corresponding maximum value, minimum value, 95 probability value and average value, any one is obtained as the key, and the real-time power quality data to be encrypted is encrypted in combination with the encryption function; The encryption function is specifically: ; Among them, x real represents the real-time power quality data to be encrypted; x seg represents the key; x eny Indicates the encrypted power quality data.

2. A method for encrypting power quality data according to claim 1, characterized in that: The selecting a key sending end from the power quality monitoring terminal and the power quality master station system according to the first random period data and the second random period data is specifically: When the start time of the first random period data is earlier than the start time of the second random period data, selecting the power quality monitoring terminal as the selected key sending end; When the start time of the first random period data is later than the start time of the second random period data, selecting the power quality master station system as the selected key sending end; When the start time of the first random period data is equal to the start time of the second random period data, the random period data respectively sent by the power quality monitoring terminal and the power quality master station system are reacquired.

3. The method for encrypting power quality data according to claim 1, characterized in that: Types of power quality data include: Voltage, current and power.

4. A method for encrypting power quality data according to claim 3, characterized in that: Also includes: According to the encrypted power quality data and the decryption function, the encrypted power quality data is decrypted, specifically: ; Among them, x a Indicates the decrypted data; x seg represents the key; x eny Indicates the encrypted power quality data.

5. A power quality data encryption device, characterized in that: It includes an acquisition module, an encryption module and a stop module; Wherein, the acquisition module is used to acquire first historical power quality data of a preset time period; The encryption module is used to use the first historical power quality data as a key and combine it with an encryption function to encrypt the real-time power quality data to be encrypted; wherein the type of the first historical power quality data is the same as the type of the real-time power quality data to be encrypted; The stopping module is used to calculate the decreasing time window of the preset time segment, and when the decreasing time window decreases to zero, the encryption is stopped; The acquisition module acquires first historical power quality data of a preset time period, specifically: The acquisition module acquires the first random period data sent by the power quality monitoring terminal and the second random period data sent by the power quality master station system; According to the first random period data and the second random period data, a key sending end is selected from the power quality monitoring terminal and the power quality master station system; Acquire the third random time period data sent by the key sending end, use the third random time period data as the preset time segment, and acquire the corresponding first historical power quality data from the historical power quality database according to the preset time segment; The encryption module uses the first historical power quality data as a key and combines an encryption function to encrypt the real-time power quality data to be encrypted, specifically: The encryption module calculates the corresponding maximum value, minimum value, 95 probability value and average value according to the first historical power quality data; From the corresponding maximum value, minimum value, 95 probability value and average value, any one is obtained as the key, and the real-time power quality data to be encrypted is encrypted in combination with the encryption function; The encryption function is specifically: ; Among them, x real represents the real-time power quality data to be encrypted; x seg represents the key; x eny Indicates the encrypted power quality data.

6. The power quality data encryption device according to claim 5, characterized in that: The encryption module selects a key sending end from the power quality monitoring terminal and the power quality master station system according to the first random period data and the second random period data, specifically: The encryption module selects the power quality monitoring terminal as the selected key sending end when the start time of the first random period data is earlier than the start time of the second random period data; When the start time of the first random period data is later than the start time of the second random period data, selecting the power quality master station system as the selected key sending end; When the start time of the first random period data is equal to the start time of the second random period data, the random period data respectively sent by the power quality monitoring terminal and the power quality master station system are reacquired.

Citation Information

Patent Citations

  • Timestamp technique-based industrial network security transmission method

    CN105827408A

  • Data encryption method and device and electronic equipment

    CN114465760A