CN113595685A - Data transmission method and device, storage medium and terminal - Google Patents
Data transmission method and device, storage medium and terminal Download PDFInfo
- Publication number
- CN113595685A CN113595685A CN202110800423.1A CN202110800423A CN113595685A CN 113595685 A CN113595685 A CN 113595685A CN 202110800423 A CN202110800423 A CN 202110800423A CN 113595685 A CN113595685 A CN 113595685A
- Authority
- CN
- China
- Prior art keywords
- data
- sending
- time
- transmitted
- receiving end
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 89
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000000903 blocking effect Effects 0.000 claims abstract description 60
- 238000000638 solvent extraction Methods 0.000 claims abstract description 12
- 238000012795 verification Methods 0.000 claims description 29
- 238000004590 computer program Methods 0.000 claims description 18
- 230000011218 segmentation Effects 0.000 claims description 18
- 238000004806 packaging method and process Methods 0.000 claims description 2
- 230000009286 beneficial effect Effects 0.000 abstract description 6
- 239000000872 buffer Substances 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0006—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
- H04L1/0007—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0078—Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
- H04L1/0079—Formats for control data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0078—Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
- H04L1/009—Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location arrangements specific to transmitters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0078—Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
- H04L1/0091—Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location arrangements specific to receivers, e.g. format detection
Abstract
A data transmission method and device, a storage medium and a terminal are provided, and the method comprises the following steps: acquiring data to be transmitted; segmenting at least a part of data in the data to be transmitted to obtain a plurality of first data blocks, and sending the plurality of first data blocks to a receiving end, wherein the size of each first data block is marked as a partitioning parameter; updating the blocking parameters at least according to a ratio of a sending time to a receiving time, wherein the sending time is a time taken for sending the plurality of data blocks, and the receiving time is a time taken for the receiving end to receive the plurality of first data blocks; and segmenting at least one part of the data which is not transmitted in the data to be transmitted according to the updated blocking parameters to obtain a plurality of second data blocks, and sending the plurality of second data blocks to the receiving end. The scheme of the embodiment of the invention is beneficial to avoiding the condition of data transmission errors.
Description
Technical Field
The present invention relates to the field of data transmission technologies, and in particular, to a data transmission method and apparatus, a storage medium, and a terminal.
Background
With the development of the internet, more and more data are generated in production and life, data are generated by users and terminal equipment at any time and any place, and the data are generally scattered everywhere to form data isolated islands which are isolated and closed with each other and cannot play due roles. In order to fully mine the potential of data and perform data analysis, data generated by different devices needs to be shared, that is, each device needs to transmit the data to other devices. In the prior art, when data to be transmitted is large, the problem of transmission errors is easy to occur. Therefore, a data transmission method is needed to avoid the problem of transmission error.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a data transmission method which can be beneficial to avoiding the problem of transmission errors.
To solve the foregoing technical problem, an embodiment of the present invention provides a data transmission method, where the method includes: acquiring data to be transmitted; segmenting at least a part of data in the data to be transmitted to obtain a plurality of first data blocks, and sending the plurality of first data blocks to a receiving end, wherein the size of each first data block is marked as a partitioning parameter; updating the blocking parameters at least according to a ratio of a sending time to a receiving time, wherein the sending time is a time taken for sending the plurality of data blocks, and the receiving time is a time taken for the receiving end to receive the plurality of first data blocks; and segmenting at least one part of the data which is not transmitted in the data to be transmitted according to the updated blocking parameters to obtain a plurality of second data blocks, and sending the plurality of second data blocks to the receiving end.
Optionally, updating the blocking parameter at least according to the ratio of the receiving time to the sending time includes: the following formula is used for updating:
wherein, size is the block parameter before updating, size' is the block parameter after updating, t1Is said transmission time, t2Is the reception time.
Optionally, sending the plurality of first data blocks to a receiving end includes: packaging each first data block to obtain a plurality of first data packets, wherein each first data packet comprises a check code; sending the plurality of first data packets to the receiving end; the check code is used for the receiving end to check each first data packet.
Optionally, updating the blocking parameter at least according to the ratio of the receiving time to the sending time includes: acquiring a verification success rate from the receiving end, wherein the verification success rate is obtained by verifying the plurality of first data packets by the receiving end; and updating the block parameters according to the ratio and the verification success rate.
Optionally, updating the blocking parameter according to the ratio and the verification success rate includes: and judging whether the verification success rate is less than or equal to a first preset threshold value, and if so, updating the block parameters according to the ratio.
Optionally, the sending the plurality of second data blocks to the receiving end includes: and if the verification success rate is less than or equal to a second preset threshold value, sending the plurality of second data blocks through a preset second channel, wherein the second channel is different from the first channel.
Optionally, the multiple first data packets are sent through a first channel, and updating the blocking parameter according to the ratio and the verification success rate includes: judging whether the verification success rate is less than or equal to a first preset threshold value, if so, judging whether the blocking parameter is less than or equal to a preset minimum blocking threshold value; and if the blocking parameter is smaller than or equal to a preset minimum blocking threshold value, taking a preset second channel as a transmission channel of the plurality of second data blocks, otherwise, updating the blocking parameter according to the ratio, wherein the second channel is different from the first channel.
An embodiment of the present invention further provides a data transmission device, where the device includes: the acquisition module is used for acquiring data to be transmitted; the device comprises a first segmentation module, a second segmentation module and a transmission module, wherein the first segmentation module is used for segmenting at least one part of data in the data to be transmitted to obtain a plurality of first data blocks and sending the plurality of first data blocks to a receiving end, and the size of each first data block is recorded as a segmentation parameter; an updating module, configured to update the blocking parameter at least according to a ratio of a sending time to a receiving time, where the sending time is a time taken to send the multiple data blocks, and the receiving time is a time taken by the receiving end to receive the multiple first data blocks; and the second segmentation module is used for segmenting at least one part of the data which is not transmitted in the data to be transmitted according to the updated segmentation parameters so as to obtain a plurality of second data blocks, and sending the plurality of second data blocks to the receiving end.
The embodiment of the present invention further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data transmission method are executed.
The embodiment of the present invention further provides a terminal, which includes a memory and a processor, where the memory stores a computer program that can be run on the processor, and the processor executes the steps of the data transmission method when running the computer program.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
in the scheme of the embodiment of the invention, the blocking parameters are updated according to the ratio of the sending time to the receiving time of the first data blocks, and at least one part of the data which is not transmitted is segmented according to the updated blocking parameters. When the scheme is adopted, the sending time is the time spent by the sending end for sending the plurality of first data blocks, and the receiving time is the time spent by the receiving end for receiving the plurality of first data blocks, so that in the transmission process of the data to be transmitted, the blocking parameters can be dynamically adjusted according to the ratio of the sending rate of the sending end to the receiving rate of the receiving end, so that the sending rate and the receiving rate of the data to be transmitted are kept balanced, the stability of data transmission can be improved, and the condition of data transmission errors is favorably avoided.
Further, in the scheme of the embodiment of the present invention, it is first determined whether the check success rate is less than or equal to a first preset threshold, and if so, the ratio of the sending time to the receiving time is adjusted to the blocking parameter. In other words, if the success rate of the verification is greater than the first preset threshold, it indicates that the data transmission process is stable, and it is not suitable to adjust the blocking parameter at this time. Therefore, in the scheme of the embodiment of the invention, the block parameters are adjusted only when the verification success rate is less than or equal to the first preset threshold, which is beneficial to further ensuring the stability of data transmission and avoiding errors in the transmission process.
Drawings
Fig. 1 is a schematic flow chart of a data transmission method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a further data transmission method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present invention.
Detailed Description
As described in the background art, a data transmission method is needed to avoid the problem of transmission errors.
The inventor of the present invention has found that a transmission error is likely to occur when the data to be transmitted is large. In the prior art, data to be transmitted is generally equally divided into a plurality of data blocks and transmitted in sequence. When the scheme is adopted, due to the unstable characteristic of network transmission, if the size of the segmented data block is not appropriate, network blockage is easily caused, and the situations of data block loss or errors and the like are caused.
In order to solve the above technical problem, an embodiment of the present invention provides a data transmission method. In the scheme of the embodiment of the invention, the block parameters are updated according to the ratio of the sending time to the receiving time of the first data blocks, and at least one part of the data which is not transmitted is segmented and sent according to the updated block parameters. When the scheme is adopted, the sending time is the time spent by the sending end for sending the plurality of first data blocks, and the receiving time is the time spent by the receiving end for receiving the plurality of first data blocks, so that in the transmission process of the data to be transmitted, the blocking parameters can be dynamically adjusted according to the ratio of the sending rate of the sending end to the receiving rate of the receiving end, so that the sending rate and the receiving rate of the data to be transmitted are kept balanced, the stability of data transmission can be improved, and the condition of data transmission errors is favorably avoided.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Referring to fig. 1, fig. 1 is a schematic flowchart of a data transmission method in an embodiment of the present invention. The method can be executed by a terminal, and the terminal can be various existing appropriate terminals, such as a mobile phone, a computer, an internet of things device and the like. In a data transmission scenario, the terminal is a data sending end, and by executing the data transmission method in the embodiment of the present invention, data to be transmitted can be effectively transmitted to a receiving end, and the receiving end may also be any appropriate terminal, such as a mobile phone, a computer, an internet of things device, and the like, but is not limited thereto. It should be noted that, in the embodiment of the present invention, a connection manner of the sending end and the receiving end is not limited, the sending end and the receiving end may be in a local area network, the local area network may be a wired local area network or a wireless local area network, and the sending end and the receiving end may also be in a wide area network (e.g., the internet), but the present invention is not limited thereto. The data transmission method shown in fig. 1 may include the steps of:
step S101: acquiring data to be transmitted;
step S102: segmenting at least a part of data in the data to be transmitted to obtain a plurality of first data blocks, and sending the plurality of first data blocks to a receiving end, wherein the size of each first data block is marked as a partitioning parameter;
step S103: updating the blocking parameters at least according to a ratio of a sending time to a receiving time, wherein the sending time is a time taken for sending the plurality of data blocks, and the receiving time is a time taken for the receiving end to receive the plurality of first data blocks;
step S104: and segmenting at least one part of the data which is not transmitted in the data to be transmitted according to the updated blocking parameters to obtain a plurality of second data blocks, and sending the plurality of second data blocks to the receiving end.
It is understood that in a specific implementation, the method may be implemented by a software program running in a processor integrated within a chip or a chip module; alternatively, the method can be implemented in hardware or a combination of hardware and software.
In the specific implementation of step S101, the data to be transmitted may be obtained from the outside in real time, or may be stored in the local memory, but is not limited thereto. The data to be transmitted may be images, videos, texts, and the like, and the specific manner of acquiring the data to be transmitted and the data to be transmitted is not limited in the embodiment of the present invention.
In a specific implementation of step S102, at least a portion of data in the data to be transmitted may be segmented to obtain a plurality of first data blocks.
In a specific embodiment, the size of the data to be partitioned may be determined according to a partitioning parameter and a transmission number parameter, and is recorded as a first size, where the partitioning parameter is the size of the first data block, the transmission number parameter is used to indicate the number of data blocks transmitted each time, and the transmission number parameter may be preset. The data blocks with the quantity being the transmission quantity parameter can be recorded as data blocks of one batch.
Specifically, if the data to be transmitted is transmitted for the first time, that is, the data blocks of the first batch are transmitted, the data of the first size is read from the first byte of the data to be transmitted, and is segmented according to the segmentation parameters to obtain a plurality of first data blocks, where the segmentation parameters may be preset. If the data to be transmitted is not transmitted for the first time, reading the data with the first size from the first byte of the data which is not transmitted in the data to be transmitted, and segmenting according to the segmentation parameters to obtain a plurality of first data blocks. The blocking parameter at this time may be preset, or may be obtained by updating the blocking parameter used when the data block of the previous batch is transmitted.
Further, for each first data block, it may be packed to obtain a plurality of first data packets. It should be noted that, in the embodiment of the present invention, a format of the plurality of first packets is not limited, and the plurality of first packets may be User Datagram Protocol (UDP) packets, Transmission Control Protocol (TCP) packets, Internet of things (IOT) packets, and the like, but is not limited thereto. In a specific embodiment, the plurality of first data blocks may be packed according to a Protocol Buffers Protocol to obtain a plurality of first data packets.
Specifically, each first packet may include the following information: serial number, check code, data content. The sequence number is used to indicate that each first data packet is the number of the first data packets sent by the sending end, and it should be noted that the sequence number is not the sequence number of each first data packet in a plurality of first data packets, but is the sequence number of each data packet in all data packets sent by the sending end. The check code is used for enabling the receiving end to check each first data packet, and the check code may be generated according to a preset check rule. In a specific embodiment, the check code is generated by a hash check, in other words, the check code is a hash check code. The data content is the data of the first data block corresponding to the first data packet. Further, each first data package may further include a file name, where the file name is a name of data to be transmitted.
Further, the plurality of first data packets may be transmitted to the receiving end, specifically, may be transmitted to the receiving end through one or more channels (channels), and more specifically, may be transmitted through a preset first Channel.
It should be noted that, if the plurality of first data blocks are to-be-transmitted data to be transmitted for the first time, that is, the first data blocks are data of the 1 st batch, before the plurality of first data packets are sent, a start packet is sent to the receiving end. The sequence number of the start packet is 0, the start packet may further include a file name, the file name is a name of data to be transmitted, the start packet may further include a check code, and the check code of the start packet may be a preset first check field.
In a specific implementation of step S103, a receiving time may be obtained from the receiving end, where the receiving end takes to receive the plurality of first data blocks.
Specifically, after receiving a plurality of first data packets, the receiving end stores the plurality of first data packets into a buffer of the receiving end, and sequentially checks the first data packets according to the check code of each first data packet. For each first data packet, if the verification is successful, storing the data content in the first data packet into a memory, otherwise, generating transmission failure information, wherein the transmission failure information may include a sequence number of the first data packet, and sending the transmission failure information to the sending end, so that the sending end resends the first data packet.
Further, a ratio of the sending time to the receiving time may be calculated, and the blocking parameter may be updated according to the ratio of the sending time to the receiving time, where the sending time is a time taken by the sending end to send the plurality of first data blocks.
In a specific embodiment, the following formula may be used to update the blocking parameter:
wherein, size is the block parameter before updating, size' is the block parameter after updating, t1Is said transmission time, t2Is the reception time.
It will be appreciated that, in the ideal case,in the normal case of the operation of the apparatus,that is, the rate of sending data by the sending end is greater than the rate of receiving data by the receiving end, which may cause the buffer of the receiving end to overflow, thereby causing network congestion. By adopting the formula (1) to dynamically adjust the partitioning parameters, the sending rate and the receiving rate of the data to be transmitted can be kept balanced, so that the stability of data transmission is ensured, and the error condition of data transmission is favorably avoided.
In another specific embodiment, after the ratio of the sending time to the receiving time is calculated, the parameter update information may be read, and the parameter update information is used to describe the correspondence between the ratio of the sending time to the receiving time and the update ratio. Further, the update ratio may be determined according to the ratio and the parameter update information, and then the block parameter is updated according to the update ratio, that is, the updated block parameter is a product of the update ratio and the block parameter before update.
In a specific implementation of step S104, at least a portion of data that is not to be transmitted in the data to be transmitted may be segmented according to the updated blocking parameter, so as to obtain a plurality of second data blocks.
Specifically, the second size may be obtained by calculation according to the updated blocking parameter and the transmission number parameter, and then at least a part of the data to be transmitted, which is not transmitted, may be segmented according to the updated blocking parameter.
In a specific embodiment, the data of the second size may be read from the first byte of the data that is not transmitted in the data to be transmitted, and the data may be segmented according to the updated blocking parameter to obtain a plurality of second data blocks. In other words, the next batch of data of the first data blocks is segmented according to the updated blocking parameters to obtain the second data blocks. Namely, the data of the (i + 1) th batch is segmented according to the updated blocking parameters, wherein the data of the (i) th batch is a plurality of first data blocks, i is a positive integer, and i is more than or equal to 1.
In another specific embodiment, the data of the (i + 2) th batch is segmented according to the updated blocking parameters. Specifically, after the plurality of first data blocks are sent to the receiving end, that is, after the plurality of first data blocks are sent to the receiving end, the data of the ith batch may be segmented according to the partitioning parameters before updating, that is, the data of the first size is read from the first byte of the data to be transmitted that is not transmitted, and is segmented according to the partitioning parameters before updating.
Further, after receiving the receiving time sent by the receiving end, the partitioning parameter is updated, and then, starting from the first byte after the ith batch of data, the data of the second size, that is, the data of the (i + 2) th batch is read, and the data is divided according to the updated partitioning parameter to obtain a plurality of second data blocks.
It should be noted that, when such a scheme is adopted, the data of the (i + 1) th batch is divided according to the block parameters before updating, so that the data of the (i) th batch can be divided according to the block parameters before updating after a plurality of first data blocks are sent to the receiving end without acquiring the receiving time from the receiving end. In other words, the data of the ith batch is divided according to the updated block dividing parameters without dividing the data of the ith batch after the receiving end finishes receiving a plurality of first data blocks, so that the data transmission is ensured to be uninterrupted while the transmission stability is ensured by adopting the method, and the transmission efficiency is improved.
Further, the second data block may be packed to obtain a plurality of second data packets, and the plurality of second data packets may be sent to the receiving end. For the content of transmitting the plurality of second data blocks, reference may be made to the description of transmitting the plurality of first data blocks in step S102, and details are not repeated here.
Further, if the data to be transmitted are all sent to the receiving end, an end packet can be sent to the receiving end, the sequence number of the end packet is 0, the end packet can also include a check code, the check code of the end packet can be a preset second check field, and the second check field is different from the first check field. The end package may also include the file name described above. The end packet may further include a total number of data packets transmitted by the transmitting end.
Further, if there is a data packet that fails to be checked, a transmission failure message may be sent to the sending end, where the transmission failure message may include a sequence number of the data packet that fails to be checked. More specifically, after receiving the end packet, the receiving end may send transmission failure information to the transmitting end. Further, after receiving the transmission failure information, the sending end may determine the data packet that failed to be verified according to the sequence number of the data packet, and resend the data packet that failed to be verified to the receiving end.
Further, when the number of the data packets successfully verified by the receiving end is equal to the number of the data packets sent by the sending end, the receiving end may merge the data contents in the data packets according to the sequence numbers of the data packets to restore the data to be transmitted, and store the data to be transmitted obtained by restoration with the file name as the name.
Referring to fig. 2, fig. 2 is a flowchart illustrating another data transmission method according to an embodiment of the present invention. The data transmission method shown in fig. 2 may include the steps of:
step S201: acquiring data to be transmitted;
step S202: segmenting at least a part of data in the data to be transmitted to obtain a plurality of first data blocks, and sending the plurality of first data blocks to a receiving end, wherein the size of each first data block is marked as a partitioning parameter;
step S203: acquiring a verification success rate from the receiving end, and updating the block parameters according to the ratio of the sending time to the receiving time and the verification success rate;
step S204: and segmenting at least one part of the data which is not transmitted in the data to be transmitted according to the updated blocking parameters to obtain a plurality of second data blocks, and sending the plurality of second data blocks to the receiving end.
It should be noted that, for specific contents of step S201, step S202, and step S204, reference may be made to the relevant description of step S101, step S102, and step S104, which is not described herein again.
With reference to fig. 1, in a specific implementation of step S103, the verification success rate may be obtained from the receiving end, and the blocking parameter may be updated according to the verification success rate and a ratio of the sending time to the receiving time. The verification success rate is a value of the number of the first data packets which are successfully verified and the total number of the first data packets.
In a first specific embodiment, it is determined whether the verification success rate is less than or equal to a first preset threshold, and if so, the blocking parameter is updated according to the ratio of the sending time to the receiving time, otherwise, the blocking parameter is not updated. The first preset threshold may be preset, and for example, may be 90%, but is not limited thereto. It should be noted that, if the success rate of the verification is higher than the first preset threshold, it indicates that the process of data transmission is stable at this time, the error rate of the first data block transmission is low, and it is not suitable to adjust the block parameters at this time. Therefore, in the scheme of the embodiment of the invention, the block parameters are adjusted only when the verification success rate is less than or equal to the first preset threshold, which is beneficial to further ensuring the stability of data transmission and avoiding errors in the transmission process. It should be noted that, in the data transmission process, the success rate of the verification may be constantly and dynamically changed as the sending end sends the data packet to the receiving end.
In a second specific embodiment, if the verification success rate is less than or equal to the second preset threshold, the preset second channel may be used as a channel for transmitting the plurality of second data blocks, that is, the plurality of second data blocks are transmitted through the second channel in step S204. Wherein the second preset threshold is smaller than the first preset threshold, and the second channel is different from the first channel.
In a third specific embodiment, it is determined whether the verification success rate is less than or equal to a first preset threshold, if so, it is further determined whether the current blocking parameter is less than or equal to a minimum blocking threshold, if so, a preset second channel is used as a channel for sending a plurality of second data blocks, and if the current blocking parameter is greater than the minimum blocking threshold, the blocking parameter is updated. The minimum blocking threshold may be preset, and may be, for example, 1kb, but is not limited thereto. In other words, if the success rate of the check is greater than the first preset threshold, neither the blocking parameter is updated nor the channel for transmitting data is switched. That is, when such a scheme is adopted, the blocking parameters are preferentially adjusted, and the transmission channel is switched only when the blocking parameters are small enough, so that the situation that data transmission is unstable due to frequent switching of the transmission channel is reduced.
More about the data transmission method shown in fig. 2 can refer to the related description of the data transmission method shown in fig. 1, and will not be described herein again.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a data transmission device in an embodiment of the present invention. The data transmission apparatus shown in fig. 3 may include:
an obtaining module 31, configured to obtain data to be transmitted;
the first segmentation module 32 is configured to segment at least a part of the data to be transmitted to obtain a plurality of first data blocks, and send the plurality of first data blocks to a receiving end, where a size of each first data block is recorded as a segmentation parameter;
an updating module 33, configured to update the blocking parameter at least according to a ratio of a sending time and a receiving time, where the sending time is a time taken to send the multiple data blocks, and the receiving time is a time taken for the receiving end to receive the multiple first data blocks;
the second segmentation module 34 is configured to segment at least a portion of data that is not transmitted in the data to be transmitted according to the updated blocking parameters to obtain a plurality of second data blocks, and send the plurality of second data blocks to the receiving end.
The working principle, the working mode, the beneficial effects and the like of the data transmission device in the embodiment of the present invention can refer to the related descriptions about the data transmission method in fig. 1 and fig. 2, and are not described again here.
The embodiment of the present invention further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data transmission method are executed. The storage medium may include ROM, RAM, magnetic or optical disks, etc. The storage medium may further include a non-volatile memory (non-volatile) or a non-transitory memory (non-transient), and the like.
The embodiment of the present invention further provides a terminal, which includes a memory and a processor, where the memory stores a computer program that can be run on the processor, and the processor executes the steps of the data transmission method when running the computer program. The terminal includes, but is not limited to, a mobile phone, a computer, a tablet computer and other terminal devices.
It should be understood that, in the embodiment of the present application, the processor may be a Central Processing Unit (CPU), and the processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory in the embodiments of the subject application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example and not limitation, many forms of Random Access Memory (RAM) are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (enhanced SDRAM), SDRAM (SLDRAM), synchlink DRAM (SLDRAM), and direct bus RAM (DR RAM).
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer instructions or the computer program are loaded or executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer program may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire or wirelessly.
In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus and system may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative; for example, the division of the unit is only a logic function division, and there may be another division manner in actual implementation; for example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit. For example, for each device or product applied to or integrated into a chip, each module/unit included in the device or product may be implemented by hardware such as a circuit, or at least a part of the module/unit may be implemented by a software program running on a processor integrated within the chip, and the rest (if any) part of the module/unit may be implemented by hardware such as a circuit; for each device or product applied to or integrated with the chip module, each module/unit included in the device or product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components of the chip module, or at least some of the modules/units may be implemented by using a software program running on a processor integrated within the chip module, and the rest (if any) of the modules/units may be implemented by using hardware such as a circuit; for each device and product applied to or integrated in the terminal, each module/unit included in the device and product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components in the terminal, or at least part of the modules/units may be implemented by using a software program running on a processor integrated in the terminal, and the rest (if any) part of the modules/units may be implemented by using hardware such as a circuit.
It should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this document indicates that the former and latter related objects are in an "or" relationship.
The "plurality" appearing in the embodiments of the present application means two or more.
The descriptions of the first, second, etc. appearing in the embodiments of the present application are only for illustrating and differentiating the objects, and do not represent the order or the particular limitation of the number of the devices in the embodiments of the present application, and do not constitute any limitation to the embodiments of the present application.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A method of data transmission, the method comprising:
acquiring data to be transmitted;
segmenting at least a part of data in the data to be transmitted to obtain a plurality of first data blocks, and sending the plurality of first data blocks to a receiving end, wherein the size of each first data block is marked as a partitioning parameter;
updating the blocking parameters at least according to a ratio of a sending time to a receiving time, wherein the sending time is a time taken for sending the plurality of data blocks, and the receiving time is a time taken for the receiving end to receive the plurality of first data blocks;
and segmenting at least one part of the data which is not transmitted in the data to be transmitted according to the updated blocking parameters to obtain a plurality of second data blocks, and sending the plurality of second data blocks to the receiving end.
2. The data transmission method of claim 1, wherein updating the blocking parameter based on at least the ratio of the receiving time to the sending time comprises:
the following formula is used for updating:
wherein, size is the block parameter before updating, size' is the block parameter after updating, t1Is said transmission time, t2Is the reception time.
3. The data transmission method of claim 1, wherein sending the first data blocks to a receiving end comprises:
packaging each first data block to obtain a plurality of first data packets, wherein each first data packet comprises a check code;
sending the plurality of first data packets to the receiving end;
the check code is used for the receiving end to check each first data packet.
4. The data transmission method of claim 3, wherein updating the blocking parameter based on at least a ratio of a receive time to a transmit time comprises:
acquiring a verification success rate from the receiving end, wherein the verification success rate is obtained by verifying the plurality of first data packets by the receiving end;
and updating the block parameters according to the ratio and the verification success rate.
5. The data transmission method according to claim 4, wherein updating the blocking parameter according to the ratio and the verification success rate comprises:
and judging whether the verification success rate is less than or equal to a first preset threshold value, and if so, updating the block parameters according to the ratio.
6. The data transmission method according to claim 4, wherein the first data packets are transmitted through a first channel, and the transmitting the second data blocks to the receiving end comprises:
and if the verification success rate is less than or equal to a second preset threshold value, sending the plurality of second data blocks through a preset second channel, wherein the second channel is different from the first channel.
7. The data transmission method according to claim 4, wherein the plurality of first data packets are sent through a first channel, and updating the blocking parameter according to the ratio and the check success rate comprises:
judging whether the verification success rate is less than or equal to a first preset threshold value, if so, judging whether the blocking parameter is less than or equal to a preset minimum blocking threshold value;
and if the blocking parameter is smaller than or equal to a preset minimum blocking threshold value, taking a preset second channel as a transmission channel of the plurality of second data blocks, otherwise, updating the blocking parameter according to the ratio, wherein the second channel is different from the first channel.
8. A data transmission apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring data to be transmitted;
the device comprises a first segmentation module, a second segmentation module and a transmission module, wherein the first segmentation module is used for segmenting at least one part of data in the data to be transmitted to obtain a plurality of first data blocks and sending the plurality of first data blocks to a receiving end, and the size of each first data block is recorded as a segmentation parameter;
an updating module, configured to update the blocking parameter at least according to a ratio of a sending time to a receiving time, where the sending time is a time taken to send the multiple data blocks, and the receiving time is a time taken by the receiving end to receive the multiple first data blocks;
and the second segmentation module is used for segmenting at least one part of the data which is not transmitted in the data to be transmitted according to the updated segmentation parameters so as to obtain a plurality of second data blocks, and sending the plurality of second data blocks to the receiving end.
9. A storage medium having a computer program stored thereon, the computer program, when executed by a processor, performing the steps of the data transmission method of any one of claims 1 to 7.
10. A terminal comprising a memory and a processor, the memory having stored thereon a computer program operable on the processor, wherein the processor, when executing the computer program, performs the steps of the data transmission method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110800423.1A CN113595685A (en) | 2021-07-15 | 2021-07-15 | Data transmission method and device, storage medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110800423.1A CN113595685A (en) | 2021-07-15 | 2021-07-15 | Data transmission method and device, storage medium and terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113595685A true CN113595685A (en) | 2021-11-02 |
Family
ID=78247694
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110800423.1A Withdrawn CN113595685A (en) | 2021-07-15 | 2021-07-15 | Data transmission method and device, storage medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113595685A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114338644A (en) * | 2021-11-24 | 2022-04-12 | 石化盈科信息技术有限责任公司 | File processing method, processing device, storage medium and electronic equipment thereof |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1231093A (en) * | 1997-06-30 | 1999-10-06 | Ge基本太空网络服务公司 | Flex slotted ALOHA transmission system and method |
CN103457973A (en) * | 2012-06-01 | 2013-12-18 | 深圳市腾讯计算机系统有限公司 | Image uploading method and system, image uploading client terminal and network server |
CN104780092A (en) * | 2014-01-13 | 2015-07-15 | 阿里巴巴集团控股有限公司 | File transmission method and device as well as server system |
CN104967635A (en) * | 2014-05-22 | 2015-10-07 | 腾讯科技(深圳)有限公司 | Data transmission method and apparatus thereof |
CN109150935A (en) * | 2017-06-19 | 2019-01-04 | 深圳联友科技有限公司 | A kind of document transmission method, device and mobile terminal |
CN110299973A (en) * | 2018-03-23 | 2019-10-01 | 天地融科技股份有限公司 | A kind of method of reseptance and device of data scrolling transmission |
CN110740171A (en) * | 2019-09-26 | 2020-01-31 | 苏州浪潮智能科技有限公司 | data fragment transmission method and device |
US20200112867A1 (en) * | 2018-10-05 | 2020-04-09 | Qualcomm Incorporated | System and methods for rapid round-trip-time measurement distribution |
CN111263402A (en) * | 2020-01-17 | 2020-06-09 | 广东中兴新支点技术有限公司 | Data transmission method and device and electronic equipment |
CN111722787A (en) * | 2019-03-22 | 2020-09-29 | 华为技术有限公司 | Blocking method and device |
CN112152759A (en) * | 2020-10-14 | 2020-12-29 | 平安科技(深圳)有限公司 | Data transmission method, data transmission system, equipment and storage medium |
-
2021
- 2021-07-15 CN CN202110800423.1A patent/CN113595685A/en not_active Withdrawn
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1231093A (en) * | 1997-06-30 | 1999-10-06 | Ge基本太空网络服务公司 | Flex slotted ALOHA transmission system and method |
CN103457973A (en) * | 2012-06-01 | 2013-12-18 | 深圳市腾讯计算机系统有限公司 | Image uploading method and system, image uploading client terminal and network server |
CN104780092A (en) * | 2014-01-13 | 2015-07-15 | 阿里巴巴集团控股有限公司 | File transmission method and device as well as server system |
CN104967635A (en) * | 2014-05-22 | 2015-10-07 | 腾讯科技(深圳)有限公司 | Data transmission method and apparatus thereof |
CN109150935A (en) * | 2017-06-19 | 2019-01-04 | 深圳联友科技有限公司 | A kind of document transmission method, device and mobile terminal |
CN110299973A (en) * | 2018-03-23 | 2019-10-01 | 天地融科技股份有限公司 | A kind of method of reseptance and device of data scrolling transmission |
US20200112867A1 (en) * | 2018-10-05 | 2020-04-09 | Qualcomm Incorporated | System and methods for rapid round-trip-time measurement distribution |
CN111722787A (en) * | 2019-03-22 | 2020-09-29 | 华为技术有限公司 | Blocking method and device |
CN110740171A (en) * | 2019-09-26 | 2020-01-31 | 苏州浪潮智能科技有限公司 | data fragment transmission method and device |
CN111263402A (en) * | 2020-01-17 | 2020-06-09 | 广东中兴新支点技术有限公司 | Data transmission method and device and electronic equipment |
CN112152759A (en) * | 2020-10-14 | 2020-12-29 | 平安科技(深圳)有限公司 | Data transmission method, data transmission system, equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114338644A (en) * | 2021-11-24 | 2022-04-12 | 石化盈科信息技术有限责任公司 | File processing method, processing device, storage medium and electronic equipment thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10021182B2 (en) | Method and apparatus for data synchronization | |
US20140201306A1 (en) | Remote direct memory access with reduced latency | |
EP3142381A1 (en) | Network video playing method and device | |
US11652573B2 (en) | Error correction in network packets using soft information | |
TWI716822B (en) | Method and device for correcting transaction causality, and electronic equipment | |
CN111490947A (en) | Data packet transmitting method, data packet receiving method, system, device and medium | |
JP2019106697A (en) | Method for dynamically managing message retransmission delay in interconnection network and device | |
CN105164960A (en) | Reduction of retransmission latency by combining pacing and forward error correction | |
CN113595685A (en) | Data transmission method and device, storage medium and terminal | |
CN112948151A (en) | Program interface image transmission method, substrate management controller and remote control equipment | |
US10650025B2 (en) | Method and apparatus for checking and updating data on a client terminal | |
CN110650182B (en) | Network caching method and device, computer equipment and storage medium | |
EP3893419A1 (en) | Data retransmission decoding method, apparatus and system, and communication device | |
US11140089B2 (en) | Data writing method, system, device and computer-readable storage medium | |
US20160037509A1 (en) | Techniques to reduce bandwidth usage through multiplexing and compression | |
WO2023083213A1 (en) | Data decoding method and apparatus, electronic device and readable storage medium | |
US20190236331A1 (en) | Method, apparatus, and storage medium for data verification | |
CN108011926B (en) | Message sending method, message processing method, server and system | |
US9906331B2 (en) | Communication method, information processing apparatus and recording medium | |
WO2022068342A1 (en) | Data sending method, data receiving method, terminal, and computer storage medium | |
CN114090927A (en) | Page loading method and device, computer equipment and storage medium | |
CN112423117B (en) | Web end video playing method and device and computer equipment | |
CN110086574B (en) | Message processing method and device, computer equipment and storage medium | |
CN116915860B (en) | Instruction transmission method, device, equipment and medium based on UDP | |
CN111176715A (en) | Information calling method and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20211102 |