Data processing method and device, electronic equipment and computer readable storage medium

CN114371863BActive Publication Date: 2026-08-18BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210020589.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-10
Publication Date
2026-08-18
Estimated Expiration
2042-01-10

AI Technical Summary

Benefits of technology

[0030] In this embodiment of the disclosure, the data of the target data packet is equivalent to undergoing two hash operations to obtain two hash values. Compared with performing a single hash operation on the entire data packet to obtain a single hash value, the solution provided in this disclosure improves the security of data interaction by performing two hash operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114371863B_ABST
    Figure CN114371863B_ABST
Patent Text Reader

Abstract

The disclosure provides a data processing method and device, electronic equipment and computer readable storage medium, relates to the technical field of computers, and particularly to the technical field of data processing. The specific implementation scheme is: dividing data of a target data packet into at least two data blocks; obtaining a first hash value of each data block to generate a hash list; obtaining a second hash value based on the hash list, signing the second hash value based on a private key to obtain signature information; and sending the target data packet, the signature information and the hash list to a data receiver.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to the field of data processing technology, specifically to a data processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Currently, data is typically transmitted in packets. To ensure data packet security and prevent tampering, data signing is usually used during the packetization process. The receiving end verifies the signature, which requires downloading the entire data packet, calculating its hash value, and then using the public key corresponding to the signature to verify the signature's validity based on the overall hash value. Summary of the Invention

[0003] This disclosure provides a data processing method, apparatus, electronic device, and computer-readable storage medium.

[0004] According to a first aspect of this disclosure, a data processing method is provided, comprising:

[0005] Divide the target data packet into at least two data blocks;

[0006] Obtain the first hash value of each data block and generate a hash list;

[0007] The second hash value is obtained based on the hash list, and the second hash value is signed based on the private key to obtain signature information;

[0008] The target data packet, the signature information, and the hash list are sent to the data receiver.

[0009] According to a second aspect of this disclosure, another data processing method is provided, including:

[0010] Obtain the target data packet, signature information, and hash list. The target data packet is divided into at least two data blocks, and the hash list includes a first hash value corresponding to each data block.

[0011] The signature information is verified using the public key to obtain a third hash value;

[0012] Calculate the second hash value of the hash list, and compare the third hash value with the second hash value to see if they match.

[0013] Based on the comparison results, the target data is processed.

[0014] According to a third aspect of this disclosure, a data processing apparatus is provided, comprising:

[0015] The partitioning module is used to divide the data in the target data packet into at least two data blocks;

[0016] The generation module is used to obtain the first hash value of each data block and generate a hash list;

[0017] The signature module is used to obtain a second hash value based on the hash list, and to sign the second hash value based on the private key to obtain signature information;

[0018] The sending module is used to send the target data packet, the signature information, and the hash list to the data receiver.

[0019] According to a fourth aspect of this disclosure, another data processing apparatus is provided, comprising:

[0020] The acquisition module is used to acquire a target data packet, signature information and hash list, wherein the target data packet is divided into at least two data blocks and the hash list includes a first hash value corresponding to each data block;

[0021] The verification module is used to perform signature verification on the signature information based on the public key and obtain a third hash value;

[0022] The comparison module is used to calculate the second hash value of the hash list and compare whether the third hash value is consistent with the second hash value;

[0023] The processing module is used to process the target data based on the comparison results.

[0024] According to a fifth aspect of this disclosure, an electronic device is provided, comprising:

[0025] At least one processor; and

[0026] A memory communicatively connected to the at least one processor; wherein,

[0027] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect or to perform the method described in the second aspect.

[0028] According to a sixth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method according to the first aspect, or to perform the method according to the second aspect.

[0029] According to a seventh aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method according to the first aspect, or implements the method according to the second aspect.

[0030] In this embodiment of the disclosure, the data of the target data packet is equivalent to undergoing two hash operations to obtain two hash values. Compared with performing a single hash operation on the entire data packet to obtain a single hash value, the solution provided in this disclosure improves the security of data interaction by performing two hash operations.

[0031] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0032] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0033] Figure 1 This is one of the flowcharts of a data processing method provided in this embodiment of the disclosure;

[0034] Figure 2 This is a second flowchart of a data processing method provided in this embodiment of the disclosure;

[0035] Figure 3 This is the third flowchart of a data processing method provided in this disclosure embodiment;

[0036] Figure 4 This is one of the flowcharts of a data processing apparatus provided in the embodiments of this disclosure;

[0037] Figure 5 This is a second flowchart of a data processing apparatus provided in an embodiment of this disclosure;

[0038] Figure 6 This is a block diagram of an electronic device used to implement the data processing method of the embodiments of this disclosure. Detailed Implementation

[0039] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0040] Please refer to Figure 1 , Figure 1This is one of the flowcharts of a data processing method provided in this disclosure embodiment, such as... Figure 1 As shown, the data processing method includes the following steps:

[0041] Step S101: Divide the data of the target data packet into at least two data blocks.

[0042] It should be noted that the target data packet is a data packet applied to the target process. For example, if the target process is an upgrade process, the target data packet corresponds to an upgrade data packet; or, if the target process is a repair process, the target data packet corresponds to a repair data packet; and so on. Optionally, if the target process is an Over-the-Air (OTA) upgrade process, the target data packet corresponds to an OTA upgrade data packet.

[0043] The data processing method provided in this disclosure can be applied to electronic devices such as computers, tablets, and mobile phones. Optionally, the electronic device acquires the target data packet, for example, by downloading the target data packet from a server, receiving the target data packet sent by another electronic device, or retrieving the target data packet from local storage, etc.

[0044] In this embodiment of the disclosure, after acquiring a target data packet, the electronic device divides the data content of the target data packet into at least two data blocks. The division of the target data packet can be based on its size or the application object. For example, if the target data packet is 10GB, it can be divided into ten 1GB data blocks, or it can be divided into five 2GB data blocks; or, if the target data packet is a target process applied to an embedded device, it can be divided into multiple smaller data blocks.

[0045] Optionally, the electronic device may pre-set the number of data blocks into which the target data packet is divided, or it may dynamically adjust the number of data blocks based on the size of the target data packet or the application scenario. For example, for a larger target data packet, a larger number of data blocks may be divided accordingly.

[0046] Step S102: Obtain the first hash value of each data block and generate a hash list.

[0047] In this embodiment of the disclosure, after dividing a target data packet into at least two data blocks, the electronic device calculates a first hash value for each data block and generates a hash list based on the first hash value of each data block. The hash list includes the first hash value corresponding to each data block.

[0048] Step S103: Obtain the second hash value based on the hash list, and sign the second hash value based on the private key to obtain signature information.

[0049] Optionally, the electronic device may perform a hash operation on the hash list to obtain a second hash value, and sign the second hash value based on a preset private key to obtain signature information.

[0050] Step S104: Send the target data packet, the signature information, and the hash list to the data receiver.

[0051] Optionally, the electronic device may send the target data packet, the signature information, and the hash list to the data receiver separately, or it may package the target data packet, the signature information, and the hash list together and send them to the data receiver, or it may place the signature information and the hash list in the header of the target data packet and send the target data including the signature information and the hash list to the data receiver.

[0052] It should be noted that the electronic device may send the target data packet, the signature information, and the hash list to the data receiver after receiving the data request from the data receiver.

[0053] For example, the target data packet is an OTA upgrade data packet, and the electronic device can acquire the target data packet after receiving the upgrade data packet.

[0054] In the event of an OTA upgrade request for the target device, the target data packet, the signature information, and the hash list are sent to the target device.

[0055] Furthermore, after receiving the target data packet, the signature information, and the hash list, the data receiver can apply a public key matching the private key to perform signature verification on the signature information to obtain a third hash value. Simultaneously, the data receiver performs a hash operation on the hash list to obtain a second hash value, which is consistent with the second hash value calculated by the electronic device in the above embodiment. At this point, the data receiver compares the third hash value obtained after signature verification with the second hash value. If they are consistent, the target process can be executed based on the target data packet. If they are inconsistent, it indicates that the hash list may have been tampered with, and the data security of the target data packet cannot be guaranteed. In this case, the data receiver should not use the target data packet to execute the target process. This ensures the accuracy and security of the target data packet and guarantees the secure execution of the target process.

[0056] In this embodiment, the electronic device can divide a target data packet into at least two data blocks, obtain a first hash value for each data block, generate a hash list, perform a second hash operation based on the hash list to obtain a second hash value, and sign the second hash value using a private key to obtain signature information. Then, the target data packet, the signature information, and the hash list are sent to a data receiver, enabling the data receiver to verify the signature information in the above manner to ensure the security of the target data packet. The signature information is obtained by signing the second hash value calculated from the hash list, which includes the first hash value corresponding to each data block after the target data packet is divided. Compared to performing a hash operation on the entire data packet to obtain a single hash value, the solution provided in this disclosure improves the security of data interaction through two hash operations.

[0057] Optionally, the target data packet is a data packet applied to the target process, and obtaining the second hash value based on the hash list includes:

[0058] Obtain the attribute information of the target process;

[0059] A hash operation is performed based on the hash list and the attribute information to obtain a second hash value.

[0060] For example, the target process is an OTA upgrade process, the target data packet is an OTA upgrade data packet, and the attribute information of the target process can be the instruction information of the OTA upgrade process.

[0061] In this embodiment of the disclosure, the electronic device performs a hash operation on each data block of the target data packet to obtain a first hash value corresponding to each data block. Then, it generates a hash list based on these first hash values. Finally, it performs another hash operation on the hash list and the attribute information of the target process to obtain a second hash value. For example, the hash list and the attribute information of the target process can be merged, and the merged information can be hashed to obtain the second hash value. Further, the electronic device signs the second hash value based on a private key to obtain signature information.

[0062] In this way, the signature information obtained from the signature is not only related to the hash list, but also to the attribute information of the target process, which can further improve the security of the signature information.

[0063] Optionally, the attribute information includes at least one of the following:

[0064] The target process instruction information, the target data packet name, the target data packet size, and the target data packet storage location.

[0065] For example, if the target process is an OTA upgrade process and the target data packet is an OTA upgrade data packet, then the attribute information may include at least one of the following: OTA upgrade process instruction information, OTA upgrade data packet name, OTA upgrade data packet size, and OTA upgrade data packet storage location. The OTA upgrade process instruction information is used to instruct how the OTA upgrade process should be executed, thereby enabling the data receiver to determine how to perform the OTA upgrade based on the OTA upgrade process instruction information.

[0066] In this embodiment of the disclosure, the electronic device can perform a hash operation based on the attribute information of the target process and a hash list to obtain a second hash value, and further sign the second hash value based on a private key to obtain signature information. This ensures that the signature information is not only related to the hash list but also to the attribute information of the target process, thereby further enhancing the security of the signature information.

[0067] Optionally, sending the target data packet, the signature information, and the hash list to the data receiver includes:

[0068] Generate script information and place the script information in the target data packet. The script information includes the signature information and the hash list.

[0069] The target data packet, including the script information, is sent to the data receiver.

[0070] In this embodiment of the disclosure, after the electronic device signs the second hash value to obtain signature information, it can generate script information based on the signature information and the hash list. The script information consists of the signature information and the hash list. The script information is placed in the header of the entire target data packet, and then the target data packet is sent to the data receiver. Based on the received target data packet, the data receiver can extract the script information from the header of the target data packet, that is, it can obtain the signature information and the hash list from the script information. The data receiver can then perform signature verification based on the signature information to determine the security of the target data packet.

[0071] In this embodiment of the disclosure, the signature information and the hash list are combined to form script information, which is then placed in the target data packet. That is, the signature information and the hash list are placed in the target data packet. In this way, the electronic device can send the target data packet, which includes the signature information and the hash list, to the data receiver. This eliminates the need to send the signature information, the hash list, and the target data packet separately, and also reduces the risk of these data being tampered with during separate transmission, thus better ensuring data security.

[0072] Optionally, when the second hash value is obtained by hashing the hash list and the attribute information of the target process, the script information further includes the attribute information. That is, the script information includes the signature information, the hash list, and the attribute information. The electronic device can place the script information in the header of the target data packet, so that the target data packet sent by the electronic device to the data receiver also includes the signature information, the hash list, and the attribute information. In this case, the attribute information of the target process can be sent to the data receiver. The attribute information includes at least one of the following: the instruction information of the target process, the name of the target data packet, the size of the target data packet, and the storage location of the target data packet. This allows the data receiver to determine how the target process should be executed and / or to determine the relevant information of the target data packet based on the attribute information, so as to better perform the processing of the target data packet and / or the target process.

[0073] Please refer to Figure 2 , Figure 2 This is a second flowchart of a data processing method provided in this embodiment of the disclosure, such as... Figure 2 As shown, the target data packet is divided into N data blocks: data block-1, data block-2, data block-3, data block-4... data block-N (N is greater than 4); the first hash value of each data block is calculated to obtain hash-1, hash-2, hash-3, hash-4... hash-N; these first hash values ​​are combined into a hash list, and a hash operation is performed on the hash list and the attribute information of the target process corresponding to the target data packet to obtain a second hash value. The second hash value is signed with a private key to obtain signature information; the signature information, hash list, and attribute information are combined into script information, and the script information is placed in the header of the target data packet, and then the target data packet including the script information is sent to the data receiver.

[0074] In this embodiment of the disclosure, the data of the target data packet is equivalent to undergoing two hash operations to obtain two hash values. Compared with performing a single hash operation on the entire data packet to obtain a single hash value, the solution provided in this disclosure improves the security of data interaction by performing two hash operations.

[0075] Please refer to Figure 3 , Figure 3 This is the third flowchart of a data processing method provided in this disclosure embodiment, such as... Figure 3 As shown, the data processing method includes the following steps:

[0076] Step S301: Obtain the target data packet, signature information, and hash list.

[0077] The target data packet is divided into at least two data blocks, and the hash list includes a first hash value corresponding to each data block.

[0078] It should be noted that the data processing method provided in this disclosure can be applied to electronic devices such as mobile phones, tablets, and computers. The electronic devices in this disclosure are... Figure 1 and Figure 2 The electronic devices in the embodiments described are not the same device; the electronic devices in the embodiments of this disclosure are equivalent to... Figure 1 and Figure 2 To better distinguish the data receiver in the embodiments described, this disclosure uses the data receiver as the execution subject to illustrate the solution provided in this disclosure.

[0079] Optionally, the data receiver can be the data sender (i.e., the receiver of the data). Figure 1 and Figure 2 The electronic device in the embodiment sends the target data packet, signature information, and hash list; or, the data receiver may obtain the target data packet, signature information, and hash list that has been downloaded and stored from local storage.

[0080] Step S302: Perform signature verification on the signature information based on the public key to obtain the third hash value.

[0081] It should be noted that the public key is the same as the one mentioned above. Figure 1 and Figure 2 In the embodiment described, the private key is paired with a public key, and the signature information is obtained by signing the second hash value based on the private key. After obtaining the signature information, the data receiver performs signature verification on the signature information based on the public key paired with the private key. This signature verification process is also a hash operation process, which can then obtain the third hash value.

[0082] Step S303: Calculate the second hash value of the hash list and compare whether the third hash value is consistent with the second hash value.

[0083] In this embodiment of the disclosure, after obtaining the hash list, the data receiver performs a hash operation on the hash list to obtain a second hash value. The hash operation used by the data receiver is the same as described above. Figure 1 and Figure 2 Since the hash operation performed on the hash list is the same in the above embodiments, the result should be the same hash value, that is, the second hash value.

[0084] Furthermore, the third hash value obtained by the data recipient in verifying the signature information is compared with the second hash value to see if they are consistent.

[0085] Step S304: Based on the comparison results, process the target data packet.

[0086] It should be noted that the signature information is obtained by signing the second hash value using the private key, and the second hash value is obtained by hashing the hash list. The third hash value obtained by the data receiver after verifying the signature information using the public key should also be consistent with the second hash value. If the comparison result shows that the third hash value is consistent with the second hash value, it means that the hash list has not been tampered with, which to some extent indicates that the target data packet has also not been tampered with. In this case, the data receiver can execute the target process based on the target data packet. If the comparison result shows that the third hash value is inconsistent with the second hash value, it means that the hash list has been tampered with, and the security of the target data packet cannot be guaranteed. The data receiver can discard the target data packet and not apply it, that is, it will not execute the target process. In this way, the processing of the target data packet is determined by comparing the third hash value and the second hash value, thereby ensuring the security of the data application by the data receiver.

[0087] It should be noted that the target data packet is a data packet applied to the target process. For example, if the target process is an upgrade process, the target data packet corresponds to an upgrade data packet; or, if the target process is a repair process, the target data packet corresponds to a repair data packet; and so on. Optionally, if the target process is an OTA upgrade process, the target data packet corresponds to an OTA upgrade data packet.

[0088] Optionally, processing the target data based on the comparison results includes:

[0089] If the third hash value matches the second hash value, calculate the fourth hash value for each data block in the target data packet;

[0090] Compare whether the fourth hash value corresponding to the target data block is consistent with the first hash value corresponding to the target data block in the hash list, wherein the target data block is any one of the at least two data blocks;

[0091] If the fourth hash value corresponding to the target data block is consistent with the first hash value, the target process is executed using the target data block.

[0092] In this embodiment of the disclosure, if the comparison result shows that the third hash value matches the second hash value, it indicates that the hash list has not been tampered with. Then, the fourth hash value of each data block in the target data packet is further calculated, and the fourth hash value corresponding to each data block is compared with the corresponding first hash value stored in the hash list. For example, for the first data block in the target data packet, the hash list stores the first hash value corresponding to that data block. The data receiver performs a hash operation on that data block to obtain the corresponding fourth hash value. Then, the fourth hash value calculated for that data block is compared with the first hash value corresponding to that data block stored in the hash list.

[0093] It should be noted that the hash operation used by the data receiver for each data block is the same as described above. Figure 1 and Figure 2 In the embodiments described above, the electronic device uses the same hash operation for each data block, so the resulting hash values ​​should also be consistent.

[0094] In this embodiment, if the fourth hash value calculated for a data block matches the first hash value corresponding to that data block stored in the hash list, it indicates that the data block has not been tampered with. The data receiver can then download the data block and apply it to execute the target process. For example, if the target data packet is an OTA upgrade data packet, the OTA upgrade process is executed accordingly. This allows the target data packet to be divided into multiple data blocks for separate verification, comparison, download, and application, eliminating the need to download the complete data packet before application. This enables simultaneous verification, download, and application of the target data packet, i.e., streaming download. For example, if the target data packet is an OTA upgrade data packet, streaming upgrades can be achieved without downloading the complete OTA upgrade data packet before execution, saving storage space.

[0095] Optionally, the method further includes:

[0096] If the fourth hash value corresponding to the target data block is inconsistent with the first hash value, the target process is stopped.

[0097] In this embodiment of the disclosure, after calculating the fourth hash value of a data block in the target data packet, if the calculated fourth hash value of the data block is inconsistent with the first hash value corresponding to the data block stored in the hash list, it indicates that the data block has been tampered with. Therefore, the target data packet is not a secure data packet, and the corresponding target process is stopped. This allows for the timely detection of tampered data blocks, eliminating the need to wait until the entire data packet is downloaded. This effectively improves the security of the data receiver and saves storage space.

[0098] Optionally, obtaining the target data packet, signature information, and hash list includes:

[0099] Obtain the target data packet, wherein the target data packet includes script information, and the script information includes the signature information and the hash list.

[0100] It should be noted that, as mentioned above Figure 1 and Figure 2 As described in the embodiments, the electronic device can place script information, including signature information and a hash list, in the target data packet and send the target data packet containing the script information to the data receiver. Upon receiving the target data packet, the data receiver can then obtain the signature information and hash list contained within it. That is, in this implementation scenario, the hash list and signature information are placed in the target data packet and sent together with it, eliminating the need to send the hash list, signature information, and target data packet separately. This avoids potential data tampering that could occur with separate transmissions, further ensuring data security.

[0101] Furthermore, the script information also includes attribute information of the target process.

[0102] Optionally, the attribute information includes at least one of the following: the instruction information of the target process, the name of the target data packet, the size of the target data packet, and the storage location of the target data packet.

[0103] For example, if the target process is an OTA upgrade process and the target data packet is an OTA upgrade data packet, then the attribute information may include at least one of the following: OTA upgrade process instruction information, OTA upgrade data packet name, OTA upgrade data packet size, and OTA upgrade data packet storage location. The OTA upgrade process instruction information is used to instruct how the OTA upgrade process should be executed, thereby enabling the data receiver to determine how to perform the OTA upgrade based on the OTA upgrade process instruction information.

[0104] In this embodiment of the disclosure, the script information is included in the target data packet, and the attribute information of the target process is also sent to the data receiver along with the target data packet. The attribute information includes at least one of the following: the instruction information of the target process, the name of the target data packet, the size of the target data packet, and the storage location of the target data packet. This enables the data receiver to determine how the target process should be executed and / or to determine the relevant information of the target data packet based on the attribute information, so as to better perform the processing of the target data packet and / or the target process.

[0105] Optionally, if the target data packet includes attribute information of the target process, as described above... Figure 1 and Figure 2In the embodiments described above, the electronic device can perform a hash operation based on the attribute information and the hash list to obtain a second hash value; in this case, in this embodiment of the disclosure, calculating the second hash value of the hash list includes:

[0106] A hash operation is performed based on the hash list and the attribute information to obtain a second hash value.

[0107] In this embodiment, if the script information in the target data packet also includes the attribute information, the data receiver performs a hash operation based on the obtained hash list and the attribute information to obtain a second hash value. This enables the data receiver to perform a hash operation based on the aforementioned... Figure 1 and Figure 2 The second hash value is calculated in the same way as described in the embodiment. The signature information received by the data receiver is obtained by the electronic device signing the second hash value obtained by hashing based on the attribute information and the hash list. This ensures that the third hash value obtained by the data receiver in signing and authenticating the signature information is consistent with the calculated second hash value, avoiding errors caused by the third hash value being inconsistent with the second hash value due to the second hash value not being calculated based on the attribute information.

[0108] Please refer to Figure 4 , Figure 4 This is one of the structural diagrams of a data processing apparatus provided in this disclosure embodiment, such as... Figure 4 As shown, the data processing device 400 includes:

[0109] The partitioning module 401 is used to divide the data of the target data packet into at least two data blocks;

[0110] The generation module 402 is used to obtain the first hash value of each data block and generate a hash list;

[0111] The signature module 403 is used to obtain a second hash value based on the hash list, and to sign the second hash value based on the private key to obtain signature information;

[0112] The sending module 404 is used to send the target data packet, the signature information, and the hash list to the data receiver.

[0113] Optionally, the target data packet is a data packet applied to the target process, and the signature module 403 is further configured to:

[0114] Obtain the attribute information of the target process;

[0115] A hash operation is performed based on the hash list and the attribute information to obtain a second hash value.

[0116] Optionally, the sending module 404 is further configured to:

[0117] Generate script information and place the script information in the target data packet. The script information includes the signature information and the hash list.

[0118] The target data packet, including the script information, is sent to the data receiver.

[0119] Optionally, the script information may also include the attribute information.

[0120] Optionally, the attribute information includes at least one of the following:

[0121] The target process instruction information, the target data packet name, the target data packet size, and the target data packet storage location.

[0122] In this embodiment of the disclosure, the data of the target data packet is equivalent to undergoing two hash operations to obtain two hash values. Compared with performing a single hash operation on the entire data packet to obtain a single hash value, the data processing device 400 provided in this disclosure can improve the security of data interaction by performing two hash operations.

[0123] It should be noted that the data processing apparatus 400 provided in this embodiment of the present disclosure is capable of achieving the above-mentioned functions. Figure 1 and Figure 2 All the technical solutions in the embodiments of the data processing method are therefore able to achieve at least the above-mentioned goals. Figure 1 and Figure 2 The full technical effects of the method embodiments described herein will not be repeated here.

[0124] Please refer to Figure 5 , Figure 5 This is a second structural diagram of a data processing apparatus provided in an embodiment of this disclosure, as shown below. Figure 5 As shown, the data processing device 500 includes:

[0125] The acquisition module 501 is used to acquire a target data packet, signature information and hash list, wherein the target data packet is divided into at least two data blocks and the hash list includes a first hash value corresponding to each data block;

[0126] Verification module 502 is used to perform signature verification on the signature information based on the public key and obtain a third hash value;

[0127] The comparison module 503 is used to calculate the second hash value of the hash list and compare whether the third hash value is consistent with the second hash value;

[0128] The processing module 504 is used to process the target data based on the comparison results.

[0129] Optionally, the processing module 504 is further configured to:

[0130] If the third hash value matches the second hash value, calculate the fourth hash value for each data block in the target data packet;

[0131] Compare whether the fourth hash value corresponding to the target data block is consistent with the first hash value corresponding to the target data block in the hash list, wherein the target data block is any one of the at least two data blocks;

[0132] If the fourth hash value corresponding to the target data block is consistent with the first hash value, the target process is executed using the target data block.

[0133] Optionally, the processing module 504 is further configured to:

[0134] If the fourth hash value corresponding to the target data block is inconsistent with the first hash value, the target process is stopped.

[0135] Optionally, the acquisition module 501 is further configured to:

[0136] Obtain the target data packet, wherein the target data packet includes script information, and the script information includes the signature information and the hash list.

[0137] Optionally, the script information may also include attribute information of the target process.

[0138] Optionally, the comparison module 503 is further configured to:

[0139] A hash operation is performed based on the hash list and the attribute information to obtain a second hash value.

[0140] Optionally, the attribute information includes at least one of the following:

[0141] The target process instruction information, the target data packet name, the target data packet size, and the target data packet storage location are at least one of the following:

[0142] The data processing apparatus 500 provided in this embodiment can determine the processing of a target data packet based on the comparison result of hash values, thereby ensuring the security of data applications.

[0143] It should be noted that the data processing apparatus 500 provided in this embodiment of the present disclosure is capable of achieving the above-mentioned functions. Figure 3 All the technical solutions in the embodiments of the data processing method are therefore able to achieve at least the above-mentioned goals. Figure 3 The full technical effects of the method embodiments described herein will not be repeated here.

[0144] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0145] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0146] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure 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 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0147] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0148] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0149] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the data processing methods described above. For example, in some embodiments, the data processing methods may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the data processing methods described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform data processing methods by any other suitable means (e.g., by means of firmware).

[0150] Various embodiments 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-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0151] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0152] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0154] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0155] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0156] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0157] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A data processing method, comprising: The target data packet is divided into at least two data blocks, and the data blocks are dynamically adjusted based on the size of the target data packet or the application scenario. Obtain the first hash value of each data block and generate a hash list; The second hash value is obtained based on the hash list, and the second hash value is signed based on the private key to obtain signature information; Send the target data packet, the signature information, and the hash list to the data receiver; The target data packet is a data packet applied to the target process. Sending the target data packet, the signature information, and the hash list to the data receiver includes: Generate script information and place the script information in the target data packet. The script information includes the signature information and the hash list. The target data packet, which includes the script information, is sent to the data receiver. The target data packet includes at least two data blocks that enable the data receiver to perform verification and comparison, as well as download and application, so as to realize simultaneous verification, download and application of the target data packet.

2. The method according to claim 1, wherein, The target data packet is a data packet applied to the target process, and obtaining the second hash value based on the hash list includes: Obtain the attribute information of the target process; A hash operation is performed based on the hash list and the attribute information to obtain a second hash value.

3. The method according to claim 2, wherein, The script information also includes the attribute information.

4. The method according to any one of claims 2-3, wherein, The attribute information includes at least one of the following: The target process instruction information, the target data packet name, the target data packet size, and the target data packet storage location.

5. A data processing method, comprising: Obtain the target data packet, signature information, and hash list. The target data packet is divided into at least two data blocks. The hash list includes a first hash value corresponding to each data block. The data blocks are dynamically adjusted based on the size of the target data packet or the application scenario. The signature information is verified using the public key to obtain a third hash value; Calculate the second hash value of the hash list, and compare the third hash value with the second hash value to see if they match. Based on the comparison results, the target data is processed, including verifying and comparing, downloading and applying at least two data blocks included in the target data packet, so as to realize the simultaneous verification, downloading and application of the target data packet; The acquisition of the target data packet, signature information, and hash list includes: Obtain the target data packet, wherein the target data packet includes script information, and the script information includes the signature information and the hash list.

6. The method according to claim 5, wherein, The processing of the target data based on the comparison results includes: If the third hash value matches the second hash value, calculate the fourth hash value for each data block in the target data packet; Compare whether the fourth hash value corresponding to the target data block is consistent with the first hash value corresponding to the target data block in the hash list, wherein the target data block is any one of the at least two data blocks; If the fourth hash value corresponding to the target data block is consistent with the first hash value, the target process is executed using the target data block.

7. The method according to claim 6, wherein, The method further includes: If the fourth hash value corresponding to the target data block is inconsistent with the first hash value, the target process is stopped.

8. The method according to claim 6, wherein the script information further includes attribute information of the target process.

9. The method according to claim 8, wherein, The calculation of the second hash value of the hash list includes: A hash operation is performed based on the hash list and the attribute information to obtain a second hash value.

10. The method according to claim 8 or 9, wherein, The attribute information includes at least one of the following: The target process instruction information, the target data packet name, the target data packet size, and the target data packet storage location are at least one of the following:

11. A data processing apparatus, comprising: A partitioning module is used to divide the data of a target data packet into at least two data blocks, wherein the data blocks are dynamically adjusted based on the size of the target data packet or the application scenario. The generation module is used to obtain the first hash value of each data block and generate a hash list; The signature module is used to obtain a second hash value based on the hash list, and to sign the second hash value based on the private key to obtain signature information; The sending module is used to send the target data packet, the signature information, and the hash list to the data receiver; The target data packet is a data packet applied to the target process, and the sending module is further configured to: Generate script information and place the script information in the target data packet. The script information includes the signature information and the hash list. The target data packet, which includes the script information, is sent to the data receiver. The target data packet includes at least two data blocks that enable the data receiver to perform verification and comparison, as well as download and application, so as to realize simultaneous verification, download and application of the target data packet.

12. A data processing apparatus, comprising: The acquisition module is used to acquire a target data packet, signature information and hash list. The target data packet is divided into at least two data blocks. The hash list includes a first hash value corresponding to each data block. The data blocks are dynamically adjusted based on the size of the target data packet or the application scenario. The verification module is used to perform signature verification on the signature information based on the public key and obtain a third hash value; The comparison module is used to calculate the second hash value of the hash list and compare whether the third hash value is consistent with the second hash value; The processing module is used to process the target data based on the comparison results, wherein at least two data blocks of the target data packet are respectively verified, compared, downloaded, and applied to achieve simultaneous verification, download, and application of the target data packet; The acquisition module is also used for: Obtain the target data packet, wherein the target data packet includes script information, and the script information includes the signature information and the hash list.

13. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-4, or the method of any one of claims 5-10.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4, or to perform the method according to any one of claims 5-10.

15. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-4, or implements the method according to any one of claims 5-10.

Citation Information

Patent Citations

  • Firmware upgrading and encapsulating method and device based on digital signing

    CN101436141A

  • Digital signature method, digital signature verification method, electronic equipment and storage medium

    CN112651031A

  • Credible mirror image transmission method for hierarchical dual hash verification

    CN113391880A