Data transmission method and device, computer device and storage medium

By splitting and encrypting the target data in power grid data transmission, and using irreversible encryption algorithms to ensure data integrity, the security problem in power grid data transmission is solved, and reliable data transmission and secure storage are achieved.

CN115801266BActive Publication Date: 2025-12-05SHENZHEN POWER SUPPLY BUREAU
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211283728.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-12-05
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

Existing power grid data transmission methods are susceptible to data leakage, attacks, and malicious tampering, resulting in insufficient security in power system operation.

Method used

By receiving target data sent by the terminal, the target ciphertext and message digest are split, the plaintext is decrypted and then encrypted again to update the model parameters. Irreversible encryption algorithms are used to ensure data integrity and to distinguish between attacked and unattacked data.

Benefits of technology

This improves the security of power grid data during transmission, reduces the risk of model parameter leakage, and enables reliable data transmission and secure storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115801266B_ABST
    Figure CN115801266B_ABST
Patent Text Reader

Abstract

The application relates to a data transmission method and device, computer equipment, a storage medium and a computer program product. The method comprises receiving target data sent by at least two terminals, the target data comprising target ciphertext and a first message digest spliced after the target ciphertext, the target ciphertext and the first message digest being obtained by encrypting model parameters obtained through model training by the terminals, and the number of bytes of the first message digest being a first target byte number; splitting the target data according to the number of bytes of the first target data in the target data sent by each terminal, to obtain the target ciphertext and the first message digest; decrypting the target ciphertext to obtain target plaintext; encrypting the target plaintext to obtain a second message digest; and in the case that the first message digest and the second message digest are the same, storing the target plaintext to update the model parameters of the terminals based on the target plaintext. The method can improve the security of the target data in the transmission process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a data transmission method and device, a computer device, a storage medium, and a computer program product. BACKGROUND

[0002] When power companies apply big data, cloud computing and other technologies to provide data monitoring and analysis, power distribution and other intelligent services for users, a large amount of power grid data is needed as support. However, during the transmission of power grid data, there are risks such as data leakage, data attacks and malicious tampering of data, which can seriously affect the safe operation of the power system. Therefore, improving the security of power grid data during transmission is a problem that needs to be solved at the present stage.

[0003] With the development of computer technology, data security transmission technologies for power systems have emerged, such as applying chaotic encryption technology to power grid data transmission multi-party secure computation. Chaotic encryption uses a chaotic system to generate a chaotic sequence as a key sequence, encrypts the plaintext using the key sequence to obtain ciphertext, and transmits the ciphertext to the receiving party. The receiving party then uses chaotic synchronization to extract the plaintext information to achieve ciphertext decryption.

[0004] This method of applying chaotic encryption technology to power grid data transmission multi-party secure computation is not suitable for encrypting power grid data and other information because the chaotic sequence has randomness and is often used as an encryption key. However, there is still a risk of attack during the transmission of power grid data, so this method has the problem of low security of power grid data. SUMMARY

[0005] Therefore, it is necessary to provide a data transmission method, device, computer device, computer readable storage medium and computer program product that can improve the security of data.

[0006] The present application provides a data transmission method. The method comprises:

[0007] receiving target data sent by at least two terminals, the target data comprising target ciphertext and a first message digest spliced after the target ciphertext, the target ciphertext and the first message digest being obtained by encrypting model parameters obtained through model training by each terminal, and the first message digest having a first target byte number;

[0008] splitting each target data according to the first target byte number of the latter in each target data sent by the terminal to obtain the target ciphertext and the first message digest;

[0009] decrypting the target ciphertext to obtain target plaintext;

[0010] encrypting the target plaintext to obtain a second message digest;

[0011] storing the target plaintext in the case where the first message digest and the second message digest are identical, so as to update the model parameters of each terminal based on the target plaintext.

[0012] In one of the embodiments, the model parameters are parameters obtained by each terminal using the respective stored power grid data to train a preset model framework, and the method further comprises performing aggregated calculation on the target plaintexts of the at least two terminals to obtain aggregated model parameters; and sending the aggregated model parameters to each terminal respectively, so as to update the model parameters of each terminal.

[0013] In one of the embodiments, the target ciphertext is obtained by encrypting the model parameters by using a preset key, the first message digest is obtained by encrypting the model parameters by using a preset digest algorithm, the target plaintext is obtained by decrypting the target ciphertext, including decrypting the target ciphertext by using the preset key to obtain the target plaintext; and the second message digest is obtained by encrypting the target plaintext, including encrypting the target plaintext by using the preset digest algorithm to obtain the second message digest.

[0014] In one of the embodiments, the target ciphertext is obtained by encrypting a plurality of data blocks with the same byte number, and the plurality of data blocks with the same byte number are obtained by splitting the model parameters according to a second target byte number, and in the case where the number of bits of the last data block in the plurality of data blocks with the same byte number is less than the second target byte number, the last data block comprises a data part and a padding part, and the padding part is filled with a numerical value.

[0015] In one of the embodiments, before receiving the target data sent by the at least two terminals, the method further comprises receiving service requests sent by each terminal; assigning a corresponding computing node to each terminal according to the service request; and establishing a connection with each terminal according to the computing node.

[0016] The application further provides a data transmission device. The device comprises:

[0017] a receiving module configured to receive target data sent by at least two terminals, the target data comprising a target ciphertext and a first message digest spliced after the target ciphertext, the target ciphertext and the first message digest being obtained by encrypting model parameters obtained by model training by each terminal, and the byte number of the first message digest being a first target byte number;

[0018] a splitting module configured to split each target data according to the first target byte number of bits behind in each target data sent by each terminal, to obtain the target ciphertext and the first message digest;

[0019] decrypting the target ciphertext to obtain target plaintext;

[0020] encrypting the target plaintext to obtain a second message digest;

[0021] storing the target plaintext in a case where the first message digest and the second message digest are identical, so as to update model parameters of each terminal based on the target plaintext.

[0022] The application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0023] receiving target data sent by at least two terminals, the target data comprising target ciphertext and a first message digest spliced after the target ciphertext, the target ciphertext and the first message digest being obtained by encrypting model parameters obtained through model training by each terminal, and the first message digest having a first target byte number;

[0024] splitting each target data according to the first target byte number of the latter in each target data sent by each terminal, to obtain the target ciphertext and the first message digest;

[0025] decrypting the target ciphertext to obtain target plaintext;

[0026] encrypting the target plaintext to obtain a second message digest;

[0027] storing the target plaintext in a case where the first message digest and the second message digest are identical, so as to update model parameters of each terminal based on the target plaintext.

[0028] The application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0029] receiving target data sent by at least two terminals, the target data comprising target ciphertext and a first message digest spliced after the target ciphertext, the target ciphertext and the first message digest being obtained by encrypting model parameters obtained through model training by each terminal, and the first message digest having a first target byte number;

[0030] splitting each target data according to the first target byte number of the latter in each target data sent by each terminal, to obtain the target ciphertext and the first message digest;

[0031] decrypting the target ciphertext to obtain target plaintext;

[0032] encrypting the target plaintext to obtain a second message digest;

[0033] In a case where the first message digest and the second message digest are identical, the target plaintext is stored to update the model parameters of each terminal based on the target plaintext.

[0034] The application further provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:

[0035] receiving target data sent by at least two terminals, the target data comprising target ciphertext and a first message digest spliced after the target ciphertext, the target ciphertext and the first message digest being obtained by each terminal encrypting model parameters obtained through model training, the first message digest having a first target byte number;

[0036] splitting each target data according to the first target byte number of the latter in the target data sent by each terminal, to obtain the target ciphertext and the first message digest;

[0037] decrypting the target ciphertext to obtain target plaintext;

[0038] encrypting the target plaintext to obtain a second message digest;

[0039] In a case where the first message digest and the second message digest are identical, the target plaintext is stored to update the model parameters of each terminal based on the target plaintext.

[0040] The data transmission method, device, computer device, storage medium and computer program product can distinguish between target data attacked and target data not attacked in the target data sent by each terminal, avoid storing the target data attacked as correct target data, and thus achieve the purpose of improving the security of the target data in the transmission process.

[0041] The application further provides a data transmission method. The method comprises:

[0042] The model parameter obtained through model training is encrypted to obtain target ciphertext and a first message digest, and the number of bytes of the first message digest is a first target number of bytes;

[0043] The first message digest is spliced after the target ciphertext to obtain target data;

[0044] The target data is sent to the server to instruct the server to split the target data according to the last first target number of bytes of the target data to obtain the target ciphertext and the first message digest, decrypt the target ciphertext to obtain target plaintext, encrypt the target plaintext to obtain a second message digest, and store the target plaintext in the case where the first message digest and the second message digest are the same, to update the model parameter based on the target plaintext.

[0045] In one of the embodiments, the model parameter obtained through model training is encrypted to obtain target ciphertext and a first message digest, including: encrypting the model parameter obtained through model training by a preset digest algorithm to obtain the first message digest; and encrypting the model parameter obtained through model training by a preset key to obtain the target ciphertext.

[0046] In one of the embodiments, the model parameter obtained through model training is encrypted by a preset key to obtain target ciphertext, including: splitting the model parameter obtained through model training according to a second target number of bytes to obtain a plurality of data blocks with the same number of bytes; encrypting the plurality of data blocks with the same number of bytes by the preset key to obtain the target ciphertext; and in the case where the number of bits of the last data block in the plurality of data blocks with the same number of bytes is less than the second target number of bytes, filling the last data block with a value to make the number of bytes of the last data block the second target number of bytes.

[0047] The application also provides a data transmission device. The device comprises:

[0048] The receiving module is configured to receive target data sent by at least two terminals, the target data comprising target ciphertext and a first message digest spliced after the target ciphertext, the target ciphertext and the first message digest both being obtained by encrypting a model parameter obtained through model training by each terminal, and the number of bytes of the first message digest being a first target number of bytes;

[0049] The splitting module is configured to split each target data according to the last first target number of bytes of the target data sent by each terminal to obtain the target ciphertext and the first message digest;

[0050] The decryption module is configured to decrypt the target ciphertext to obtain target plaintext;

[0051] The second encryption module is configured to encrypt the target plaintext to obtain a second message digest.

[0052] a storage module, configured to store the target plaintext in a case where the first message digest and the second message digest are the same, so as to update the model parameters of each terminal based on the target plaintext.

[0053] The application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0054] encrypting the model parameters obtained through the model training to obtain target ciphertext and a first message digest, the number of bytes of the first message digest being a first target number of bytes;

[0055] splicing the first message digest after the target ciphertext to obtain target data;

[0056] sending the target data to a server, so as to instruct the server to split the target data according to the first target number of bytes of the latter in the target data, to obtain the target ciphertext and the first message digest, to decrypt the target ciphertext to obtain target plaintext, to encrypt the target plaintext to obtain a second message digest, and to store the target plaintext in a case where the first message digest and the second message digest are the same, so as to update the model parameters based on the target plaintext.

[0057] The application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0058] encrypting the model parameters obtained through the model training to obtain target ciphertext and a first message digest, the number of bytes of the first message digest being a first target number of bytes;

[0059] splicing the first message digest after the target ciphertext to obtain target data;

[0060] sending the target data to a server, so as to instruct the server to split the target data according to the first target number of bytes of the latter in the target data, to obtain the target ciphertext and the first message digest, to decrypt the target ciphertext to obtain target plaintext, to encrypt the target plaintext to obtain a second message digest, and to store the target plaintext in a case where the first message digest and the second message digest are the same, so as to update the model parameters based on the target plaintext.

[0061] The application further provides a computer program product. The computer program product comprises a computer program, and the computer program is executed by a processor to implement the following steps:

[0062] encrypting the model parameters obtained through the model training to obtain target ciphertext and a first message digest, the number of bytes of the first message digest being a first target number of bytes;

[0063] Splice the first message digest after the target ciphertext to obtain target data;

[0064] Send the target data to the server to instruct the server to split the target data according to the first target byte number of the latter in the target data, obtain the target ciphertext and the first message digest, decrypt the target ciphertext to obtain the target plaintext, encrypt the target plaintext to obtain the second message digest, and in the case that the first message digest and the second message digest are the same, store the target plaintext to update the model parameters based on the target plaintext.

[0065] The above data transmission method, device, computer equipment, storage medium and computer program product can encrypt the model parameters obtained through model training to obtain target ciphertext and a first message digest, the byte number of the first message digest is a first target byte number; splice the first message digest after the target ciphertext to obtain target data; send the target data to the server to instruct the server to split the target data according to the first target byte number of the latter in the target data, obtain the target ciphertext and the first message digest, decrypt the target ciphertext to obtain the target plaintext, encrypt the target plaintext to obtain the second message digest, and in the case that the first message digest and the second message digest are the same, store the target plaintext to update the model parameters based on the target plaintext, which can encrypt the model parameters obtained through model training, and then send the encrypted model parameters, i.e. target data, to the server, instead of directly sending the model parameters to the server, thereby reducing the risk of model parameter leakage and achieving the purpose of improving the security of target data in the transmission process. BRIEF DESCRIPTION OF DRAWINGS

[0066] Figure 1 The application environment diagram of the data transmission method in one embodiment;

[0067] Figure 2 The flowchart of the data transmission method in one embodiment;

[0068] Figure 3 The flowchart of the aggregation calculation step in one embodiment;

[0069] Figure 4 The flowchart of the data transmission method in another embodiment;

[0070] Figure 5 The flowchart of the data transmission method in yet another embodiment;

[0071] Figure 6 The structural block diagram of the data transmission device in one embodiment;

[0072] Figure 7A structural block diagram of a data transmission device in another embodiment;

[0073] Figure 8 An internal structural diagram of a computer device in an embodiment;

[0074] Figure 9 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0075] For the purpose, technical solutions and advantages of the present application to be more clear, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and do not limit the present application.

[0076] It should be understood that the "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. Unless the context clearly indicates otherwise, the singular form "one", "an" or "the" and the like similar words do not represent a quantity limitation, but represent the existence of at least one.

[0077] The data transmission method provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 In the application environment, at least two terminals 102 communicate with a server 104 through a network. A data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The at least two terminals 102 cooperatively execute the data transmission method provided by the embodiments of the present application through the network and the server 104.

[0078] The at least two terminals 102 respectively encrypt the model parameters obtained through model training to obtain target ciphertext and a first message digest, and the number of bytes of the first message digest is a first target byte number; the first message digest is spliced after the target ciphertext to obtain target data; and the target data is sent to the server 104. The server 104 respectively receives the target data sent by the at least two terminals 102; according to the first target byte number of the target data sent by each terminal 102, the target data is split to obtain target ciphertext and a first message digest; the target ciphertext is decrypted to obtain target plaintext; the target plaintext is encrypted to obtain a second message digest; in the case that the first message digest and the second message digest are the same, the target plaintext is stored to update the model parameters of each terminal 102 based on the target plaintext.

[0079] The terminal 102 can be, but is not limited to, smart meters from various power companies, personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0080] In one embodiment, such as Figure 2 As shown, a data transmission method is provided, which is applied to... Figure 1 Taking server 104 as an example, the following steps are included:

[0081] Step 202: Receive target data sent by at least two terminals. The target data includes target ciphertext and a first message digest concatenated after the target ciphertext. Both the target ciphertext and the first message digest are obtained by each terminal encrypting the model parameters obtained through model training. The number of bytes in the first message digest is the number of bytes in the first target.

[0082] The target data comprises data to be transmitted sent by each of at least two terminals, including target ciphertext and a first message digest, with the first message digest appended to the target ciphertext. Both the target ciphertext and the first message digest are obtained by encrypting model parameters, and the encryption algorithms used to generate the target ciphertext and the first message digest are different. The target ciphertext is used to characterize the model parameters, while the first message digest is used to uniquely identify the model parameters.

[0083] The number of bytes in the first message digest is fixed and is the number of bytes in the first destination, which can be 16 bytes, or 128 bits.

[0084] The encryption algorithm for generating target ciphertext is used to generate a fixed number of bytes of output ciphertext from input plaintext of arbitrary length. Moreover, it is an irreversible encryption algorithm. Only when the input plaintext is the same can the same output ciphertext be obtained. Even if the output ciphertext is obtained, it is impossible to reverse calculate the input plaintext through the decryption algorithm. Therefore, the first message digest can be used to uniquely identify the model parameters.

[0085] Since the encryption algorithm used to generate the target ciphertext is an irreversible encryption algorithm, by comparing the first message digest with the second message digest obtained by encrypting the target plaintext, if the first message digest and the second message digest are the same, it can be determined that the target data has not been attacked and the target data is correct.

[0086] Specifically, the server receives target data sent by at least two terminals.

[0087] Step 204, respectively according to the first target byte number of bits in the target data sent by each terminal, the target data is split to obtain the target ciphertext and the first message digest.

[0088] Wherein, the first target byte number of bits is from the first target byte number minus one to the last bit of the target data. For example, the target data is 123456789012345678, a total of 18 bits, the first target byte number is 10, and the last 10 bits of the target data are the 9th to 18th bits, that is, 9012345678.

[0089] Specifically, the server respectively according to the first target byte number of bits in the target data sent by each terminal, the target data is split to obtain the target ciphertext and the first message digest, and the remaining bits of the target data are taken as the target ciphertext, and the remaining bits are the first bit of the target data to the first target byte number minus two.

[0090] For example, the target data is 123456789012345678, the first target byte number is 10, and the last 10 bits of the target data are split to obtain 9012345678, and 9012345678 is the first message digest. At the same time, the remaining bits of the target data are the 1st to 8th bits of the target data: 12345678, and 12345678 is the target ciphertext.

[0091] Step 206, decrypting the target ciphertext to obtain the target plaintext.

[0092] Wherein, the target plaintext is the unencrypted data corresponding to the model parameter, which can be the same data as the model parameter, or the data which can represent the model parameter.

[0093] Specifically, the server respectively decrypts the target ciphertext corresponding to each terminal to obtain the target plaintext corresponding to each terminal.

[0094] Step 208, encrypting the target plaintext to obtain the second message digest.

[0095] Wherein, the byte number of the second message digest is fixed and is the first target byte number, and the encryption algorithm for generating the second message digest is the same as the encryption algorithm for generating the first message digest.

[0096] Specifically, the server encrypts the target plaintext corresponding to each terminal to obtain the second message digest corresponding to each terminal.

[0097] At step 210, in the case that the first message digest and the second message digest are the same, the target plaintext is stored to update the model parameters of each terminal based on the target plaintext.

[0098] Wherein, the first message digest and the second message digest being the same indicates that the target data is not attacked in the process of being sent by the terminal to the server. On the contrary, it indicates that the target data is attacked in the process of being sent by the terminal to the server and the target data has been leaked, so the terminal needs to re-encrypt the model parameters and send the regenerated target data to the server.

[0099] Specifically, the server compares the first message digest and the second message digest corresponding to each terminal, and in the case that the first message digest and the second message digest are the same, the target plaintext is stored to update the model parameters of each terminal based on the target plaintext; in the case that the first message digest and the second message digest are different, the step of receiving the target data sent by at least two terminals continues to be executed.

[0100] In the above data transmission method, by receiving the target data sent by at least two terminals, the target data includes target ciphertext and first message digest spliced after the target ciphertext, the target ciphertext and the first message digest are obtained by each terminal encrypting the model parameters obtained through model training, and the number of bytes of the first message digest is the first target byte number; each target data is split according to the first target byte number of the latter in each target data sent by the terminal, to obtain the target ciphertext and the first message digest; the target ciphertext is decrypted to obtain the target plaintext; the target plaintext is encrypted to obtain the second message digest; in the case that the first message digest and the second message digest are the same, the target plaintext is stored to update the model parameters of each terminal based on the target plaintext, which can distinguish the target data attacked and the target data not attacked in the target data sent by each terminal, avoid storing the target data attacked as correct target data, and further achieve the purpose of improving the security of the target data in the transmission process.

[0101] In one embodiment, as shown in Figure 3 The data transmission method further includes the following steps:

[0102] At step 302, the target plaintext of at least two terminals is aggregated and calculated to obtain an aggregated model parameter.

[0103] The model parameter is a parameter obtained by training a preset model framework using the power grid data stored by each terminal until training convergence. The preset model framework is a machine learning model issued by the server to each terminal, which can be a deep neural network model. The power grid data includes, but is not limited to, smart meter data installed at the location of each user, power consumption data generated by electrical appliances such as air conditioners and electric fans, and operation data of a power company.

[0104] The aggregated model parameter is a parameter obtained by aggregating the target plaintext of at least two terminals. The aggregation can be weighted summation, for example, calculating the average of the target plaintext of at least two terminals, or taking the maximum value of the target plaintext of at least two terminals. The present embodiment is not limited in this regard.

[0105] Specifically, the server aggregates and calculates the target plaintext of at least two terminals to obtain the aggregated model parameter.

[0106] In step 304, the aggregated model parameter is sent to each terminal to update the model parameter of each terminal.

[0107] Specifically, the server sends the aggregated model parameter to each terminal, so that the aggregated model parameter is used as the target model parameter of each terminal.

[0108] In the present embodiment, by aggregating and calculating the target plaintext of at least two terminals to obtain the aggregated model parameter, and sending the aggregated model parameter to each terminal, the purpose of completing federated learning between at least two terminals can be achieved.

[0109] In one embodiment, the target ciphertext is obtained by encrypting the model parameter using a preset key, and the first message digest is obtained by encrypting the model parameter using a preset digest algorithm. The above step 206 decrypts the target ciphertext to obtain the target plaintext, including: decrypting the target ciphertext using the preset key to obtain the target plaintext; and the above step 208 encrypts the target plaintext to obtain the second message digest, including: encrypting the target plaintext using the preset digest algorithm to obtain the second message digest.

[0110] The preset key is a key commonly used by each terminal when encrypting the model parameter and decrypting the target ciphertext using a preset encryption algorithm, that is, the same preset encryption algorithm and the same preset key are used for encryption and decryption by each terminal. The preset encryption algorithm can be AES (Advanced Encryption Standard), or other symmetric encryption algorithm, which is not limited in the present embodiment.

[0111] The preset digest algorithm can be MD5 (Message-Digest Algorithm), which is a hash function in the field of computer security and is used to ensure the integrity of a message. MD5 is a one-way encryption algorithm and the encryption is irreversible, which is used to generate fixed-length data, generally 16 bytes, from a string of arbitrary length after calculation. The preset digest algorithm can also be SHA1, which is not limited in the embodiment.

[0112] Specifically, the server decrypts the target ciphertext by using the preset key through the preset encryption algorithm to obtain the target plaintext, and encrypts the target plaintext through the preset digest algorithm to obtain the second message digest.

[0113] In the embodiment, the target ciphertext is decrypted by using the preset key, and the target plaintext is encrypted through the preset digest algorithm, which can achieve the purpose of obtaining the second message digest.

[0114] In one embodiment, the target ciphertext is obtained by encrypting a plurality of data blocks with the same byte number, and the plurality of data blocks with the same byte number are obtained by splitting the model parameters according to the second target byte number. In the case that the number of bits of the last data block in the plurality of data blocks with the same byte number is less than the second target byte number, the last data block includes a data part and a padding part, and the padding part is filled with a numerical value.

[0115] The second target byte number is determined according to the preset encryption algorithm. When the preset encryption algorithm is AES algorithm, the second target byte number can be 128 bits, 192 bits or 256 bits.

[0116] The last data block is the data block arranged at the last in the plurality of data blocks with the same byte number, the data part is a part of the model parameters contained in the last data block, and the padding part is the padding content obtained by padding the numerical value to the insufficient number of bits in the last data block. The numerical value filled in the padding part is the natural number 0. By padding 0 to the insufficient number of bits in the last data block, only the byte number of the last data block is changed, and the data content contained in the last data block is not changed. Therefore, the target plaintext obtained by decrypting the target ciphertext and the model parameters are the same in data content, and in the case that the number of bits of the last data block in the plurality of data blocks with the same byte number is less than the second target byte number, the byte number of the target plaintext is greater than the byte number of the model parameters; in the case that the number of bits of the last data block in the plurality of data blocks with the same byte number is equal to the second target byte number, the byte number of the target plaintext is equal to the byte number of the model parameters, and the target plaintext and the model parameters are the same data.

[0117] In a case where the number of bits of the last data block in the plurality of data blocks with the same number of bytes is less than the second target number of bytes, the last data block includes a data part and a padding part, and the padding part is filled with a numerical value.

[0118] For example, the model parameter is 40 bytes of plaintext data, and the second target number of bytes is 16 bytes. The model parameter is split into 3 data blocks according to 16 bytes as a data block, and the number of bytes of the plaintext contained in the last data block is 8 bytes, which is less than 16 bytes. Therefore, the last end of the last data block (that is, the number of bits that is insufficient in length) needs to be filled with the number 0 so that the number of bytes of the filled last end data block is 16 bytes. The data part of the last data block is the plaintext contained in the last data block, and the padding part is the number 0 filled with 8 bytes.

[0119] In a case where the number of bits of the last data block in the plurality of data blocks with the same number of bytes is equal to the second target number of bytes, the last data block only includes a data part and does not include a padding part.

[0120] For example, the model parameter is 48 bytes of plaintext data, and the second target number of bytes is 16 bytes. The model parameter is split into 3 data blocks according to 16 bytes as a data block, and the number of bytes of the plaintext contained in the last data block is 16 bytes. Therefore, the last end of the last data block does not need to be filled with the number 0.

[0121] In an embodiment, before receiving the target data sent by the at least two terminals, the data transmission method further includes the following steps: receiving service requests sent by the terminals; allocating corresponding computing nodes to the terminals respectively according to the service requests; and establishing connections with the terminals according to the computing nodes.

[0122] The service request includes an Internet Protocol Address (IP address) of the terminal. The server includes a master node and at least two computing nodes. The master node is used to receive service requests and allocate work tasks corresponding to the service requests to the computing nodes. The computing nodes are used to process the work tasks in a computing manner.

[0123] Specifically, the master node in the server receives service requests sent by the terminals; according to the service requests, finds computing nodes with the same network protocol addresses as the network protocol addresses contained in the service requests sent by the terminals in the at least two computing nodes, determines the computing nodes corresponding to the terminals respectively, and allocates the corresponding computing nodes to the terminals respectively; and establishes communication connections between the terminals and the corresponding computing nodes allocated to the terminals respectively.

[0124] In this embodiment, by receiving the service request sent by each terminal, determining the computing node corresponding to each terminal respectively, and establishing the connection between each terminal and the corresponding computing node respectively, the connection between each terminal and the server can be established before receiving the target data sent by at least two terminals, so that the data transmission between each terminal and the server can be realized.

[0125] In one embodiment, as shown in Figure 4 , a data transmission method is provided, which is applied to one terminal 102 in Figure 1 for example, and includes the following steps:

[0126] Step 402, encrypting the model parameter obtained through model training to obtain target ciphertext and a first message digest, and the byte number of the first message digest is a first target byte number.

[0127] Specifically, the terminal encrypts the model parameter obtained through model training to obtain target ciphertext and a first message digest, and the byte number of the first message digest is a first target byte number.

[0128] Step 404, concatenating the first message digest after the target ciphertext to obtain target data.

[0129] Specifically, the terminal concatenates the first message digest after the target ciphertext to obtain target data.

[0130] Step 406, sending the target data to the server to instruct the server to split the target data according to the first target byte number of the latter in the target data, to obtain target ciphertext and a first message digest, to decrypt the target ciphertext to obtain target plaintext, to encrypt the target plaintext to obtain a second message digest, and to store the target plaintext in the case that the first message digest and the second message digest are the same, to update the model parameter based on the target plaintext.

[0131] Specifically, the terminal sends the target data to the server to instruct the server to split the target data according to the first target byte number of the latter in the target data, to obtain target ciphertext and a first message digest, to decrypt the target ciphertext to obtain target plaintext, to encrypt the target plaintext to obtain a second message digest, and to store the target plaintext in the case that the first message digest and the second message digest are the same, to update the model parameter based on the target plaintext.

[0132] In the embodiment, the model parameter obtained through the model training is encrypted to obtain target ciphertext and a first message digest, and the number of bytes of the first message digest is a first target byte number; the first message digest is spliced after the target ciphertext to obtain target data; the target data is sent to the server to instruct the server to split the target data according to the first target byte number of the latter in the target data, to obtain the target ciphertext and the first message digest, to decrypt the target ciphertext to obtain target plaintext, to encrypt the target plaintext to obtain a second message digest, and to store the target plaintext in the case that the first message digest and the second message digest are the same, to update the model parameter based on the target plaintext. The model parameter obtained through the model training can be encrypted, and then the encrypted model parameter, that is, the target data, is sent to the server, instead of directly sending the model parameter to the server, thereby reducing the risk of model parameter leakage, and further achieving the purpose of improving the security of the target data in the transmission process.

[0133] In one embodiment, the model parameter obtained through the model training is encrypted to obtain target ciphertext and a first message digest, including: encrypting the model parameter obtained through the model training by a preset digest algorithm to obtain the first message digest; and encrypting the model parameter obtained through the model training by a preset key to obtain the target ciphertext.

[0134] Specifically, the terminal encrypts the model parameter obtained through the model training by a preset digest algorithm to obtain a first message digest, and encrypts the model parameter obtained through the model training by a preset encryption algorithm using a preset key to obtain target ciphertext.

[0135] In the embodiment, the model parameter obtained through the model training is encrypted by a preset digest algorithm to obtain a first message digest, and the model parameter obtained through the model training is encrypted by a preset key to obtain target ciphertext.

[0136] In one embodiment, the model parameter obtained through the model training is encrypted by a preset key to obtain target ciphertext, including: splitting the model parameter obtained through the model training according to a second target byte number to obtain a plurality of data blocks with the same byte number; encrypting the plurality of data blocks with the same byte number by the preset key to obtain the target ciphertext; and in the case that the number of bits of the last data block in the plurality of data blocks with the same byte number is less than the second target byte number, filling a value in the last data block to make the byte number of the last data block be the second target byte number.

[0137] Specifically, the terminal splits the model parameters obtained through model training according to the second target byte number to obtain a plurality of data blocks with the same byte number; encrypts the plurality of data blocks with the same byte number using a preset key to obtain target ciphertext; and in a case where the number of bits in a last data block among the plurality of data blocks with the same byte number is less than the second target byte number, fills the last data block with a value to make the byte number of the last data block the second target byte number.

[0138] In the embodiment, by splitting the model parameters according to the second target byte number into a plurality of data blocks with the same byte number first and then encrypting, the target ciphertext can be obtained.

[0139] In one embodiment, as shown in Figure 5 a data transmission method is provided, comprising the following steps:

[0140] S1, each terminal uses the power grid data on the local side of each terminal to perform model training according to the model framework (corresponding to the preset model framework in the above embodiment) issued by the cloud computing platform (corresponding to the server in the above embodiment), and waits for local training to converge;

[0141] S2, after the local training converges, each terminal sends a cloud service request to the master node of the cloud computing platform, and then the master node of the cloud computing platform allocates a computing node to the terminal according to the service information of the cloud computing slave node;

[0142] S3, each terminal receives the slave node information allocated from the master node, and each terminal establishes a connection according to the slave node information allocated by the master node and the cloud computing platform slave node, and saves the information after the connection is established;

[0143] S4, each terminal processes the encrypted model parameter data (corresponding to the model parameters in the above embodiment) to be transmitted using the MD5 authentication algorithm to generate a message digest MAC1 (corresponding to the first message digest in the above embodiment);

[0144] S5, each terminal groups the encrypted model parameter data to be transmitted, taking 128 bits as a data block, divides the data to be transmitted into n data blocks (n is an integer greater than 1), if the last data block is less than 128 bits, the insufficient part is supplemented to 128 bits with 0, and uses the AES encryption algorithm to process the ciphertext C using the previously agreed key; the previously agreed key is generated in advance by each terminal and the cloud service side, and a set of the previously agreed key is used for encryption and decryption operations in the data processing process;

[0145] S6, each terminal attaches the message digest MAC1 behind the ciphertext C||MAC1 (corresponding to the target data in the above embodiment) to the cloud server (corresponding to the server in the above embodiment), and after the master node of the cloud computing platform receives the data (corresponding to the target data in the above embodiment) transmitted from each terminal, the last 128 bits are separated and extracted, and the master node of the cloud computing platform decrypts the separated ciphertext C using the AES decryption algorithm to obtain the plaintext D2;

[0146] S7, the master node of the cloud computing platform processes the plaintext D2 using the MD5 authentication algorithm to obtain a new message digest MAC2, compares the message digest MAC1 with MAC2, if MAC1 and MAC2 are the same, then step S8 is performed; if they are different, it indicates that the transmitted data has been attacked, and returns to step S4;

[0147] S8, the cloud server aggregates the encrypted model parameter corresponding to the plaintext D2 received into a global federated model to obtain new model parameters (corresponding to the aggregated model parameters in the above embodiment), and sends the new model parameters to each terminal respectively, and completes federated learning.

[0148] In this embodiment, the encrypted model parameter data to be transmitted is encrypted and decrypted based on federated learning, the encryption operation and the decryption operation jointly use the pre-negotiated key, and the encrypted model parameter data to be transmitted is processed using the MD5 authentication algorithm to generate the message digest MAC1, the plaintext D2 is processed using the MD5 authentication algorithm to obtain a new message digest MAC2, the message digest MAC1 and MAC2 are compared, in the case that the two message digests are the same, the encrypted model parameter corresponding to the received plaintext D2 is aggregated, and the new model parameters obtained by aggregation are sent to each terminal respectively, and the federated learning is completed. Since the power grid data is not directly transmitted but the encrypted model parameter data to be transmitted, the security protection of the power grid data transmission is realized, and the purpose of improving the security of the encrypted model parameter data in the transmission process is achieved.

[0149] It should be understood that although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0150] Based on the same inventive concept, the embodiments of the present application also provide a data transmission device for implementing the above-mentioned data transmission method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more data transmission device embodiments provided below can refer to the limitations of the data transmission method in the foregoing, which will not be described here again.

[0151] In one embodiment, as shown in Figure 6 A data transmission device 600 is provided, comprising a receiving module 602, a splitting module 604, a decryption module 606, a first encryption module 608, and a storage module 610, wherein:

[0152] The receiving module 602 is configured to receive target data sent by at least two terminals, the target data comprising target ciphertext and a first message digest concatenated after the target ciphertext, the target ciphertext and the first message digest being obtained by encrypting model parameters obtained through model training by each terminal, and the first message digest having a first target byte number.

[0153] The splitting module 604 is configured to split each target data according to the first target byte number of bits after each target data sent by each terminal, to obtain the target ciphertext and the first message digest.

[0154] The decryption module 606 is configured to decrypt the target ciphertext to obtain target plaintext.

[0155] The first encryption module 608 is configured to encrypt the target plaintext to obtain a second message digest.

[0156] The storage module 610 is configured to store the target plaintext in the case where the first message digest and the second message digest are the same, to update the model parameters of each terminal based on the target plaintext.

[0157] In one embodiment, the model parameters are parameters obtained by training a preset model framework using power grid data stored by each terminal, and the data transmission device 600 further comprises an aggregation module configured to perform aggregation calculation on the target plaintext of the at least two terminals to obtain aggregated model parameters, and send the aggregated model parameters to each terminal to update the model parameters of each terminal.

[0158] In one embodiment, the target ciphertext is obtained by encrypting the model parameters using a preset key, and the first message digest is obtained by encrypting the model parameters using a preset digest algorithm, and the decryption module 606 is further configured to decrypt the target ciphertext using the preset key to obtain the target plaintext; and the first encryption module 608 is further configured to encrypt the target plaintext using the preset digest algorithm to obtain the second message digest.

[0159] In one embodiment, the target ciphertext is obtained by encrypting multiple data blocks of the same number of bytes. The multiple data blocks of the same number of bytes are obtained by splitting the model parameters according to the second target number of bytes. When the number of bits in the last data block in the multiple data blocks of the same number of bytes is less than the second target number of bytes, the last data block includes a data part and a padding part, and the padding part is filled with a numerical value.

[0160] In one embodiment, the data transmission device 600 further includes a connection module, which is used to receive service requests sent by each terminal; allocate corresponding computing nodes to each terminal according to the service requests; and establish connections with each terminal according to the computing nodes.

[0161] Each module in the aforementioned data transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0162] Based on the same inventive concept, this application also provides a data transmission apparatus for implementing the data transmission method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more data transmission apparatus embodiments provided below can be found in the limitations of the data transmission method described above, and will not be repeated here.

[0163] In one embodiment, such as Figure 7 As shown, a data transmission device 700 is provided, including: a second encryption module 702, a splicing module 704, and a sending module 706, wherein:

[0164] The second encryption module 702 is used to encrypt the model parameters obtained through model training to obtain the target ciphertext and the first message digest, wherein the number of bytes in the first message digest is the same as the number of bytes in the first target.

[0165] The splicing module 704 is used to splice the first message digest after the target ciphertext to obtain the target data;

[0166] The sending module 706 is used to send target data to the server, instructing the server to split the target data according to the number of the last target byte in the target data to obtain target ciphertext and a first message digest, decrypt the target ciphertext to obtain target plaintext, encrypt the target plaintext to obtain a second message digest, and store the target plaintext if the first message digest and the second message digest are the same, so as to update the model parameters based on the target plaintext.

[0167] In an embodiment, the second encryption module 702 is further configured to encrypt the model parameter obtained through the model training by using a preset digest algorithm to obtain a first message digest, and encrypt the model parameter obtained through the model training by using a preset key to obtain target ciphertext.

[0168] In an embodiment, the second encryption module 702 is further configured to split the model parameter obtained through the model training according to a second target byte number to obtain a plurality of data blocks with the same byte number, encrypt the plurality of data blocks with the same byte number by using a preset key to obtain target ciphertext, and in a case where a bit number of a last data block in the plurality of data blocks with the same byte number is less than the second target byte number, fill the last data block with a value to make the byte number of the last data block be the second target byte number.

[0169] The modules in the data transmission apparatus can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the modules.

[0170] In an embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 8 The computer device includes a processor, a memory, an input / output interface, and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store target data, target plaintext, a second message digest, and the like. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with terminals outside through a network connection. The computer program is executed by the processor to implement a data transmission method.

[0171] In an embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 9As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data transmission method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0172] Those skilled in the art will understand that Figure 8 and Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0173] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0174] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0175] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0176] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of the country and region.

[0177] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. Among them, any reference to memory, database or other medium used in each embodiment provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in each embodiment provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in each embodiment provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0178] Each technical feature of the above embodiments can be combined arbitrarily. In order to make the description simple, not all possible combinations of each technical feature in the above embodiments are described, but as long as the combination of these technical features does not exist contradictory, it should be considered as the scope of the present application.

[0179] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific manner, but should not be construed as limiting the scope of the patent of the present application. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A data transmission method, characterized in that, The method includes: The system receives target data sent by at least two terminals. The target data includes target ciphertext and a first message digest appended to the target ciphertext. Both the target ciphertext and the first message digest are obtained by each terminal encrypting model parameters trained by the model. The number of bytes in the first message digest is a first target number of bytes. The target ciphertext is used to represent the model parameters, and the first message digest is used to uniquely identify the model parameters. The encryption algorithm used to generate the target ciphertext is different from the encryption algorithm used to generate the first message digest. The target ciphertext is obtained by encrypting multiple data blocks with the same number of bytes. The multiple data blocks with the same number of bytes are obtained by splitting the model parameters according to a second target number of bytes. If the number of bits in the last data block among the multiple data blocks with the same number of bytes is less than the second target number of bytes, the last data block includes a data portion and a padding portion, and the padding portion is filled with numerical values. Each target data is split according to the number of the last first target byte in the target data sent by each terminal to obtain the target ciphertext and the first message digest; the target ciphertext is decrypted to obtain the target plaintext; The target plaintext is encrypted to obtain a second message digest; If the first message digest and the second message digest are the same, the target plaintext is stored to update the model parameters of each terminal based on the target plaintext.

2. The method according to claim 1, characterized in that, The model parameters are obtained by each terminal training a preset model framework using its own stored power grid data. The method further includes: Aggregate the target plaintext of the at least two terminals to obtain aggregation model parameters; The aggregated model parameters are sent to each terminal to update the model parameters of each terminal.

3. The method according to claim 1, characterized in that, The target ciphertext is obtained by encrypting the model parameters using a preset key, and the first message digest is obtained by encrypting the model parameters using a preset digest algorithm. Decrypting the target ciphertext to obtain the target plaintext includes: The target ciphertext is decrypted using the preset key to obtain the target plaintext; The encryption of the target plaintext to obtain a second message digest includes: The target plaintext is encrypted using the preset digest algorithm to obtain a second message digest.

4. The method according to claim 1, characterized in that, Before receiving target data sent by at least two terminals, the method further includes: Receive service requests sent by various terminals; Based on the service request, a corresponding computing node is allocated to each terminal. Based on the computing nodes, establish connections with each terminal.

5. The method according to claim 1, characterized in that, The method further includes: The number of the second target bytes is determined according to the preset encryption algorithm.

6. A data transmission method, characterized in that, The method includes: The model parameters obtained through model training are encrypted to obtain the target ciphertext and the first message digest, wherein the number of bytes in the first message digest is the number of bytes in the first target. The first message digest is appended to the target ciphertext to obtain the target data; The target data is sent to the server to instruct the server to split the target data according to the number of the last target byte in the target data to obtain the target ciphertext and the first message digest. The target ciphertext is decrypted to obtain the target plaintext. The target plaintext is encrypted to obtain the second message digest. If the first message digest and the second message digest are the same, the target plaintext is stored to update the model parameters based on the target plaintext.

7. The method according to claim 6, characterized in that, The step of encrypting the model parameters obtained through model training to obtain the target ciphertext and the first message digest includes: The model parameters obtained through model training are encrypted using a preset digest algorithm to obtain the first message digest; The model parameters obtained through model training are encrypted using a preset key to obtain the target ciphertext.

8. The method according to claim 7, characterized in that, The step of encrypting the model parameters obtained through model training using a preset key to obtain the target ciphertext includes: The model parameters obtained through model training are split according to the second target number of bytes to obtain multiple data blocks with the same number of bytes; The target ciphertext is obtained by encrypting the multiple data blocks with the same number of bytes using a preset key; If the number of bits in the last data block among the multiple data blocks with the same number of bytes is less than the second target number of bytes, the last data block is padded with a value so that the number of bytes in the last data block is the second target number of bytes.

9. A data transmission device, characterized in that, The device includes: A receiving module is configured to receive target data sent by at least two terminals. The target data includes target ciphertext and a first message digest appended to the target ciphertext. Both the target ciphertext and the first message digest are obtained by each terminal encrypting model parameters trained by the model. The number of bytes in the first message digest is a first target number of bytes. The target ciphertext is used to represent the model parameters, and the first message digest is used to uniquely identify the model parameters. The encryption algorithm used to generate the target ciphertext is different from the encryption algorithm used to generate the first message digest. The target ciphertext is obtained by encrypting multiple data blocks with the same number of bytes. The multiple data blocks with the same number of bytes are obtained by splitting the model parameters according to a second target number of bytes. If the number of bits in the last data block of the multiple data blocks with the same number of bytes is less than the second target number of bytes, the last data block includes a data portion and a padding portion, and the padding portion is filled with numerical values. The splitting module is used to split each of the target data according to the number of the last first target byte in the target data sent by each terminal, so as to obtain the target ciphertext and the first message digest. The decryption module is used to decrypt the target ciphertext to obtain the target plaintext; The first encryption module is used to encrypt the target plaintext to obtain a second message digest; A storage module is used to store the target plaintext when the first message digest and the second message digest are the same, so as to update the model parameters of each terminal based on the target plaintext.

10. A data transmission device, characterized in that, The device includes: The second encryption module is used to encrypt the model parameters obtained through model training to obtain the target ciphertext and the first message digest, wherein the number of bytes in the first message digest is the number of bytes in the first target. The splicing module is used to splice the first message digest after the target ciphertext to obtain the target data; The sending module is configured to send the target data to the server, instructing the server to split the target data according to the number of the last target byte bits in the target data to obtain the target ciphertext and the first message digest, decrypt the target ciphertext to obtain the target plaintext, encrypt the target plaintext to obtain the second message digest, and store the target plaintext if the first message digest and the second message digest are the same, so as to update the model parameters based on the target plaintext.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Power grid end-to-end communication encryption system and method for power grid, communication equipment and storage medium

    CN111586680A

  • Model training method and device, electronic equipment and storage medium

    CN114492854A