Power data acquisition terminal and method with encryption function
By introducing a dynamic encryption matrix and random number generation mechanism in the power data acquisition system, combining device status and environment data to dynamically generate encryption keys and random numbers, the problem of difficult data security and privacy in the prior art is solved, and more efficient and secure data encryption protection is achieved.
Patent Information
- Application Number
- CN202411833467.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Existing power data acquisition systems have difficulty ensuring data security and privacy during data transmission, storage and use, especially in the flexibility of key management and encryption algorithms.
By introducing a dynamic encryption matrix, weighting factor, acceleration sensor data and random number generation mechanism, combining device status and environment data, encryption keys and random numbers are generated dynamically, data encryption is encrypted, and the encryption matrix is updated in real time.
Improve the adaptability and security of data encryption, enhance the ability to resist analysis attacks and brute-force cracking, and ensure the integrity and confidentiality of data during transmission.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power data collection with encryption function, and in particular to an electric power data collection terminal and method with encryption function. Background Art
[0002] With the development of smart grids, power data acquisition and monitoring technology plays an increasingly important role in modern power systems. Power data acquisition terminals are used to collect various operating data of power equipment and power systems in real time, such as power consumption, equipment load, environmental status, etc. These data are of great significance for power dispatching, load forecasting, equipment maintenance, etc. However, with the widespread application of data acquisition, data security and privacy issues have become more serious, especially in the process of data transmission, storage and use. How to ensure that data is not tampered with or leaked has become a technical problem that needs to be solved urgently.
[0003] Electricity data is highly sensitive and private. For power companies, electricity consumption data not only reflects the working status of equipment, but is also closely related to key factors such as users' electricity consumption behavior and equipment failure prediction. For users, personal electricity consumption data may leak private information such as users' living habits and work patterns. In addition, with the improvement of the intelligence of equipment, more and more power equipment and terminals transmit data through wireless networks. Data is vulnerable to external attacks during transmission, exposing great security risks. Therefore, ensuring the integrity, confidentiality and availability of power data is a core issue in power data acquisition systems. At present, many power data acquisition systems mainly rely on traditional encryption technologies to ensure data security. For example, symmetric encryption algorithms, asymmetric encryption algorithms and hash algorithms are used to encrypt and authenticate data. However, these existing technologies have some limitations in practical applications. Traditional encryption algorithms, such as DES and AES, are effective in ensuring data security, but the encryption process often relies on fixed keys and algorithms. The security of traditional encryption algorithms usually depends on the confidentiality and management of keys. In large-scale power data acquisition terminals, due to the large number of devices and their wide distribution, the distribution and management of keys become very complicated. If the key management is not done properly, it may lead to key leakage or failure, thus affecting the security of data. In addition, the key update mechanism in the prior art lacks flexibility and cannot well cope with the security challenges brought by changes in device status.
[0004] To address the above problems, this technology proposes a new encryption method, which combines the power data acquisition terminal with encryption function and the data protection mechanism, and provides more secure and efficient encryption protection for power data by introducing dynamic encryption matrix, weighting factor, acceleration sensor data and random number generation mechanism. Summary of the invention
[0005] The present invention provides a power data acquisition method with encryption function, which helps solve the problems mentioned in the above background technology.
[0006] The present invention provides the following technical solution: a power data collection method with encryption function, comprising:
[0007] S1. Collect environmental data and equipment information;
[0008] Environmental data is collected through sensors, expressed as Env_Data={E1, E2, E3};
[0009] The sensors include a temperature sensor, a voltage sensor and a humidity sensor;
[0010] The environmental data includes temperature value, voltage value and humidity value;
[0011] Where E1 is the temperature value collected by the temperature sensor, E2 is the voltage value collected by the voltage sensor, and E3 is the humidity value collected by the humidity sensor;
[0012] Get device status information, recorded as Device_Status={D1, D2, D3, D4};
[0013] Where D1 is the unique identifier of the device, D2 is the current battery power of the device, D3 is the acceleration of the device, and D4 is the current timestamp, ensuring that each encryption has a different generated seed;
[0014] Set the seed generation formula to combine device status and environment data;
[0015] S2, combining the device status and the environment data to form a seed generation strategy, and using the seed generation strategy to obtain seeds;
[0016] S3. Obtain an encryption key through a key generation strategy based on the seed generated in step S2;
[0017] S4, forming a random number generation strategy based on the key matrix, and generating a random number through the random number generation strategy;
[0018] S5. Encrypt the data using the key matrix and the generated random number;
[0019] S6, dynamically update the encryption matrix;
[0020] Through steps S1 to S6, the data collection module takes the collected data as input and transmits the data to the data encryption module. The data encryption module first generates a seed, generates a corresponding encryption key according to the seed, generates a random number based on the seed and the encryption key, encrypts the data using the key and the random number, and takes the encrypted data as output. The encrypted data is transmitted to the data collection center through the data transmission module, and the data collection center decrypts the collected encrypted data through the decryption strategy.
[0021] Optionally, the seed generation strategy specifically includes:
[0022] The seed generation formula is Seed=f(Env_Data, Device_Status);
[0023] Where f() is a custom mathematical function used to generate seeds;
[0024] ;
[0025] Where E i represents the i-th item of environmental data, D j Represents the jth item of device status information, α i and β i is the weight coefficient, which is used to adjust the relative importance of different data items.
[0026] Optionally, the key generation strategy specifically includes:
[0027] Set a seed-based key generation method, the key generation formula is K=KeyGen(Seed);
[0028] Where K is the encryption key, KeyGen() is the key generation algorithm, and the encryption key is generated through the following steps;
[0029] Convert the seed Seed into a matrix form, and set the key matrix K to be an m×m matrix, where m is determined by the length of the encrypted data;
[0030] Fill the key matrix K with the seed Seed and the matrix position;
[0031] K ij =Transform(Seed,i,j)=(Seed+i×j)%P;
[0032] Transform() is a transformation function that combines the seed value with the row and column indices of the matrix to generate each element of the matrix. i and j are the row and column indices of the matrix. P is a prime number to ensure that the value of each element is within a reasonable range. % is a modulo operation.
[0033] Filled key matrix , where K ij Generated by seed calculation.
[0034] Optionally, the forming of a random number generation strategy based on a key matrix specifically includes:
[0035] Setting a random number generation algorithm based on the key matrix K;
[0036] The random number generation formula is R=RNG(K);
[0037] Generate pseudo-random numbers using the elements of the matrix K. Generate a pseudo-random number using the following formula:
[0038] ;
[0039] Where Q is a large prime number to ensure that the range of random numbers is large enough, and K ij are the elements of the matrix K, i and j are the indices of the rows and columns of the matrix;
[0040] The generated random number R is further transformed by the following steps:
[0041] .
[0042] Optionally, the encrypting data using a key matrix and a generated random number specifically includes:
[0043] The data is encrypted using the key matrix K and the generated random number R. The encryption formula is:
[0044] ;
[0045] in is a function that represents the degree of influence of environmental data on encryption, obtained by weighted average:
[0046] , where E k is the environmental data item, α k is the weight of each environmental factor;
[0047] in is a function that indicates the degree of influence of device status on encryption, obtained by weighted average:
[0048] , where D j is the device status data item, β j is the weight of each device status factor.
[0049] Optionally, the dynamically updating the encryption matrix specifically includes:
[0050] Set the key matrix update interval, denoted as t;
[0051] Get new environment data and device status data every time t, and use the update formula to update the key matrix. The update formula is:
[0052] K'=KeyGen(NewSeed);
[0053] Among them, NewSeed is the seed regenerated based on the new environment data and device status data, and K' is the updated key matrix.
[0054] Optionally, the data collection center decrypts the collected encrypted data using a decryption strategy, specifically including:
[0055] S7, obtaining keys, random numbers, environmental data, and device status data;
[0056] S8, inverse operation of the decryption matrix, using the inverse operation of the matrix and the reverse multiplication to restore the original data;
[0057] Let the encrypted data be EncryptedData i ;
[0058] The decryption formula is: ;
[0059] Where D' i is the decrypted data, K ij is the key matrix element used in encryption, R i It is the random number used for encryption;
[0060] S9, restore original data;
[0061] The decryption operation is: .
[0062] A terminal for implementing the power data collection method with encryption function, comprising:
[0063] Data collection module: collects temperature values, voltage values, humidity values, the device's unique identifier, the device's current battery power, the device's acceleration, and the current timestamp;
[0064] Data encryption module: combines device status and environmental data, obtains seeds through seed generation strategy, obtains encryption keys through key generation strategy based on the generated seeds, forms random number generation strategy based on key matrix, generates random numbers through random number generation strategy, encrypts data using key matrix and generated random numbers, and dynamically updates encryption matrix;
[0065] Data transmission module: transmits the encrypted data to the data collection center;
[0066] Decryption module: obtains the key, random number, environmental data and device status data, and uses the inverse operation of the matrix and the reverse multiplication to restore the original data.
[0067] The present invention has the following beneficial effects:
[0068] 1. By introducing environmental data and device status information into the data encryption process, this step enhances the adaptability and security of data encryption. Traditional encryption methods often rely on static data sources, for example, only using power data itself, which makes the encrypted data vulnerable to analytical attacks, especially when the encrypted data belongs to a fixed pattern. In this step, environmental data, such as temperature and humidity, and device status data, such as battery power, are used as inputs, which can effectively change the result of each encryption, so that the encryption process no longer relies on a single data source. This approach increases the complexity of data encryption and greatly improves the ability to resist analytical attacks. For example, the encryption results of power data will be different in different environments and device states, and even if the attacker obtains certain encrypted data, it is impossible to accurately predict the encryption method of other data. In this way, even if the attacker can steal part of the encrypted data, other key information cannot be inferred, which greatly improves the security of the system. The purpose of setting the seed generation formula is to reasonably combine the device status and environmental data to ensure that the seeds generated during the encryption process have sufficient randomness and complexity. By inputting multiple data into the formula, not only can the diversity of encryption seeds be increased, but also the security risks caused by seed duplication can be reduced. This step helps ensure that the generated encryption seed can accurately reflect the real-time status of the device and environment, and enhance the unpredictability of the encryption algorithm, making the data transmission process more secure. The reasonable design of the seed generation formula will directly affect the quality and security of the subsequent encryption process. By combining multiple information of device status and environmental data to form a seed generation strategy, the generated seed can be made more secure. Different device status and environmental data will ensure that the seeds generated each time are different, preventing external attackers from predicting through known patterns. This strategy helps reduce the risk of brute force cracking of the encryption algorithm, while enabling the system to adapt to different working environments and device conditions. The enhancement of randomness and unpredictability lays a solid foundation for subsequent key generation and data encryption, and improves the security performance of the entire encryption system. By combining seeds with key generation strategies, unique and unpredictable encryption keys can be generated. Different combinations of seeds ensure the diversity of keys in each encryption process, avoiding the security risks that static keys may bring. The key generation strategy will ensure that the encryption key has sufficient complexity and randomness, thereby greatly improving the security of the data. This process not only improves the system's resistance to attacks, but also enhances the flexibility and adaptability of key management, providing a strong guarantee for the entire data encryption. By combining the key matrix and random number generation strategy, it can be ensured that the generated random numbers not only rely on the complexity of the key, but also generate high-quality random numbers through a unique algorithm. This random number generation method improves the unpredictability of the encryption algorithm and makes the encryption process more protective.Random numbers are usually used to generate symmetric keys, encrypt data, or perturb data during the encryption process. Their randomness and complexity directly determine the encryption strength. Through an efficient random number generation strategy, the anti-attack capability of the entire encryption system can be further enhanced. Using the key matrix and the generated random numbers for data encryption can ensure the security of the data. The multi-dimensional structure of the key matrix makes the encryption process more complex and less predictable, and the introduction of random numbers increases the variability of each encrypted data. Through this process, the data can be fully protected from unauthorized access or tampering. The combination of the key matrix and random numbers optimizes the encryption efficiency and enhances the encryption strength, which plays a key role in ensuring the security and integrity of data during transmission. Dynamically updating the encryption matrix can ensure that the encryption algorithm will not be affected by known attack patterns in long-term operation. By periodically changing the encryption matrix, attackers cannot crack the encryption system by analyzing the pattern of the static encryption matrix. The dynamic update mechanism can also respond to changes in device status and environment to ensure that the encryption process always maintains high security. In addition, this strategy also improves the anti-interference and adaptability of the system, making the encryption process more flexible and reliable, and able to cope with changing external environments and potential security threats. Through the design of this entire process, the data is protected from collection to encryption and then to transmission, which prevents data from being tampered with or stolen during transmission. The efficient input of the data collection module and the powerful protection capability of the encryption module ensure the security of the encrypted data. The key generation, random number generation and encryption algorithm used in each link greatly enhance the volatility and unpredictability of the data during the encryption process, ensuring the immunity of the data to attacks during transmission. The data collection center decrypts the encrypted data through appropriate decryption strategies, and can smoothly restore the data under the premise of ensuring security, which improves the security and efficiency of the entire data transmission process.
[0069] 2. The key to generating seeds is to ensure high randomness and unpredictability in the encryption process. The generation of seed values is based on device and environment data, so that each encryption process no longer relies on static or preset keys, but is dynamically generated according to the current environment and device status. In this way, even if the same data input is used, the generated seed values will be different at different times and in different device states, thus ensuring that the encryption keys and encryption matrices are different each time. The introduction of seeds prevents attackers from reversely calculating and pattern recognizing the encryption process, thereby improving the security of the system. In addition, the generation of seed values increases the "unpredictability" of the encryption process, and even if the attacker knows certain encrypted data, he cannot derive other encrypted data from it. This method effectively solves the security risks caused by fixed seeds or improper key management in traditional encryption algorithms, and improves the encryption's anti-attack capability.
[0070] 3. Key generation is the core link in the encryption process, and its effect directly affects the security of the encryption algorithm. By generating keys based on dynamic seed values, the vulnerabilities of using static keys in traditional encryption systems are avoided. Key generation not only takes into account environmental data and device status data, but also increases the randomness and complexity of the key through complex mathematical calculations. This key generated based on real-time data not only increases the encryption strength, but also makes the key unique in each operation. Therefore, even if an attacker has the key for a certain encryption, it is not easy to infer other keys, which greatly enhances the security and anti-attack capabilities of the system. The algorithm used in the key generation process ensures the irreversibility and computational complexity of the key, which makes the amount of calculation required to crack the key increase exponentially, further increasing the difficulty of password cracking. In addition, the generated key is highly unpredictable, which greatly reduces the possibility of being cracked by brute force or through known plaintext attacks.
[0071] 4. The role of random number generation in encryption algorithms cannot be underestimated. It provides uncertainty and protection for each encryption. By generating random numbers based on seeds and keys, each step in the encryption process can be made more random, so that the encrypted data cannot be predicted by any known pattern or regularity. Traditional encryption algorithms often use fixed keys and algorithms, while the random number generation algorithm in this step introduces randomness in the encryption process into each data item, thereby ensuring that the encrypted data presents new and unpredictable characteristics each time. By continuously generating different random numbers, even if an attacker steals the encrypted data, he cannot infer the random number of the next encryption operation, which greatly increases the difficulty of the attack. For example, for fixed key or known plaintext attacks, using the randomness provided by the pseudo-random number generator, attackers cannot predict future encryption outputs by analyzing the encryption results.
[0072] 5. By using the generated dynamic keys, random numbers, and weighted factors of environment and device data, each data item is ensured to be unique during the encryption process. Since each encryption process is dynamically adjusted based on real-time data and device status, the generated encrypted data is highly random. Even if the same original data is encrypted at different times or on different devices, the encryption results will be completely different. This feature greatly improves the security of the data and prevents attackers from cracking the encrypted data through known plaintext attacks or pattern recognition. In addition, the encryption process also uses a combination of random numbers and encryption matrices to make each encrypted data unpredictable. Even if an attacker can steal part of the encrypted data, other sensitive information cannot be restored, ensuring the integrity and confidentiality of the data.
[0073] 6. Dynamically updating the encryption matrix is the key to ensuring the long-term effectiveness of the encryption algorithm. This process monitors the changes in the device and environmental status in real time, dynamically adjusts the encryption matrix according to the changed status, and ensures that the encryption system can adapt to different working environments and device states. In this way, even if an attacker has mastered the encryption matrix of a certain encryption process, it is impossible to predict or crack the subsequent encrypted data because the matrix used for each encryption is constantly changing. The matrix used for each encryption is different, and attackers cannot infer future encryption modes by analyzing historical encryption data. Even if a key or encryption matrix is leaked, the dynamic update mechanism will quickly invalidate it, avoiding the potential security risks caused by the long-term use of the key. Changes in the status of the device and environment will affect the generation of the encryption matrix, thereby ensuring that the encryption process can respond to new attack methods or changes in environmental conditions in a timely manner.
[0074] 7. By obtaining keys, random numbers, environmental data, and device status data, it is ensured that the decryption process can accurately restore the state at the time of encryption, avoiding security vulnerabilities in key management. In encryption and decryption algorithms, the confidentiality of keys is crucial. By using keys, random numbers, and weighting coefficients extracted from the encryption matrix, we can ensure that the decryption process is consistent with the state at the time of encryption. The extraction of these parameters is based on the dynamic calculation of the environmental data, device status, and seed values used during encryption, preventing security risks caused by static keys or data models. The use of random numbers in the encryption process provides unpredictability for data encryption, while the extraction of random numbers and keys in the decryption process ensures the accuracy of data recovery. The dynamic generation and extraction of keys and random numbers greatly enhances the complexity of the encryption process, making it impossible for attackers to decrypt the data even if they steal the encrypted data, because they cannot obtain or guess the values of keys, random numbers, and weighting coefficients. The introduction of inverse matrix operations ensures that the encrypted data can be restored to the original data through mathematically strict inverse operations. The key to this operation lies in the existence and computational complexity of the inverse matrix, which ensures that only users with the correct keys and encryption matrices can restore the data. Without the correct definition of the inverse matrix or encryption matrix, the decryption process will not be completed. Therefore, even if the attacker obtains the encrypted data, it is still impossible to decrypt without the correct key and matrix information. In addition, the use of the inverse matrix has important security significance. In traditional encryption algorithms, attackers may try to infer the encryption method by using known plaintext attacks. By using the inverse matrix to decrypt data, each encryption matrix is unique and depends on the key and environmental data, which greatly improves the security of the encryption system. Even if the attacker can obtain part of the ciphertext or key, it is not easy to crack the entire encryption system. Restoring the original data is a key link in the entire encryption and decryption process, and its accuracy is directly related to the effectiveness of the system and the reliability of the data. By combining the key, random number and weighting coefficient with the inverse matrix operation, it can be ensured that the encrypted data can obtain the original power data after decryption, thereby ensuring the integrity and consistency of the data. Each operation in the recovery process depends on the random number and environmental data used during encryption, which enables the recovery process to accurately reconstruct the original data even in a changing environment and device state. This step effectively prevents the problem of data loss or incorrect recovery. For example, an attacker may try to destroy data integrity by modifying the ciphertext, but due to the strict matrix operations and key dependence in the encryption and decryption process, the attacker cannot obtain valid decrypted data through simple manipulation or tampering. Therefore, the recovery process can not only correctly restore data, but also prevent data corruption caused by malicious attacks or misoperation. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 This is a schematic diagram of the encryption process of the present invention. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0077] Example, see Figure 1 , a power data acquisition method with encryption function, comprising:
[0078] S1. Collect environmental data and equipment information;
[0079] Environmental data is collected through sensors, expressed as Env_Data={E1, E2, E3};
[0080] The sensors include a temperature sensor, a voltage sensor and a humidity sensor;
[0081] The environmental data includes temperature value, voltage value and humidity value;
[0082] Where E1 is the temperature value collected by the temperature sensor, E2 is the voltage value collected by the voltage sensor, and E3 is the humidity value collected by the humidity sensor;
[0083] Get device status information, recorded as Device_Status={D1, D2, D3, D4};
[0084] Where D1 is the unique identifier of the device, D2 is the current battery power of the device, D3 is the acceleration of the device, and D4 is the current timestamp, ensuring that each encryption has a different generated seed;
[0085] Set the seed generation formula to combine device status and environment data;
[0086] S2, combining the device status and the environment data to form a seed generation strategy, and using the seed generation strategy to obtain seeds;
[0087] S3. Obtain an encryption key through a key generation strategy based on the seed generated in step S2;
[0088] S4, forming a random number generation strategy based on the key matrix, and generating a random number through the random number generation strategy;
[0089] S5. Encrypt the data using the key matrix and the generated random number;
[0090] S6, dynamically update the encryption matrix;
[0091] Through steps S1 to S6, the data collection module takes the collected data as input and transmits the data to the data encryption module. The data encryption module first generates a seed, generates a corresponding encryption key according to the seed, generates a random number based on the seed and the encryption key, encrypts the data using the key and the random number, and takes the encrypted data as output. The encrypted data is transmitted to the data collection center through the data transmission module, and the data collection center decrypts the collected encrypted data through the decryption strategy.
[0092] By introducing environmental data and device status information into the data encryption process, this step enhances the adaptability and security of data encryption. Traditional encryption methods often rely on static data sources, for example, only using power data itself, which makes the encrypted data vulnerable to analysis attacks, especially when the encrypted data belongs to a fixed pattern. In this step, environmental data, such as temperature and humidity, and device status data, such as battery power, are used as inputs, which can effectively change the result of each encryption, so that the encryption process no longer relies on a single data source. This approach increases the complexity of data encryption and greatly improves the ability to resist analysis attacks. For example, the encryption results of power data will be different in different environments and device states, and even if the attacker obtains some encrypted data, it is impossible to accurately predict the encryption method of other data. In this way, even if the attacker can steal part of the encrypted data, other key information cannot be inferred, which greatly improves the security of the system. The purpose of setting the seed generation formula is to reasonably combine the device status and environmental data to ensure that the seeds generated during the encryption process have sufficient randomness and complexity. By inputting multiple data into the formula, not only can the diversity of encryption seeds be increased, but also the security risks caused by seed duplication can be reduced. This step helps ensure that the generated encryption seed can accurately reflect the real-time status of the device and environment, and enhance the unpredictability of the encryption algorithm, making the data transmission process more secure. The reasonable design of the seed generation formula will directly affect the quality and security of the subsequent encryption process. By combining multiple information of device status and environmental data to form a seed generation strategy, the generated seed can be made more secure. Different device status and environmental data will ensure that the seeds generated each time are different, preventing external attackers from predicting through known patterns. This strategy helps reduce the risk of brute force cracking of the encryption algorithm, while enabling the system to adapt to different working environments and device conditions. The enhancement of randomness and unpredictability lays a solid foundation for subsequent key generation and data encryption, and improves the security performance of the entire encryption system. By combining seeds with key generation strategies, unique and unpredictable encryption keys can be generated. Different combinations of seeds ensure the diversity of keys in each encryption process, avoiding the security risks that static keys may bring. The key generation strategy will ensure that the encryption key has sufficient complexity and randomness, thereby greatly improving the security of the data. This process not only improves the system's resistance to attacks, but also enhances the flexibility and adaptability of key management, providing a strong guarantee for the entire data encryption. By combining the key matrix and random number generation strategy, it can be ensured that the generated random numbers not only rely on the complexity of the key, but also generate high-quality random numbers through a unique algorithm. This random number generation method improves the unpredictability of the encryption algorithm and makes the encryption process more protective.Random numbers are usually used to generate symmetric keys, encrypt data, or perturb data during the encryption process. Their randomness and complexity directly determine the encryption strength. Through an efficient random number generation strategy, the anti-attack capability of the entire encryption system can be further enhanced. Using the key matrix and the generated random numbers for data encryption can ensure the security of the data. The multi-dimensional structure of the key matrix makes the encryption process more complex and less predictable, and the introduction of random numbers increases the variability of each encrypted data. Through this process, the data can be fully protected from unauthorized access or tampering. The combination of the key matrix and random numbers optimizes the encryption efficiency and enhances the encryption strength, which plays a key role in ensuring the security and integrity of data during transmission. Dynamically updating the encryption matrix can ensure that the encryption algorithm will not be affected by known attack patterns in long-term operation. By periodically changing the encryption matrix, attackers cannot crack the encryption system by analyzing the pattern of the static encryption matrix. The dynamic update mechanism can also respond to changes in device status and environment to ensure that the encryption process always maintains high security. In addition, this strategy also improves the anti-interference and adaptability of the system, making the encryption process more flexible and reliable, and able to cope with changing external environments and potential security threats. Through the design of this entire process, the data is protected from collection to encryption and then to transmission, which prevents data from being tampered with or stolen during transmission. The efficient input of the data collection module and the powerful protection capability of the encryption module ensure the security of the encrypted data. The key generation, random number generation and encryption algorithm used in each link greatly enhance the volatility and unpredictability of the data during the encryption process, ensuring the immunity of the data to attacks during transmission. The data collection center decrypts the encrypted data through appropriate decryption strategies, and can smoothly restore the data under the premise of ensuring security, which improves the security and efficiency of the entire data transmission process.
[0093] The seed generation strategy specifically includes:
[0094] The seed generation formula is Seed=f(Env_Data, Device_Status);
[0095] Where f() is a custom mathematical function used to generate seeds;
[0096] ;
[0097] Where E i represents the i-th item of environmental data, D j Represents the jth item of device status information, α i and β i is the weight coefficient, which is used to adjust the relative importance of different data items.
[0098] The key to generating seeds is to ensure high randomness and unpredictability in the encryption process. The generation of seed values is based on device and environment data, so that each encryption process no longer relies on static or preset keys, but is dynamically generated according to the current environment and device status. In this way, even if the same data input is used, the generated seed values will be different at different times and in different device states, thus ensuring that the encryption keys and encryption matrices are different each time. The introduction of seeds prevents attackers from reversely calculating and pattern recognizing the encryption process, thus improving the security of the system. In addition, the generation of seed values increases the "unpredictability" of the encryption process, and even if the attacker knows some encrypted data, he cannot deduce other encrypted data from it. This method effectively solves the security risks caused by fixed seeds or improper key management in traditional encryption algorithms, and improves the encryption's anti-attack capability.
[0099] The key generation strategy specifically includes:
[0100] Set a seed-based key generation method, the key generation formula is K=KeyGen(Seed);
[0101] Where K is the encryption key, KeyGen() is the key generation algorithm, and the encryption key is generated through the following steps;
[0102] Convert the seed Seed into a matrix form, and set the key matrix K to be an m×m matrix, where m is determined by the length of the encrypted data;
[0103] Fill the key matrix K with the seed Seed and the matrix position;
[0104] K ij =Transform(Seed,i,j)=(Seed+i×j)%P;
[0105] Transform() is a transformation function that combines the seed value with the row and column indices of the matrix to generate each element of the matrix. i and j are the row and column indices of the matrix. P is a prime number to ensure that the value of each element is within a reasonable range. % is a modulo operation.
[0106] Filled key matrix , where K ij Generated by seed calculation.
[0107] Key generation is the core link in the encryption process, and its effect directly affects the security of the encryption algorithm. By generating keys based on dynamic seed values, the vulnerabilities of using static keys in traditional encryption systems are avoided. Key generation not only takes into account environmental data and device status data, but also increases the randomness and complexity of the key through complex mathematical calculations. This key generated based on real-time data not only increases the encryption strength, but also makes the key unique in each operation. Therefore, even if an attacker has the key for a certain encryption, it is difficult to infer other keys, which greatly enhances the security and anti-attack capabilities of the system. The algorithm used in the key generation process ensures the irreversibility and computational complexity of the key, which makes the amount of calculation required to crack the key increase exponentially, further increasing the difficulty of password cracking. In addition, the generated key is highly unpredictable, which greatly reduces the possibility of being cracked by brute force or through known plaintext attacks.
[0108] The random number generation strategy formed based on the key matrix specifically includes:
[0109] Setting a random number generation algorithm based on the key matrix K;
[0110] The random number generation formula is R=RNG(K);
[0111] Generate a pseudo-random number using the elements of the matrix K. Generate a pseudo-random number using the following formula:
[0112] ;
[0113] Where Q is a large prime number to ensure that the range of random numbers is large enough, and K ij are the elements of the matrix K, i and j are the indices of the rows and columns of the matrix;
[0114] The generated random number R is further transformed by the following steps:
[0115] .
[0116] The role of random number generation in encryption algorithms cannot be underestimated. It provides uncertainty and protection for each encryption. By generating random numbers based on seeds and keys, each step in the encryption process can be made more random, so that the encrypted data cannot be predicted by any known pattern or regularity. Traditional encryption algorithms often use fixed keys and algorithms, while the random number generation algorithm in this step introduces randomness in the encryption process into each data item, ensuring that the encrypted data presents new and unpredictable characteristics each time. By continuously generating different random numbers, even if an attacker steals the encrypted data, he cannot infer the random number of the next encryption operation, which greatly increases the difficulty of the attack. For example, for fixed key or known plaintext attacks, using the randomness provided by the pseudo-random number generator, attackers cannot predict future encryption outputs by analyzing the encryption results.
[0117] The method of encrypting data using a key matrix and a generated random number specifically includes:
[0118] The data is encrypted using the key matrix K and the generated random number R. The encryption formula is:
[0119] ;
[0120] in is a function that represents the degree of influence of environmental data on encryption, obtained by weighted average:
[0121] , where E k is the environmental data item, α k is the weight of each environmental factor;
[0122] in is a function that indicates the degree of influence of device status on encryption, obtained by weighted average:
[0123] , where D j is the device status data item, β j is the weight of each device status factor.
[0124] By utilizing the generated dynamic keys, random numbers, and weighted factors of the environment and device data, each data item is ensured to be unique during the encryption process. Since each encryption process is dynamically adjusted based on real-time data and device status, the generated encrypted data is highly random. Even if the same original data is encrypted at different times or on different devices, the encryption results will be completely different. This feature greatly improves the security of the data and prevents attackers from cracking the encrypted data through known plaintext attacks or pattern recognition. In addition, the encryption process also utilizes a combination of random numbers and encryption matrices to make each encrypted data unpredictable. Even if an attacker can steal part of the encrypted data, other sensitive information cannot be recovered, ensuring the integrity and confidentiality of the data.
[0125] The dynamically updating encryption matrix specifically includes:
[0126] Set the key matrix update interval, denoted as t;
[0127] Get new environment data and device status data every time t, and use the update formula to update the key matrix. The update formula is:
[0128] K'=KeyGen(NewSeed);
[0129] Among them, NewSeed is the seed regenerated based on the new environment data and device status data, and K' is the updated key matrix.
[0130] Dynamically updating the encryption matrix is key to ensuring the long-term effectiveness of the encryption algorithm. This process monitors changes in the device and environmental status in real time, dynamically adjusts the encryption matrix according to the changing status, and ensures that the encryption system can adapt to different working environments and device states. In this way, even if an attacker has mastered the encryption matrix of a certain encryption process, it is impossible to predict or crack the subsequent encrypted data because the matrix used for each encryption is constantly changing. The matrix used for each encryption is different, and attackers cannot infer future encryption modes by analyzing historical encryption data. Even if a key or encryption matrix is leaked, the dynamic update mechanism will quickly invalidate it, avoiding the potential security risks caused by the long-term use of the key. Changes in the device and environmental status will affect the generation of the encryption matrix, thereby ensuring that the encryption process can respond to new attack methods or changes in environmental conditions in a timely manner.
[0131] The data collection center decrypts the collected encrypted data through a decryption strategy, which specifically includes:
[0132] S7, obtaining keys, random numbers, environmental data, and device status data;
[0133] S8, inverse operation of the decryption matrix, using the inverse operation of the matrix and the reverse multiplication to restore the original data;
[0134] Let the encrypted data be EncryptedData i ;
[0135] The decryption formula is: ;
[0136] Where D' i is the decrypted data, K ij is the key matrix element used in encryption, R i It is the random number used for encryption;
[0137] S9, restore original data;
[0138] The decryption operation is: .
[0139] By obtaining keys, random numbers, environmental data, and device status data, it is ensured that the decryption process can accurately restore the state at the time of encryption, avoiding security vulnerabilities in key management. In encryption and decryption algorithms, the confidentiality of keys is crucial. By using keys, random numbers, and weighting coefficients extracted from the encryption matrix, we can ensure that the decryption process is consistent with the state at the time of encryption. The extraction of these parameters is based on the dynamic calculation of the environmental data, device status, and seed values used during encryption, preventing security risks caused by static keys or data models. The use of random numbers in the encryption process provides unpredictability for data encryption, while the extraction of random numbers and keys in the decryption process ensures the accuracy of data recovery. The dynamic generation and extraction of keys and random numbers greatly enhances the complexity of the encryption process, making it impossible for attackers to decrypt the data even if they steal the encrypted data, because they cannot obtain or guess the values of keys, random numbers, and weighting coefficients. The introduction of inverse matrix operations ensures that the encrypted data can be restored to the original data through mathematically strict inverse operations. The key to this operation lies in the existence and computational complexity of the inverse matrix, which ensures that only users with the correct keys and encryption matrices can restore the data. Without the correct definition of the inverse matrix or encryption matrix, the decryption process will not be completed. Therefore, even if the attacker obtains the encrypted data, it is still impossible to decrypt without the correct key and matrix information. In addition, the use of the inverse matrix has important security significance. In traditional encryption algorithms, attackers may try to infer the encryption method by using known plaintext attacks. By using the inverse matrix to decrypt data, each encryption matrix is unique and depends on the key and environmental data, which greatly improves the security of the encryption system. Even if the attacker can obtain part of the ciphertext or key, it is not easy to crack the entire encryption system. Restoring the original data is a key link in the entire encryption and decryption process, and its accuracy is directly related to the effectiveness of the system and the reliability of the data. By combining the key, random number and weighting coefficient with the inverse matrix operation, it can be ensured that the encrypted data can obtain the original power data after decryption, thereby ensuring the integrity and consistency of the data. Each operation in the recovery process depends on the random number and environmental data used during encryption, which enables the recovery process to accurately reconstruct the original data even in a changing environment and device state. This step effectively prevents the problem of data loss or incorrect recovery. For example, an attacker may try to destroy data integrity by modifying the ciphertext, but due to the strict matrix operations and key dependence in the encryption and decryption process, the attacker cannot obtain valid decrypted data through simple manipulation or tampering. Therefore, the recovery process can not only correctly restore data, but also prevent data corruption caused by malicious attacks or misoperation.
[0140] This embodiment also provides a terminal of a power data collection method with an encryption function, including:
[0141] Data collection module: collects temperature values, voltage values, humidity values, the device's unique identifier, the device's current battery power, the device's acceleration, and the current timestamp;
[0142] Data encryption module: combines device status and environmental data, obtains seeds through seed generation strategy, obtains encryption keys through key generation strategy based on the generated seeds, forms random number generation strategy based on key matrix, generates random numbers through random number generation strategy, encrypts data using key matrix and generated random numbers, and dynamically updates encryption matrix;
[0143] Data transmission module: transmits the encrypted data to the data collection center;
[0144] Decryption module: obtains the key, random number, environmental data and device status data, and uses the inverse operation of the matrix and the reverse multiplication to restore the original data.
[0145] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0146] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A power data collection method with encryption function, characterized in that: include: S1. Collect environmental data and equipment information; Environmental data is collected through sensors, expressed as Env_Data={E1, E2, E3}; The sensors include a temperature sensor, a voltage sensor and a humidity sensor; The environmental data includes temperature value, voltage value and humidity value; Where E1 is the temperature value collected by the temperature sensor, E2 is the voltage value collected by the voltage sensor, and E3 is the humidity value collected by the humidity sensor; Get device status information, recorded as Device_Status={D1, D2, D3, D4}; Where D1 is the unique identifier of the device, D2 is the current battery power of the device, D3 is the acceleration of the device, and D4 is the current timestamp, ensuring that each encryption has a different generated seed; Set the seed generation formula to combine device status and environment data; S2, combining the device status and the environment data to form a seed generation strategy, and using the seed generation strategy to obtain seeds; The seed generation strategy specifically includes: The seed generation formula is Seed=f(Env_Data, Device_Status); Where f() is a custom mathematical function used to generate seeds; ; Where E i represents the i-th item of environmental data, D j Represents the jth item of device status information, α i and β i is the weight coefficient, which is used to adjust the relative importance of different data items; S3. Obtain an encryption key through a key generation strategy based on the seed generated in step S2; S4, forming a random number generation strategy based on the key matrix, and generating a random number through the random number generation strategy; S5. Encrypt the data using the key matrix and the generated random number; S6, dynamically update the encryption matrix; Through steps S1 to S6, the data collection module takes the collected data as input and transmits the data to the data encryption module. The data encryption module first generates a seed, generates a corresponding encryption key according to the seed, generates a random number based on the seed and the encryption key, encrypts the data using the key and the random number, and takes the encrypted data as output. The encrypted data is transmitted to the data collection center through the data transmission module, and the data collection center decrypts the collected encrypted data through the decryption strategy.
2. The power data collection method with encryption function according to claim 1 is characterized in that: The key generation strategy specifically includes: Set a seed-based key generation method, the key generation formula is K=KeyGen(Seed); Where K is the encryption key, KeyGen() is the key generation algorithm, and the encryption key is generated through the following steps; Convert the seed Seed into a matrix form, and assume that the key matrix K is an m×m matrix, where m is determined by the length of the encrypted data; Fill the key matrix K with the seed Seed and the matrix position; K ij =Transform(Seed,i,j)=(Seed+i×j)%P; Transform() is a transformation function that combines the seed value with the row and column indices of the matrix to generate each element of the matrix. i and j are the row and column indices of the matrix. P is a prime number to ensure that the value of each element is within a reasonable range. % is a modulo operation. Filled key matrix , where K ij Generated by seed calculation.
3. The power data collection method with encryption function according to claim 2 is characterized in that: The random number generation strategy formed based on the key matrix specifically includes: Setting a random number generation algorithm based on the key matrix K; The random number generation formula is R=RNG(K); Generate a pseudo-random number using the elements of the matrix K. Generate a pseudo-random number using the following formula: ; Where Q is a large prime number to ensure that the range of random numbers is large enough, and K ij are the elements of the matrix K, i and j are the indices of the rows and columns of the matrix; The generated random number R is further transformed by the following steps: 。 4. The method for collecting power data with encryption function according to claim 3, characterized in that: The method of encrypting data using a key matrix and a generated random number specifically includes: The data is encrypted using the key matrix K and the generated random number R. The encryption formula is: ; in is a function that represents the degree of influence of environmental data on encryption, obtained by weighted average: , where E k is the environmental data item, α k is the weight of each environmental factor; in is a function that indicates the degree of influence of device status on encryption, obtained by weighted average: , where D j is the device status data item, β j is the weight of each device status factor.
5. The method for collecting power data with encryption function according to claim 4, characterized in that: The dynamically updating encryption matrix specifically includes: Set the key matrix update interval, denoted as t; Get new environment data and device status data every time t, and use the update formula to update the key matrix. The update formula is: K'=KeyGen(NewSeed); Among them, NewSeed is the seed regenerated based on the new environment data and device status data, and K' is the updated key matrix.
6. The method for collecting power data with encryption function according to claim 5, characterized in that: The data collection center decrypts the collected encrypted data through a decryption strategy, which specifically includes: S7, obtaining keys, random numbers, environmental data, and device status data; S8, inverse operation of the decryption matrix, using the inverse operation of the matrix and the reverse multiplication to restore the original data; Let the encrypted data be EncryptedData i ; The decryption formula is: ; Where D' i is the decrypted data, K ij is the key matrix element used in encryption, R i It is the random number used for encryption; S9, restore original data; The decryption operation is: .
7. A terminal using the power data collection method with encryption function as claimed in claim 6, characterized in that: include: Data collection module: collects temperature values, voltage values, humidity values, the device's unique identifier, the device's current battery power, the device's acceleration, and the current timestamp; Data encryption module: combines device status and environmental data, obtains seeds through seed generation strategy, obtains encryption keys through key generation strategy based on the generated seeds, forms random number generation strategy based on key matrix, generates random numbers through random number generation strategy, encrypts data using key matrix and generated random numbers, and dynamically updates encryption matrix; Data transmission module: transmits the encrypted data to the data collection center; Decryption module: obtains the key, random number, environmental data and device status data, and uses the inverse operation of the matrix and the reverse multiplication to restore the original data.
Citation Information
Patent Citations
Private key generation method and system based on voiceprint recognition
CN110661615A
Security hybrid encryption method based on narrowband Internet of Things
CN111541677A