A data transmission method, a transmitting end, a receiving end, a device and a storage medium
By performing data segmentation and parallel cache encoding on the transmission task at the sending end, multiple QR codes are generated, which solves the user experience problems caused by the seriality of transmission tasks in the existing technology, realizes multi-task parallel transmission, and improves transmission efficiency. .
Patent Information
- Application Number
- CN202211592144.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-12-12
AI Technical Summary
Existing physically isolated one-way transmission technologies based on images or QR codes can only transmit data serially, resulting in a reduced user experience. Especially in multiple transmission tasks, when the previous task has a large amount of data, subsequent tasks need to wait. Concurrent transfers cannot be achieved.
By performing data segmentation on the transmission task at the sending end, multiple data fragments are obtained, cached and encoded in parallel, and multiple QR codes are generated to achieve parallel data transmission of multiple transmission tasks and improve the concurrency of transmission tasks.
Parallel data transmission of multiple transmission tasks is realized, which avoids users waiting for one task to be completed before starting the next task, improving user experience and transmission efficiency.
Smart Images

Figure CN116132423B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data transmission, and in particular to a data transmission method, a transmitting end, a receiving end, a device and a storage medium. Background Art
[0002] As the degree of openness of network information continues to increase, information sharing is becoming more and more an effective means to improve work efficiency and make joint decisions among multiple departments. The most important consideration in information sharing is security.
[0003] For security and confidentiality reasons, some computer information systems must not be directly or indirectly linked to the Internet or other public information networks, and must be physically isolated. Physical isolation means that the internal LAN does not have a direct physical connection with the Internet or other external networks at any time. However, the existence of physical isolation makes it impossible to complete the transmission of data and information between isolated networks in specific fields, resulting in the inability to use the application services of the intranet normally. Based on the above problems, the prior art proposes a one-way transmission system based on QR codes, which aims to solve the technical problem of one-way data transmission between physically isolated network domains.
[0004] The physical isolation one-way transmission technology based on image or QR code encoding in the existing technology can indeed contribute to the security of shared information, but the existing technology can only realize the transmission of transmission tasks in serial. For multiple simultaneous transmission tasks, it can only start another transmission task after the previous transmission task is completed. If the data volume of the previous transmission task is large, all subsequent transmission tasks will have to wait, which reduces the user experience. Summary of the invention
[0005] The present application provides a data transmission method, a transmitting end, a receiving end and a storage medium for improving the concurrency of data transmission.
[0006] The first aspect of the present application provides a data transmission method, including:
[0007] The sending end divides data into at least two transmission tasks, and obtains a plurality of data slices respectively, and each transmission task includes at least two data slices;
[0008] The sending end extracts first data slices from the at least two transmission tasks respectively, and marks the first data slices that have been extracted;
[0009] The sending end caches the first data slices in parallel to a first display queue;
[0010] The sending end extracts second data slices from at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice;
[0011] The sending end caches the second data slices in parallel to a second display queue;
[0012] The sending end repeats the above extraction and caching steps until all data slices of the at least two transmission tasks are extracted and parallel caching is completed;
[0013] The sending end encodes the first data slice in the first display queue according to an encoding rule to generate a first two-dimensional code, and projects the first two-dimensional code onto a first screen, so that the receiving end obtains the first data slice through the first two-dimensional code;
[0014] The sending end encodes the second data fragment in the second display queue according to the encoding rule, generates a second two-dimensional code, and projects the second two-dimensional code onto a second screen, so that the receiving end obtains the second data fragment through the second two-dimensional code.
[0015] Optionally, after the sending end caches the first data slices in parallel to the first display queue, the data transmission method further includes:
[0016] The sending end determines the urgency level of the first transmission task;
[0017] The transmitting end determines the maximum data capacity displayed on the first screen;
[0018] The sending end determines the existing data capacity of the first display queue;
[0019] The sending end determines whether the existing data capacity is less than the maximum data capacity;
[0020] If the existing data capacity is less than the maximum data capacity, the sending end determines EN i Whether the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, where N i ω is the data volume of any data slice in the i-th transmission task, and E is determined according to the emergency level;
[0021] If the EN iIf the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, the sending end polls and reads the first transmission task and the second transmission task, obtains a first preset number of data slices after the first data slice of the first transmission task or the second transmission task, caches the obtained data slices in parallel to the first display queue, and moves the read pointer to the next transmission task of the transmission task where the first data slice is located;
[0022] If the EN i If the value of ω is not greater than the difference between the maximum data capacity and the existing data capacity, the sending end obtains a second preset number of data slices after the first data slice of the first transmission task, and the second preset number is determined according to the urgency level. The obtained data slices are cached in parallel to the first display queue, and the read pointer is moved to the next transmission task of the first transmission task.
[0023] Optionally, the sending end encodes the first data slice in the first display queue according to an encoding rule to generate a first two-dimensional code, and projects the first two-dimensional code onto the first screen, including:
[0024] The sending end randomly generates a set of target number sequences, wherein the target number sequence is an integer number sequence;
[0025] The transmitting end extracts a first target data slice from the first data slice according to the number sequence rule of the target number sequence, and generates a first target QR code according to the extracted first target data slice;
[0026] The transmitting end extracts a second target data slice, and generates a second target two-dimensional code according to the extracted second target data slice, wherein the second target data slice is the remaining data slices in the first data slice except the first target data slice;
[0027] The transmitting end encodes the target number sequence into the first target two-dimensional code and the second target two-dimensional code;
[0028] The sending end projects the first target two-dimensional code and the second target two-dimensional code onto a first screen, so that the receiving end obtains the first target data slice, the second target data slice and the target number series through the first target two-dimensional code and the second target two-dimensional code.
[0029] Optionally, the target number sequence is an arithmetic sequence or a geometric sequence.
[0030] Optionally, the sending end performs data segmentation on at least two transmission tasks, and respectively obtains a plurality of data fragments, including:
[0031] The sending end performs data segmentation on at least two transmission tasks according to the data capacity of the minimum information writing unit in a two-dimensional code, and obtains a number of data volumes N respectively. i ω data sharding, where is the data capacity of a QR code, a transmission task T i The amount of data is K, which is the data capacity of a QR code. i times.
[0032] The first aspect of the present application also provides a data transmission method, including:
[0033] The receiving end captures the first screen to obtain a first QR code image;
[0034] The receiving end determines a target number sequence according to the first two-dimensional code image;
[0035] The receiving end generates a first decoding queue according to the number of first data slices of the first display queue;
[0036] The receiving end fills the first target data slice of the first display queue into the first decoding queue according to the target sequence, wherein the first target data slice is a part of the first data slice;
[0037] The second target data slices of the first display queue of the receiving end are filled into the remaining positions of the first decoding queue, and the second target data slices are the remaining data slices in the first data slices except the first target data slices;
[0038] The receiving end determines the encoding tags corresponding to the first target data segment and the second target data segment in the first decoding queue, wherein the encoding tags include the transmission task numbers and sequence numbers of the first target data segment and the second target data segment;
[0039] The receiving end determines whether there is a target transmission task according to the transmission task number;
[0040] If so, the receiving end stores the first target data fragment and the second target data fragment into the target transmission task according to the sequence number;
[0041] If not, the receiving end establishes a target transmission task, and stores the first target data segment and the second target data segment into the target transmission task according to the sequence number.
[0042] A third aspect of the present application provides a sending end, including:
[0043] A segmentation unit, used to segment data for at least two transmission tasks, and obtain a plurality of data slices respectively, each transmission task including at least two data slices;
[0044] A first extraction unit, configured to extract first data slices from the at least two transmission tasks respectively, and mark the first data slices that have been extracted;
[0045] A first cache unit, configured to cache the first data slices in parallel to a first display queue;
[0046] A second extraction unit, configured to extract second data slices from at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice;
[0047] A second cache unit, configured to cache the second data slices in parallel to a second display queue;
[0048] A repeating unit, used to repeat the above-mentioned extraction and caching steps until all data slices of the at least two transmission tasks are extracted and parallel caching is completed;
[0049] a first encoding unit, configured to encode the first data slice in the first display queue according to an encoding rule, generate a first two-dimensional code, and project the first two-dimensional code onto a first screen, so that a receiving end obtains the first data slice through the first two-dimensional code;
[0050] The second encoding unit is used to encode the second data fragment in the second display queue according to the encoding rule, generate a second QR code, and project the second QR code onto the second screen so that the receiving end can obtain the second data fragment through the second QR code.
[0051] Optionally, the sending end further includes:
[0052] A first determining unit, configured to determine an urgency level of the first transmission task;
[0053] A second determining unit, used to determine a maximum data capacity displayed on the first screen;
[0054] A third determining unit, configured to determine an existing data capacity of the first display queue;
[0055] A first judging unit, configured to judge whether the existing data capacity is less than the maximum data capacity;
[0056] The second judgment unit is used to judge whether EN iWhether the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, where N i ω is the data volume of any data slice in the i-th transmission task, and E is determined according to the emergency level;
[0057] Reading unit, used if the EN i If the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, the sending end polls and reads the first transmission task and the second transmission task, obtains a first preset number of data slices after the first data slice of the first transmission task or the second transmission task, caches the obtained data slices in parallel to the first display queue, and moves the read pointer to the next transmission task of the transmission task where the first data slice is located;
[0058] Acquisition unit, used if the EN i The value of ω is not greater than the difference between the maximum data capacity and the existing data capacity, and a second preset number of data slices are obtained after the first data slice of the first transmission task, and the second preset number is determined according to the urgency level. The obtained data slices are cached in parallel to the first display queue, and the read pointer is moved to the next transmission task of the first transmission task.
[0059] Optionally, the first encoding unit is specifically used for:
[0060] Randomly generate a set of target number sequences, wherein the target number sequence is an integer number sequence;
[0061] Extracting a first target data slice from the first data slice according to the number sequence rule of the target number sequence, and generating a first target QR code according to the extracted first target data slice;
[0062] Extracting a second target data slice, and generating a second target two-dimensional code according to the extracted second target data slice, wherein the second target data slice is the remaining data slices in the first data slice except the first target data slice;
[0063] Encoding the target number sequence into the first target two-dimensional code and the second target two-dimensional code;
[0064] The first target two-dimensional code and the second target two-dimensional code are projected onto a first screen, so that a receiving end obtains the first target data slice, the second target data slice and the target number series through the first target two-dimensional code and the second target two-dimensional code.
[0065] A fourth aspect of the present application provides a receiving end, including:
[0066] A shooting unit, used for shooting the first screen to obtain a first QR code image;
[0067] A first determining unit, configured to determine a target number sequence according to the first two-dimensional code image;
[0068] A generating unit, configured to generate a first decoding queue according to the number of first data slices of the first display queue;
[0069] A first filling unit, used for filling the first target data slice of the first display queue into the first decoding queue according to the target sequence, wherein the first target data slice is a part of the first data slice;
[0070] A second filling unit is used to fill the second target data slices of the first display queue into the remaining positions of the first decoding queue, wherein the second target data slices are the remaining data slices in the first data slices except the first target data slices;
[0071] A second determining unit, used to determine the encoding tags corresponding to the first target data fragment and the second target data fragment in the first decoding queue, wherein the encoding tags include the transmission task numbers and sequence numbers of the first target data fragment and the second target data fragment;
[0072] A judging unit, used for judging whether there is a target transmission task according to the transmission task number;
[0073] A first storage unit, used for storing the first target data segment and the second target data segment into the target transmission task according to the sequence number if they exist;
[0074] The second storage unit is used to establish a target transmission task if it does not exist, and store the first target data segment and the second target data segment into the target transmission task according to the sequence number.
[0075] A fifth aspect of the present application provides a data transmission device, the device comprising:
[0076] Processor, memory, input-output unit, and bus;
[0077] The processor is connected to the memory, the input and output unit, and the bus;
[0078] The memory stores a program, and the processor calls the program to execute the first aspect and any optional data transmission method in the first aspect.
[0079] In a sixth aspect, the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional data transmission method in the first aspect.
[0080] It can be seen from the above technical scheme that the present application has the following advantages: through the data transmission method proposed in the present application, data is segmented for at least two transmission tasks, and different data slices of at least two transmissions are obtained respectively, and each transmission task includes at least two data slices; the first data slice is extracted from the at least two transmission tasks respectively, and the first data slices corresponding to the at least two transmission tasks are cached in parallel to the first display queue; the second data slice is extracted from the at least two transmission tasks, and the second data slices corresponding to the at least two transmission tasks are cached in parallel to the second display queue, and the second data slice is any data slice in the at least two transmission tasks except the first data slice; the extraction and caching steps are repeated until all data slices of the at least two transmission tasks are extracted and the parallel caching is completed, the first data slice in the first display queue is encoded according to the encoding rule, and a first QR code is generated, and The first QR code is projected onto the first screen, so that the receiving end obtains the first data slices corresponding to at least two transmission tasks respectively through the first QR code; the second data slices in the second display queue are encoded according to the encoding rule to generate a second QR code, and the second QR code is projected onto the second screen, so that the receiving end obtains the second data slices corresponding to at least two transmission tasks respectively through the second QR code; through the above method, at least two transmission tasks are split into several data slices, and different data slices corresponding to at least two transmission tasks are cached in parallel in the same QR code, and different data slices of one of the at least two transmission tasks are cached in different QR codes, so that parallel data transmission of different transmission tasks is realized, thereby improving the concurrency of data transmission of transmission tasks, so that users do not have to wait for the completion of one transmission task before transmitting the next transmission task, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0082] Figure 1 A schematic diagram of an embodiment of a data transmission method provided by the present application;
[0083] Figure 2-a A flowchart of another embodiment of a data transmission method provided by the present application;
[0084] Figure 2-b A flowchart of another embodiment of a data transmission method provided by the present application;
[0085] Figure 3 A schematic diagram of the structure of an embodiment of a transmitting end provided by the present application;
[0086] Figure 4 A schematic diagram of another embodiment of a transmitting end provided by the present application;
[0087] Figure 5 A schematic diagram of a structure of an embodiment of a receiving end provided by the present application;
[0088] Figure 6 A schematic diagram of the structure of an embodiment of a data transmission device provided in the present application. DETAILED DESCRIPTION
[0089] The present application provides a data transmission method, a sending end, a receiving end, a device and a storage medium for improving the concurrency of data transmission of a transmission task.
[0090] It should be noted that the data transmission method provided in this application can be applied to a terminal or a server. For example, the terminal can be a smart phone or a computer, a tablet computer, a smart TV, a smart watch, a portable computer terminal, or a fixed terminal such as a desktop computer. For the convenience of explanation, this application uses the sending end as the execution subject for example.
[0091] See also Figure 1 , Figure 1 An embodiment of a data transmission method provided in the present application includes:
[0092] 101. The sending end divides data for at least two transmission tasks and obtains a plurality of data slices respectively, where each transmission task includes at least two data slices;
[0093] In this embodiment, the transmitting end divides the data of at least two transmission tasks according to the data capacity ω of the minimum information writing unit in a two-dimensional code, and obtains a number of data volumes N i ω data sharding, where is the data capacity of a QR code, a transmission task T i The amount of data is K, which is the data capacity of a QR code. i For example: split the data of three transmission tasks T1, T2 and T3, and obtain three data fragments of transmission task T1 respectively. The four data shards of the transmission task T2 The three data shards of the transmission task T3 Data sharding The amount of data is N1ω.
[0094] 102. The sending end extracts first data slices from at least two transmission tasks respectively, and marks the extracted first data slices;
[0095] In this embodiment, the sender extracts the first data slice from the first transmission task, and the first data slice can be any data slice in the first transmission task. The sender extracts the first data slice from the second transmission task, and the first data slice can be any data slice in the second transmission task. For example: the first data slice extracted by the sender from the first transmission task T1 is The first data fragment extracted by the sender from the second transmission task T2 is
[0096] 103. The sending end caches the first data slice in parallel to the first display queue;
[0097] In this embodiment, the sending end will cache the first data slices respectively obtained from at least two transmission tasks in parallel to the first display queue. For example: the first data slice extracted by the sending end is and The sender will and Cache in parallel to the first display queue.
[0098] 104. The sending end extracts second data slices from the at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice;
[0099] In this embodiment, the sending end extracts the second data slice of the first transmission task from the first transmission task, and the second data slice is any data slice in the first transmission task except the first data slice; the sending end extracts the second data slice of the second transmission task from the second transmission task, and the second data slice is any data slice in the second transmission task except the first data slice; for example: the first data slice of the first transmission task is Then the second data slice of the first transmission task can be or The first data slice of the second transmission task is Then the second data slice of the second transmission task is or or
[0100] 105. The sending end caches the second data slice in parallel to the second display queue;
[0101] In this embodiment, the sending end caches the second data slice of the first transmission task and the second data slice of the second transmission task in parallel to the second display queue. The second data slice of the second transmission task is Then and Cache to the second display queue.
[0102] 106. The sending end repeats the above extraction and caching steps until all data slices of at least two transmission tasks are extracted and parallel caching is completed;
[0103] In this embodiment, the sending end repeats the above steps 102 to 105 until all data slices of all transmission tasks are extracted and parallel cache is completed. For example, there are three transmission tasks T1, T2 and T3, and the three data slices of transmission task T1 The four data shards of the transmission task T2 The three data shards of the transmission task T3 Split all data of the three transmission tasks T1, T2 and T3 into pieces Repeat steps 102 to 105 and cache in parallel.
[0104] 107. The sending end encodes the first data slice in the first display queue according to the encoding rule to generate a first two-dimensional code, and projects the first two-dimensional code onto the first screen, so that the receiving end obtains the first data slice through the first two-dimensional code;
[0105] In this embodiment, for example, the first data fragment in the first display queue is and The sender will and Encode according to the encoding rule to generate a first two-dimensional code, and project the first two-dimensional code onto the first screen, so that the receiving end obtains the first data fragment through the first two-dimensional code and
[0106] 108. The sending end encodes the second data fragment in the second display queue according to the encoding rule, generates a second two-dimensional code, and projects the second two-dimensional code onto the second screen, so that the receiving end obtains the second data fragment through the second two-dimensional code.
[0107] In this embodiment, for example, the second data fragment in the second display queue is The sending end segments the second data Encode according to the encoding rule to generate a second two-dimensional code, and project the second two-dimensional code onto the second screen so that the receiving end obtains the second data fragment through the second two-dimensional code
[0108] In this embodiment, at least two transmission tasks are split into several data slices, and different data slices corresponding to the at least two transmission tasks are cached in parallel in the same QR code, and different data slices of one of the at least two transmission tasks are cached in different QR codes, thereby realizing parallel data transmission of different transmission tasks, thereby improving the concurrency of data transmission of transmission tasks, so that users do not have to wait for the completion of one transmission task before transmitting the next transmission task, thereby improving user experience.
[0109] In order to make the data transmission method provided by the present application more obvious and easy to understand, the data transmission method provided by the present application is described in detail below:
[0110] See also Figure 2-a and Figure 2-b , Figure 2-a and Figure 2-b Another embodiment of a data transmission method provided by the present application includes:
[0111] 201. The sending end divides data into at least two transmission tasks and obtains a plurality of data slices respectively, where each transmission task includes at least two data slices.
[0112] 202. The sending end extracts first data slices from at least two transmission tasks respectively, and marks the extracted first data slices;
[0113] 203. The sending end caches the first data slice in parallel to the first display queue;
[0114] Steps 210 to 203 in this embodiment are similar to those in the previous Figure 1 Steps 101 to 103 in the embodiment are similar and will not be described in detail here.
[0115] 204. The sending end determines the urgency level of the first transmission task;
[0116] In this embodiment, the sending end determines the urgency level of the first transmission task, and the urgency level can be divided into levels 1-5.
[0117] 205. The sending end determines the maximum data capacity displayed on the first screen;
[0118] In this embodiment, the maximum data capacity displayed on the first screen is the data capacity of the maximum number of QR codes that can be displayed on the first screen at the same time. For example, if the first screen can display up to 10 QR codes at the same time, the maximum data capacity displayed on the first screen is the maximum data capacity that can be contained in the 10 QR codes.
[0119] 206. The sending end determines the existing data capacity of the first display queue;
[0120] In this embodiment, the sending end determines the existing data capacity of the first display queue, that is, the data volume of the first data slice in the first display queue. For example: the first data slice in the first display queue is The existing data capacity is and The total data capacity.
[0121] 207. The sending end determines whether the existing data capacity is less than the maximum data capacity;
[0122] In this embodiment, the sending end determines whether the existing data capacity is less than the maximum data capacity. If the existing data capacity is less than the maximum data capacity, the sending end executes step 208; if the existing data capacity is not less than the maximum data capacity, the sending end executes step 214.
[0123] 208. If the existing data capacity is less than the maximum data capacity, the sender determines EN i Is the value of ω greater than the difference between the maximum data capacity and the existing data capacity, where N i ω is the data volume of any data slice in the i-th transmission task, and E is determined according to the urgency level;
[0124] In this embodiment, if the existing data capacity is less than the maximum data capacity, the sending end determines EN i Is the value of ω greater than the difference between the maximum data capacity and the existing data capacity? i The value of ω is greater than the difference between the maximum data capacity and the existing data capacity, the sending end executes step 209. If EN i If the value of ω is less than or equal to the difference between the maximum data capacity and the existing data capacity, the sending end executes step 210.
[0125] 209. If EN i If the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, the sending end polls and reads the first transmission task and the second transmission task, obtains the first preset number of data slices after the first data slice of the first transmission task or the second transmission task, caches the obtained data slices in parallel to the first display queue, and moves the read pointer to the next transmission task of the transmission task where the first data slice is located;
[0126] In this embodiment, if EN i If the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, the sending end polls and reads the first transmission task and the second transmission task, and obtains the first preset number of data slices after the first data slice of the first transmission task or the second transmission task, wherein the total amount of data of the first preset number of data slices is less than or equal to the difference between the maximum data capacity and the existing data capacity.
[0127] 210. If EN i If the value of ω is not greater than the difference between the maximum data capacity and the existing data capacity, the transmitting end obtains a second preset number of data slices after the first data slice of the first transmission task, the second preset data is determined according to the urgency level, and the obtained data slices are cached in parallel to the first display queue, and the read pointer is moved to the next transmission task of the first transmission task;
[0128] In this embodiment, if EN i If the value of ω is not greater than the difference between the maximum data capacity and the existing data capacity, the terminal obtains the second preset number of data fragments after the first data fragment of the first transmission task, wherein the value of the second preset number is the same as the emergency level. For example, if the emergency level is level 3, the second preset number is 3.
[0129] In this embodiment, when the existing data capacity is less than the maximum data capacity, an appropriate number of data slices are filled into the first display queue, thereby further improving the efficiency of data transmission.
[0130] 211. The sending end extracts second data slices from at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice;
[0131] 212. The sending end caches the second data slice in parallel to the second display queue;
[0132] 213. The sending end repeats the above extraction and caching steps until all data slices of at least two transmission tasks are extracted and parallel caching is completed;
[0133] Steps 211 to 213 in this embodiment are similar to those in the previous embodiment. Figure 1 Steps 104 to 106 in the embodiment are similar and will not be described in detail here.
[0134] 214. The sending end encodes the first data slice in the first display queue according to the encoding rule to generate a first two-dimensional code, and projects the first two-dimensional code onto the first screen, so that the receiving end obtains the first data slice through the first two-dimensional code;
[0135] In this embodiment, the transmitting end encodes the first data slice in the first display queue according to the encoding rules, generates the first QR code, and projects the first QR code onto the first screen, including: the transmitting end randomly generates a set of target number series, and the target number series is an integer number series; the transmitting end extracts the first target data slice from the first data slice according to the number series rule of the target number series, and generates the first target QR code according to the extracted first target data slice; the transmitting end extracts the second target data slice, and generates the second target QR code according to the extracted second target data slice, and the second target data slice is the remaining data slice in the first data slice except the first target data slice; the transmitting end encodes the target number series into the first target QR code and the second target QR code; the transmitting end projects the first target QR code and the second target QR code onto the first screen. Among them, the target number series is an arithmetic progression or a geometric progression. For example: the first data slice in the first display queue is The target sequence is an arithmetic sequence, and the target sequence has the following pattern: 1, 3, 5. Then the first data slice in the display queue is extracted. The third data shard And the fifth data shard As the first target data slice, extract the second data slice in the display queue And the fourth data shard As the second target data slice.
[0136] Through the method of the present application, the first target data fragment and the second target data fragment are extracted using a randomly generated target number sequence, thereby further improving the security of data transmission.
[0137] 215. The receiving end captures the first screen to obtain a first QR code image;
[0138] In this embodiment, the receiving end continuously captures the two-dimensional code image displayed on the first screen through a camera, and saves the captured two-dimensional code image.
[0139] 216. The receiving end determines the target number sequence according to the first two-dimensional code image;
[0140] In this embodiment, the receiving end determines the target number sequence by parsing the first two-dimensional code image.
[0141] 217. The receiving end generates a first decoding queue according to the number of first data fragments of the first display queue;
[0142] In this embodiment, the receiving end generates a first decoding queue according to the number of first data slices of the first display queue. For example, if the number of first data slices of the first display queue is 5, the receiving end generates a first decoding queue with 5 storage units.
[0143] 218. The receiving end fills the first target data slice in the first display queue into the first decoding queue according to the target sequence, where the first target data slice is a part of the first data slice;
[0144] In this embodiment, the first target data slice is a data slice whose storage position in the first display queue conforms to the sequence rule of the target sequence; for example, the target sequence is: 1, 3, 5, if the first display queue is: and Then the first target data fragment in the first display queue is and The receiving end will Fill the first storage unit of the first decoding queue, Fill the third storage unit of the first decoding queue and Fill the fifth storage unit of the first decoding queue.
[0145] 219. The receiving end fills the second target data fragments in the first display queue into the remaining positions of the first decoding queue, where the second target data fragments are the remaining data fragments in the first data fragments except the first target data fragments;
[0146] In this embodiment, for example, the second target data segment is and The receiving end will Fill the second storage unit of the first decoding queue and Fill the fourth storage unit of the first decoding queue.
[0147] 220. The receiving end determines the coding tags of the first target data segment and the second target data segment in the first decoding queue, where the coding tags include the transmission task numbers and sequence numbers corresponding to the first target data segment and the second target data segment;
[0148] In this embodiment, the transmission task number is used to mark which transmission task the first target data slice is in, and the sequence number is used to mark the specific position of the first target data slice in the transmission task. and Then in the first target data shard The data shard transmission task number is: 1, the sequence number is 2, and the transmission task number 1 means The data shard is in the first transmission task, and the sequence number 2 indicates In the second storage unit in the first transfer task.
[0149] 221. The receiving end determines whether there is a target transmission task;
[0150] In this embodiment, the receiving end determines whether there is a target transmission task; if so, the receiving end executes step 222; if not, the receiving end executes step 223; the task number of the target transmission task is the same as the transmission task number corresponding to the first target data slice or the transmission task number corresponding to the second target data slice. Then the first target data fragment is The corresponding transmission task number is 1. If there is a transmission task with the transmission task number 1, the transmission task is determined to be the target transmission task.
[0151] 222. If so, the receiving end stores the first target data fragment and the second target data fragment in the target transmission task according to the sequence numbering;
[0152] In this embodiment, if the receiving end determines that there is a target transmission task, the receiving end stores the first target data slice into the target transmission task according to the transmission task number and sequence number of the first target data slice, and stores the second target data slice into the target transmission task according to the transmission task number and sequence number of the second target data slice. For example, the target transmission task is numbered 1, and the first target data slice includes and The receiving end will Store it in the first storage space of the first transmission task, Store it in the second storage space of the first transmission task, Store in the first storage space of the second transfer task.
[0153] 223. If it does not exist, the receiving end establishes a target transmission task, and stores the first target data segment and the second target data segment into the target transmission task according to the sequence number.
[0154] In this embodiment, if the receiving end determines that the target transmission task does not exist, the receiving end establishes the target transmission task and stores the first data slice and the second data slice into the target transmission task corresponding to the first data slice and the second data slice. The specific storage process is similar to step 223 and will not be repeated here.
[0155] 224. The sending end encodes the second data slice in the second display queue according to the encoding rule to generate a second two-dimensional code, and projects the second two-dimensional code onto the second screen, so that the receiving end obtains the second data slice through the second two-dimensional code;
[0156] Step 224 in this embodiment is similar to step 214 in this embodiment, and will not be described in detail here.
[0157] The above describes a data transmission method provided by the present application. The following describes a sending end provided by the present application:
[0158] See also Figure 3 , Figure 3 An embodiment of a transmitting end provided in the present application includes:
[0159] The segmentation unit 301 is used to segment data of at least two transmission tasks and obtain a plurality of data slices respectively, where each transmission task includes at least two data slices;
[0160] A first extraction unit 302, configured to extract first data slices from the at least two transmission tasks respectively, and mark the first data slices that have been extracted;
[0161] A first cache unit 303, configured to cache the first data slices in parallel to a first display queue;
[0162] A second extraction unit 304 is configured to extract second data slices from at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice;
[0163] A second cache unit 305, configured to cache the second data slices in parallel to a second display queue;
[0164] A repeating unit 306 is used to repeat the above extraction and caching steps until all data slices of the at least two transmission tasks are extracted and parallel caching is completed;
[0165] A first encoding unit 307 is used to encode the first data slice in the first display queue according to an encoding rule to generate a first two-dimensional code, and project the first two-dimensional code onto a first screen, so that a receiving end obtains the first data slice through the first two-dimensional code;
[0166] The second encoding unit 308 is used to encode the second data fragment in the second display queue according to the encoding rule, generate a second QR code, and project the second QR code onto the second screen so that the receiving end can obtain the second data fragment through the second QR code.
[0167] In this embodiment, the functions performed by each unit are similar to those in the above-mentioned Figure 1 The steps in the method embodiment shown correspond to each other and will not be described in detail here.
[0168] The following is a detailed description of the sender provided by this application. Figure 4 , Figure 4 Another embodiment of the transmitting end provided in the present application includes:
[0169] A segmentation unit 401 is used to segment data for at least two transmission tasks, and obtain a plurality of data slices respectively, where each transmission task includes at least two data slices;
[0170] A first extraction unit 402, configured to extract first data slices from the at least two transmission tasks respectively, and mark the first data slices that have been extracted;
[0171] A first cache unit 403, configured to cache the first data slices in parallel to a first display queue;
[0172] A second extraction unit 404 is configured to extract second data slices from at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice;
[0173] A second cache unit 405, configured to cache the second data slices in parallel to a second display queue;
[0174] A repeating unit 406 is used to repeat the above extraction and caching steps until all data slices of the at least two transmission tasks are extracted and parallel caching is completed;
[0175] A first encoding unit 407 is used to encode the first data slice in the first display queue according to an encoding rule to generate a first two-dimensional code, and project the first two-dimensional code onto a first screen, so that a receiving end obtains the first data slice through the first two-dimensional code;
[0176] The second encoding unit 408 is used to encode the second data fragment in the second display queue according to the encoding rule, generate a second QR code, and project the second QR code onto the second screen so that the receiving end can obtain the second data fragment through the second QR code.
[0177] Optionally, the sending end further includes:
[0178] A first determining unit 409, configured to determine an emergency level of the first transmission task;
[0179] A second determining unit 410 is used to determine a maximum data capacity displayed on the first screen;
[0180] A third determining unit 411 is used to determine the existing data capacity of the first display queue;
[0181] A first determining unit 412, configured to determine whether the existing data capacity is less than the maximum data capacity;
[0182] The second judgment unit 413 is used to judge EN if the existing data capacity is less than the maximum data capacity.i Whether the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, where N i ω is the data volume of any data slice in the i-th transmission task, and E is determined according to the emergency level;
[0183] The reading unit 414 is used to read the EN i If the value of ω is greater than the difference between the maximum data capacity and the existing data capacity, the sending end polls and reads the first transmission task and the second transmission task, obtains a first preset number of data slices after the first data slice of the first transmission task or the second transmission task, caches the obtained data slices in parallel to the first display queue, and moves the read pointer to the next transmission task of the transmission task where the first data slice is located;
[0184] The acquisition unit 415 is used to i The value of ω is not greater than the difference between the maximum data capacity and the existing data capacity, and a second preset number of data slices are obtained after the first data slice of the first transmission task, and the second preset number is determined according to the urgency level. The obtained data slices are cached in parallel to the first display queue, and the read pointer is moved to the next transmission task of the first transmission task.
[0185] Optionally, the first encoding unit 407 is specifically configured to:
[0186] Randomly generate a set of target number sequences, wherein the target number sequence is an integer number sequence;
[0187] Extracting a first target data slice from the first data slice according to the number sequence rule of the target number sequence, and generating a first target QR code according to the extracted first target data slice;
[0188] Extracting a second target data slice, and generating a second target two-dimensional code according to the extracted second target data slice, wherein the second target data slice is the remaining data slices in the first data slice except the first target data slice;
[0189] Encoding the target number sequence into the first target two-dimensional code and the second target two-dimensional code;
[0190] The first target two-dimensional code and the second target two-dimensional code are projected onto a first screen, so that a receiving end obtains the first target data slice, the second target data slice and the target number series through the first target two-dimensional code and the second target two-dimensional code.
[0191] In the system of this embodiment, the functions performed by each unit correspond to the steps in the method embodiment shown in Figure 2 above, and the details will not be repeated here.
[0192] This application also provides a receiving end, see Figure 5 , Figure 5 An embodiment of a receiving end provided in the present application includes:
[0193] The photographing unit 501 is used to photograph the first screen and obtain a first QR code image;
[0194] A first determining unit 502, configured to determine a target number sequence according to the first two-dimensional code image;
[0195] A generating unit 503, configured to generate a first decoding queue according to the number of first data slices of the first display queue;
[0196] A first filling unit 504 is used to fill the first target data slice of the first display queue into the first decoding queue according to the target sequence, wherein the first target data slice is a part of the first data slice;
[0197] A second filling unit 505 is used to fill the second target data slices of the first display queue into the remaining positions of the first decoding queue, where the second target data slices are the remaining data slices in the first data slices except the first target data slices;
[0198] A second determining unit 506 is used to determine the coding tags corresponding to the first target data segment and the second target data segment in the first decoding queue, wherein the coding tags include the transmission task numbers and sequence numbers of the first target data segment and the second target data segment;
[0199] A judging unit 507, configured to judge whether there is a target transmission task according to the transmission task number;
[0200] A first storage unit 508, configured to store the first target data segment and the second target data segment into the target transmission task according to the sequence number if they exist;
[0201] The second storage unit 509 is used to establish a target transmission task if it does not exist, and store the first target data segment and the second target data segment into the target transmission task according to the sequence number.
[0202] This application also provides a data transmission device, see Figure 6 , Figure 6 An embodiment of a data transmission device provided in the present application includes:
[0203] Processor 601, memory 602, input and output unit 603, bus 604;
[0204] The processor 601 is connected to the memory 602, the input and output unit 603 and the bus 604;
[0205] The memory 602 stores a program, and the processor 601 calls the program to execute any of the above data transmission methods.
[0206] The present application also relates to a computer-readable storage medium, on which a program is stored. When the program is run on a computer, the computer executes any of the above data transmission methods.
[0207] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0208] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0209] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0210] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0211] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk, etc. Various media that can store program codes.
Claims
1. A data transmission method, characterized in that: The data transmission method comprises: The sending end divides data into at least two transmission tasks, and obtains a plurality of data slices respectively, and each transmission task includes at least two data slices; The sending end extracts first data slices from the at least two transmission tasks respectively, and marks the first data slices that have been extracted; The sending end caches the first data slices in parallel to a first display queue; The sending end extracts second data slices from at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice; The sending end caches the second data slices in parallel to a second display queue; The sending end repeats the above extraction and caching steps until all data slices of the at least two transmission tasks are extracted and parallel caching is completed; The sending end encodes the first data slice in the first display queue according to an encoding rule to generate a first two-dimensional code, and projects the first two-dimensional code onto a first screen, so that the receiving end obtains the first data slice through the first two-dimensional code; The sending end encodes the second data slice in the second display queue according to the encoding rule to generate a second two-dimensional code, and projects the second two-dimensional code onto a second screen, so that the receiving end obtains the second data slice through the second two-dimensional code; After the transmitting end caches the first data slices in parallel to the first display queue, the data transmission method further includes: The sending end determines the urgency level of the first transmission task; The transmitting end determines the maximum data capacity displayed on the first screen; The sending end determines the existing data capacity of the first display queue; The sending end determines whether the existing data capacity is less than the maximum data capacity; If the existing data capacity is less than the maximum data capacity, the transmitting end determines whether the value of EN i ω is greater than the difference between the maximum data capacity and the existing data capacity, where N i ω is the data volume of any data slice in the i-th transmission task, and E is determined according to the urgency level; If the value of EN i ω is greater than the difference between the maximum data capacity and the existing data capacity, the sending end polls and reads the first transmission task and the second transmission task, obtains a first preset number of data slices after the first data slice of the first transmission task or the second transmission task, caches the obtained data slices in parallel to the first display queue, and moves the read pointer to the next transmission task of the transmission task where the first data slice is located; If the value of EN i ω is not greater than the difference between the maximum data capacity and the existing data capacity, the sending end obtains a second preset number of data slices after the first data slice of the first transmission task, and the second preset number is determined according to the urgency level. The obtained data slices are cached in parallel to the first display queue, and the read pointer is moved to the next transmission task of the first transmission task.
2. The data transmission method according to claim 1, characterized in that: The sending end encodes the first data slice in the first display queue according to an encoding rule to generate a first two-dimensional code, and projects the first two-dimensional code onto the first screen, including: The sending end randomly generates a set of target number sequences, wherein the target number sequence is an integer number sequence; The transmitting end extracts a first target data slice from the first data slice according to the number sequence rule of the target number sequence, and generates a first target QR code according to the extracted first target data slice; The transmitting end extracts a second target data slice, and generates a second target two-dimensional code according to the extracted second target data slice, wherein the second target data slice is the remaining data slices in the first data slice except the first target data slice; The transmitting end encodes the target number sequence into the first target two-dimensional code and the second target two-dimensional code; The sending end projects the first target two-dimensional code and the second target two-dimensional code onto a first screen, so that the receiving end obtains the first target data slice, the second target data slice and the target number series through the first target two-dimensional code and the second target two-dimensional code.
3. The data transmission method according to claim 2, characterized in that: The target number sequence is an arithmetic sequence or a geometric sequence.
4. The data transmission method according to claim 1, characterized in that: The sending end performs data segmentation on at least two transmission tasks, and obtains a plurality of data fragments respectively, including: The transmitting end divides data for at least two transmission tasks according to the data capacity of the minimum information writing unit in a two-dimensional code, and obtains several data slices with data volume N i ω respectively, where is the data capacity of a two-dimensional code, and the data volume of a transmission task Ti is Ki times the data capacity of a two-dimensional code.
5. A data transmission method, characterized in that: The method comprises a receiving end and a sending end, wherein the sending end is used to perform the data transmission method according to any one of claims 1 to 4, and the receiving end is used to perform the following method: The receiving end photographs the first screen to obtain a first QR code image; The receiving end determines a target number sequence according to the first two-dimensional code image; The receiving end generates a first decoding queue according to the number of first data slices of the first display queue; The receiving end fills the first target data slice of the first display queue into the first decoding queue according to the target sequence, wherein the first target data slice is a part of the first data slice; The receiving end fills the second target data slice of the first display queue into the remaining position of the first decoding queue, wherein the second target data slice is the remaining data slice in the first data slice except the first target data slice; The receiving end determines the encoding tags corresponding to the first target data segment and the second target data segment in the first decoding queue, wherein the encoding tags include the transmission task numbers and sequence numbers of the first target data segment and the second target data segment; The receiving end determines whether there is a target transmission task according to the transmission task number; If so, the receiving end stores the first target data fragment and the second target data fragment into the target transmission task according to the sequence number; If not, the receiving end establishes a target transmission task, and stores the first target data segment and the second target data segment into the target transmission task according to the sequence number.
6. A transmitting end, characterized in that: The transmitting end comprises: A segmentation unit, used to perform data segmentation on at least two transmission tasks, and obtain a plurality of data slices respectively, each transmission task including at least two data slices; A first extraction unit, configured to extract first data slices from the at least two transmission tasks respectively, and mark the first data slices that have been extracted; A first cache unit, configured to cache the first data slices in parallel to a first display queue; A second extraction unit, configured to extract second data slices from at least two transmission tasks respectively, where the second data slice is any data slice in the at least two transmission tasks except the first data slice; A second cache unit, configured to cache the second data slices in parallel to a second display queue; A repeating unit, used to repeat the above-mentioned extraction and caching steps until all data slices of the at least two transmission tasks are extracted and parallel caching is completed; a first encoding unit, configured to encode the first data slice in the first display queue according to an encoding rule, generate a first two-dimensional code, and project the first two-dimensional code onto a first screen, so that a receiving end obtains the first data slice through the first two-dimensional code; a second encoding unit, configured to encode the second data slice in the second display queue according to the encoding rule, generate a second two-dimensional code, and project the second two-dimensional code onto a second screen, so that the receiving end obtains the second data slice through the second two-dimensional code; The transmitting end also includes: A first determining unit, configured to determine an emergency level of a first transmission task; A second determining unit, used to determine a maximum data capacity displayed on the first screen; A third determining unit, configured to determine an existing data capacity of the first display queue; A first judging unit, configured to judge whether the existing data capacity is less than the maximum data capacity; A second judgment unit is used to judge whether the value of EN i ω is greater than the difference between the maximum data capacity and the existing data capacity if the existing data capacity is less than the maximum data capacity, wherein N i ω is the data volume of any data slice in the i-th transmission task, and E is determined according to the urgency level; a reading unit, configured to, if the value of EN i ω is greater than the difference between the maximum data capacity and the existing data capacity, cause the sending end to poll and read the first transmission task and the second transmission task, obtain a first preset number of data slices after the first data slice of the first transmission task or the second transmission task, cache the obtained data slices in parallel to the first display queue, and move the reading pointer to the next transmission task of the transmission task where the first data slice is located; an acquisition unit, for acquiring a second preset number of data slices after the first data slice of the first transmission task if the value of the EN i ω is not greater than the difference between the maximum data capacity and the existing data capacity, wherein the second preset number is determined according to the urgency level, caching the acquired data slices in parallel to the first display queue, and moving the read pointer to the next transmission task of the first transmission task.
7. A data transmission device, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 5.
