Data encryption and decryption transmission method and device, medium and program product
By using data frame construction and encryption algorithms in the power Internet of Things, the target transmission data is encapsulated into encrypted data and transmitted through the data transmission network, the problem of low data transmission efficiency caused by limited resources of embedded devices is solved, and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411905731.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-08
AI Technical Summary
In the power Internet of Things, due to limited resources of embedded devices, traditional complex encryption algorithms have high computational complexity during data transmission, resulting in low data transmission efficiency.
By acquiring the target transmission data, the initial data frame set is determined based on the pre-constructed data frame construction algorithm, the encrypted data sequence is determined based on the preset encryption algorithm, the encrypted data is encapsulated as the target encryption data, and transmitted to the second terminal through the data transmission network for decryption.
Improves the security and efficiency of data transmission and reduces the consumption of computing resources on embedded devices.
Smart Images

Figure CN119788366A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data encryption technology, and in particular to a data encryption and decryption transmission method, device, medium and program product. Background Art
[0002] With the rapid development of the power Internet of Things, a large number of embedded devices are widely used in various links of the power system. Embedded devices need to transmit data between different platforms to realize functions such as monitoring, control and management of the power system.
[0003] In the process of data transmission, there are challenges in data security and reliability. Data transmission errors seriously affect the stable operation of the power system, and embedded devices in the power Internet of Things usually have limited resources, including computing power, storage capacity, and energy supply. Traditional data transmission methods use relatively complex encryption algorithms to encrypt data before transmission.
[0004] However, after the data is encrypted using a more complex encryption algorithm, although the security is high during the data transmission process, the calculation complexity is large, a large amount of computing resources will be consumed when running on an embedded device, and the data transmission efficiency is low. Summary of the invention
[0005] The present invention provides a data encryption and decryption transmission method, device, medium and program product, which can improve the data transmission efficiency while improving the data transmission security.
[0006] According to one aspect of the present invention, there is provided a method for encrypting and decrypting data and transmitting the data, comprising:
[0007] Acquire target transmission data of the first terminal, and determine an initial data frame set corresponding to the target transmission data based on a pre-constructed data frame construction algorithm;
[0008] Determine an encrypted data sequence corresponding to the initial data frame set based on a preset data encryption algorithm, and determine target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence;
[0009] The target encrypted data is transmitted to a second terminal via a data transmission network, so that the second terminal decrypts the target encrypted data using a preset data decryption algorithm to obtain target transmission data.
[0010] According to another aspect of the present invention, there is provided a data encryption and decryption transmission device, comprising:
[0011] An initial data frame set construction module, used to obtain target transmission data of the first terminal, and determine an initial data frame set corresponding to the target transmission data based on a pre-constructed data frame construction algorithm;
[0012] A data encryption module, used to determine an encrypted data sequence corresponding to the initial data frame set based on a preset data encryption algorithm, and determine target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence;
[0013] The data decryption module is used to transmit the target encrypted data to the second terminal through the data transmission network, so that the second terminal decrypts the target encrypted data through a preset data decryption algorithm to obtain the target transmission data.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data encryption, decryption and transmission method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data encryption, decryption and transmission method described in any embodiment of the present invention when executed.
[0019] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the data encryption, decryption and transmission method described in any embodiment of the present invention is implemented.
[0020] The technical solution of the embodiment of the present invention obtains the target transmission data of the first terminal, determines the initial data frame set corresponding to the target transmission data based on the pre-constructed data frame construction algorithm; determines the encrypted data sequence corresponding to the initial data frame set based on the preset data encryption algorithm, and determines the target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence, which can encapsulate the data into encrypted data with lower energy consumption, thereby improving the security of the data. The target encrypted data is transmitted to the second terminal through the data transmission network, so that the second terminal decrypts the target encrypted data through the preset data decryption algorithm to obtain the target transmission data. It can improve the security of data transmission and improve the efficiency of data transmission.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flow chart of a data encryption and decryption transmission method provided according to the first embodiment of the present invention;
[0024] Figure 2 is a flow chart of another data encryption and decryption transmission method provided according to the second embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of the structure of a data encryption and decryption transmission device provided according to Embodiment 3 of the present invention;
[0026] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the data encryption and decryption transmission method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 A flowchart of a data encryption and decryption transmission method is provided for the first embodiment of the present invention. This embodiment can be applied to encrypt the target transmission data by a preset data encryption algorithm, and transmit the encrypted data to a second terminal, so that the second terminal decrypts the target encrypted data by a preset data decryption algorithm to obtain the target transmission data. The method can be executed by a data encryption and decryption transmission device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0031] S110: Acquire target transmission data of the first terminal, and determine an initial data frame set corresponding to the target transmission data based on a pre-constructed data frame construction algorithm.
[0032] The first terminal may be an embedded device in the power Internet of Things, such as a smart meter. The first terminal may be used to monitor and collect power data in the power Internet of Things in real time, and process and encrypt the collected power data. The power data may include voltage data, current data, and the collection time of voltage and current data.
[0033] The target transmission data may be target transmission data corresponding to the power data obtained by cleaning, denoising, and normalizing the collected power data through the first terminal.
[0034] The data frame construction algorithm may be a pre-constructed algorithm for encapsulating the target transmission data to be transmitted into a data frame according to a preset data format and a preset processing rule in network communication. The initial data frame set may be a set of multiple data frames into which the target transmission data of the first terminal is encapsulated by the data frame construction algorithm.
[0035] Optionally, before acquiring the target transmission data of the first terminal, the method may further include: acquiring target power data, and preprocessing the target power data through a normalization algorithm to obtain the target transmission data of the first terminal.
[0036] The target power data may be data related to power obtained through the first terminal in the power system. The target power data may be collected from various links such as power production, transmission, distribution, and power supply load, and is used to reflect the operating status, load conditions, energy efficiency, and other information of the power system. The target power data may include current data and voltage data. The normalization algorithm may be a minimum-maximum normalization algorithm.
[0037] Exemplarily, the target power data can be preprocessed by a normalization algorithm to obtain the target transmission data of the first terminal by the following formula:
[0038] Voltage data:
[0039]
[0040] Among them, X 1 is the normalized value of voltage data, X V is the original value of voltage data, X Vmax Indicates the maximum value of voltage data, X vmin Indicates the minimum value of voltage data;
[0041] Current data:
[0042]
[0043] Among them, X 2 is the normalized value of the current data, X A is the original value of current data, X Amax Indicates the maximum current data, X Amin Indicates the minimum value of current data.
[0044] Optionally, an initial data frame set corresponding to the target transmission data is determined based on a pre-constructed data frame construction algorithm, including: processing the target transmission data through the data frame construction algorithm to obtain a binary sequence data frame corresponding to the target transmission data; dividing the binary sequence data frame into multiple data subsequences according to a preset grouping length, and determining an initial data frame set corresponding to the target transmission data based on the multiple data subsequences.
[0045] The data frame construction algorithm may be a pre-constructed algorithm for converting and encapsulating the target transmission data into a data frame. The binary sequence data frame may be a sequence in binary form corresponding to the target transmission data obtained after being processed by the data frame construction algorithm and encapsulated into a data frame. The preset packet length may be a pre-set length of each data subsequence. The data subsequence may be a binary sequence data frame divided into a plurality of fixed-length data units according to the preset packet length by the data frame construction algorithm, and each data subsequence contains a portion of the original data.
[0046] Specifically, the target transmission data can be converted into a binary sequence data frame based on a pre-constructed data frame construction algorithm, and divided into multiple data subsequences according to a preset group length, and then the initial data frame set corresponding to the target transmission data is determined, which can further improve the efficiency of processing and transmission of power data.
[0047] S120. Determine an encrypted data sequence corresponding to the initial data frame set based on a preset data encryption algorithm, and determine target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence.
[0048] The preset data encryption algorithm may be a predefined algorithm for encrypting data. The preset data encryption algorithm may encrypt each data subsequence in the initial data frame set to ensure the security of the data during transmission. The encrypted data sequence may be an encrypted data sequence obtained after encrypting multiple data subsequences corresponding to the initial data frame set by the preset data encryption algorithm. The target encrypted data may be encrypted data determined according to the initial data frame set and the encrypted data sequence and used to be sent to the data recipient.
[0049] Optionally, determining an encrypted data sequence corresponding to an initial data frame set based on a preset data encryption algorithm includes: obtaining a preset binary sequence, performing a cyclic shift process on each data subsequence through a preset data encryption algorithm to obtain a shifted subsequence corresponding to each data subsequence; and determining an encrypted data sequence corresponding to the initial data frame set based on multiple shifted subsequences and the preset binary sequence.
[0050] Among them, the preset binary sequence can be a predefined binary sequence for encrypting data. For example, an XOR operation can be performed on the preset binary sequence and the data subsequence after cyclic shift processing to generate an encrypted subsequence. The binary sequence can be a fixed sequence set in advance, or a sequence generated according to a certain encryption algorithm rule. The preset binary sequence is used for. The cyclic shift processing can be to cyclically shift the elements in the data sequence in a fixed direction (such as left shift or right shift), and by performing cyclic shift processing on each data subsequence, a shift subsequence corresponding to each data subsequence can be obtained. By performing cyclic shift processing on each data subsequence, the original arrangement order of the data subsequence can be changed, thereby increasing the complexity and randomness of encryption. The shift subsequence can be a data subsequence after cyclic shift processing. The shift subsequence can be used to perform an XOR operation with the preset binary sequence to generate an encrypted subsequence.
[0051] Optionally, determining an encrypted data sequence corresponding to the initial data frame set based on multiple shifted subsequences and a preset binary sequence includes: performing an XOR operation on each shifted subsequence and a preset binary sequence to obtain an encrypted subsequence corresponding to each shifted subsequence; and determining the encrypted data sequence corresponding to the initial data frame set based on multiple encrypted subsequences.
[0052] Specifically, a circular left shift operation can be performed on each data subsequence, and each element in the data subsequence is sequentially shifted to the left by a preset number of positions, and the preset number of elements at the leftmost side of the sequence are sequentially moved to the rightmost side of the sequence position, thereby obtaining a shift subsequence corresponding to each data subsequence. Then, a comparison operation is performed on the shift subsequence with a predefined preset binary sequence, and the numbers at the same position of the two sequences are compared. If the numbers are the same, the XOR operation output is 0, and if the numbers are different, the XOR operation output is 1. The XOR operation is performed on each shift subsequence in turn to obtain an encrypted subsequence corresponding to each shift subsequence, and finally, the encrypted data sequence corresponding to the initial data frame set is determined based on the multiple encrypted subsequences corresponding to the multiple data subsequences.
[0053] Exemplarily, the initial data frame set is 11001010101100100111010, the preset group length is 8, the preset number is 3, and the preset binary sequence is 10101101, then the initial data frame set can be divided into multiple data subsequences 01100101, 01011001 and 00111010. When the encryption operation is performed on the first group sequence 01100101, the sequence 01100101 can be cyclically shifted left by 3 bits to obtain the shifted subsequence 00101011, and the shifted subsequence 00101011 is subjected to a bit-by-bit XOR operation with the preset binary sequence 10101101 to obtain the encrypted sequence 10000110 corresponding to the data subsequence. In the same way, the data subsequences 01011001 and 00111010 are cyclically shifted and XORed to obtain multiple encrypted subsequences corresponding to the multiple data subsequences, and the encrypted data sequence corresponding to the initial data frame set is determined based on the multiple encrypted subsequences.
[0054] Optionally, target encrypted data corresponding to the target transmission data is determined based on the initial data frame set and the encrypted data sequence, including: obtaining a preset encryption sequence, first terminal identification information, second terminal identification information and data collection time of the target power data; splicing the binary sequence data frame, the first terminal identification information, the second terminal identification information, the data collection time, the preset encryption sequence, the initial data frame set and the encrypted data sequence through a preset splicing algorithm to obtain the target encrypted data corresponding to the target transmission data.
[0055] The preset encryption sequence can be a pre-set encryption element used to increase complexity and security in the data encryption process. The preset encryption sequence can be a pre-defined fixed encryption sequence; or it can be dynamically generated based on a certain algorithm or rule. When encrypting data, this preset encryption sequence can be embedded in the encrypted data to increase the security of data transmission.
[0056] The preset splicing algorithm may be a pre-set algorithm for splicing binary sequence data frames, first terminal identification information, second terminal identification information, data collection time, preset encryption sequence, initial data frame set and encrypted data sequence. By setting the splicing algorithm to splice the binary sequence data frames, first terminal identification information, second terminal identification information, data collection time, preset encryption sequence, initial data frame set and encrypted data sequence, target encrypted data corresponding to the target transmission data can be obtained.
[0057] Among them, the first terminal identification information can be a unique identifier of the first terminal sending data, which is used to identify the identity information of the first terminal. The first terminal identification information may include identification information such as the device number, area code, and sequence number of the first terminal. The second terminal identification information may be a unique identifier of the second terminal receiving data, which is used to identify the identity information of the second terminal. The second terminal identification information may include. The data collection time of the target power data may be a specific time point or time period for data recording and acquisition for specific power data in the power system. The authenticity and availability of the power system status can be reflected through the target power data and the data collection time of the target power data.
[0058] Optionally, the binary sequence data frame, the first terminal identification information, the second terminal identification information, the data collection time, the preset encryption sequence, the initial data frame set and the encrypted data sequence are spliced through a preset splicing algorithm to obtain target encrypted data corresponding to the target transmission data.
[0059] Optionally, the first terminal identification information, the second terminal identification information and the data collection time may be spliced, and the spliced data information may be added to the data frame header of the target encrypted data; the preset encryption sequence, the initial data frame set and the encrypted data sequence may be spliced to obtain the main body data of the target encrypted data, and the target encrypted data may be obtained by splicing the data frame header data and the main body data.
[0060] Optionally, the first terminal identification information, the second terminal identification information and the data collection time can also be spliced, and the spliced data information is added to the data frame header of the target encrypted data; multiple data subsequences in the initial data frame set and the encryption subsequences corresponding to the multiple data subsequences in the preset encryption sequence are obtained, and then the spliced encryption subsequence corresponding to each data subsequence is obtained according to each data subsequence, the encryption subsequence corresponding to each data subsequence and the encrypted data sequence, and then the multiple spliced encryption subsequences are spliced to obtain the main body data of the target encrypted data, and the target encrypted data is obtained by splicing the data frame header data and the main body data. Among them, each spliced encryption subsequence is spliced by the corresponding data subsequence, the encryption subsequence corresponding to the data subsequence and the encrypted data sequence.
[0061] S130. Transmit the target encrypted data to the second terminal through the data transmission network, so that the second terminal decrypts the target encrypted data through a preset data decryption algorithm to obtain the target transmission data.
[0062] The data transmission network may be a network for transmitting target encrypted data. The data transmission network may transmit the encrypted target encrypted data from the first terminal to the second terminal securely and reliably. The data transmission network may be composed of various physical and logical components, such as routers, switches, optical fibers, copper cables and other components.
[0063] Among them, the second terminal can be a device for receiving target encrypted data, which can be used to receive and decrypt the target encrypted data sent by the first terminal through the data transmission network. The second terminal can be any electronic device capable of processing and decrypting data, such as a computer, a tablet computer, a smart phone and other devices. The second terminal is equipped with a decryption algorithm that is the same as or compatible with the first terminal, and can correctly decrypt the received target encrypted data. The preset data decryption algorithm can be a decryption algorithm corresponding to the preset encryption algorithm. The preset data decryption algorithm can be used to decrypt the target encrypted data sent by the first terminal through the data transmission network. The algorithm usually corresponds to the algorithm used for encryption, but the operation direction is opposite. Through the preset data decryption algorithm, the second terminal can verify the identity of the sender of the data and ensure the integrity and confidentiality of the data.
[0064] The technical solution of the embodiment of the present invention obtains the target transmission data of the first terminal, determines the initial data frame set corresponding to the target transmission data based on the pre-constructed data frame construction algorithm; determines the encrypted data sequence corresponding to the initial data frame set based on the preset data encryption algorithm, and determines the target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence, which can encapsulate the data into encrypted data with lower energy consumption, thereby improving the security of the data. The target encrypted data is transmitted to the second terminal through the data transmission network, so that the second terminal decrypts the target encrypted data through the preset data decryption algorithm to obtain the target transmission data. It can improve the security of data transmission and improve the efficiency of data transmission.
[0065] Embodiment 2
[0066] Figure 2 This is a flowchart of another data encryption and decryption transmission method provided in the second embodiment of the present invention. Based on the above embodiment, this embodiment refines the method of transmitting target encrypted data to a second terminal through a data transmission network so that the second terminal decrypts the target encrypted data through a preset data decryption algorithm to obtain the target transmission data. The same terms as those in the above embodiment are not repeated here. Figure 2 As shown, the method includes:
[0067] S210: Acquire target transmission data of the first terminal, and determine an initial data frame set corresponding to the target transmission data based on a pre-constructed data frame construction algorithm.
[0068] S220. Determine an encrypted data sequence corresponding to the initial data frame set based on a preset data encryption algorithm, and determine target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence.
[0069] S230. Transmit the target encrypted data to the second terminal through the data transmission network. The second terminal decompresses the target encrypted data through a preset decompression algorithm to obtain the first terminal identification information, the second terminal identification information, the data collection time of the target power data, the initial data frame set and the encrypted data sequence.
[0070] Among them, the preset disassembly algorithm can be a pre-built algorithm for disassembling the target encrypted data into multiple components.
[0071] The target encrypted data is transmitted to the second terminal through the data transmission network. The first terminal IP address (IP address, i.e. Internet Protocol Address) and the second terminal IP address may be pre-set according to the network layer protocol, wherein the first terminal IP address may be determined by conversion based on the first terminal identification information; after the transport layer protocol is selected according to the application scenario, the data frame is sent, and the data frame is routed and forwarded through switches and routers in the network according to the second terminal IP address; when the network management platform of the second terminal receives the data frame, it sends a confirmation message to the first terminal. If the first terminal does not receive it within the specified time, it retransmits it according to the retransmission mechanism.
[0072] Specifically, after the target encrypted data is transmitted to the second terminal through the data transmission network, the second terminal can disassemble the target encrypted data through a preset disassembly algorithm to obtain data frame header data and body data. Among them, the data frame header data may include the identification information of the first terminal, the identification information of the second terminal and the data acquisition time of the target power data. The body data is the power data actually transmitted, and the body data may include an initial data frame set, a preset encryption sequence and an encrypted data sequence. By disassembling the target encrypted data through a preset disassembly algorithm, the target encrypted data can be quickly disassembled into multiple parts, thereby improving the efficiency of subsequent processing and analysis. The disassembly process itself can be used as a security mechanism to ensure that only devices with the correct disassembly algorithm can correctly parse the data, which can further ensure data security. And the disassembled data frame header data and body data can be verified separately. For example, the data frame header data can be used to verify the identity of the sender and the receiver and the timeliness of the data; while the body data can be verified by decrypting and comparing with the initial data frame set to verify the integrity and accuracy of the data.
[0073] Optionally, when the target encrypted data is transmitted to the second terminal through the data transmission network, the second terminal disassembles the target encrypted data through a preset disassembly algorithm to obtain data frame header data and main body data. The identification information of the first terminal and the identification information of the second terminal in the disassembled data frame header data can be verified by the second terminal. When the identification information of the first terminal and the identification information of the second terminal in the data frame header data meet the preset decryption conditions, the main body data can be decrypted through the decryption algorithm. When the identification information of the first terminal and the identification information of the second terminal in the data frame header data do not meet the preset decryption conditions, the main body data will not be decrypted, thereby reducing energy loss while ensuring data security.
[0074] S240. When the first terminal identification information and the second terminal identification information meet a preset decryption condition, the encrypted data sequence is decrypted using a preset data decryption algorithm to obtain a decrypted data frame set corresponding to the encrypted data sequence.
[0075] Among them, the preset decryption condition can be a pre-set condition that the disassembled data needs to meet before decrypting the encrypted data sequence in the target encrypted data. For example, the decryption operation is allowed only when the identification information of the two terminals matches or satisfies a certain specific relationship. By setting the preset decryption condition, the security and confidentiality of the data can be ensured to prevent unauthorized access and tampering. The decrypted data frame set can be a data set corresponding to the initial data frame set obtained by decrypting the encrypted data sequence through a preset data decryption algorithm.
[0076] Exemplarily, when the first terminal identification information and the second terminal identification information meet the preset decryption condition, the data frame body part can be divided into groups according to the specific splicing form between the data frame body part and the encrypted data sequence in the received target encrypted data and the preset group length during encryption to obtain multiple encrypted subsequences. The encrypted subsequences are decrypted by performing bit-by-bit XOR operations and reverse cyclic shift processing with a predefined preset binary sequence to obtain a decrypted data frame set corresponding to the encrypted data sequence.
[0077] S250: verify the target encrypted data according to the decrypted data frame set and the initial data frame set, and if the target encrypted data passes the verification, determine the target transmission data corresponding to the initial data frame set.
[0078] Specifically, after decrypting the encrypted data sequence by a preset data decryption algorithm to obtain a decrypted data frame set corresponding to the encrypted data sequence, the decrypted data frame set can be compared with the initial data frame set. If the decrypted data frame set is consistent with the initial data frame set, it means that there is no error or tampering in the data frame during the data transmission process. When the target encrypted data passes the verification, the target transmission data corresponding to the initial data frame set can be determined by a data recovery algorithm based on the decrypted data frame set and the initial data frame set. The data recovery algorithm can be an algorithm for determining the target transmission data corresponding to the initial data frame set based on the decrypted data frame set and the initial data frame set.
[0079] Optionally, after the second terminal decrypts the target encrypted data using a preset data decryption algorithm, it also includes: when the target encrypted data fails to pass verification, the second terminal sends a data retransmission request to the first terminal; the first terminal regenerates the target encrypted data corresponding to the target transmission data according to the data retransmission request, and transmits the target encrypted data to the second terminal through the data transmission network.
[0080] The data retransmission request may be a data retransmission request sent to the first terminal when the second terminal decrypts the target encrypted data and finds that the decrypted data frame set is inconsistent with the original data frame set before encryption.
[0081] Exemplarily, after decrypting the target encrypted data, the second terminal can compare the decrypted data frame set obtained by decryption with the initial data frame set before encryption. If the decrypted data frame set obtained by decryption is inconsistent with the initial data frame set before encryption, a data retransmission request is sent to the first terminal. When the first terminal receives the data retransmission request, it can determine based on the data retransmission request that the encrypted data previously transmitted to the second terminal has not been correctly restored to the original data after decryption, and there may be a transmission error or data tampering. At this time, the first terminal can regenerate the target encrypted data corresponding to the target transmission data based on the data retransmission request, and retransmit the target encrypted data to the second terminal through the data transmission network, so that the second terminal can obtain the target transmission data by re-decrypting the received target encrypted data.
[0082] The technical solution of the embodiment of the present invention obtains the target transmission data of the first terminal, determines the initial data frame set corresponding to the target transmission data based on the pre-constructed data frame construction algorithm; determines the encrypted data sequence corresponding to the initial data frame set based on the preset data encryption algorithm, and determines the target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence, which can encapsulate the data into encrypted data with lower energy consumption, thereby improving the security of the data. The target encrypted data is transmitted to the second terminal through the data transmission network, so that the second terminal decrypts the target encrypted data through the preset data decryption algorithm to obtain the target transmission data. It can improve the security of data transmission and improve the efficiency of data transmission.
[0083] Embodiment 3
[0084] Figure 3 This is a schematic diagram of the structure of a data encryption and decryption transmission device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: an initial data frame set construction module 310, a data encryption module 320 and a data decryption module 330.
[0085] The initial data frame set construction module 310 is used to obtain the target transmission data of the first terminal, and determine the initial data frame set corresponding to the target transmission data based on a pre-constructed data frame construction algorithm; the data encryption module 320 is used to determine the encrypted data sequence corresponding to the initial data frame set based on a preset data encryption algorithm, and determine the target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence; the data decryption module 330 is used to transmit the target encrypted data to the second terminal through the data transmission network, so that the second terminal decrypts the target encrypted data through a preset data decryption algorithm to obtain the target transmission data.
[0086] Furthermore, the initial data frame set construction module 310 is specifically used to: process the target transmission data through a data frame construction algorithm to obtain a binary sequence data frame corresponding to the target transmission data; divide the binary sequence data frame into multiple data subsequences according to a preset grouping length, and determine the initial data frame set corresponding to the target transmission data based on the multiple data subsequences.
[0087] Furthermore, the data encryption module 320 is specifically used to: obtain a preset binary sequence, perform cyclic shift processing on each data subsequence through a preset data encryption algorithm, and obtain a shifted subsequence corresponding to each data subsequence; determine an encrypted data sequence corresponding to the initial data frame set based on multiple shifted subsequences and the preset binary sequence.
[0088] Furthermore, the data encryption module 320 is also specifically used to: perform an XOR operation on each shift subsequence and a preset binary sequence to obtain an encryption subsequence corresponding to each shift subsequence; and determine an encrypted data sequence corresponding to the initial data frame set based on multiple encryption subsequences.
[0089] Furthermore, the data encryption module 320 is also specifically used to: obtain a preset encryption sequence, first terminal identification information, second terminal identification information and data collection time of target power data; splice the binary sequence data frame, first terminal identification information, second terminal identification information, data collection time, preset encryption sequence, initial data frame set and encrypted data sequence through a preset splicing algorithm to obtain target encrypted data corresponding to the target transmission data.
[0090] Furthermore, the data decryption module 330 is specifically used for: the second terminal disassembles the target encrypted data through a preset disassembly algorithm to obtain the first terminal identification information, the second terminal identification information, the data collection time of the target power data, the initial data frame set and the encrypted data sequence; when the first terminal identification information and the second terminal identification information meet the preset decryption conditions, the encrypted data sequence is decrypted through the preset data decryption algorithm to obtain the decrypted data frame set corresponding to the encrypted data sequence; the target encrypted data is verified according to the decrypted data frame set and the initial data frame set, and when the target encrypted data passes the verification, the target transmission data corresponding to the initial data frame set is determined.
[0091] Furthermore, the data encryption and decryption transmission device also includes a data retransmission module, which is used for, after the second terminal decrypts the target encrypted data through a preset data decryption algorithm, if the target encrypted data fails to pass verification, the second terminal sends a data retransmission request to the first terminal; the first terminal regenerates the target encrypted data corresponding to the target transmission data according to the data retransmission request, and transmits the target encrypted data to the second terminal through the data transmission network.
[0092] Furthermore, the data encryption and decryption transmission device also includes a data preprocessing module, which is used to obtain target power data before obtaining the target transmission data of the first terminal, and preprocess the target power data through a normalization algorithm to obtain the target transmission data of the first terminal.
[0093] The data encryption and decryption transmission device provided in the embodiment of the present invention can execute the data encryption and decryption transmission method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0094] Embodiment 4
[0095] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0096] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0097] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0098] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the encryption and decryption transmission method of data.
[0099] In some embodiments, the encryption and decryption transmission method of data may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the encryption and decryption transmission method of data described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the encryption and decryption transmission method of data in any other appropriate manner (e.g., by means of firmware).
[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0102] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0105] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0107] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data encryption and decryption transmission method, characterized in that: include: Acquire target transmission data of the first terminal, and determine an initial data frame set corresponding to the target transmission data based on a pre-constructed data frame construction algorithm; Determine an encrypted data sequence corresponding to the initial data frame set based on a preset data encryption algorithm, and determine target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence; The target encrypted data is transmitted to a second terminal via a data transmission network, so that the second terminal decrypts the target encrypted data using a preset data decryption algorithm to obtain target transmission data.
2. The method according to claim 1, characterized in that The determining of the initial data frame set corresponding to the target transmission data based on a pre-built data frame construction algorithm comprises: Processing the target transmission data by using the data frame construction algorithm to obtain a binary sequence data frame corresponding to the target transmission data; The binary sequence data frame is divided into a plurality of data subsequences according to a preset grouping length, and an initial data frame set corresponding to the target transmission data is determined according to the plurality of data subsequences.
3. The method according to claim 2, characterized in that The step of determining the encrypted data sequence corresponding to the initial data frame set based on a preset data encryption algorithm includes: Obtain a preset binary sequence, and perform cyclic shift processing on each of the data subsequences using a preset data encryption algorithm to obtain a shifted subsequence corresponding to each of the data subsequences; An encrypted data sequence corresponding to the initial data frame set is determined according to the plurality of shifted subsequences and the preset binary sequence.
4. The method according to claim 3, characterized in that The step of determining the encrypted data sequence corresponding to the initial data frame set according to the plurality of shifted subsequences and the preset binary sequence comprises: Performing an XOR operation on each of the shifted subsequences and the preset binary sequence to obtain an encrypted subsequence corresponding to each of the shifted subsequences; An encrypted data sequence corresponding to the initial data frame set is determined according to the plurality of encrypted subsequences.
5. The method according to claim 1, characterized in that The step of determining target encrypted data corresponding to the target transmission data according to the initial data frame set and the encrypted data sequence comprises: Obtaining a preset encryption sequence, first terminal identification information, second terminal identification information, and data collection time of target power data; The binary sequence data frame, the first terminal identification information, the second terminal identification information, the data collection time, the preset encryption sequence, the initial data frame set and the encrypted data sequence are spliced through a preset splicing algorithm to obtain target encrypted data corresponding to the target transmission data.
6. The method according to claim 1, characterized in that The second terminal decrypts the target encrypted data by using a preset data decryption algorithm to obtain target transmission data, including: The second terminal disassembles the target encrypted data by using a preset disassembly algorithm to obtain the first terminal identification information, the second terminal identification information, the data collection time of the target power data, the initial data frame set and the encrypted data sequence; In the case where the first terminal identification information and the second terminal identification information meet the preset decryption condition, decrypting the encrypted data sequence by using the preset data decryption algorithm to obtain a decrypted data frame set corresponding to the encrypted data sequence; The target encrypted data is verified according to the decrypted data frame set and the initial data frame set, and when the target encrypted data passes the verification, the target transmission data corresponding to the initial data frame set is determined.
7. The method according to claim 6, characterized in that After the second terminal decrypts the target encrypted data using a preset data decryption algorithm, the method further includes: When the target encrypted data fails to pass the verification, the second terminal sends a data retransmission request to the first terminal; The first terminal regenerates target encrypted data corresponding to the target transmission data according to the data retransmission request, and transmits the target encrypted data to the second terminal through the data transmission network.
8. The method according to claim 1, characterized in that Before acquiring the target transmission data of the first terminal, the method further includes: Target power data is acquired, and the target power data is preprocessed by a normalization algorithm to obtain target transmission data of the first terminal.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data encryption, decryption and transmission method described in any one of claims 1 to 8 when executed.
10. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the method for encrypting, decrypting and transmitting data described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Encryption processing method, decryption processing method and related devices
CN117176325A
Data communication interaction security management method and device, and storage medium
CN117527365A
Data processing method and device, data transmission method and device, medium, product and equipment
CN118821077A
Encryption processing program and encryption processing method
JP2008039844A
Data encryption method, apparatus and device, data decryption method, apparatus and device, and storage medium
WO2022089014A1
Cited By
Data transmission method, electronic equipment, medium and product
CN120415899A