CN113468585A - Encryption method, device and storage medium based on energy key table - Google Patents

Encryption method, device and storage medium based on energy key table Download PDF

Info

Publication number
CN113468585A
CN113468585A CN202111025654.6A CN202111025654A CN113468585A CN 113468585 A CN113468585 A CN 113468585A CN 202111025654 A CN202111025654 A CN 202111025654A CN 113468585 A CN113468585 A CN 113468585A
Authority
CN
China
Prior art keywords
energy
encrypted
information
data
time
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
CN202111025654.6A
Other languages
Chinese (zh)
Other versions
CN113468585B (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.)
State Grid Zhejiang Electric Power Co Ltd
Marketing Service Center of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
State Grid Zhejiang Electric Power Co Ltd
Marketing Service Center of State Grid Zhejiang Electric Power 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 State Grid Zhejiang Electric Power Co Ltd, Marketing Service Center of State Grid Zhejiang Electric Power Co Ltd filed Critical State Grid Zhejiang Electric Power Co Ltd
Priority to CN202111025654.6A priority Critical patent/CN113468585B/en
Publication of CN113468585A publication Critical patent/CN113468585A/en
Application granted granted Critical
Publication of CN113468585B publication Critical patent/CN113468585B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention provides an encryption method, an encryption device and a storage medium based on an energy key table, wherein the encryption method comprises the following steps: acquiring a plurality of to-be-encrypted energy data with a time sequence, wherein the to-be-encrypted energy data at least comprises to-be-encrypted energy information and to-be-encrypted energy marks; generating a time sequence table based on the time sequence and the energy mark to be encrypted, extracting a binary code of the time sequence table, and calculating a first hash value of the binary code of the time sequence table based on a hash algorithm; calculating according to the data quantity value of the energy information to be encrypted to obtain a multi-dimensional key; the method comprises the steps of encrypting corresponding energy information to be encrypted based on a multi-dimensional key to obtain encrypted energy information, generating an energy key table according to a plurality of multi-dimensional keys, generating energy data to be transmitted according to a plurality of encrypted energy information, and sending the energy key table and the energy data to be transmitted. The technical scheme provided by the invention has higher safety guarantee while sensitive electric power and energy data can be efficiently transmitted on line.

Description

Encryption method, device and storage medium based on energy key table
Technical Field
The invention relates to the technical field of data transmission, in particular to an encryption method, an encryption device and a storage medium based on an energy key table.
Background
With the continuous development of power systems, the power systems generate a large amount of power data during the construction, daily operation and management processes. Because the power data contains a large amount of confidential information, when other terminals need the power data, a manager stores the generated power data by using a large-capacity storage medium (such as a hard disk) and then copies the power data in the storage medium to the terminal so as to avoid illegal access and stealing of the power data by other people.
However, with the increasing huge amount of power data, a manager needs to copy the power data with a large amount to a storage medium, and then needs to copy the power data in the storage medium to other terminals, so that the time for the terminal to acquire the power data is greatly increased, and the transmission efficiency is low. Therefore, the prior art method of manually transmitting power data by using a storage medium has the problem of low transmission efficiency.
Disclosure of Invention
The embodiment of the invention provides an encryption method, an encryption device and a storage medium based on an energy key table, which can effectively encrypt sensitive electric power and energy data, so that the sensitive electric power and energy data can be efficiently transmitted on line and have higher safety guarantee.
In a first aspect of the embodiments of the present invention, an encryption method based on an energy key table is provided, including:
acquiring a plurality of to-be-encrypted energy data with a time sequence, wherein the to-be-encrypted energy data at least comprises to-be-encrypted energy information and to-be-encrypted energy marks;
generating a time sequence table based on the time sequence and the energy mark to be encrypted, extracting a binary code of the time sequence table, and calculating a first hash value of the binary code of the time sequence table based on a hash algorithm;
calculating according to the data quantity value of the energy information to be encrypted to obtain a multi-dimensional key, calculating the multi-dimensional key of each energy data to be encrypted with a time sequence by the following formula,
Figure 870770DEST_PATH_IMAGE001
wherein the content of the first and second substances,Dis a multi-dimensional key, and is characterized in that,T 1is a quantized value of a starting time point of the time series,T 2is a quantized value of the end time point of the time series,His the first hash value of the first set of values,O d calculated for the previous momentdA multi-dimensional key of the energy data to be encrypted,K d calculated for the previous momentdThe weight of the multidimensional key of the energy data to be encrypted,Sin order to be a magnitude of the data,Lis a normalized value;
and encrypting the corresponding energy information to be encrypted based on the multi-dimensional key to obtain encrypted energy information, generating an energy key table according to the multi-dimensional keys, generating energy data to be transmitted according to the encrypted energy information, and transmitting the energy key table and the energy data to be transmitted.
Optionally, in a possible implementation manner of the first aspect, the previous time instant first time is calculated by the following formuladThe weight of the multidimensional key of the energy data to be encrypted comprises the following steps:
Figure 584648DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 397008DEST_PATH_IMAGE003
is to calculateK d The time of the energy source information to be encrypted is taken as a reference, and the data quantity value of the energy source information to be encrypted at the previous first time is taken as a reference;
Figure 526638DEST_PATH_IMAGE004
is to calculateK d The time of the energy source information to be encrypted is taken as a reference, and the data quantity value of the energy source information to be encrypted at the previous second time is taken as a reference;
Figure 872169DEST_PATH_IMAGE005
is to calculateK d The time of the energy source information to be encrypted at the third previous time is taken as a reference, the data quantity value of the energy source information to be encrypted at the third previous time is taken as a reference,Athe weight value of the data quantity value of the energy source information to be encrypted at the previous first moment,Bthe weighted value of the data quantity value of the energy information to be encrypted at the previous second moment,Cthe weighted value of the data quantity value of the energy information to be encrypted at the previous second moment.
Optionally, in one possible implementation manner of the first aspect, the obtaining a plurality of energy data to be encrypted with a time series includes:
receiving selected information, wherein the selected information at least comprises target time period information and target energy information;
selecting corresponding duration sequence energy source data to be encrypted in a plurality of categories of energy source data to be encrypted based on the target energy source information;
and selecting a time sequence of energy source data to be encrypted in the energy source data to be encrypted based on the target time period information.
Optionally, in one possible implementation manner of the first aspect, generating the time sequence table based on the time sequence and the energy source mark to be encrypted includes:
acquiring each moment value in the time sequence;
extracting year, month and day information in the time value, and converting the year, month and day information into first quantity information according to a first preset mode;
extracting time, minute and second information in the time value, and converting the time, minute and second information into second numerical information according to a second preset mode;
generating a quantized time value based on the first quantity information and the second quantity information;
and generating a time sequence table by the quantized time value and the corresponding energy source mark to be encrypted.
Optionally, in a possible implementation manner of the first aspect, generating a time sequence table by using the quantized time value and the corresponding energy source identifier to be encrypted includes:
quantizing the energy mark to be encrypted based on a preset corresponding relationship to obtain a quantized energy mark to be encrypted, wherein the preset corresponding relationship is the corresponding relationship between the energy mark to be encrypted and a quantized value of the energy mark to be encrypted;
and combining the quantized time value and the quantized energy mark into a quantitative value to generate a time sequence table.
Optionally, in a possible implementation manner of the first aspect, the obtaining the encrypted energy information by encrypting the corresponding energy information to be encrypted based on the multidimensional key includes:
adding the multi-dimensional key into a preset general compression path to generate an encrypted compression path;
generating a reverse decryption decompression path according to the encryption compression path, wherein the decryption decompression path responds to the multidimensional key to perform decompression processing;
and encrypting the energy information to be encrypted based on the encryption compression path to obtain encrypted energy information.
Optionally, in a possible implementation manner of the first aspect, the method further includes:
setting a damage logic in the decryption decompression path;
and when the error frequency of the multidimensional key received by the decryption decompression path exceeds a preset value, the encrypted energy information is destroyed according to a preset destruction logic based on the destruction logic.
Optionally, in a possible implementation manner of the first aspect, the preset value of the number of errors is 3.
In a second aspect of the embodiments of the present invention, an encryption apparatus based on an energy key table is provided, including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a plurality of to-be-encrypted energy data with time sequences, and the to-be-encrypted energy data at least comprises to-be-encrypted energy information and to-be-encrypted energy marks;
the generating module is used for generating a time sequence table based on the time sequence and the energy mark to be encrypted, extracting the binary codes of the time sequence table, and calculating a first hash value of the binary codes of the time sequence table based on a hash algorithm;
the calculation module is used for calculating according to the data quantity value of the energy information to be encrypted to obtain a multi-dimensional key, calculating the multi-dimensional key of each energy data to be encrypted with a time sequence through the following formula,
Figure 491369DEST_PATH_IMAGE001
wherein the content of the first and second substances,Dis a multi-dimensional key, and is characterized in that,T 1is a quantized value of a starting time point of the time series,T 2is a quantized value of the end time point of the time series,His the first hash value of the first set of values,O d calculated for the previous momentdA multi-dimensional key of the energy data to be encrypted,K d calculated for the previous momentdThe weight of the multidimensional key of the energy data to be encrypted,Sin order to be a magnitude of the data,Lis a normalized value;
and the encryption module is used for encrypting the corresponding energy information to be encrypted based on the multi-dimensional keys to obtain encrypted energy information, generating an energy key table according to the multi-dimensional keys, generating energy data to be transmitted according to the encrypted energy information, and sending the energy key table and the energy data to be transmitted.
In a third aspect of the embodiments of the present invention, a storage medium is provided, in which a computer program is stored, which, when being executed by a processor, is adapted to implement the method according to the first aspect of the present invention and various possible designs of the first aspect of the present invention.
The encryption method, the encryption device and the storage medium based on the energy key table can obtain the corresponding multi-dimensional key according to multiple dimensions such as the acquisition time of energy, the data quantity value of energy information and the like in a time sequence, and each energy data only has the unique multi-dimensional key in the encryption and decryption processes in the generation mode of the multi-dimensional key, so that the secrecy of the energy data to be transmitted in the transmission process is guaranteed. The problem of unsafe in the transmission process of sensitive electric power data and energy data is solved.
According to the technical scheme, when the multi-dimensional key is calculated, the time sequence list is processed through the Hash algorithm, so that the length of the multi-dimensional key obtained by the method is similar, the change amplitude of the length of the multi-dimensional key is not higher due to more change of data volume transmitted each time, and the multi-dimensional key has certain consistency in length.
The invention can carry out quantization processing on the data in the time sequence list, so that the data in the time sequence list can be quickly converted into binary codes, and the data processing efficiency of the invention is improved. Moreover, the quantized data is unique, so that the transmission process of the power data, the energy data and the energy information cannot be the same multi-dimensional key every time, the safety is high, and the data is not easy to break.
Drawings
FIG. 1 is a flow chart of an encryption method based on an energy key table;
fig. 2 is a block diagram of an encryption apparatus based on an energy key table.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein.
It should be understood that, in various embodiments of the present invention, the sequence numbers of the processes do not mean the execution sequence, and the execution sequence of the processes should be determined by the functions and the internal logic of the processes, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
It should be understood that in the present application, "comprising" and "having" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that, in the present invention, "a plurality" means two or more. "and/or" is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "comprises A, B and C" and "comprises A, B, C" means that all three of A, B, C comprise, "comprises A, B or C" means that one of A, B, C comprises, "comprises A, B and/or C" means that any 1 or any 2 or 3 of A, B, C comprises.
It should be understood that in the present invention, "B corresponding to a", "a corresponds to B", or "B corresponds to a" means that B is associated with a, and B can be determined from a. Determining B from a does not mean determining B from a alone, but may be determined from a and/or other information. And the matching of A and B means that the similarity of A and B is greater than or equal to a preset threshold value.
As used herein, "if" may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
The invention provides an encryption method based on an energy key table, as shown in figure 1, comprising the following steps:
step S110, a plurality of to-be-encrypted energy data with a time sequence are obtained, wherein the to-be-encrypted energy data at least comprise to-be-encrypted energy information and to-be-encrypted energy marks. The energy data to be encrypted in the invention can be commercial power, solar energy, wind energy, nuclear energy, water energy, heat energy and the like, and can also be voltage, current, electric power and the like respectively included by commercial power, solar energy, wind energy, nuclear energy, water energy and heat energy, and the invention does not limit the form of the energy data to be encrypted. The energy information to be encrypted may be a quantity value, such as a quantity value, a voltage value, a current value, and the like of the commercial power. The energy source mark to be encrypted may be a name corresponding to a type of the energy source, for example, if the encrypted energy source information is the nuclear energy, the encrypted energy source mark corresponds to the name of the nuclear energy, and so on.
The time sequence in the present invention can be regarded as a time axis, the time axis can be synchronized with the natural time, the time sequence includes a plurality of moments, each moment may have different encrypted energy information, and the encrypted energy information may be the sum of corresponding energy usage amounts before the moment.
And S120, generating a time sequence table based on the time sequence and the energy mark to be encrypted, extracting the binary codes of the time sequence table, and calculating a first hash value of the binary codes of the time sequence table based on a hash algorithm. The hash algorithm in the present invention can map a binary value of any length to a shorter binary value of a fixed length, and this small binary value is referred to as the first hash value in the present application. The first hash value is a unique and extremely compact representation of a piece of data. By the method, the data size of the time sequence list can be compressed, so that the subsequently generated data size of the multi-dimensional key is small.
Step S130, calculating according to the data quantity value of the energy information to be encrypted to obtain a multi-dimensional key, calculating the multi-dimensional key of each energy data to be encrypted with a time sequence through the following formula,
Figure 289561DEST_PATH_IMAGE001
wherein the content of the first and second substances,Dis a multi-dimensional key, and is characterized in that,T 1is a quantized value of a starting time point of the time series,T 2is a quantized value of the end time point of the time series,His the first hash value of the first set of values,O d calculated for the previous momentdA multi-dimensional key of the energy data to be encrypted,K d calculated for the previous momentdThe weight of the multidimensional key of the energy data to be encrypted,Sin order to be a magnitude of the data,Lis a normalized value.
When the multi-dimensional key is calculated, the time sequence moment, the first hash value and the multi-dimensional key of each previous energy data to be encrypted are fully considered. According to the scheme, even if the energy data to be encrypted obtained at two moments are the same, the multi-dimensional key is different due to the change of the time dimension. I.e. at each moment
Figure 222882DEST_PATH_IMAGE006
The values are all different. The data amount is the data amount, and the unit can be byte, kilobyte, megabyte, etc. The normalization value may be preset, e.g. 100, 1000, etc., for use in assigning numbers to the multi-dimensional keyThe value is reduced, and subsequent calculation is facilitated.
Step S140, encrypting the corresponding energy information to be encrypted based on the multi-dimensional keys to obtain encrypted energy information, generating an energy key table according to the multi-dimensional keys, generating energy data to be transmitted according to the encrypted energy information, and sending the energy key table and the energy data to be transmitted. Because the administrator may need energy data and encrypted energy information of multiple dimensions, the administrator can correspond to multiple multi-dimensional keys.
After the multi-dimensional key is obtained, the corresponding energy information to be encrypted is encrypted according to the multi-dimensional key, and each piece of energy information to be encrypted is arranged in one-to-one correspondence with the corresponding multi-dimensional key. And encrypting the energy information to be encrypted according to the multi-dimensional key to obtain corresponding encrypted energy information, wherein the encrypted energy information is encrypted at the moment. Because the multidimensional keys can be multiple, the energy key table can be obtained according to the multidimensional keys, multiple lost storages are realized through the energy key table, and the management of an administrator is facilitated. After the energy key table and the energy data to be transmitted are obtained, the energy key table and the energy data to be transmitted can be asynchronously transmitted, so that the condition that the energy key table and the energy data to be transmitted are simultaneously stolen by others to cause secret leakage is prevented.
In one possible embodiment, the present invention may calculate the previous time instant by the following formuladThe weight of the multidimensional key of the energy data to be encrypted comprises the following steps:
Figure 422919DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 947441DEST_PATH_IMAGE003
is to calculateK d The time of the energy source information to be encrypted is taken as a reference, and the data quantity value of the energy source information to be encrypted at the previous first time is taken as a reference;
Figure 498508DEST_PATH_IMAGE004
is to calculateK d The time of the energy source information to be encrypted is taken as a reference, and the data quantity value of the energy source information to be encrypted at the previous second time is taken as a reference;
Figure 766679DEST_PATH_IMAGE005
is to calculateK d The time of the energy source information to be encrypted at the third previous time is taken as a reference, the data quantity value of the energy source information to be encrypted at the third previous time is taken as a reference,Athe weight value of the data quantity value of the energy source information to be encrypted at the previous first moment,Bthe weighted value of the data quantity value of the energy information to be encrypted at the previous second moment,Cthe weighted value of the data quantity value of the energy information to be encrypted at the previous second moment.
For example, calculateK d When the time of (1) is 9/10/11/00 seconds in 2020, the reference is 9/10/11/00/seconds in 2020. At this time, the first time (8/10/12/00/20 seconds in 2020), the second time (7/23/8/10/00 seconds in 2020), and the third time (15/6/17/15/40/30 seconds in 2020) are acquired, and the first time, the second time, and the third time are respectively the times at which the energy encryption information is generated after the energy data to be encrypted is acquired. The first time may be the time closest to the reference in the past, and the first time at this time may be regarded as the time of generating the most recent primary energy encryption information before the energy encryption information is generated this time; the second time may be the latest previous time of the first time, and the second time may be regarded as the latest generation time of the primary energy encryption information before the energy encryption information is generated at the first time, and so on, to obtain the corresponding third time and the data quantity value of the energy information to be encrypted corresponding to the third time.
The invention is in calculatingdThe weight of the multidimensional key of the energy data to be encrypted is obtaineddThe data quantity values of the energy source information to be encrypted at the previous three moments of the energy source data to be encrypted are obtained, and the right of the multi-dimensional key of each energy source data to be encrypted is obtained according to the data quantity values of the energy source information to be encrypted at the previous three momentsAnd (4) heavy. Through the calculation in the mode, the weight of the multi-dimensional key of each energy source data to be encrypted is different, so that the multi-dimensional key generated by the method has uniqueness in each dimension.
Furthermore, the weights of the data quantity values of the energy information to be encrypted at the previous three moments can be configured in advance, for exampleA1.1 percent of,BIs 1,CIs 0.9, the specific value is not limited in the present invention, but it is guaranteedABCSo that
Figure 24485DEST_PATH_IMAGE003
To pairK d Will have an influence greater than
Figure 743742DEST_PATH_IMAGE005
To pairK d Is caused by the influence ofK d The data quantity value of the energy information to be encrypted in the past can be changed.
In one possible embodiment, step S110 includes:
step S1101, receiving selected information, wherein the selected information at least comprises target time period information and target energy information. According to the invention, the energy data is firstly selected when being transmitted, namely, the administrator selects the data at the data end for storing the energy data. The target time period information may be 00 min 00 s at 1 st 00 h/1 st 2020 to 59 min 59 s at 23 st at 12 st 31 st 2020. The target energy information may be voltage information, current information, nuclear energy information, and the like.
Step S1102, selecting corresponding energy data to be encrypted with a duration sequence from the energy data to be encrypted of multiple categories based on the target energy information. For example, if the target energy information is nuclear energy, the energy data to be encrypted of the corresponding duration sequence is selected, the duration sequence may be started from the initial acquisition time, for example, the initial acquisition time may be 2015 year 1 month 1 day 00 hour 00 minute 00 second, and the time axis of the acquisition time at this time is 2015 year 1 month 1 day 00 minute 00 second to the present. At this time, a time sequence and a time axis corresponding to the nuclear energy are obtained.
Step S1103, selecting a time series of energy data to be encrypted from the energy data to be encrypted based on the target time period information. According to the method, the energy data to be encrypted corresponding to the time period from 00 min 00 s at 1 month and 1 day in 2015 to 00 min 00 s at 1 month and 1 day in 2020 to 59 min 59 s at 23 months 31 and 31 days in 2020 is selected on the time axis, and the energy data to be encrypted is the data required by the administrator.
Through the steps S1101 to S1103, the present invention can rapidly extract the energy data to be encrypted.
In one possible embodiment, step S120 includes:
each time instant value in the time series is obtained. The time series in the present invention will have multiple time values.
The year, month and day information in the extracted time value is converted according to a first preset mode to become first quantity information. The first preset mode may be, for example, 12/31/2020, which may be converted to 6365, where 6 corresponds to 2020, and since the time axis starts from 2015, 2015 is considered as 1, and then 2020 is 6. Of these, 365 days of a year, 12 months 31 is the last day of the year, and it is deemed 365. In the above manner, the year, month and day can be quantified so that it can be compared in quantity.
And converting the time, minute and second information in the extracted time value according to a second preset mode to form second quantity information. The second predetermined manner may be that, for example, 23 hours 59 minutes 59 seconds can be quantified as 86400, 24 hours a day, 60 minutes each hour, and 60 seconds per minute, 86400 seconds a day, so the present invention quantifies the time, minute, and second information as a numerical value.
And generating a quantized time value based on the first quantity information and the second quantity information. For example, 59 minutes 59 seconds at 31/23/12/2020, the quantified value is 636586400.
Wherein the quantized value of the starting time point of the time sequenceT 1Quantized value of the end time point of the time seriesT 2Quantization may be performed in the manner of step S120, respectively.
And generating a time sequence table by the quantized time value and the corresponding energy source mark to be encrypted.
Through the technical scheme, all time values in the time sequence list can be quantized, so that the time sequence list is numerical values when being processed, and calculation and statistics are facilitated.
In one possible embodiment, the step of generating the time sequence table by the quantized time value and the corresponding energy source mark to be encrypted includes:
and quantizing the energy marker to be encrypted based on a preset corresponding relationship to obtain a quantized energy marker to be encrypted, wherein the preset corresponding relationship is the corresponding relationship between the energy marker to be encrypted and the quantized value of the energy marker to be encrypted. The energy source indicia to be encrypted may be the name of the energy source. In this step, the preset corresponding relationship may be set in advance, and includes a corresponding relationship between a plurality of energy markers to be encrypted and quantized values corresponding to the energy markers, and the energy markers to be encrypted are quantized according to the preset corresponding relationship, for example, the quantized value corresponding to the nuclear energy (energy marker to be encrypted) in advance is 100 (quantized value of energy marker to be encrypted), the quantized value corresponding to the wind energy in advance is 200, the quantized value corresponding to the voltage in advance is 300, and the quantized value corresponding to the current in advance is 400, and the energy markers to be encrypted are quantized in this way. Through the above manner, the quantization processing of the energy target to be encrypted is realized.
And combining the quantized time value and the quantized energy mark into a quantitative value to generate a time sequence table. After the time value and the energy mark are respectively quantized, all information and data in the time sequence list are quantized values, so that the subsequent storage and the processing based on the Hash algorithm are convenient, and the processing speed of the technical scheme is higher.
In one possible embodiment, the obtaining of the encrypted energy information by encrypting the corresponding energy information to be encrypted based on the multidimensional key comprises:
and adding the multi-dimensional key to a preset general compression path to generate an encrypted compression path. The invention can obtain the encrypted compression path according to the preset compression path after obtaining the multi-dimensional key, and carry out encrypted compression processing on the energy data and the energy information to be encrypted according to the encrypted compression path.
And generating a reverse decryption decompression path according to the encryption compression path, wherein the decryption decompression path responds to the multi-dimensional key to perform decompression processing. The invention can generate a corresponding decryption decompression path while obtaining the encryption compression path, and the user end can decrypt and pressurize the encrypted energy information and the energy data according to the decryption decompression path.
And encrypting the energy information to be encrypted based on the encryption compression path to obtain encrypted energy information.
Through the technical scheme, the universal compression path and the multi-dimensional key are combined to obtain the encryption path, so that the encryption processing of the energy information to be encrypted is realized. The method is convenient and quick, and simultaneously ensures that each encrypted energy information has different multidimensional keys.
In one possible embodiment, the method further comprises:
and setting a destroy logic in the decryption decompression path. In the actual use and operation process, the encrypted energy information can be transferred to other people through various ways, so that the invention needs to set a damage logic, other personnel who do not master the multidimensional key can not open the encrypted energy information, and the data can be damaged. For example, the damage logic is to scramble the source code corresponding to the encrypted energy information so that the source code cannot be recovered and restored.
And when the error frequency of the multidimensional key received by the decryption decompression path exceeds a preset value, the encrypted energy information is destroyed according to a preset destruction logic based on the destruction logic. Wherein the default value of the number of errors is 3. And when the error frequency of the multi-dimensional key exceeds 3 times, judging that the person who wants to open the encrypted energy information does not have the corresponding authority, and destroying according to preset destroying logic at the moment.
Through the mode, the safety of the energy data is guaranteed, and even if the encrypted energy information is acquired by others, the encrypted energy information cannot be opened through means of multiple attempts.
The technical solution of the present invention further provides an encryption apparatus based on an energy key table, as shown in fig. 2, including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a plurality of to-be-encrypted energy data with time sequences, and the to-be-encrypted energy data at least comprises to-be-encrypted energy information and to-be-encrypted energy marks;
the generating module is used for generating a time sequence table based on the time sequence and the energy mark to be encrypted, extracting the binary codes of the time sequence table, and calculating a first hash value of the binary codes of the time sequence table based on a hash algorithm;
the calculation module is used for calculating according to the data quantity value of the energy information to be encrypted to obtain a multi-dimensional key, calculating the multi-dimensional key of each energy data to be encrypted with a time sequence through the following formula,
Figure 719789DEST_PATH_IMAGE001
wherein the content of the first and second substances,Dis a multi-dimensional key, and is characterized in that,T 1is a quantized value of a starting time point of the time series,T 2is a quantized value of the end time point of the time series,His the first hash value of the first set of values,O d calculated for the previous momentdA multi-dimensional key of the energy data to be encrypted,K d calculated for the previous momentdThe weight of the multidimensional key of the energy data to be encrypted,Sin order to be a magnitude of the data,Lis a normalized value;
and the encryption module is used for encrypting the corresponding energy information to be encrypted based on the multi-dimensional keys to obtain encrypted energy information, generating an energy key table according to the multi-dimensional keys, generating energy data to be transmitted according to the encrypted energy information, and sending the energy key table and the energy data to be transmitted.
The storage medium may be a computer storage medium or a communication medium. Communication media includes any medium that facilitates transfer of a computer program from one place to another. Computer storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, a storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Additionally, the ASIC may reside in user equipment. Of course, the processor and the storage medium may reside as discrete components in a communication device. The storage medium may be read-only memory (ROM), random-access memory (RAM), CD-ROMs, magnetic tapes, floppy disks, optical data storage devices, and the like.
The present invention also provides a program product comprising execution instructions stored in a storage medium. The at least one processor of the device may read the execution instructions from the storage medium, and the execution of the execution instructions by the at least one processor causes the device to implement the methods provided by the various embodiments described above.
In the above embodiments of the terminal or the server, it should be understood that the Processor may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The encryption method based on the energy key table is characterized by comprising the following steps:
acquiring a plurality of to-be-encrypted energy data with a time sequence, wherein the to-be-encrypted energy data at least comprises to-be-encrypted energy information and to-be-encrypted energy marks;
generating a time sequence table based on the time sequence and the energy mark to be encrypted, extracting a binary code of the time sequence table, and calculating a first hash value of the binary code of the time sequence table based on a hash algorithm;
calculating according to the data quantity value of the energy information to be encrypted to obtain a multi-dimensional key, calculating the multi-dimensional key of each energy data to be encrypted with a time sequence by the following formula,
Figure 621151DEST_PATH_IMAGE001
wherein the content of the first and second substances,Dis a multi-dimensional key, and is characterized in that,T 1is a quantized value of a starting time point of the time series,T 2is a quantized value of the end time point of the time series,His the first hash value of the first set of values,O d calculated for the previous momentdA multi-dimensional key of the energy data to be encrypted,K d calculated for the previous momentdThe weight of the multidimensional key of the energy data to be encrypted,Sin order to be a magnitude of the data,Lis a normalized value;
and encrypting the corresponding energy information to be encrypted based on the multi-dimensional key to obtain encrypted energy information, generating an energy key table according to the multi-dimensional keys, generating energy data to be transmitted according to the encrypted energy information, and transmitting the energy key table and the energy data to be transmitted.
2. The energy key table-based encryption method of claim 1,
calculating the weight of the multidimensional key of the energy source data to be encrypted at the d-th moment by the following formula, wherein the weight comprises the following steps:
Figure 866188DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 114766DEST_PATH_IMAGE003
is to calculateK d The time of the energy source information to be encrypted is taken as a reference, and the data quantity value of the energy source information to be encrypted at the previous first time is taken as a reference;
Figure 775555DEST_PATH_IMAGE004
is to calculateK d The time of the energy source information to be encrypted is taken as a reference, and the data quantity value of the energy source information to be encrypted at the previous second time is taken as a reference;
Figure 681938DEST_PATH_IMAGE005
is to calculateK d The time of the energy source information to be encrypted at the third previous time is taken as a reference, the data quantity value of the energy source information to be encrypted at the third previous time is taken as a reference,Athe weight value of the data quantity value of the energy source information to be encrypted at the previous first moment,Bthe weighted value of the data quantity value of the energy information to be encrypted at the previous second moment,Cthe weighted value of the data quantity value of the energy information to be encrypted at the previous second moment.
3. The energy key table-based encryption method of claim 1,
the method for acquiring a plurality of energy source data to be encrypted with time series comprises the following steps:
receiving selected information, wherein the selected information at least comprises target time period information and target energy information;
selecting corresponding duration sequence energy source data to be encrypted in a plurality of categories of energy source data to be encrypted based on the target energy source information;
and selecting a time sequence of energy source data to be encrypted in the energy source data to be encrypted based on the target time period information.
4. The energy key table-based encryption method of claim 1,
generating a time sequence table based on the time sequence and the energy source mark to be encrypted comprises:
acquiring each moment value in the time sequence;
extracting year, month and day information in the time value, and converting the year, month and day information into first quantity information according to a first preset mode;
extracting time, minute and second information in the time value, and converting the time, minute and second information into second numerical information according to a second preset mode;
generating a quantized time value based on the first quantity information and the second quantity information;
and generating a time sequence table by the quantized time value and the corresponding energy source mark to be encrypted.
5. The energy key table-based encryption method according to claim 4,
the step of generating a time sequence table by the quantized time value and the corresponding energy mark to be encrypted comprises the following steps:
quantizing the energy mark to be encrypted based on a preset corresponding relationship to obtain a quantized energy mark to be encrypted, wherein the preset corresponding relationship is the corresponding relationship between the energy mark to be encrypted and a quantized value of the energy mark to be encrypted;
and combining the quantized time value and the quantized energy mark into a quantitative value to generate a time sequence table.
6. The energy key table-based encryption method of claim 1,
the encrypting the corresponding energy information to be encrypted based on the multidimensional key to obtain the encrypted energy information comprises the following steps:
adding the multi-dimensional key into a preset general compression path to generate an encrypted compression path;
generating a reverse decryption decompression path according to the encryption compression path, wherein the decryption decompression path responds to the multidimensional key to perform decompression processing;
and encrypting the energy information to be encrypted based on the encryption compression path to obtain encrypted energy information.
7. The energy key table-based encryption method of claim 6, further comprising:
setting a damage logic in the decryption decompression path;
and when the error frequency of the multidimensional key received by the decryption decompression path exceeds a preset value, the encrypted energy information is destroyed according to a preset destruction logic based on the destruction logic.
8. The energy key table-based encryption method of claim 7,
wherein the default value of the number of errors is 3.
9. Encryption equipment based on energy key table, its characterized in that includes:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a plurality of to-be-encrypted energy data with time sequences, and the to-be-encrypted energy data at least comprises to-be-encrypted energy information and to-be-encrypted energy marks;
the generating module is used for generating a time sequence table based on the time sequence and the energy mark to be encrypted, extracting the binary codes of the time sequence table, and calculating a first hash value of the binary codes of the time sequence table based on a hash algorithm;
the calculation module is used for calculating according to the data quantity value of the energy information to be encrypted to obtain a multi-dimensional key, calculating the multi-dimensional key of each energy data to be encrypted with a time sequence through the following formula,
Figure 707662DEST_PATH_IMAGE001
wherein the content of the first and second substances,Dis a multi-dimensional key, and is characterized in that,T 1is a quantized value of a starting time point of the time series,T 2is a quantized value of the end time point of the time series,His a first hash value,O d Calculated for the previous momentdA multi-dimensional key of the energy data to be encrypted,K d is first of the previous timedThe weight of the multidimensional key of the energy data to be encrypted,Sin order to be a magnitude of the data,Lis a normalized value;
and the encryption module is used for encrypting the corresponding energy information to be encrypted based on the multi-dimensional keys to obtain encrypted energy information, generating an energy key table according to the multi-dimensional keys, generating energy data to be transmitted according to the encrypted energy information, and sending the energy key table and the energy data to be transmitted.
10. Storage medium, characterized in that a computer program is stored in the storage medium, which computer program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 8.
CN202111025654.6A 2021-09-02 2021-09-02 Encryption method, device and storage medium based on energy key table Active CN113468585B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111025654.6A CN113468585B (en) 2021-09-02 2021-09-02 Encryption method, device and storage medium based on energy key table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111025654.6A CN113468585B (en) 2021-09-02 2021-09-02 Encryption method, device and storage medium based on energy key table

Publications (2)

Publication Number Publication Date
CN113468585A true CN113468585A (en) 2021-10-01
CN113468585B CN113468585B (en) 2021-11-19

Family

ID=77867270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111025654.6A Active CN113468585B (en) 2021-09-02 2021-09-02 Encryption method, device and storage medium based on energy key table

Country Status (1)

Country Link
CN (1) CN113468585B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030014637A1 (en) * 2001-06-28 2003-01-16 Ellison Carl M. Time varying presentation of items based on a key hash
US20150270966A1 (en) * 2012-10-12 2015-09-24 Thomson Licensing Aggregator-oblivious encryption of time-series data
WO2019047062A1 (en) * 2017-09-06 2019-03-14 福建联迪商用设备有限公司 Anti-dpa attack encryption method and computer-readable storage medium
US10382407B1 (en) * 2017-03-31 2019-08-13 EMC IP Holding Company LLC Encryption and decryption of time series data using a digital filter array
CN110611570A (en) * 2019-09-26 2019-12-24 鹏城实验室 Encryption, key information providing and data acquisition methods and devices
CN110650116A (en) * 2019-07-04 2020-01-03 浙江工商大学 Multi-type multi-dimensional data aggregation method and system for security smart power grid
CN112636895A (en) * 2020-09-07 2021-04-09 长沙理工大学 Image encryption and decryption method and image encryption and decryption system
CN113032828A (en) * 2021-03-23 2021-06-25 广东电网有限责任公司 Improved binary system interaction information encryption method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030014637A1 (en) * 2001-06-28 2003-01-16 Ellison Carl M. Time varying presentation of items based on a key hash
US20150270966A1 (en) * 2012-10-12 2015-09-24 Thomson Licensing Aggregator-oblivious encryption of time-series data
US10382407B1 (en) * 2017-03-31 2019-08-13 EMC IP Holding Company LLC Encryption and decryption of time series data using a digital filter array
WO2019047062A1 (en) * 2017-09-06 2019-03-14 福建联迪商用设备有限公司 Anti-dpa attack encryption method and computer-readable storage medium
CN110650116A (en) * 2019-07-04 2020-01-03 浙江工商大学 Multi-type multi-dimensional data aggregation method and system for security smart power grid
CN110611570A (en) * 2019-09-26 2019-12-24 鹏城实验室 Encryption, key information providing and data acquisition methods and devices
CN112636895A (en) * 2020-09-07 2021-04-09 长沙理工大学 Image encryption and decryption method and image encryption and decryption system
CN113032828A (en) * 2021-03-23 2021-06-25 广东电网有限责任公司 Improved binary system interaction information encryption method and device

Also Published As

Publication number Publication date
CN113468585B (en) 2021-11-19

Similar Documents

Publication Publication Date Title
CN110324143B (en) Data transmission method, electronic device and storage medium
CN111698088B (en) Key alternation method, key alternation device, electronic equipment and medium
CN109522328B (en) Data processing method and device, medium and terminal thereof
CN108647262B (en) Picture management method and device, computer equipment and storage medium
CN101262599A (en) Method and system for data processing
CN114969128A (en) Secret query method, system and storage medium based on secure multi-party computing technology
CN113468585B (en) Encryption method, device and storage medium based on energy key table
CN113343255A (en) Data interaction method based on privacy protection
CN111475690B (en) Character string matching method and device, data detection method and server
Tang et al. OPPR: An outsourcing privacy-preserving JPEG image retrieval scheme with local histograms in cloud environment
CN116305294B (en) Data leakage tracing method and device, electronic equipment and storage medium
CN104363089B (en) A kind of method that fuzzy vault is realized based on geographical location information
CN113572860B (en) Method and device for tracking leaked data, storage system, equipment and storage medium
CN113315629B (en) Cloud storage and verification system for business passwords
CN114547562A (en) Method and device for adding and applying text watermark
CN115935299A (en) Authorization control method, device, computer equipment and storage medium
CN113032828A (en) Improved binary system interaction information encryption method and device
CN110737925A (en) storage system hard disk protection method and device
CN117077185B (en) Data storage and protection method, system and medium based on HMAC and secret sharing
Ramadhan et al. Data security using low bit encoding algorithm and rsa algorithm
CN117910023B (en) Computer information security processing method and system based on big data
CN112910654B (en) Private key management method, system, equipment and storage medium
CN117390687B (en) Sensitive data query method and device, storage medium and electronic equipment
Alfawair et al. Secure Image Indexing Using Speeded Up Robust Features (SURF) Key Points and SHAKE256 Hashing
CN115630670A (en) Two-dimensional code generation method and device, electronic equipment 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