CN113468585B - 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 PDFInfo
- Publication number
- CN113468585B CN113468585B CN202111025654.6A CN202111025654A CN113468585B CN 113468585 B CN113468585 B CN 113468585B CN 202111025654 A CN202111025654 A CN 202111025654A CN 113468585 B CN113468585 B CN 113468585B
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000003860 storage Methods 0.000 title claims abstract description 30
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 10
- 230000006835 compression Effects 0.000 claims description 18
- 238000007906 compression Methods 0.000 claims description 18
- 230000006837 decompression Effects 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 14
- 230000006378 damage Effects 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 4
- 238000010606 normalization Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 description 10
- 230000005540 biological transmission Effects 0.000 description 6
- 239000003550 marker Substances 0.000 description 6
- 230000008859 change Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000013139 quantization Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 241001391944 Commicarpus scandens Species 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing 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
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,
wherein,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:
wherein,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;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;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,
wherein,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,
wherein,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 momentThe 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, for example, 100, 1000, etc., and is used to reduce the numerical value of the multi-dimensional key for facilitating subsequent calculations.
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:
wherein,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;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;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,Cfor the energy to be encrypted at the second previous momentA weight value of a data magnitude of the source information.
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 obtaineddAnd the 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 used for obtaining the weight of the multi-dimensional key of each energy source data to be encrypted according to the data quantity values of the energy source information to be encrypted at the previous three moments. 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 guaranteedA>B>CSo thatTo pairK d Will have an influence greater thanTo 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,
wherein,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,
wherein,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,Lthe normalization value is preset and is used for reducing the digital value of the multi-dimensional key;
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:
wherein,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;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;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,Cand ensuring that A is greater than B and greater than C for the weighted value of the data quantity value of the energy information to be encrypted at the second moment in the past.
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,
wherein,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,Lthe normalization value is preset and is used for reducing the digital value of the multi-dimensional key;
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.
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 CN113468585A (en) | 2021-10-01 |
CN113468585B true 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 (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7246235B2 (en) * | 2001-06-28 | 2007-07-17 | Intel Corporation | Time varying presentation of items based on a key hash |
EP2720403A1 (en) * | 2012-10-12 | 2014-04-16 | Thomson Licensing | Aggregator-oblivious encryption of time-series data |
CN110650116B (en) * | 2019-07-04 | 2021-08-31 | 浙江工商大学 | Multi-type multi-dimensional data aggregation method for security smart power grid |
CN112636895B (en) * | 2020-09-07 | 2024-09-06 | 长沙理工大学 | 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 |
-
2021
- 2021-09-02 CN CN202111025654.6A patent/CN113468585B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN110611570A (en) * | 2019-09-26 | 2019-12-24 | 鹏城实验室 | Encryption, key information providing and data acquisition methods and devices |
Also Published As
Publication number | Publication date |
---|---|
CN113468585A (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111698088B (en) | Key alternation method, key alternation device, electronic equipment and medium | |
CN109522328B (en) | Data processing method and device, medium and terminal thereof | |
CN111475690B (en) | Character string matching method and device, data detection method and server | |
CN111651516B (en) | Financial block chain big data processing system and method | |
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 | |
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 | |
US12061604B2 (en) | Searchable encryption system | |
CN113315629A (en) | Cloud storage and verification system for commercial passwords | |
CN116049792A (en) | Face registration and recognition method and face data protection system | |
CN104363089B (en) | A kind of method that fuzzy vault is realized based on geographical location information | |
CN110737925A (en) | storage system hard disk protection method and device | |
Ramadhan et al. | Data security using low bit encoding algorithm and rsa algorithm | |
CN114547562A (en) | Method and device for adding and applying text watermark | |
CN113032828A (en) | Improved binary system interaction information encryption method and device | |
CN117077185B (en) | Data storage and protection method, system and medium based on HMAC and secret sharing | |
CN114945963A (en) | Registration device, search operation device, data management device, registration program, search operation program, and data management program | |
CN118332529B (en) | Method, device, medium and electronic equipment for generating data security identifier | |
CN115051840B (en) | Safety monitoring system for data transmission | |
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 | |
Al-Hassani | Hide Encrypted Secret Image into Audio File using Multi-Logistic Chaotic Map and Wavelet Transform | |
CN118074903A (en) | Integrated data encryption and decryption authorization verification method |
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 |