Data transmission method and device, electronic device, and storage medium
By segmenting and randomly transmitting the original data, and encrypting the sub-data labels and sequence numbers, the problems of data transmission security and efficiency in the prior art are solved, and efficient and secure data transmission is achieved.
Patent Information
- Application Number
- CN202211234576.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-10
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-10-10
AI Technical Summary
The prior art is difficult to effectively protect data security during data transmission, especially when transmitting big data such as audio and video files, the asymmetric encryption method takes a long time and affects the transmission efficiency.
By segmenting the original data to be transmitted, multiple sub-data are generated, and a randomly generated sequence identifier is added to each sub-data. The sub-data is transmitted in a random order, and the label and sequence numbers of the sub-data are spliced into spliced data for encryption.
It realizes the security and efficiency of data transmission without encrypting the original data, and avoids the performance bottleneck of asymmetric encryption methods in big data transmission.
Smart Images

Figure CN115801315B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology and security, and in particular to data transmission methods and devices, electronic devices, and storage media. Background Art
[0002] The Internet is an open system for the public at this stage. During the transmission process, user information and privacy may be stolen by criminals using various illegal means, and the network security problems caused by this are becoming increasingly serious. At present, the methods of data transmission are similar. Basically, symmetric encryption or asymmetric encryption is used to obtain the key from the data information, and then the key is used to encrypt the transmitted data.
[0003] Symmetric encryption (such as DES) can be cracked by brute force or special equipment, and cannot effectively protect data. Asymmetric encryption is relatively more secure, but when the data to be transmitted is large, such as audio and video data, asymmetric encryption takes a long time and affects data transmission efficiency.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] In view of the above problems, the present application is proposed to provide a data transmission method and device, an electronic device, and a storage medium that overcome the above problems or at least partially solve the above problems, including:
[0006] A data transmission method, the method comprising:
[0007] The original data to be transmitted is divided into multiple sub-data, and the label of each sub-data is recorded;
[0008] For each of the sub-data, a corresponding sequence identifier is added to each of the sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number;
[0009] According to the label and the sequence number of each sub-data, the labels and the sequence numbers of the plurality of sub-data are spliced to obtain spliced data;
[0010] Encrypting the spliced data to obtain a ciphertext of the spliced data;
[0011] The multiple updated sub-data corresponding to the multiple sub-data are transmitted to the data receiving end in a random order, and the spliced data ciphertext is transmitted to the data receiving end.
[0012] Optionally, transmitting the multiple updated sub-data corresponding to the multiple sub-data to the data receiving end in a random order includes:
[0013] Randomly extract a target operation formula from the formula library;
[0014] Randomly generate a transmission random number corresponding to each updated sub-data according to the target operation formula;
[0015] The multiple updated sub-data are transmitted to the data receiving end in the order of the corresponding transmission random number sizes.
[0016] Optionally, when the original data to be transmitted is an audio or video file, the original data to be transmitted is segmented to obtain a plurality of sub-data, including:
[0017] Convert the audio and video files into byte streams;
[0018] Determine the target number of splits according to the length of the byte stream;
[0019] The byte stream is divided according to the target number of divisions to obtain multiple sub-data.
[0020] Optionally, determining the target number of splits according to the length of the byte stream includes:
[0021] According to the length of the byte stream, the target number of segments corresponding to the length of the byte stream is obtained from a preset relationship table, and the preset relationship table is used to record the correspondence between the lengths of different byte streams and the number of segments.
[0022] Optionally, for each sub-data, adding a corresponding sequence identifier to each sub-data to obtain updated sub-data includes:
[0023] Generate multiple sequence numbers according to the total number of copies of the multiple sub-data;
[0024] Randomly matching the plurality of sequence numbers with the plurality of sub-data one by one;
[0025] For each sub-data, the sequence number corresponding to each sub-data is used as a sequence identifier and added to each sub-data to obtain updated sub-data.
[0026] Optionally, for each sub-data, taking the sequence number corresponding to each sub-data as a sequence identifier, and adding it to each sub-data to obtain updated sub-data, comprises:
[0027] For each sub-data, the corresponding sequence number is used as a sequence identifier and added to the start position or the end position of each sub-data to obtain the updated sub-data.
[0028] Optionally, the splicing the labels and sequence numbers of the plurality of sub-data according to the label and sequence number of each sub-data to obtain the spliced data includes:
[0029] Splicing the label and sequence number corresponding to each sub-data to obtain sub-spliced data;
[0030] The multiple sub-splicing data corresponding to the multiple sub-data are spliced together to obtain splicing data.
[0031] Optionally, the encrypting the spliced data to obtain a ciphertext of the spliced data includes:
[0032] The spliced data is encrypted using an asymmetric encryption algorithm to obtain a ciphertext of the spliced data.
[0033] A data transmission method, the method comprising:
[0034] receiving a plurality of updated sub-data and concatenated data ciphertexts, wherein the plurality of updated sub-data and the concatenated data ciphertexts are generated by the data transmitting end using the above-mentioned data transmission method; each updated sub-data is composed of a sub-data with a corresponding sequence number added thereto;
[0035] Decrypting the ciphertext of the spliced data using a key to obtain spliced data; the spliced data is formed by splicing the labels and sequence numbers of multiple sub-data, and the labels are used to indicate the positions of each byte in the corresponding sub-data in the original data;
[0036] The sub-data in the multiple updated sub-data are concatenated according to the labels and sequence numbers of the multiple sub-data to obtain the original data.
[0037] A data transmission device, comprising:
[0038] The data segmentation module is used to segment the original data to be transmitted to obtain multiple sub-data and record the label of each sub-data;
[0039] An identification adding module is used for adding a corresponding sequence identification to each sub-data to obtain updated sub-data; the sequence identification is a randomly generated sequence number;
[0040] A number splicing module, used for splicing the labels and sequence numbers of the plurality of sub-data according to the labels and sequence numbers of each sub-data to obtain spliced data;
[0041] A data encryption module, used for encrypting the spliced data to obtain a ciphertext of the spliced data;
[0042] The data transmission module is used to transmit the multiple updated sub-data corresponding to the multiple sub-data to the data receiving end in a random order, and transmit the spliced data ciphertext to the data receiving end.
[0043] Optionally, the data transmission module includes:
[0044] The target operation formula determination submodule is used to randomly extract a target operation formula from the formula library;
[0045] A transmission random number determination submodule, used to randomly generate a transmission random number corresponding to each updated sub-data according to the target operation formula;
[0046] The random sequence transmission submodule is used to transmit a plurality of updated sub-data to a data receiving end in the order of the corresponding transmission random number sizes.
[0047] Optionally, when the original data to be transmitted is an audio or video file, the data segmentation module includes:
[0048] A file conversion submodule, used for converting the audio and video files into byte streams;
[0049] The submodule for determining the number of copies is used to determine the target number of copies to be divided according to the length of the byte stream;
[0050] The segmentation submodule is used to segment the byte stream according to the target segmentation number to obtain multiple sub-data.
[0051] Optionally, the portion determination submodule is specifically used to obtain the target number of portions corresponding to the length of the byte stream from a preset relationship table based on the length of the byte stream, and the preset relationship table is used to record the correspondence between the lengths of different byte streams and the number of portions to be divided.
[0052] Optionally, add an identification module, including:
[0053] A sequence number generation submodule, used for generating a plurality of sequence numbers according to the total number of copies of the plurality of sub-data;
[0054] A sequence number corresponding submodule, used for randomly corresponding the plurality of sequence numbers to the plurality of sub-data one by one;
[0055] The sequence number adding submodule is used to add the sequence number corresponding to each sub-data as a sequence identifier to each sub-data to obtain updated sub-data.
[0056] Optionally, the sequence number adding submodule is specifically configured to add, for each sub-data, the corresponding sequence number as a sequence identifier to the start position or the end position of each sub-data to obtain updated sub-data.
[0057] Optionally, the numbering splicing module includes:
[0058] A first splicing submodule, used for splicing the label and sequence number corresponding to each sub-data to obtain sub-splicing data;
[0059] The second splicing submodule is used to splice the multiple sub-splicing data corresponding to the multiple sub-data to obtain splicing data.
[0060] Optionally, the data encryption module is specifically used to encrypt the spliced data using an asymmetric encryption algorithm to obtain a ciphertext of the spliced data.
[0061] A data transmission device, comprising:
[0062] A data receiving module, used for receiving a plurality of updated sub-data and concatenated data ciphertexts, wherein the plurality of updated sub-data and the concatenated data ciphertexts are generated by the data transmitting end using the above-mentioned data transmission method; each updated sub-data is composed of a corresponding sequence number added to the sub-data;
[0063] A data decryption module, used to decrypt the ciphertext of the spliced data using a key to obtain spliced data; the spliced data is formed by splicing the labels and sequence numbers of multiple sub-data, and the labels are used to indicate the positions of each byte in the corresponding sub-data in the original data;
[0064] The data restoration module is used to splice the sub-data in the multiple updated sub-data according to the labels and sequence numbers of the multiple sub-data to obtain the original data.
[0065] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the data transmission method described above when executed by the processor.
[0066] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data transmission method described above are implemented.
[0067] This application has the following advantages:
[0068] In an embodiment of the present application, the original data to be transmitted is divided into multiple sub-data, and the label of each sub-data is recorded; for each sub-data, a corresponding sequence identifier is added to each sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number; according to the label and sequence number of each sub-data, the labels of multiple sub-data and multiple sequence numbers are spliced to obtain spliced data; the spliced data is encrypted to obtain a spliced data ciphertext; the multiple updated sub-data corresponding to the multiple sub-data are transmitted to the data receiving end in a random order, and the spliced data ciphertext is transmitted; the embodiment of the present application divides the original data to be transmitted into multiple sub-data, and the multiple sub-data are transmitted in a random order, so that the security of the original complete data during the transmission process can be effectively guaranteed; at the same time, by encrypting the identifiers and labels of multiple sub-data into a spliced data ciphertext for transmission, the amount of data to be encrypted is small, the efficiency of data encryption transmission is improved, and the protection of the original data can be achieved without encrypting the original data to be transmitted itself. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0070] Figure 1 This is a flowchart of a data transmission method applied to a data sending end according to an embodiment of the present application;
[0071] Figure 2 This is a schematic diagram of segmenting the original data to be transmitted in an embodiment of the present application;
[0072] Figure 3 This is a flowchart of the steps of transmitting an audio file in an embodiment of the present application;
[0073] Figure 4 This is a flowchart of the steps of a data transmission method applied to a data receiving end according to an embodiment of the present application;
[0074] Figure 5 This is a structural block diagram of a data transmission device applied to a data sending end according to an embodiment of the present application;
[0075] Figure 6 This is a structural block diagram of a data transmission device applied to a data receiving end in an embodiment of the present application. DETAILED DESCRIPTION
[0076] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0077] When one terminal interacts with another terminal, it is usually necessary to transmit the data related to the interaction to the other party through the Internet. In this process, the security of information is particularly important. In order to improve the security of data transmission, in the prior art, it is generally achieved by encrypting the transmitted data. At present, both symmetric encryption and asymmetric encryption methods used on the Internet have advantages and disadvantages. For example, symmetric encryption is fast but not safe when encrypting data; while asymmetric encryption is relatively safe but slow when encrypting data; especially when the transmitted data is large, such as when transmitting audio and video files, the use of asymmetric encryption to encrypt data has a particularly obvious impact on transmission efficiency.
[0078] In order to prevent data from being illegally stolen during transmission and ensure data transmission efficiency. One of the main technical concepts of the embodiment of the present application is that by segmenting the original data to be transmitted and transmitting it in a random order, the security of the original complete data during transmission can be effectively guaranteed; by randomly adding sequence identifiers to the multiple sub-data obtained by segmentation, and encrypting the sequence identifiers and labels of each sub-data for transmission, the amount of data to be encrypted is reduced, the efficiency of data encryption transmission is improved, and the protection of the original data can be achieved without encrypting the original data itself.
[0079] Reference Figure 1 , shows a flowchart of a data transmission method provided by an embodiment of the present application, the execution subject of the method is a data sending end, and in the embodiment of the present application, the method may include the following steps:
[0080] Step 101, split the original data to be transmitted to obtain multiple sub-data, and record the label of each sub-data.
[0081] In this embodiment, different segmentation methods can be used to segment the original data to be transmitted to obtain multiple sub-data, each sub-data has a corresponding label, and the position of each byte in the sub-data in the original data to be transmitted can be restored through the label. The label can start from 0 or from 1, and this application does not impose any restrictions on this.
[0082] Step 102: for each sub-data, a corresponding sequence identifier is added to each sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number.
[0083] In this embodiment, different sub-data have different sequence identifiers. After the original data to be transmitted is segmented, multiple sub-data are obtained, each of which has a corresponding sequence identifier, and the sequence identifier of each sub-data is generated by a random number generation method. The sequence identifier is added to the sub-data to obtain updated sub-data, so that the corresponding sub-data can be uniquely identified by the sequence identifier.
[0084] Step 103: splice the labels and sequence numbers of the plurality of sub-data according to the labels and sequence numbers of each sub-data to obtain spliced data.
[0085] After obtaining the label and sequence number of each sub-data, a corresponding relationship between the label and sequence number of each sub-data can be established, and the labels and sequence numbers of all sub-data are arranged according to a certain arrangement rule and then spliced together to obtain spliced data.
[0086] Step 104, encrypting the spliced data to obtain a ciphertext of the spliced data.
[0087] The spliced data includes the serial number and label of each sub-data. It can be understood that the position of each sub-data in the original data can be determined through the spliced data. After obtaining all the sub-data obtained by segmenting the original data, all the sub-data can be spliced and restored to the original data in combination with the spliced data. Therefore, the spliced data is related to the security of the original data. It is necessary to encrypt the spliced data to obtain the spliced data ciphertext, which plays a protective role in splicing all the sub-data back to the original data.
[0088] Step 105: transmitting the multiple updated sub-data corresponding to the multiple sub-data to the data receiving end in a random order, and transmitting the spliced data ciphertext to the data receiving end.
[0089] After obtaining the spliced data ciphertext and multiple updated sub-data corresponding to the multiple sub-data, the spliced data ciphertext is transmitted to the data receiving end, so that the data receiving end can subsequently decrypt the spliced data ciphertext to obtain the spliced data, and then splice the multiple sub-data back to the original data based on the spliced data.
[0090] Among them, multiple updated sub-data are transmitted to the data receiving end in a random order. Compared with transmitting in a predetermined order, by disrupting the order of transmission of each sub-data, it can be further difficult for illegal elements to intercept the sub-data and restore it to the original data, thereby improving the security of the original data transmission.
[0091] The embodiment of the present application divides the original data to be transmitted into multiple sub-data and records the label of each sub-data; for each sub-data, a corresponding sequence identifier is added to each sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number; according to the label and sequence number of each sub-data, the labels of multiple sub-data and multiple sequence numbers are spliced to obtain spliced data; the spliced data is encrypted to obtain a spliced data ciphertext; the multiple updated sub-data corresponding to the multiple sub-data are transmitted to the data receiving end in a random order, and the spliced data ciphertext is transmitted; the embodiment of the present application divides the original data to be transmitted into multiple sub-data, and the multiple sub-data are transmitted in a random order, so that the security of the original complete data during the transmission process can be effectively guaranteed; at the same time, by encrypting the identifiers and labels of multiple sub-data into a spliced data ciphertext for transmission, the amount of data to be encrypted is small, the efficiency of data encryption transmission is improved, and the protection of the original data can be achieved without encrypting the original data to be transmitted itself.
[0092] Next, the data transmission method in this exemplary embodiment will be further described.
[0093] In step 101, the original data to be transmitted is divided into multiple sub-data, and the label of each sub-data is recorded.
[0094] In the embodiment of the present application, the original data to be transmitted is generally big data including audio and video files. It can be understood that audio and video files refer to audio files and / or video files, and big data means that the data length of the original data to be transmitted is relatively long, generally exceeding 1MB.
[0095] The original data to be transmitted may be divided into a fixed number of divided portions to obtain a plurality of sub-data. The number of divided portions may also be determined according to the size of the original data to be transmitted, and the original data to be transmitted may be divided based on the determined number of divided portions to obtain a plurality of sub-data of the same number as the number of divided portions; generally, the larger the original data, the more divided portions.
[0096] Generally, the larger the data to be transmitted, the longer the corresponding transmission time. Considering that after the original data to be transmitted is divided, multiple sub-data can be obtained and transmitted in a multi-threaded manner to improve the transmission efficiency of the original data. Therefore, in a preferred embodiment of the present application, the number of divisions is determined according to the size of the original data to be transmitted.
[0097] In an optional embodiment of the present application, when the original data to be transmitted is an audio or video file, the above-mentioned segmentation of the original data to be transmitted to obtain multiple sub-data may include:
[0098] Convert the audio and video files into byte streams;
[0099] Determine the target number of splits according to the length of the byte stream;
[0100] The byte stream is divided according to the target number of divisions to obtain multiple sub-data.
[0101] In this embodiment, considering that audio and video files are generally encapsulated into a specific format, such as H264 format, AAC format, etc., therefore, in this embodiment, when the original data to be transmitted is an unencapsulated audio and video file, it is necessary to perform byte conversion on the audio and video file and convert it into a corresponding byte stream; then, according to the length of the byte stream, the target number of divisions is determined. For example, the target number of divisions corresponding to the length of the byte stream can be determined by formula calculation or table lookup; finally, the byte stream is divided based on the target number of divisions to obtain multiple sub-data.
[0102] In one example, determining the target number of splits according to the length of the byte stream may include:
[0103] According to the length of the byte stream, the target number of segments corresponding to the length of the byte stream is obtained from a preset relationship table, and the preset relationship table is used to record the correspondence between the lengths of different byte streams and the number of segments.
[0104] This example uses a preset relationship table to record the correspondence between the length of different byte streams and the number of splits. For example, when the length of the byte stream is between 10,000 and 100,000 bytes, the corresponding number of splits can be 100; when the length of the byte stream is between 100,000 and 200,000 bytes, the corresponding number of splits can be 200, and so on.
[0105] like Figure 2 FIG. 1 is a schematic diagram showing how to segment the original data to be transmitted to obtain multiple sub-data in an embodiment of the present application. Figure 2 In the example, the original data to be transmitted is a complete audio file, which is divided into 4 parts, namely 04 sub-data 1, 03 sub-data 2, 01 sub-data 3, and 02 sub-data 4. Among them, 04 in 04 sub-data 1 is the sequence code of sub-data 1, also known as the sequence identifier, 0 in 04 represents the complete audio code, and 4 represents the identifier of the sub-data; the number of 04 sub-data 1 is 0. Similarly, 03 in 03 sub-data 2 is the sequence code of sub-data 2, and the number of 03 sub-data 2 is 1; 01 in 01 sub-data 3 is the sequence code of sub-data 3, and the number of 01 sub-data 3 is 2; 02 in 02 sub-data 4 is the sequence code of sub-data 4, and the number of 02 sub-data 4 is 3.
[0106] It can be understood that a complete audio file can be obtained by sequentially splicing sub-data 1, sub-data 2, sub-data 3, and sub-data 4.
[0107] Furthermore, the above-mentioned segmentation of the original data to be transmitted to obtain multiple sub-data involves not only the number of segments but also the segmentation method.
[0108] In an optional embodiment, after determining the target number of splits, the original data to be transmitted is split so that the byte differences of the multiple sub-data are minimal, and the bytes in the same sub-data are adjacent bytes in the original data to be transmitted. For example, the original data to be transmitted has 101000 bytes, and the target number of splits is 100, then the sub-data labeled 1 corresponds to the 1st to 1010th bytes of the original data to be transmitted, the sub-data labeled 2 corresponds to the 1011th to 2020th bytes of the original data to be transmitted, ..., the sub-data labeled 100 corresponds to the 99991st to 101000th bytes of the original data to be transmitted. It can be understood that the corresponding original data can be obtained by splicing multiple sub-data in the order of corresponding labels from small to large.
[0109] In another optional embodiment, after determining the target number of splits, the original data to be transmitted is split, and the original data to be transmitted is first split into a plurality of initial sub-data corresponding to the target number of splits according to a preset number of bytes, and then the remaining bytes in the original data to be transmitted are split again according to the target number of splits. For example, if the original data to be transmitted has 101000 bytes and the target number of splits is 100, the original data is first split every 1000 bytes to obtain 100 initial sub-data, wherein the initial sub-data numbered 1 corresponds to the 1st to 1000th bytes of the original data to be transmitted, the initial sub-data numbered 2 corresponds to the 1001st to 2000th bytes of the original data to be transmitted, ..., and the initial sub-data numbered 100 corresponds to the 90001st to 100000th bytes of the original data to be transmitted. There are 1000 bytes from 100001 to 101000 of the original data to be transmitted, and then the 1000 bytes are evenly divided into 100 portions, each portion contains 10 bytes, and the bytes are added to the initial sub-data numbered from 1 to 100 in the order of the bytes in each portion, to obtain 100 sub-data. That is, the sub-data numbered 1 corresponds to the 1st to 1000th bytes and the 100001st to 100010th bytes of the original data to be transmitted, the initial sub-data numbered 2 corresponds to the 1001st to 2000th bytes and the 100011st to 100020th bytes of the original data to be transmitted, ..., and the initial sub-data numbered 100 corresponds to the 90001st to 100000th bytes and the 100990th to 101000th bytes of the original data to be transmitted.
[0110] Generally, the way in which the original data to be transmitted is divided needs to be synchronized to the data receiving end to ensure that the data receiving end can correctly restore the original data by receiving a plurality of sub-data.
[0111] In step 102, for each sub-data, a corresponding sequence identifier is added to each sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number.
[0112] After obtaining multiple sub-data, a corresponding sequence identifier is added to each sub-data to obtain updated sub-data. It can be understood that the updated sub-data has an additional sequence identifier compared to the sub-data before the update, and the sequence identifier is generated randomly. It can be understood that for the sub-data labeled 1, the added sequence identifier is not necessarily 1, but is obtained randomly.
[0113] In some optional embodiments of the present application, for each sub-data, adding a corresponding sequence identifier to each sub-data to obtain updated sub-data includes:
[0114] Generate multiple sequence numbers according to the total number of copies of the multiple sub-data;
[0115] Randomly matching the plurality of sequence numbers with the plurality of sub-data one by one;
[0116] For each sub-data, the sequence number corresponding to each sub-data is used as a sequence identifier and added to each sub-data to obtain updated sub-data.
[0117] In this embodiment, a plurality of sequence numbers are first generated according to the total number of the plurality of sub-data. For example, when the plurality of sub-data is specifically 100 sub-data, the generated sequence numbers may be 1, 2, 3, ..., 100.
[0118] Then, the multiple sequence numbers are randomly matched one by one with the multiple sub-data. For example, according to the label order of the sub-data, a sequence number can be randomly extracted from the multiple sequence numbers in turn as the sequence number corresponding to the sub-data. For example, for the sub-data labeled 1, a sequence number can be randomly selected from the above 100 sequence numbers as the sequence number corresponding to the sub-data labeled 1. For the sub-data labeled 2, a sequence number can be randomly selected from the remaining 99 sequence numbers as the sequence number corresponding to the sub-data labeled 2, and so on.
[0119] After determining the sequence number corresponding to each sub-data, the sequence number is added to the sub-data as a sequence identifier of the corresponding sub-data to obtain updated sub-data. Exemplarily, the sequence number can be added to the start position or the end position of the sub-data.
[0120] In step 103, the labels and sequence numbers of the plurality of sub-data are concatenated according to the label and sequence number of each sub-data to obtain concatenated data.
[0121] Each sub-data has a corresponding label and sequence number. When the sequence number is determined, the corresponding sub-data can be determined from multiple sub-data. After the label is determined, the position of each byte in the corresponding sub-data in the original data to be transmitted can be determined. In other words, the labels and sequence numbers of multiple sub-data are an indispensable reference for the data receiving end to restore the original data. Therefore, it is necessary to establish a corresponding relationship between the label and sequence number of each sub-data, arrange the labels and sequence numbers of all sub-data according to a certain arrangement rule, and then splice them together to obtain spliced data.
[0122] In some optional embodiments of the present application, the above-mentioned splicing the labels of the multiple sub-data and the multiple sequence numbers according to the label and the sequence number of each sub-data to obtain the spliced data may include:
[0123] Splicing the label and sequence number corresponding to each sub-data to obtain sub-spliced data;
[0124] The multiple sub-splicing data corresponding to the multiple sub-data are spliced together to obtain splicing data.
[0125] In this embodiment, the serial number and label corresponding to each sub-data can be spliced together to obtain sub-spliced data; for example, the serial number corresponding to a sub-data is 15 and the label is 1, and the spliced sub-spliced data can be 1501 or 0115, but the splicing rules of the serial number and label corresponding to each sub-data should be the same.
[0126] After obtaining the sub-spliced data corresponding to each sub-data, multiple sub-spliced data are spliced to obtain spliced data; wherein, the multiple sub-spliced data can be spliced randomly.
[0127] In other optional embodiments, the step of concatenating the labels of the plurality of sub-data and the plurality of sequence numbers according to the label and the sequence number of each sub-data to obtain the concatenated data may include:
[0128] Randomly concatenate multiple labels corresponding to multiple sub-data to obtain label concatenated data;
[0129] splicing the plurality of sequence numbers corresponding to the plurality of sub-data in accordance with the splicing order of the corresponding labels to obtain sequence number splicing data;
[0130] The label splicing data and the sequence number splicing data are spliced together to obtain splicing data.
[0131] In this embodiment, multiple labels of all sub-data can be randomly spliced to obtain label splicing data; then, according to the splicing order of each label in the label splicing data, the corresponding serial numbers are spliced to obtain number splicing data; finally, the label splicing data and the serial number splicing data are spliced to obtain splicing data.
[0132] Exemplarily, assuming there are 10 sub-data, the sequence number corresponding to the sub-data labeled 1 is 5; the sequence number corresponding to the sub-data labeled 2 is 8; the sequence number corresponding to the sub-data labeled 3 is 4; the sequence number corresponding to the sub-data labeled 4 is 2; the sequence number corresponding to the sub-data labeled 5 is 9; the sequence number corresponding to the sub-data labeled 6 is 3; the sequence number corresponding to the sub-data labeled 7 is 1; the sequence number corresponding to the sub-data labeled 8 is 10; the sequence number corresponding to the sub-data labeled 9 is 7; and the sequence number corresponding to the sub-data labeled 10 is 6.
[0133] The 10 numbers corresponding to the 10 sub-data are randomly spliced to obtain label splicing data. For example, the obtained label splicing data is 06080501030407091002; correspondingly, the obtained sequence splicing data is 03100905040201070608; finally, the label splicing data and the sequence number splicing data are spliced to obtain splicing data. At this time, the splicing data obtained by splicing the label splicing data and the sequence number splicing data can be 0608050103040709100203100905040201070608, or it can be 0310090504020107060806080501030407091002.
[0134] In step 104, the spliced data is encrypted to obtain a ciphertext of the spliced data.
[0135] The spliced data obtained by splicing the labels and sequence numbers of multiple sub-data is an indispensable reference for the data receiving end to restore the original data. In other words, the spliced data is related to the security of the original data. Therefore, the spliced data needs to be encrypted to obtain the encrypted spliced data ciphertext.
[0136] Among them, the spliced data is encrypted, and a variety of encryption methods can be used to encrypt the spliced data, including symmetric encryption and asymmetric encryption. Considering that in practical applications, the asymmetric encryption method is more difficult to crack and more secure than the symmetric encryption method, and the length of the spliced data is much smaller than the original data to be transmitted, therefore, in a preferred embodiment of the present application, an asymmetric encryption algorithm can be used to encrypt the spliced data. The asymmetric encryption algorithm can include an RSA encryption algorithm, an ElGamal encryption algorithm, and the like. For example, when the spliced data is encrypted using the RSA encryption algorithm, the data receiving end can use a public key to decrypt the spliced data ciphertext.
[0137] In step 105, the multiple updated sub-data corresponding to the multiple sub-data are transmitted to the data receiving end in a random order, and the spliced data ciphertext is transmitted to the data receiving end.
[0138] After obtaining the spliced data ciphertext and multiple updated sub-data corresponding to the multiple sub-data, the spliced data ciphertext is transmitted to the data receiving end, so that the data receiving end can subsequently decrypt the spliced data ciphertext to obtain the spliced data, and then splice the multiple sub-data back to the original data based on the spliced data.
[0139] Among them, multiple updated sub-data are transmitted to the data receiving end in a random order. Compared with transmitting in a predetermined order, by disrupting the order of transmission of each sub-data, it can be further difficult for illegal elements to intercept the sub-data and restore it to the original data, thereby improving the security of the original data transmission.
[0140] In some optional embodiments of the present application, transmitting the multiple updated sub-data corresponding to the multiple sub-data in a random order may include:
[0141] Randomly extract a target operation formula from the formula library;
[0142] Randomly generate a transmission random number corresponding to each updated sub-data according to the target operation formula;
[0143] The multiple updated sub-data are transmitted in the order of the corresponding transmission random number sizes.
[0144] At least two operation formulas are stored in the formula library. Each time the data sender sends a copy of the original data to be transmitted, a target operation formula can be randomly obtained from the formula library. For each updated sub-data, a corresponding transmission random number is randomly generated by the target operation formula. Finally, multiple updated sub-data are transmitted in order from large to small or from small to large according to the corresponding transmission random numbers.
[0145] That is to say, in this embodiment, each time the data transmitting end transmits data, the target operation formula used to generate the transmission random number may be different, which further improves the security of data transmission.
[0146] For example, each sub-data can be matched by numerical value, and the length of the sub-data can be combined with the time to form a string of numerical strings, where the time is the actual time. Since the time is constantly changing, even if the lengths of two sub-data are the same, the corresponding numerical strings are different. Then, combining the numerical string of the sub-data and the target operation formula, the transmission random number corresponding to each updated sub-data can be obtained, and then the transmission order of each updated sub-data can be determined according to the size of the transmission random number.
[0147] For example, when the target calculation formula is the intermediate position speed formula of uniformly accelerated linear motion, the specific formula is as follows:
[0148]
[0149] Among them, V s / 2 Indicates the intermediate speed, V 0 represents the initial velocity, V t Indicates the final speed.
[0150] According to the target calculation formula, the intermediate position speed V s / 2 The operation requires two conditions, namely the initial velocity V 0 and the final speed V t . Determine the maximum and minimum values from the numerical character strings of multiple sub-data, and use the maximum value as the end speed V t Substitute into the target calculation formula and use the minimum value as the initial speed V 0 Substituting into the target calculation formula, the intermediate position speed V can be calculated s / 2 , and then at the intermediate position speed V s / 2 is the maximum value, and a transmission random number is generated for each updated sub-data, so that the transmission random number corresponding to each updated sub-data can be obtained. Finally, the transmission random numbers corresponding to all updated sub-data can be sorted in order from large to small or from small to large to determine the transmission sequence number of each updated sub-data. Optionally, in the process of generating the transmission random number corresponding to each updated sub-data, if there are at least two identical transmission random numbers, multiple updated sub-data with the same transmission random number can be transmitted in a default sequence, for example, in order of sequence number from small to large or from large to small, or in order of the corresponding numerical string value from small to large or from large to small.
[0151] Combine the following Figure 3 The schematic diagram of the transmission process of the audio file shown in the figure provides an exemplary explanation and description of the present solution.
[0152] Step 301: The data sending end converts the audio file into an audio byte stream.
[0153] When sending an audio file, you need to first convert the audio file into a corresponding audio byte stream.
[0154] Step 302: The data sending end divides the audio byte stream into multiple sub-data according to the length of the audio byte stream, generates an unordered sequence number at the beginning of each sub-data, and obtains the label of each sub-data; and generates the order of sending each sub-data through a random number.
[0155] According to the length of the audio byte stream, the number of portions of the audio byte stream is determined, and the audio byte stream is divided based on the number of portions, so that a plurality of sub-data can be obtained. An unordered sequence number is generated at the beginning of each sub-data, that is, the randomly generated sequence number is added to the starting position of the corresponding sub-data. At the same time, when multiple sub-data are obtained by segmentation, a label of each sub-data can be obtained, and the label is used to indicate the position of the byte in the sub-data in the audio byte stream.
[0156] When sending sub-data, the order in which each sub-data is sent is randomly generated, that is, a random number is transmitted, so that multiple sub-data are sent to the data receiving end in a random order.
[0157] Step 303: The data sending end concatenates the sub-data number and the sequence number, and encrypts them using the RSA algorithm to generate a ciphertext.
[0158] The labels and sequence numbers of all sub-data are spliced together according to the set rules, and encrypted through the RSA asymmetric encryption algorithm to generate the corresponding ciphertext, that is, the spliced data ciphertext, and the ciphertext is sent to the data receiving end to improve the security of data transmission.
[0159] Step 304, the data receiving end receives the shuffled sub-data and ciphertext, parses the ciphertext using the key, combines the parsed labels and sequence numbers, and splices the sub-data into an audio byte stream.
[0160] After receiving the scrambled sub-data and ciphertext, the data receiving end can parse out the label and sequence number of each sub-data through the key. According to the label and sequence number of each sub-data, the bytes in each sub-data can be restored to the corresponding position to obtain the audio byte stream, thus completing the entire process of sending and receiving audio data.
[0161] The embodiment of the present application only needs to segment the byte stream of the audio and video file, and encrypt the labels and sequence numbers of the sub-data obtained by the segmentation using an asymmetric encryption algorithm, so as to achieve the same data encryption effect, thereby solving the problem that the audio and video files are too large and can be easily cracked using symmetric encryption, resulting in the theft of audio and video. Since the labels and sequence numbers are relatively small in bytes, they will not affect the encryption speed, thus solving the problem of slow asymmetric encryption data.
[0162] Reference Figure 4 , shows a flowchart of a data transmission method provided by an embodiment of the present application, the execution subject of the method is a data receiving end, and in the embodiment of the present application, the method may include the following steps:
[0163] Step 401, receiving a plurality of updated sub-data and concatenated data ciphertexts, wherein the plurality of updated sub-data and the concatenated data ciphertexts are generated by a data transmitting end using the data transmission method described in the above embodiment; each updated sub-data is composed of a sub-data with a corresponding sequence number added thereto;
[0164] Step 402, decrypting the ciphertext of the spliced data using a key to obtain spliced data; the spliced data is spliced by the labels and sequence numbers of multiple sub-data, and the labels are used to indicate the position of each byte in the corresponding sub-data in the original data;
[0165] Step 403: splice the sub-data in the plurality of updated sub-data according to the labels and sequence numbers of the plurality of sub-data to obtain the original data.
[0166] In an embodiment of the present application, a data receiving end can receive multiple updated sub-data and spliced data ciphertexts sent by a data sending end; the spliced data ciphertexts are decrypted using a pre-agreed key to obtain spliced data, which is formed by splicing the labels of multiple sub-data and the corresponding sequence numbers, wherein the labels are used to indicate the positions of each byte in the corresponding sub-data in the original data, and the sequence number is used to determine the unique corresponding sub-data.
[0167] The difference between the updated sub-data and the sub-data is that a sequence identifier (also called a sequence number) is added. Therefore, the data receiving end can restore the updated sub-data based on the rule to obtain the corresponding sub-data and sequence number. The sub-data is used to splice and restore the original data, and the sequence number is used to uniquely identify the corresponding sub-data.
[0168] After obtaining the label of each sub-data and the corresponding sequence number, as well as the updated sub-data consisting of the sub-data and the corresponding sequence number, the multiple sub-data can be spliced to obtain the original data.
[0169] It should be noted that, since data transmission on the Internet is generally bidirectional, the same device can be used as both a data transmitter and a data receiver. When used as a data transmitter, the following operations can be performed: Figure 1 The process shown in the embodiment; when used as a data receiving end, the following can be performed Figure 4 The process shown in the example.
[0170] To facilitate understanding, the data transmission method provided in the embodiment of the present application will be exemplarily explained and illustrated with reference to a specific example.
[0171] In the first step, after the data sender gets the audio file to be transmitted, it converts the audio file into a byte stream. Assume that the byte stream of 187640 bytes obtained by conversion is as follows:
[0172] dfdfa35afas21asadas2wqeqeqwe9dskjasfas0w436faasas23we5z2asdaas2df94sdasd2123123asda1szcdfdfa35afas21asadas9dskjasfas0w236faasas2355z2asdaas2df94sdasd2123123asda1szc……(the data is large, the subsequent part is omitted).
[0173] In the second step, the above 187640-byte byte stream is divided into 100 sub-data, and the obtained multiple sub-data (multiple sub-data are listed in the order of numbers from 0 to 100) are as follows:
[0174] dfdfa35afas21asadas2wqeq、eqwe9dskjasfas0w436fa、asas23we5z2asdaas2d、f94sdasd2123123asda1 szc, dfdfa35afas21asadas9d, skjasfas0w236faasas2355, z2asdaas2df94sdasd2, 123123asda1szc,….
[0175] The third step is to add a random sequence number before each sub-data to obtain the corresponding updated sub-data, as follows:
[0176] 06dfdfa35afas21asadas2wqeq、010eqwe9dskjasfas0w436fa、088asas23we5z2asdaas2d、032f94sdasd2123123asda1s zc、041dfdfa35afas21asadas9d、082skjasfas0w236faasas2355、044z2asdaas2df94sdasd2、055123123asda1szc、…….
[0177] In the fourth step, the multiple updated sub-data obtained in the third step are shuffled in order and sent to the data receiving end through multiple threads.
[0178] Then, the sequence number and label of each sub-data are spliced together to obtain the following multiple sub-spliced data:
[0179] 060, 0101, 0882, 033, 0414, 0825, 0446, 0557, …
[0180] The sub-joined data are joined together to obtain the joined data, as follows:
[0181] 060010108820330414082504460557,…….
[0182] Next, the spliced data is encrypted using the RSA algorithm, and the encrypted spliced data ciphertext is sent to the data receiving end.
[0183] In the fifth step, the data receiving end stores the received updated sub-data in the cache first. After all the updated sub-data are transmitted and the spliced data ciphertext is received, the spliced data ciphertext is parsed to obtain the labels and sequence numbers of multiple sub-data, and the updated sub-data in the cache are compared one by one according to the beginning sequence number, and restored to the corresponding sub-data and sorted. After sorting, the complete audio is obtained.
[0184] The embodiment of the present application divides the original data to be transmitted into multiple sub-data and records the label of each sub-data; for each sub-data, adds a corresponding sequence identifier to each sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number; according to the label and sequence number of each sub-data, the labels of multiple sub-data and the multiple sequence numbers are spliced to obtain spliced data; the spliced data is encrypted to obtain a spliced data ciphertext; multiple updated sub-data corresponding to the multiple sub-data are transmitted to the data receiving end in a random order, and the spliced data ciphertext is transmitted; after receiving the transmitted multiple updated sub-data and the spliced data ciphertext, the data receiving end decrypts the spliced data ciphertext to obtain the spliced data spliced by the labels and sequence numbers of each sub-data, and the sub-data restored from the multiple updated sub-data are sorted and spliced according to the spliced data to obtain the original data. The embodiment of the present application can effectively ensure the security of the original complete data during the transmission process by dividing the original data to be transmitted into multiple sub-data, and transmitting the multiple sub-data in a random order; at the same time, by encrypting the identifiers and labels of the multiple sub-data into a spliced data ciphertext for transmission, the amount of data to be encrypted is small, and the encryption speed is not affected, which solves the problem of slow asymmetric encryption data, thereby improving the efficiency of data encryption transmission, and can achieve protection of the original data without encrypting the original data to be transmitted itself.
[0185] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0186] Reference Figure 5 , shows a structural block diagram of an embodiment of a data transmission device of the present application, the data transmission device can be used to execute the data transmission method in the above embodiment. In the embodiment of the present application, the data transmission device may include the following modules:
[0187] The data segmentation module 501 is used to segment the original data to be transmitted to obtain multiple sub-data and record the label of each sub-data;
[0188] An adding identification module 502 is used to add a corresponding sequence identification to each sub-data to obtain updated sub-data; the sequence identification is a randomly generated sequence number;
[0189] A number splicing module 503, configured to splice the labels and sequence numbers of the plurality of sub-data according to the labels and sequence numbers of each sub-data to obtain spliced data;
[0190] The data encryption module 504 is used to encrypt the spliced data to obtain a ciphertext of the spliced data;
[0191] The data transmission module 505 is used to transmit the multiple updated sub-data corresponding to the multiple sub-data to the data receiving end in a random order, and transmit the spliced data ciphertext to the data receiving end.
[0192] Optionally, the data transmission module 505 may include:
[0193] The target operation formula determination submodule is used to randomly extract a target operation formula from the formula library;
[0194] A transmission random number determination submodule, used to randomly generate a transmission random number corresponding to each updated sub-data according to the target operation formula;
[0195] The random sequence transmission submodule is used to transmit a plurality of updated sub-data to a data receiving end in the order of the corresponding transmission random number sizes.
[0196] Optionally, when the original data to be transmitted is an audio or video file, the data segmentation module 501 may include:
[0197] A file conversion submodule, used for converting the audio and video files into byte streams;
[0198] The submodule for determining the number of copies is used to determine the target number of copies to be divided according to the length of the byte stream;
[0199] The segmentation submodule is used to segment the byte stream according to the target segmentation number to obtain multiple sub-data.
[0200] Optionally, the portion determination submodule can be specifically used to obtain the target number of portions corresponding to the length of the byte stream from a preset relationship table based on the length of the byte stream, and the preset relationship table is used to record the correspondence between the lengths of different byte streams and the number of portions to be divided.
[0201] Optionally, adding identification module 502 may include:
[0202] A sequence number generation submodule, used for generating a plurality of sequence numbers according to the total number of copies of the plurality of sub-data;
[0203] A sequence number corresponding submodule, used for randomly corresponding the plurality of sequence numbers to the plurality of sub-data one by one;
[0204] The sequence number adding submodule is used to add the sequence number corresponding to each sub-data as a sequence identifier to each sub-data to obtain updated sub-data.
[0205] Optionally, the sequence number adding submodule may be specifically used to add the corresponding sequence number as a sequence identifier to the start position or the end position of each sub-data for each sub-data to obtain updated sub-data.
[0206] Optionally, the number splicing module 503 may include:
[0207] A first splicing submodule, used for splicing the label and sequence number corresponding to each sub-data to obtain sub-splicing data;
[0208] The second splicing submodule is used to splice the multiple sub-splicing data corresponding to the multiple sub-data to obtain splicing data.
[0209] Optionally, the data encryption module 504 may be specifically configured to encrypt the spliced data using an asymmetric encryption algorithm to obtain a ciphertext of the spliced data.
[0210] The embodiment of the present application only needs to segment the byte stream of the audio and video file, and encrypt the labels and sequence numbers of the sub-data obtained by the segmentation using an asymmetric encryption algorithm, so as to achieve the same data encryption effect, thereby solving the problem that the audio and video files are too large and can be easily cracked using symmetric encryption, resulting in the theft of audio and video. Since the labels and sequence numbers are relatively small in bytes, they will not affect the encryption speed, thus solving the problem of slow asymmetric encryption data.
[0211] Reference Figure 6 , shows a structural block diagram of an embodiment of a data transmission device of the present application, the data transmission device can be used to execute the data transmission method in the above embodiment. In the embodiment of the present application, the data transmission device may include the following modules:
[0212] The data receiving module 601 is used to receive a plurality of updated sub-data and concatenated data ciphertexts, wherein the plurality of updated sub-data and the concatenated data ciphertexts are generated by the data transmitting end using the data transmission method described in the above embodiment; each updated sub-data is composed of the sub-data with the corresponding sequence number added;
[0213] The data decryption module 602 is used to decrypt the ciphertext of the spliced data using a key to obtain spliced data; the spliced data is spliced by the labels and sequence numbers of multiple sub-data, and the labels are used to indicate the position of each byte in the corresponding sub-data in the original data;
[0214] The data restoration module 603 is used to splice the sub-data in the multiple updated sub-data according to the labels and sequence numbers of the multiple sub-data to obtain the original data.
[0215] It should be noted that, since data transmission on the Internet is generally bidirectional, the same device can be used as both a data transmitter and a data receiver. When used as a data transmitter, the following operations can be performed: Figure 1 The process shown in the embodiment; when used as a data receiving end, the following can be performed Figure 4 The process shown in the embodiment. That is, the same device can include Figure 5 The module described in the embodiment may also include Figure 6 The module described in the embodiment.
[0216] The embodiment of the present application divides the original data to be transmitted into multiple sub-data and records the label of each sub-data; for each sub-data, adds a corresponding sequence identifier to each sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number; according to the label and sequence number of each sub-data, the labels of multiple sub-data and the multiple sequence numbers are spliced to obtain spliced data; the spliced data is encrypted to obtain a spliced data ciphertext; multiple updated sub-data corresponding to the multiple sub-data are transmitted to the data receiving end in a random order, and the spliced data ciphertext is transmitted; after receiving the transmitted multiple updated sub-data and the spliced data ciphertext, the data receiving end decrypts the spliced data ciphertext to obtain the spliced data spliced by the labels and sequence numbers of each sub-data, and the sub-data restored from the multiple updated sub-data are sorted and spliced according to the spliced data to obtain the original data. The embodiment of the present application can effectively ensure the security of the original complete data during the transmission process by dividing the original data to be transmitted into multiple sub-data, and transmitting the multiple sub-data in a random order; at the same time, by encrypting the identifiers and labels of the multiple sub-data into a spliced data ciphertext for transmission, the amount of data to be encrypted is small, and the encryption speed is not affected, which solves the problem of slow asymmetric encryption data, thereby improving the efficiency of data encryption transmission, and can achieve protection of the original data without encrypting the original data to be transmitted itself.
[0217] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0218] An embodiment of the present application also discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the data transmission method described above when executed by the processor.
[0219] The embodiment of the present application further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data transmission method described above are implemented.
[0220] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0221] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0222] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0223] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0224] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0225] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0226] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0227] The above is a detailed introduction to a data transmission method and device, electronic device and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data transmission method, characterized in that: The method comprises: The original data to be transmitted is divided into multiple sub-data, and the label of each sub-data is recorded; For each of the sub-data, a corresponding sequence identifier is added to each of the sub-data to obtain updated sub-data; the sequence identifier is a randomly generated sequence number; According to the label and the sequence number of each sub-data, the labels and the sequence numbers of the plurality of sub-data are concatenated to obtain concatenated data; Encrypting the spliced data to obtain a ciphertext of the spliced data; Transmitting a plurality of updated sub-data corresponding to the plurality of sub-data to a data receiving end in a random order, and transmitting the spliced data ciphertext to the data receiving end; The step of transmitting the updated sub-data corresponding to the sub-data to the data receiving end in a random order includes: Randomly extract a target operation formula from the formula library; Randomly generate a transmission random number corresponding to each updated sub-data according to the target operation formula; The multiple updated sub-data are transmitted to the data receiving end in the order of the corresponding transmission random number sizes.
2. The method according to claim 1, characterized in that When the original data to be transmitted is an audio or video file, the original data to be transmitted is segmented to obtain a plurality of sub-data, including: Convert the audio and video files into byte streams; Determine the target number of splits according to the length of the byte stream; The byte stream is divided according to the target number of divisions to obtain multiple sub-data.
3. The method according to claim 2, characterized in that The step of determining the target number of splits according to the length of the byte stream includes: According to the length of the byte stream, the target number of segments corresponding to the length of the byte stream is obtained from a preset relationship table, and the preset relationship table is used to record the correspondence between the lengths of different byte streams and the number of segments.
4. The method according to claim 1, characterized in that: The step of adding a corresponding sequence identifier to each sub-data to obtain updated sub-data includes: Generate multiple sequence numbers according to the total number of copies of the multiple sub-data; Randomly matching the plurality of sequence numbers with the plurality of sub-data one by one; For each sub-data, the sequence number corresponding to each sub-data is used as a sequence identifier and added to each sub-data to obtain updated sub-data.
5. The method according to claim 4, characterized in that The step of adding, for each sub-data, a sequence number corresponding to each sub-data as a sequence identifier to each sub-data to obtain updated sub-data includes: For each sub-data, the corresponding sequence number is used as a sequence identifier and added to the start position or the end position of each sub-data to obtain the updated sub-data.
6. The method according to any one of claims 1 to 5, characterized in that The step of splicing the labels and sequence numbers of the plurality of sub-data according to the labels and sequence numbers of each sub-data to obtain spliced data includes: Splicing the label and sequence number corresponding to each sub-data to obtain sub-spliced data; The multiple sub-splicing data corresponding to the multiple sub-data are spliced together to obtain splicing data.
7. The method according to any one of claims 1 to 5, characterized in that The step of encrypting the spliced data to obtain a ciphertext of the spliced data includes: The spliced data is encrypted using an asymmetric encryption algorithm to obtain a ciphertext of the spliced data.
8. A data transmission method, characterized in that: The method comprises: receiving a plurality of updated sub-data and concatenated data ciphertexts, wherein the plurality of updated sub-data and the concatenated data ciphertexts are generated by a data transmitting end using the data transmission method according to any one of claims 1 to 7; each updated sub-data is composed of a sub-data with a corresponding sequence number added thereto; Decrypting the ciphertext of the spliced data using a key to obtain spliced data; the spliced data is formed by splicing the labels and sequence numbers of multiple sub-data, and the labels are used to indicate the positions of each byte in the corresponding sub-data in the original data; The sub-data in the multiple updated sub-data are concatenated according to the labels and sequence numbers of the multiple sub-data to obtain the original data.
9. A data transmission device, characterized in that: The device comprises: The data segmentation module is used to segment the original data to be transmitted to obtain multiple sub-data and record the label of each sub-data; An identification adding module is used to add a corresponding sequence identification to each sub-data to obtain updated sub-data; the sequence identification is a randomly generated sequence number; A number splicing module, used for splicing the labels and sequence numbers of the plurality of sub-data according to the labels and sequence numbers of each sub-data to obtain spliced data; A data encryption module, used for encrypting the spliced data to obtain a ciphertext of the spliced data; A data transmission module, used for transmitting the multiple updated sub-data corresponding to the multiple sub-data to the data receiving end in a random order, and transmitting the spliced data ciphertext to the data receiving end; Wherein, the data transmission module includes: The target operation formula determination submodule is used to randomly extract a target operation formula from the formula library; A transmission random number determination submodule, used to randomly generate a transmission random number corresponding to each updated sub-data according to the target operation formula; The random sequence transmission submodule is used to transmit a plurality of updated sub-data to a data receiving end in the order of the corresponding transmission random number sizes.
10. A data transmission device, characterized in that: The device comprises: A data receiving module, used for receiving a plurality of updated sub-data and concatenated data ciphertexts, wherein the plurality of updated sub-data and the concatenated data ciphertexts are generated by a data transmitting end using the data transmission method according to any one of claims 1 to 7; each updated sub-data is composed of a corresponding sequence number added to the sub-data; A data decryption module, used to decrypt the ciphertext of the spliced data using a key to obtain spliced data; the spliced data is formed by splicing the labels and sequence numbers of multiple sub-data, and the labels are used to indicate the positions of each byte in the corresponding sub-data in the original data; The data restoration module is used to splice the sub-data in the multiple updated sub-data according to the labels and sequence numbers of the multiple sub-data to obtain the original data.
11. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the data transmission method according to any one of claims 1 to 8 when executed by the processor.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
A method for broadcasting a safety net and transmitting the safety net unidirectionally to an external network
CN109104431A