Data processing method and device, equipment, readable storage medium and program product
By segmenting and encrypting data during transmission from smart devices, and generating and merging encrypted data, the problem of data interception in existing technologies is solved, thus improving the security of data transmission.
Patent Information
- Application Number
- CN202512056684.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-10
AI Technical Summary
The lack of dynamic key management and complex encryption mechanisms in the data transmission process of existing smart devices makes the data vulnerable to interception and cracking, posing serious security risks.
A segmented encryption method is used to extract the target data, generate first and second segmented data, and encrypt them separately based on different key keys. The data is then merged and sent to the receiving device.
Segmented encryption improves data transmission security, reduces the risk of data leakage, and prevents attackers from directly decrypting and merging data.
Smart Images

Figure CN121645219A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a data processing method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] With the rapid development of Internet of Things and wireless communication technology, intelligent terminal devices are increasingly popular, and now they have penetrated into people's daily life, and various types of intelligent devices have appeared, such as electric shavers, electric toothbrushes, etc. When using such intelligent devices, users usually need to connect the smart APP (Application) on the mobile phone with the device, thereby establishing communication to realize function control and data interaction.
[0003] In the related art, one of the two parties in communication usually encrypts the data generated by interaction and sends it to the other party for decryption to obtain information. However, in the related art, the data itself is often directly and simply encrypted, lacking dynamic key management and sufficient encryption mechanism, resulting in that the data is easily intercepted and cracked during transmission, and there is a serious security risk. SUMMARY
[0004] Therefore, it is necessary to provide a data processing method, device, computer equipment, computer readable storage medium and computer program product capable of improving data security in view of the above technical problems.
[0005] In a first aspect, the present application provides a data processing method applied to a data sending device, comprising:
[0006] obtaining target data to be sent to a data receiving device; wherein, when the data sending device is a target intelligent device, the data receiving device is an object terminal; or, when the data sending device is an object terminal, the data receiving device is the target intelligent device;
[0007] performing data interception on the target data to obtain first intercepted data and second intercepted data;
[0008] generating a first key corresponding to the first intercepted data based on the second intercepted data, encrypting the first intercepted data based on the first key to obtain first encrypted data;
[0009] determining a second key corresponding to the second intercepted data based on the first encrypted data, encrypting the second intercepted data based on the second key to obtain second encrypted data;
[0010] merge the first encrypted data and the second encrypted data to obtain merged data, and send the merged data to the data receiving device.
[0011] In a second aspect, the present application further provides a data processing apparatus, comprising:
[0012] a data acquisition module configured to acquire target data to be sent to a data receiving device; wherein when the data sending device is a target intelligent device, the data receiving device is a target terminal; or when the data sending device is a target terminal, the data receiving device is the target intelligent device;
[0013] a data interception module configured to intercept the target data to obtain first intercepted data and second intercepted data;
[0014] a first encryption module configured to generate a first key corresponding to the first intercepted data based on the second intercepted data, encrypt the first intercepted data based on the first key to obtain first encrypted data;
[0015] a second encryption module configured to determine a second key corresponding to the second intercepted data based on the first encrypted data, encrypt the second intercepted data based on the second key to obtain second encrypted data;
[0016] a data sending module configured to merge the first encrypted data and the second encrypted data to obtain merged data, and send the merged data to the data receiving device.
[0017] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0018] acquire target data to be sent to a data receiving device; wherein when the data sending device is a target intelligent device, the data receiving device is a target terminal; or when the data sending device is a target terminal, the data receiving device is the target intelligent device;
[0019] intercept the target data to obtain first intercepted data and second intercepted data;
[0020] generate a first key corresponding to the first intercepted data based on the second intercepted data, encrypt the first intercepted data based on the first key to obtain first encrypted data;
[0021] determining a second key corresponding to the second intercepted data based on the first encrypted data, and encrypting the second intercepted data based on the second key to obtain second encrypted data;
[0022] merging the first encrypted data and the second encrypted data to obtain merged data, and sending the merged data to the data receiving device.
[0023] In a fourth aspect, the present application further provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the following steps:
[0024] obtaining target data to be sent to a data receiving device; wherein when the data sending device is a target intelligent device, the data receiving device is a target terminal; or when the data sending device is a target terminal, the data receiving device is the target intelligent device;
[0025] performing data interception on the target data to obtain first intercepted data and second intercepted data;
[0026] generating a first key corresponding to the first intercepted data based on the second intercepted data, and encrypting the first intercepted data based on the first key to obtain first encrypted data;
[0027] determining a second key corresponding to the second intercepted data based on the first encrypted data, and encrypting the second intercepted data based on the second key to obtain second encrypted data;
[0028] merging the first encrypted data and the second encrypted data to obtain merged data, and sending the merged data to the data receiving device.
[0029] In a fifth aspect, the present application further provides a computer program product comprising a computer program, the computer program being executed by a processor to implement the following steps:
[0030] obtaining target data to be sent to a data receiving device; wherein when the data sending device is a target intelligent device, the data receiving device is a target terminal; or when the data sending device is a target terminal, the data receiving device is the target intelligent device;
[0031] performing data interception on the target data to obtain first intercepted data and second intercepted data;
[0032] generating a first key corresponding to the first intercepted data based on the second intercepted data, and encrypting the first intercepted data based on the first key to obtain first encrypted data;
[0033] determining, based on the first encrypted data, a second key corresponding to the second intercepted data, encrypting the second intercepted data based on the second key to obtain second encrypted data;
[0034] merging the first encrypted data and the second encrypted data to obtain merged data, and sending the merged data to the data receiving device.
[0035] The data processing method, device, computer device, computer readable storage medium, and computer program product described above obtain target data to be sent to a data receiving device. When the data sending device is a target intelligent device, the data receiving device is an object terminal. When the data sending device is an object terminal, the data receiving device is a target intelligent device. The target data is intercepted to obtain first intercepted data and second intercepted data. A first key corresponding to the first intercepted data is generated based on the second intercepted data in plaintext. The first intercepted data in plaintext is encrypted based on the first key to obtain first encrypted data. A second key corresponding to the second intercepted data is determined based on the first encrypted data. The second intercepted data is encrypted based on the second key to obtain second encrypted data. In this way, segmented data encryption is implemented. After the first encrypted data and the second encrypted data are merged to obtain merged data, the merged data is sent to the data receiving device. In this way, the first intercepted data and the second intercepted data obtained by data interception are encrypted in a segmented manner, and then merged into the entire merged data. In this way, an attacker cannot directly decrypt the merged data, the data leakage risk is reduced, and the data security is improved. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.
[0037] Figure 1 It is an application environment diagram of the data processing method in an embodiment;
[0038] Figure 2 It is a flowchart of the data processing method in an embodiment;
[0039] Figure 3 It is a schematic diagram of the data processing process in an embodiment;
[0040] Figure 4 It is a structural block diagram of the data processing device in an embodiment;
[0041] Figure 5 Figure 1 is a diagram of an internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0043] It should be noted that the terms "first", "second", and the like used herein can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" and any variations thereof used herein are intended to cover non-exclusive inclusion. The term "multiple" used herein refers to two or more. The term "and / or" used herein refers to one of the options or any combination of multiple options.
[0044] The data processing method provided by the embodiments of the present application can be applied to an application environment as shown in Figure 1 The data sending device 102 communicates with the data receiving device 104 through a network. When the data sending device 102 is a target smart device, the data receiving device 104 is an object terminal; or when the data sending device 102 is an object terminal, the data receiving device 104 is the target smart device.
[0045] In some embodiments, the data sending device 102 obtains target data to be sent to the data receiving device 104; when the data sending device 102 is a target smart device, the data receiving device 104 is an object terminal; or when the data sending device 102 is an object terminal, the data receiving device 104 is a target smart device; the data sending device 102 performs data interception on the target data to obtain first intercepted data and second intercepted data; the data sending device 102 generates a first key corresponding to the first intercepted data based on the second intercepted data, and encrypts the first intercepted data based on the first key to obtain first encrypted data; the data sending device 102 determines a second key corresponding to the second intercepted data based on the first encrypted data, and encrypts the second intercepted data based on the second key to obtain second encrypted data; the data sending device 102 merges the first encrypted data and the second encrypted data to obtain merged data, and sends the merged data to the data receiving device 104.
[0046] The object terminal is a kind of terminal, and the terminal can be but is not limited to various personal computers, notebook computers, smart phones, tablet computers and the like.
[0047] In one example embodiment, as shown in Figure 2 A data processing method is provided, which is applied to the data sending device 102 in Figure 1 for example, and includes the following steps 202 to 210. Among them:
[0048] Step 202, obtaining target data to be sent to a data receiving device; wherein, when the data sending device is a target smart device, the data receiving device is an object terminal; or, when the data sending device is an object terminal, the data receiving device is a target smart device.
[0049] Among them, the object terminal is a terminal for communicating with the target smart device, and the object terminal can be understood as a terminal held by a target object, and the target smart device can be a smart device of the target object, such as an electric shaver, a smart toothbrush, etc. The target data includes at least one of protocol instruction data for communication between the object terminal and the target smart device, usage data for using the target smart device, and object description information of the target object. In some embodiments, when the data sending device is a target smart device, the data receiving device is an object terminal. In other embodiments, when the data sending device is an object terminal, the data receiving device is a target smart device. In the embodiments of the present application, the data sending device and the data receiving device both have data encryption and decryption capabilities. In some embodiments, the data sending device can be regarded as a device for implementing data encryption, and the data receiving party can be regarded as a device for implementing data decryption.
[0050] Optionally, after the data sending device communicates with the data receiving device through Bluetooth, the data sending device sends the target data to the data receiving device at a regular time. Alternatively, after the data sending device obtains a data request of the data receiving device, the data sending device obtains the indicated target data based on the data request.
[0051] Step 204, data interception is performed on the target data to obtain first intercepted data and second intercepted data.
[0052] Optionally, the data sending device performs data interception on the target data according to a preset data interception rule to obtain the first intercepted data and the second intercepted data. Illustratively, the data interception rule indicates a preset data interception position. For example, the data interception rule indicates that the mth bit in the target data is the data interception position, and the first intercepted data is obtained by intercepting the first m bits in the target data. The first intercepted data includes the data of the mth bit. Then, the intercepted target data is taken as the second intercepted data. Illustratively, the data interception rule indicates a ratio of the data length of the first intercepted data to the data length of the second intercepted data. Therefore, the data sending device determines the data length of the target data, and determines the first intercepted data and the second intercepted data based on the data length of the target data and the ratio indicated by the data interception rule.
[0053] In some embodiments, the data importance of the first intercepted data is higher than that of the second intercepted data. Optionally, the data sending device determines key part data in the target data, takes the position of a character in the key part data in the target data as the data interception position, and intercepts the target data at the data interception position to obtain two intercepted data. The intercepted data containing the key part data is taken as the first intercepted data, and the character at the data interception position is included in the first intercepted data. The other intercepted data is taken as the second intercepted data, that is, the second intercepted data does not contain the key part data. The key part data is data containing sensitive information. In this way, it can be ensured that the key part data is located in the first intercepted data with higher data importance.
[0054] In some embodiments, the data interception on the target data to obtain the first intercepted data and the second intercepted data includes: determining device information related to the target intelligent device; determining a corresponding data interception position based on the device information; and performing data interception on the target data at the data interception position to obtain the first intercepted data and the second intercepted data.
[0055] The device information related to the target intelligent device at least includes a device model. In some embodiments, the device information further includes device attributes, and the device attributes at least include a Media Access Control (MAC) address and a serial number of the target intelligent device.
[0056] Optionally, the data sending device acquires device information of the target smart device, and determines a corresponding device model based on the device information, and determines a data interception position matched with the device model. The data sending device intercepts the target data into first intercepted data and second intercepted data according to the data interception position, wherein a position of a last character of the first intercepted data in the target data is the data interception position. For example, based on the device data, it is determined that the data interception position is 12 bits, and the target data is 20 bits in length, then the data from the 1st bit to the 12th bit in the target data is taken as the first intercepted data, and the data from the 13th bit to the 20th bit is taken as the second intercepted data.
[0057] As described above, in some embodiments, when the data importance of the first intercepted data is higher than the data importance of the second intercepted data, after the data sending device determines the data interception position, the method further includes: the data sending device determines a data sensitivity level of the target data, and in the case that the data sensitivity level is a sensitive level, a preset sensitive field is acquired, and key part data is identified from the target data. A data position of a last character of the key part data in the target data is taken as a modified data position, and it is checked whether the modified data position is before the data interception position or whether the modified data position coincides with the data interception position. If the modified data position is before the data interception position, or if the modified data position coincides with the data interception position, data interception is performed according to the data interception position, the data at the data interception position and the data before the data interception position in the target data are taken as the first intercepted data, and the data after the data interception position in the target data is taken as the second intercepted data. In this way, it can be ensured that the key part data is in the first intercepted data with higher data importance. If the modified data position is after the data interception position and the modified data position does not coincide with the data interception position, the modified data position is taken as a new data interception position, and data interception is performed on the target data according to the new data interception position, the data before the new data interception position and the data at the new data interception position in the target data are taken as the first intercepted data, and the data after the new data interception position in the target data is taken as the second intercepted data. For example, based on the device data, it is determined that the data interception position is 12 bits, and the target data is 20 bits in length, if the modified data position is the 11th bit, then the data from the 1st bit to the 12th bit in the target data is taken as the first intercepted data, and the data from the 13th bit to the 20th bit is taken as the second intercepted data. If the modified data position is the 14th bit, then the data from the 1st bit to the 14th bit in the target data is taken as the first intercepted data, and the data from the 15th bit to the 20th bit is taken as the second intercepted data. In the above embodiments, the matched data interception position can be acquired based on the device information, and therefore dynamic data interception of the target data is realized based on the data interception position, and the first intercepted data and the second intercepted data are obtained.
[0058] In some embodiments, based on the device information, the corresponding data interception position is determined, including: based on the device information, determining the device model of the target smart device, and determining the target sending time of the target data; based on the target sending time and the device model, determining the data interception position corresponding to the target data from the mapping relationship between time, model and data interception position.
[0059] The target sending time refers to the expected time of data reaching the data receiving device. The mapping relationship includes a plurality of sub-mapping relationships, each of which indicates the data interception position corresponding to the corresponding sending time and device signal. Therefore, it can be understood that the data interception position is determined based on the time dimension and the device dimension.
[0060] Alternatively, the data sending device obtains the device model of the target smart device from the device information, and determines the target sending time of the target data, which is notified to the data sending device and the data receiving device. The data sending device determines the data interception position corresponding to the target data from the mapping relationship between time, model and data interception position based on the target sending time and the device model. For example, the model of the target smart device is a razor model A, and the sending time is 8. Based on the mapping relationship, the corresponding data interception position is determined to be the 10th position. For example, the model of the target smart device is an electric toothbrush model A, and the sending time is 8. Based on the mapping relationship, the corresponding data interception position is determined to be the 12th position. It can be seen that for different sending times and different device models, the data interception position is dynamically determined, avoiding the data interception position being easily obtained by the attacker after the data interception position is intercepted with a fixed data interception position, and reducing the risk of data leakage.
[0061] As described above, in some embodiments, when the data importance of the first intercepted data is higher than the data importance of the second intercepted data, after the data sending device determines the data interception position based on the target sending time, the device model and the mapping relationship, the method further comprises: the data sending device determines the data sensitivity level of the target data, and in the case that the data sensitivity level is a sensitive level, a preset sensitive field is obtained, and the key part data is identified from the target data. The last character of the key part data in the target data is taken as the modified data position, and it is checked whether the modified data position is before the data interception position or whether the modified data position coincides with the data interception position. If the modified data position is before the data interception position, or if the modified data position coincides with the data interception position, the data interception is performed according to the data interception position, the data of the data interception position in the target data and the data before the data interception position are taken as the first intercepted data, and the data after the data interception position in the target data is taken as the second intercepted position. In this way, it can be ensured that the key part data is located in the first intercepted data with higher data importance. If the modified data position is after the data interception position and the modified data position does not coincide with the data interception position, the modified data position is taken as a new data interception position, and the target data is intercepted according to the new data interception position. The data before the new data interception position in the target data and the data at the new data interception position are taken as the first intercepted data, and the data after the new data interception position in the target data is taken as the second intercepted data.
[0062] In the above embodiment, based on the target sending time and the device model, the data interception position corresponding to the target data can be dynamically determined from the mapping relationship between the time, the model and the data interception position, dynamic data interception is realized, and after data interception is performed at a fixed data interception position, the data interception rule is easily obtained by the attacker, and the data leakage risk is reduced.
[0063] Step 206, based on the second intercepted data, a first key key corresponding to the first intercepted data is generated, and the first intercepted data is encrypted based on the first key key to obtain first encrypted data.
[0064] Among them, the first key key is the key for generating the first encrypted data. It can be understood that the first intercepted data and the second intercepted data are both plaintexts. The first encrypted data is the ciphertext obtained after the first intercepted data is encrypted. The first key key can be a symmetric key or an asymmetric key.
[0065] Optionally, the data sending device generates a first key key corresponding to the first intercepted data based on the second intercepted data. The data sending device directly encrypts the first intercepted data by using the first key key to obtain the first encrypted data.
[0066] In some embodiments, the generating of the first key comprises: the data sending device processing the second intercepted data by using a preset first bit operation algorithm to obtain the first key.
[0067] In some embodiments, the encrypting of the first intercepted data based on the first key to obtain the first encrypted data comprises: determining a device key corresponding to the first intercepted data based on the device information of the target smart device; encrypting the first intercepted data by using the device key to obtain first intermediate encrypted data; and encrypting the first intermediate encrypted data by using the first key to obtain the first encrypted data.
[0068] For example, the data sending device obtains a Mac address and a serial number from the device information of the target smart device, combines the Mac address and the serial number to obtain combined data, and generates a corresponding device key according to the combined data by using a bit operation algorithm corresponding to the device key.
[0069] For example, the data sending device encrypts the first intercepted data by using the device key to obtain first intermediate encrypted data. The data sending device encrypts the first intermediate encrypted data by using the first key to obtain the first encrypted data.
[0070] Of course, in other embodiments, the method further comprises: the data sending device can also encrypt the first intercepted data by using the first key to obtain first intermediate encrypted data, and then encrypt the first intermediate encrypted data again by using the device key to obtain the first encrypted data after the device key is determined.
[0071] In the above embodiments, the corresponding device key is determined by using the device information, and the device key and the first key are used to realize multiple encryption in the process of encrypting the first intercepted data, so as to improve the security of the data.
[0072] Step 208: based on the first encrypted data, determining a second key corresponding to the second intercepted data, and encrypting the second intercepted data based on the second key to obtain second encrypted data.
[0073] The second key is a key for generating the second encrypted data. The second encrypted data is ciphertext obtained by encrypting the second intercepted data. The second key can be a symmetric key or an asymmetric key.
[0074] For example, after the first encrypted data is calculated, the data sending device determines the corresponding second key based on the first encrypted data and the device information.
[0075] Exemplarily, the data sending device directly encrypts the second intercepted data based on the second key to obtain second encrypted data.
[0076] In some embodiments, based on the first encrypted data, the second key corresponding to the second intercepted data is determined, including: based on the first encrypted data and the device information of the target smart device, the second key corresponding to the second intercepted data is generated; and based on the second key, the second intercepted data is encrypted to obtain the second encrypted data, including: the second intercepted data is encrypted by the second key to obtain second intermediate encrypted data; a set key corresponding to the second intercepted data is obtained, and the second intermediate encrypted data is encrypted by the set key to obtain the second encrypted data.
[0077] Exemplarily, the data sending device generates the second key corresponding to the second intercepted data according to the first encrypted data and the device information of the target smart device by using a preset second bit operation algorithm.
[0078] Exemplarily, the data sending device randomly generates a random number, and obtains the set key corresponding to the second intercepted data based on the random number. The data sending device encrypts the second intercepted data by the second key to obtain second intermediate encrypted data. The data sending device encrypts the second intermediate encrypted data by the set key to obtain the second encrypted data. Of course, the method can also be: the data sending device encrypts the second intercepted data by the set key to obtain second intermediate encrypted data. The data sending device encrypts the second intermediate encrypted data by the second key to obtain the second encrypted data.
[0079] In the above embodiments, the second intercepted data is encrypted by the second key and the set key, which can ensure the effectiveness of the encryption of the second intercepted data, thereby improving the security.
[0080] Step 210, merging the first encrypted data and the second encrypted data to obtain merged data, and sending the merged data to the data receiving device.
[0081] Optionally, the data sending device merges the first encrypted data and the second encrypted data according to a preset merging rule to obtain merged data. The preset merging rule is sent to the data sending device and the data receiving device in advance.
[0082] Exemplarily, the merging rule can be a rule that the first encrypted data is in front and the second encrypted data is behind, or a rule that the second encrypted data is in front and the first encrypted data is behind. Therefore, when the merging is performed, the merging boundary position can also be recorded. For example, if the merging is performed according to the rule that the first encrypted data is in front and the second encrypted data is behind, the position of the last character of the first encrypted data in the merged data is taken as the merging boundary position. If the merging is performed according to the rule that the second encrypted data is in front and the first encrypted data is behind, the position of the last character of the second encrypted data in the merged data is taken as the merging boundary position.
[0083] In this way, the data sending device can synchronously send the merged data and the merging boundary position to the data receiving device, so that the data receiving device can perform data interception on the merged data based on the merging boundary position and the locally cached merging rule, to obtain the first encrypted data and the second encrypted data. Then, the first encrypted data and the second encrypted data are decrypted respectively to obtain the target data.
[0084] In the above data processing method, the target data to be sent to the data receiving device is obtained. When the data sending device is a target intelligent device, the data receiving device is an object terminal. Or, when the data sending device is an object terminal, the data receiving device is a target intelligent device. The target data is intercepted to obtain first intercepted data and second intercepted data. Based on the second intercepted data in plaintext, a first key corresponding to the first intercepted data is generated. Based on the first key, the first intercepted data in plaintext is encrypted to obtain the first encrypted data. Based on the first encrypted data, a second key corresponding to the second intercepted data is determined. Based on the second key, the second intercepted data is encrypted to obtain the second encrypted data. In this way, segmented data encryption is realized. After the merged data is obtained by merging the first encrypted data and the second encrypted data, the merged data is sent to the data receiving device. In this way, the first intercepted data and the second intercepted data obtained by data interception are encrypted in a segmented manner, and then merged into the entire merged data. Therefore, an attacker cannot directly decrypt the merged data, the data leakage risk is reduced, and the data security is improved.
[0085] In some embodiments, the data receiving device performs data interception on the merged data to determine the first encrypted data and the second encrypted data. After the data receiving device decrypts the second encrypted data based on the first encrypted data, the first encrypted data is decrypted based on the decrypted second intercepted data to obtain the first intercepted data. Based on the first intercepted data and the second intercepted data, the target data is obtained.
[0086] Optionally, after obtaining the merged data and the merged boundary position, the data receiving device can perform data interception on the merged data based on the merged boundary position and the locally cached merging rule, to obtain the first encrypted data and the second encrypted data.
[0087] Alternatively, after obtaining the merged data, if the data length of the first encrypted data is the same as the data length of the first intercepted data, and the merging rule is the rule that the first encrypted data is in front and the second encrypted data is behind, the data receiving device determines the decryption corresponding data interception position based on the device model and the target sending time, performs data interception on the merged data based on the decryption corresponding data interception position, to obtain the first encrypted data and the second encrypted data. It should be noted that, since this example is in the case that the data length of the first encrypted data is the same as the data length of the first intercepted data, and the merging rule is the rule that the first encrypted data is in front and the second encrypted data is behind, therefore, the data interception position used for data interception on the target data in the foregoing is the same as the decryption corresponding data interception position, and therefore, the decryption corresponding data interception position can be directly determined based on the device model and the target sending time. For example, when encrypting, the encryption corresponding data interception position (the data interception position used for data interception on the target data) is determined based on the device model and the target sending time, such as the 12th position, and when decrypting, the decryption corresponding data interception position is again determined based on the device model and the target sending time, and the result is also the 12th position. The first 12 positions of the target data are the first intercepted data, and the remaining data of the target data is the second intercepted data. Then, after obtaining the merged data, since the data length of the first encrypted data in the merged data is the same as the data length of the first intercepted data, which is also 12 positions, and the merging rule is that the first encrypted data is in front and the second encrypted data is behind, it is known that the first 12 positions in the merged data are also the first encrypted data, and the remaining data is the second encrypted data. Therefore, when decrypting, the decryption corresponding data interception position determined based on the device model and the target sending time is still the 12th position (because the encryption and decryption each determine the data interception position based on the device model and the target sending time), and therefore, the first 12 positions of the merged data can be directly extracted to obtain the first encrypted data, and the remaining data of the merged data is taken as the second encrypted data.
[0088] Optionally, after obtaining the first encrypted data and the second encrypted data, the data receiving device decrypts the second encrypted data based on the first encrypted data, to obtain the second intercepted data. The data receiving device decrypts the first encrypted data based on the second intercepted data, to obtain the first intercepted data, and then splices the first intercepted data and the second intercepted data according to the merging rule, to obtain the target data.
[0089] For example, when it is determined that the merged data uses symmetric encryption, the data receiving device generates a second key based on the first encrypted data, the device information, by the data receiving device. The data receiving device obtains a setting key from the local, decrypts the second encrypted data using the setting key to obtain second intermediate encrypted data, and decrypts the second intermediate encrypted data using the second key to obtain second intercepted data. The data receiving device determines the first key using the obtained second intercepted data, decrypts the first encrypted data using the first key to obtain first intermediate encrypted data. The data receiving device generates a device key based on the device information, and decrypts the first intermediate encrypted data based on the device key to obtain first intercepted data.
[0090] In the above embodiment, after the data receiving device obtains the merged data, the first encrypted data and the second encrypted data obtained by data interception are decrypted, so that the target data in plaintext can be accurately obtained.
[0091] In one specific embodiment, the interaction between the data sending device and the data receiving device is taken as an example for illustration, as shown in Figure 3 , which is a schematic diagram of the data processing process in one embodiment.
[0092] Step 1: The data sending device obtains target data to be sent to the data receiving device; wherein, when the data sending device is a target smart device, the data receiving device is an object terminal; or, when the data sending device is an object terminal, the data receiving device is a target smart device.
[0093] Step 2: The data sending device determines the device model of the target smart device based on the device information, and determines the target sending time of the target data; based on the target sending time and the device model, the data sending device determines the data interception position corresponding to the target data from the mapping relationship between time, model and data interception position. The data sending device performs data interception on the target data according to the data interception position to obtain first intercepted data and second intercepted data.
[0094] For example, as shown in Figure 3 , when the target data is protocol instruction data, the protocol instruction data is intercepted based on the data interception position after the data interception position is determined to obtain instruction data D1 (first intercepted data) and instruction data D2 (second intercepted data).
[0095] Step 3: The data sending device generates a first key corresponding to the first intercepted data based on the second intercepted data; determines a device key corresponding to the first intercepted data based on the device information of the target smart device; encrypts the first intercepted data through the device key to obtain first intermediate encrypted data; and encrypts the first intermediate encrypted data through the first key to obtain first encrypted data.
[0096] For example, as shown in FIG. 2, the instruction data D1 is encrypted by using the key S1 (device key) to obtain the encrypted data E1 (first intermediate data). The encrypted data E1 is encrypted by using the key S2 (first key) generated based on D2 to obtain the encrypted data E2 (second encrypted data). Figure 3
[0097] Step 4: The data sending device generates a second key corresponding to the second intercepted data based on the first encrypted data and the device information of the target smart device; encrypts the second intercepted data through the second key to obtain second intermediate encrypted data; obtains a set key corresponding to the second intercepted data, and encrypts the second intermediate encrypted data by using the set key to obtain second encrypted data.
[0098] For example, as shown in FIG. 2, the instruction data D2 is encrypted by using the key S3 (second key) generated based on the encrypted data E2 (second encrypted data) to obtain the encrypted data F1 (second intermediate encrypted data). The encrypted data F1 is encrypted by using the key S4 (set key) to obtain the encrypted data F2 (second encrypted data). Figure 3
[0099] Step 5: The data sending device merges the first encrypted data and the second encrypted data to obtain merged data.
[0100] Step 6: The data sending device sends the merged data to the data receiving device.
[0101] Step 7: The data receiving device intercepts the merged data to determine the first encrypted data and the second encrypted data. After the data receiving device decrypts the second encrypted data based on the first encrypted data, the first encrypted data is decrypted based on the decrypted second intercepted data to obtain the first intercepted data, and the target data is obtained based on the first intercepted data and the second intercepted data.
[0102] In the above embodiments, by acquiring target data to be sent to a data receiving device; wherein the data sending device is a target smart device, and the data receiving device is an object terminal; or the data sending device is an object terminal, and the data receiving device is a target smart device; the target data is intercepted to obtain first intercepted data and second intercepted data; a first key corresponding to the first intercepted data is generated based on the second intercepted data in plaintext, and the first intercepted data in plaintext is encrypted based on the first key to obtain first encrypted data. Based on the first encrypted data, a second key corresponding to the second intercepted data is determined, and the second intercepted data is encrypted based on the second key to obtain second encrypted data. Thus, segmented data encryption is realized. After the first encrypted data and the second encrypted data are combined to obtain combined data, the combined data is sent to the data receiving device. In this way, the first intercepted data and the second intercepted data obtained by data interception are encrypted in a segmented manner, and then combined into the entire combined data. In this way, an attacker cannot directly decrypt the combined data, reducing the risk of data leakage and improving data security.
[0103] It should be understood that, although each step in the flowchart involved in each embodiment as described above 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 sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple 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 alternately or alternately with at least part of other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.
[0104] Based on the same inventive concept, the embodiments of the present application also provide a data processing apparatus for implementing the above-mentioned data processing method. The implementation scheme of the problem solving provided by the apparatus is similar to the implementation scheme described in the above method, so the specific limitations in one or more data processing apparatus embodiments provided below can refer to the limitations of the data processing method in the above text, which will not be repeated here.
[0105] In one exemplary embodiment, as shown in Figure 4 A data processing apparatus 400 is provided, comprising a data acquisition module 402, a data interception module 404, a first encryption module 406, a second encryption module 408, and a data sending module 410, wherein:
[0106] The data acquisition module 402 is configured to acquire target data to be sent to a data receiving device; when the data sending device is a target smart device, the data receiving device is an object terminal; or when the data sending device is an object terminal, the data receiving device is a target smart device.
[0107] The data interception module 404 is configured to perform data interception on the target data to obtain first intercepted data and second intercepted data.
[0108] The first encryption module 406 is configured to generate a first key corresponding to the first intercepted data based on the second intercepted data, encrypt the first intercepted data based on the first key, and obtain first encrypted data.
[0109] The second encryption module 408 is configured to determine a second key corresponding to the second intercepted data based on the first encrypted data, encrypt the second intercepted data based on the second key, and obtain second encrypted data.
[0110] The data sending module 410 is configured to merge the first encrypted data and the second encrypted data to obtain merged data, and send the merged data to the data receiving device.
[0111] In some embodiments, the data interception module 404 is configured to determine device information related to the target smart device, determine a corresponding data interception position based on the device information, and perform data interception on the target data at the data interception position to obtain the first intercepted data and the second intercepted data.
[0112] In some embodiments, the data interception module 404 is configured to determine a device model of the target smart device based on the device information, determine a target sending time of the target data, and determine a data interception position corresponding to the target data from a mapping relationship between time, model and data interception position based on the target sending time and the device model.
[0113] In some embodiments, the first encryption module 406 is configured to determine a device key corresponding to the first intercepted data based on the device information of the target smart device, encrypt the first intercepted data by using the device key to obtain first intermediate encrypted data, and encrypt the first intermediate encrypted data by using the first key to obtain the first encrypted data.
[0114] In some embodiments, the second encryption module 408 is configured to generate a second key corresponding to the second intercepted data based on the first encrypted data and device information of the target smart device; encrypt the second intercepted data by using the second key to obtain second intermediate encrypted data; obtain a set key corresponding to the second intercepted data, and encrypt the second intermediate encrypted data by using the set key to obtain the second encrypted data.
[0115] In some embodiments, the apparatus further includes a decryption module configured to determine the first encrypted data and the second encrypted data by intercepting the merged data by using the data receiving device, decrypt the first encrypted data based on the second intercepted data obtained after the data receiving device decrypts the second encrypted data based on the first encrypted data, and obtain the target data based on the first intercepted data and the second intercepted data.
[0116] The modules in the data processing apparatus described above 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.
[0117] In an exemplary embodiment, a computer device is provided, which can be a server or a terminal. An internal structure diagram of the computer device can be as shown in Figure 5 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 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 external terminals through a network connection. The computer program is executed by the processor to implement a data processing method.
[0118] Those skilled in the art can understand that Figure 5 The structure shown in the above
[0119] In an embodiment, a computer device is also provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method embodiments when executing the computer program.
[0120] In an embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program implementing the steps in the above method embodiments when executed by a processor.
[0121] In an embodiment, a computer program product is provided, comprising a computer program, and the computer program implementing the steps in the above method embodiments when executed by a processor.
[0122] It should be noted that the user information (including but not limited to user device 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 regulations.
[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in 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 the embodiments provided in 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, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0124] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0125] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A data processing method, characterized by, The method is applied to a data sending device, and comprises: obtaining target data to be sent to a data receiving device; wherein, when the data sending device is a target intelligent device, the data receiving device is an object terminal; or, when the data sending device is an object terminal, the data receiving device is the target intelligent device; performing data interception on the target data to obtain first intercepted data and second intercepted data; generating a first key corresponding to the first intercepted data based on the second intercepted data, encrypting the first intercepted data based on the first key to obtain first encrypted data; determining a second key corresponding to the second intercepted data based on the first encrypted data, encrypting the second intercepted data based on the second key to obtain second encrypted data; merging the first encrypted data and the second encrypted data to obtain merged data, and sending the merged data to the data receiving device.
2. The method of claim 1, wherein, The method further comprises: determining device information related to the target intelligent device; determining a corresponding data interception position based on the device information; performing data interception on the target data at the data interception position to obtain the first intercepted data and the second intercepted data.
3. The method of claim 2, wherein, The method further comprises: determining a device model of the target intelligent device based on the device information, and determining a target sending time of the target data; determining a data interception position corresponding to the target data from a mapping relationship between time, model and data interception position based on the target sending time and the device model.
4. The method of claim 1, wherein, The method further comprises: determining a device key corresponding to the first intercepted data based on device information of the target intelligent device; encrypting the first intercepted data by using the device key to obtain first intermediate encrypted data; encrypting the first intermediate encrypted data by using the first key to obtain the first encrypted data.
5. The method of claim 1, wherein, The method further comprises: generating a second key corresponding to the second intercepted data based on the first encrypted data and the device information of the target intelligent device; The method further comprises: encrypting the second intercepted data by using the second key to obtain second intermediate encrypted data; obtaining a set key corresponding to the second intercepted data, and encrypting the second intermediate encrypted data by using the set key to obtain the second encrypted data.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: The data interception is performed on the merged data by the data receiving device to determine first encrypted data and second encrypted data, the first encrypted data is decrypted based on the decrypted second intercepted data after the second encrypted data is decrypted based on the first encrypted data by the data receiving device, the first intercepted data is obtained, and the target data is obtained based on the first intercepted data and the second intercepted data.
7. A data processing apparatus, characterized by, The apparatus comprises: The data acquisition module is configured to acquire target data to be sent to a data receiving device; when the data sending device is a target intelligent device, the data receiving device is a target terminal; or when the data sending device is a target terminal, the data receiving device is the target intelligent device; The data interception module is configured to intercept the target data to obtain first intercepted data and second intercepted data; The first encryption module is configured to generate a first key corresponding to the first intercepted data based on the second intercepted data, encrypt the first intercepted data based on the first key, and obtain first encrypted data; The second encryption module is configured to determine a second key corresponding to the second intercepted data based on the first encrypted data, encrypt the second intercepted data based on the second key, and obtain second encrypted data; The data sending module is configured to merge the first encrypted data and the second encrypted data to obtain merged data, and send the merged data to the data receiving device.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.