CN113692007A - Data transmission method, device, system, storage medium and terminal equipment - Google Patents

Data transmission method, device, system, storage medium and terminal equipment Download PDF

Info

Publication number
CN113692007A
CN113692007A CN202110990254.2A CN202110990254A CN113692007A CN 113692007 A CN113692007 A CN 113692007A CN 202110990254 A CN202110990254 A CN 202110990254A CN 113692007 A CN113692007 A CN 113692007A
Authority
CN
China
Prior art keywords
file
data
terminal
data packet
filling
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.)
Pending
Application number
CN202110990254.2A
Other languages
Chinese (zh)
Inventor
苏文畅
王东文
刘学学
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Tingjian Technology Co ltd
Original Assignee
Anhui Tingjian Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Anhui Tingjian Technology Co ltd filed Critical Anhui Tingjian Technology Co ltd
Priority to CN202110990254.2A priority Critical patent/CN113692007A/en
Publication of CN113692007A publication Critical patent/CN113692007A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
    • H04W28/065Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information using assembly or disassembly of packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a data transmission method, a device, a system, a storage medium and a terminal device, wherein the method comprises the following steps: receiving a forward data packet sent by a second terminal through a first data channel, wherein the forward data packet is a data packet which is read forward by the second terminal from a file to be transmitted; receiving a reverse data packet sent by a second terminal through a second data channel, wherein the reverse data packet is a data packet which is read reversely by the second terminal from the file to be transmitted; and sequentially and forwardly filling each received forward data packet into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely filling each received reverse data packet into the temporary file according to the receiving sequence. The method can enable the data transmission between the terminals to be more efficient and stable.

Description

Data transmission method, device, system, storage medium and terminal equipment
Technical Field
The present application relates to the field of data communication technologies, and in particular, to a data transmission method, apparatus, system, storage medium, and terminal device.
Background
The main data channels for data transmission between the current terminal devices comprise two channels, namely wifi and Bluetooth. However, in the conventional data transmission process between terminals, wifi channels and bluetooth channels between terminals are not fully utilized.
Specifically, in a conventional data transmission scheme between terminals, a terminal device usually sends wifi setting parameters to a wifi chip through a bluetooth chip, so that the wifi chip can access a local area network through the received setting parameters. In the above scheme, the bluetooth is only used as a means for configuring the network for the wifi chip, and after the network configuration of the wifi chip is completed, the bluetooth has no other function and only uses wifi as a main channel for data transmission.
It can be understood that wifi is used as the main channel of data transmission alone, directly leads to data transmission to break off when the wifi channel breaks down very easily, and data transmission's stability is not high, is difficult to promote data transmission efficiency moreover.
Disclosure of Invention
Based on the above technical current situation, the present application provides a data transmission method, apparatus, system, storage medium, and terminal device, which can enable data transmission between terminals to be more efficient and stable.
In order to achieve the above purpose, the present application specifically proposes the following technical solutions:
a method of data transmission, comprising:
receiving a forward data packet sent by a second terminal through a first data channel, wherein the forward data packet is a data packet which is read forward by the second terminal from a file to be transmitted;
receiving a reverse data packet sent by a second terminal through a second data channel, wherein the reverse data packet is a data packet which is read reversely by the second terminal from the file to be transmitted;
and sequentially and forwardly filling each received forward data packet into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely filling each received reverse data packet into the temporary file according to the receiving sequence.
Optionally, sequentially forward filling each received forward data packet into a temporary file created locally in advance according to a receiving order, and sequentially reverse filling each received reverse data packet into the temporary file according to the receiving order, including:
determining a forward filling position and a reverse filling position at least according to file header information of a temporary file which is created locally in advance; the method comprises the steps that file header information of a temporary file records information of a file interval to be filled of the temporary file;
sequentially filling the received forward data packets into the temporary file in a forward direction according to the receiving sequence based on the determined forward filling position;
and sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence based on the determined reverse filling position.
Optionally, the determining, at least according to file header information of a temporary file created locally in advance, a forward padding location and a reverse padding location includes:
determining the initial position and the end position of a file interval to be filled of a temporary file by inquiring file header information of the temporary file which is created locally in advance, determining the initial position of the file interval to be filled as a forward filling initial position, and determining the end position of the file interval to be filled as a reverse filling initial position;
the forward filling, based on the determined forward filling position, sequentially and forward filling the received forward data packets into the temporary file according to the receiving order, including: sequentially and forwardly filling all the received forward data packets into the temporary file according to the receiving sequence from the forward filling starting position;
sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence based on the determined reverse filling positions, and the method comprises the following steps: and sequentially reversely filling the received reverse data packets into the temporary file according to the receiving sequence from the reverse filling starting position.
Optionally, the method further includes:
and after filling the received forward data packet and/or reverse data packet into the temporary file each time, updating the file interval to be filled recorded in the file header information of the temporary file.
Optionally, determining the forward filling position at least according to file header information of a temporary file created locally in advance, including:
judging whether the received forward data packet is a fillable forward data packet or not according to the position number of the received forward data packet and the file header information of the temporary file; the forward data packet capable of being filled refers to a forward data packet of which the position number is within the range of the interval of the file to be filled of the temporary file; the position number of the forward data packet is used for representing the position of the data packet in the file to be transmitted;
and if the received forward data packet is the fillable forward data packet, determining a position corresponding to the position number of the received fillable forward data packet as a forward filling position.
Optionally, based on the determined forward filling position, sequentially and forward filling the received forward data packets into the temporary file according to the receiving order, including:
and filling the received fillable forward data packets to the file positions corresponding to the position numbers of the fillable forward data packets in the temporary file according to the receiving sequence.
Optionally, if the position number of the received fillable forward packet is a number of a discontinuous position, after filling the fillable forward packet to a file position in the temporary file corresponding to the position number of the fillable forward packet, the method further includes:
updating the filled fragment information recorded in the file tail information of the temporary file, and merging and updating the updated filled fragment information and the information of the file interval to be filled of the temporary file;
the interruption position is a position which is not adjacent to the initial position and the end position of the file interval to be filled in the temporary file; the padded segment information includes information of padded file positions in a file interval to be padded of the temporary file.
Optionally, after the forward data packet is filled to the end position of the file interval to be filled of the temporary file, according to the filled segment information in the file tail information of the temporary file and the information of the file interval to be filled in the file header information of the temporary file, request data from the second terminal and fill the file interval to be filled of the temporary file until the temporary file is completely filled.
A method of data transmission, comprising:
the method comprises the steps that data are read from a file to be transmitted in a forward direction to obtain a forward data package, and data are read from the file to be transmitted in a reverse direction to obtain a reverse data package;
and sending the read forward data packet to a first terminal through a first data channel, and sending the read reverse data packet to the first terminal through a second data channel, so that the first terminal utilizes the forward data packet to carry out forward filling on a temporary file in the first terminal, and utilizes the reverse data packet to carry out reverse filling on the temporary file.
Optionally, the forward reading data from the file to be transmitted to obtain a forward data packet, including:
receiving a data transmission instruction, and determining a data transmission starting position from the received data transmission instruction;
and sequentially reading data in a forward direction from the data transmission starting position in the file to be transmitted to obtain a forward data packet.
A data transmission system comprising:
the system comprises a first terminal and a second terminal, wherein the first terminal and the second terminal establish connection through a first data channel and a second data channel;
the first terminal is used for receiving a forward data packet sent by the second terminal through the first data channel and receiving a reverse data packet sent by the second terminal through the second data channel; sequentially and forwardly filling all received forward data packets into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely filling all received reverse data packets into the temporary file according to the receiving sequence;
the second terminal is used for reading data from the file to be transmitted in a forward direction to obtain a forward data package and reading data from the file to be transmitted in a reverse direction to obtain a reverse data package; and sending the read forward data packet to the first terminal through a first data channel, and sending the read reverse data packet to the first terminal through a second data channel.
A data transmission apparatus comprising:
the data receiving unit is used for receiving a forward data packet sent by a second terminal through a first data channel, wherein the forward data packet is a data packet which is read forward by the second terminal from a file to be transmitted; receiving a reverse data packet sent by a second terminal through a second data channel, wherein the reverse data packet is a data packet which is read reversely by the second terminal from the file to be transmitted;
and the data filling unit is used for sequentially and forwardly filling the received forward data packets into a temporary file which is created locally in advance according to the receiving sequence, and sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence.
A data transmission apparatus comprising:
the data reading unit is used for reading data from a file to be transmitted in a forward direction to obtain a forward data package and reading data from the file to be transmitted in a reverse direction to obtain a reverse data package;
and the data sending unit is used for sending the read forward data packet to a first terminal through a first data channel and sending the read reverse data packet to the first terminal through a second data channel, so that the first terminal utilizes the forward data packet to fill the temporary file in the first terminal in the forward direction and utilizes the reverse data packet to fill the temporary file in the reverse direction.
A terminal device, comprising:
a memory and a processor;
wherein the memory is connected with the processor and used for storing programs;
the processor is used for implementing the data transmission method by running the program in the memory.
A storage medium having stored thereon a computer program which, when executed by a processor, implements the data transmission method described above.
According to the data transmission method, two data channels are established between the first terminal and the second terminal, the second terminal reads data from two ends of a file to be transmitted simultaneously, and the read data packets are sent to the first terminal through the two data channels respectively. The first terminal fills the data packets received from the two data channels into the temporary file created locally in sequence according to the receiving sequence, so that the purpose of synchronizing the file to be transmitted into the temporary file is achieved, namely, the file to be transmitted is transmitted from the second terminal to the first terminal.
The data transmission efficiency of the data transmission scheme is higher because the second terminal reads data bidirectionally and transmits the data through two data channels simultaneously. In addition, the whole data transmission process is carried out through two data channels simultaneously, so that the whole data transmission process cannot be interrupted even if one of the channels is unstable or fails, and the stability of the data transmission scheme is higher.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a data transmission system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a file to be transmitted and a temporary file provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a data transmission process provided in an embodiment of the present application;
FIG. 5 is a schematic content diagram of a file header of a temporary file provided in an embodiment of the present application;
FIG. 6 is a schematic content diagram of an end of file of a temporary file provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another data transmission device provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical scheme of the embodiment of the application is applied to a data transmission application scene. By adopting the technical scheme of the embodiment of the application, the data transmission efficiency between the terminals can be improved, and the data transmission stability is improved.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solution provided by the embodiment of the present application can be applied to the data transmission system shown in fig. 1. In the data transmission system, the same wireless chip is installed inside the first terminal and the second terminal, and the same wireless chip specifically includes at least two wireless chips with different modes, such as a bluetooth chip, a wifi chip, a 4G chip, a zigbee chip, and the like. The first terminal and the second terminal can be various terminals with data reading, writing and storing functions, such as a smart phone, a smart device, a server and the like.
Based on the wireless chips with different modes, data channels with different modes can be established between the first terminal and the second terminal. The data channel is established between the first terminal and the second terminal, and may be established directly through a corresponding chip between the first terminal and the second terminal, or established between corresponding chips of the two terminals by means of a routing device or a relay server.
For example, assume that a bluetooth chip and a wifi chip are both installed inside a first terminal and a second terminal, and simultaneously, the bluetooth chip and the wifi chip between the first terminal and the second terminal are respectively connected, so that a bluetooth channel and a wifi channel can be simultaneously established between the first terminal and the second terminal.
According to the technical scheme of data transmission, the same file to be transmitted can be transmitted between the terminal devices participating in data transmission through different data channels, and therefore stability and data transmission efficiency of data transmission are improved.
In order to intuitively introduce the data transmission scheme provided by the embodiment of the present application, in the embodiment of the present application, a wifi channel established between a first terminal and a second terminal is used as a first data channel, a bluetooth channel established between the first terminal and the second terminal is used as a second data channel, and the second terminal sends a file to be transmitted to the first terminal is used as an example, so as to introduce specific contents of the data transmission scheme provided by the embodiment of the present application.
An embodiment of the present application provides a data transmission method, as shown in fig. 2, the method includes:
s201, the first terminal and the second terminal establish data transmission service, and the first terminal establishes a blank temporary file locally.
Specifically, the file to be transmitted refers to a file locally stored at the second terminal, and the specific processing procedure of the data transmission method provided by the present application is introduced in the embodiment of the present application, for example, the second terminal transmits the file to be transmitted locally stored at the second terminal to the first terminal. It can be understood that, when the first terminal sends the file stored locally to the second terminal, the data transmission method provided by the present application may be executed with reference to the description of the embodiment of the present application, so as to implement the transmission of the file.
When the first terminal and the second terminal need to transmit data, the first terminal and the second terminal interactively establish a data transmission service. For example, the first terminal may request the file to be transmitted to the second terminal, and the second terminal responds to the request of the first terminal, so as to establish the data transmission service, or the second terminal may push the file to be transmitted to the first terminal, and the first terminal receives the push request of the second terminal, so as to establish the data transmission service.
The establishment of the data transmission service can be implemented by referring to a conventional data transmission service establishment mode, and details of the embodiment of the present application are not described. In addition, the first terminal and the second terminal can interactively establish data transmission service through any one of the first data channel and the second data channel between the first terminal and the second terminal.
When a data transmission service is established between a first terminal and a second terminal, the second terminal sends attribute information of a file to be transmitted to the first terminal, wherein the attribute information comprises information such as the data type of the file to be transmitted and the size of the file to be transmitted. And when the first terminal receives the attribute information, creating a blank temporary file locally.
The size of the temporary file is guaranteed to be not smaller than that of the file to be transmitted, so that the data content of the file to be transmitted can be completely stored in the temporary file, and the first terminal can be guaranteed to have enough space to receive the file to be transmitted.
As a preferred embodiment, the first terminal locally creates a blank temporary file with the same size as the file to be transmitted, and is used for receiving the data package of the file to be transmitted sent by the second terminal. It can be understood that, since the size of the temporary file created by the first terminal is the same as that of the file to be transmitted, in the process of transmitting the file to be transmitted to the first terminal by the second terminal, when the temporary file of the first terminal is completely filled, it can be determined that the transmission of the file to be transmitted is completed. Therefore, the first terminal locally creates a blank temporary file with the same size as the file to be transmitted, and the first terminal is favorable for judging the file transmission progress.
For example, as shown in fig. 3, assuming that the length of the file to be transmitted is from 0 to 100, that is, there are 101 data blocks, a blank temporary file capable of accommodating 101 data blocks is created at the first terminal.
Further, since the data transmission between the terminals is to divide the complete data file into data packets and transmit the data packets sequentially, in order to facilitate storage of each data packet, after the first terminal creates a temporary file with the same size as the file to be transmitted, the first terminal may further divide the positions of each data block in the temporary file, for example, divide 101 data block positions from 0 to 100, so as to correspondingly store 101 data blocks from 0 to 100 in the file to be transmitted. In addition, the positions of the divided data blocks can be numbered respectively as the block numbers of the positions of the data blocks, and the corresponding positions of the data blocks can be retrieved from the temporary file more conveniently according to the block numbers corresponding to the positions of the data blocks.
S202, the second terminal reads data from the file to be transmitted in a forward direction to obtain a forward data package, and reads data from the file to be transmitted in a reverse direction to obtain a reverse data package.
After a data transmission service is established between the first terminal and the second terminal, the second terminal starts to read the data packet from the file to be transmitted and sends the data packet to the first terminal.
Specifically, the second terminal starts to read data from the head and the tail of the file to be transmitted at the same time to obtain the data packet.
As shown in fig. 4, the second terminal reads data from the head of the file to be transmitted to the tail in sequence, which is defined as that the second terminal reads data from the file to be transmitted in the forward direction, and each read data block forms a data packet, which is defined as a forward data packet.
The second terminal reads data from the tail part of the file to be transmitted to the head part in sequence, the data is defined as the data which is read reversely from the file to be transmitted by the second terminal, each data block is read to form a data packet, and the data packet is defined as a reverse data packet.
It can be understood that the second terminal reads data from the file to be transmitted along the forward direction and the reverse direction simultaneously, and the data reading efficiency of the second terminal can be improved.
And S203, the second terminal sends the read forward data packet to the first terminal through the first data channel, and sends the read reverse data packet to the first terminal through the second data channel.
Specifically, as shown in fig. 4, when the second terminal reads a data packet from the file to be transmitted in the forward direction, the read forward data packet is sent to the first terminal through the first data channel, that is, through the wifi channel.
Meanwhile, when the second terminal reversely reads a data packet from the file to be transmitted, the read reverse data packet is sent to the first terminal through the second data channel, namely, the Bluetooth channel.
S204, the first terminal receives the forward data packet sent by the second terminal through the first data channel, and receives the reverse data packet sent by the second terminal through the second data channel.
Specifically, as the second terminal continuously reads the forward data packets and the reverse data packets from the file to be transmitted and respectively sends the forward data packets and the reverse data packets to the first terminal through the first data channel and the second data channel, the first terminal can sequentially receive each forward data packet sent by the second terminal through the first data channel and sequentially receive each reverse data packet sent by the second terminal through the second data channel.
S205, the first terminal sequentially and forwardly fills the received forward data packets into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely fills the received reverse data packets into the temporary file according to the receiving sequence.
It can be understood that the second terminal is a data packet sequentially read from the file to be transmitted and sent to the first terminal. Therefore, in a state that the network is unblocked, the sequence of receiving the data packages by the first terminal is the same as the sequence of reading the data packages from the file to be transmitted by the second terminal. That is, according to the order in which the first terminal receives the respective packets, the mutual positional relationship between the received respective packets can be determined.
For example, the position of the previous forward data packet received from the first data channel in the file to be transmitted is left of the position of the next forward data packet received from the first data channel in the file to be transmitted; and the position of the former reverse data packet received from the second data channel in the file to be transmitted is positioned at the right side of the position of the latter forward data packet received from the second data channel in the file to be transmitted.
Based on the above description, the first terminal may determine the filling positions of the forward packets and the reverse packets in the temporary file according to the order of the received forward packets and reverse packets.
For example, as shown in fig. 4, based on the order of receiving the forward packets and the order of receiving the reverse packets, the first terminal sequentially forward fills the received forward packets into a temporary file created locally in advance according to the receiving order, and sequentially reverse fills the received reverse packets into the temporary file according to the receiving order.
Similar to the second terminal reading the data package from the file to be transmitted, the first terminal fills the data package into the temporary file in the forward direction, specifically, fills the data package into the temporary file along the direction from the head to the tail of the temporary file; the first terminal reversely fills the data packet into the temporary file, specifically, fills the data packet into the temporary file along a direction from the tail to the head of the temporary file.
As can be understood by referring to fig. 4, the first terminal fills the data packets into the temporary file in sequence according to the receiving order of the data packets, so that the arrangement order of the data blocks in the filled temporary file is the same as the arrangement order of the data blocks in the file to be transmitted, that is, the file to be transmitted is synchronized into the temporary file.
As can be seen from the above description, in the data transmission method provided in the embodiment of the present application, two data channels are established between the first terminal and the second terminal, and the second terminal reads data from two ends of a file to be transmitted simultaneously, and sends the read data packets to the first terminal from the two data channels respectively. The first terminal fills the data packets received from the two data channels into the temporary file created locally in sequence according to the receiving sequence, so that the purpose of synchronizing the file to be transmitted into the temporary file is achieved, namely, the file to be transmitted is transmitted from the second terminal to the first terminal.
The data transmission efficiency of the data transmission scheme is higher because the second terminal reads data bidirectionally and transmits the data through two data channels simultaneously. In addition, the whole data transmission process is carried out through two data channels simultaneously, so that the whole data transmission process cannot be interrupted even if one of the channels is unstable or fails, and the stability of the data transmission scheme is higher.
When the first terminal and the second terminal perform data transmission through the first data channel and the second data channel simultaneously, a transmission interruption or a breakpoint continuous transmission may occur.
For example, in the data transmission process through the wifi channel and the bluetooth channel, the wifi chip or the bluetooth chip may temporarily generate other service requirements, for example, the wifi chip may generate a requirement for accessing the public network, at this time, only the data transmission of the wifi channel may be suspended, and when the wifi chip finishes accessing the public network service and is idle, the data transmission service may be continuously executed. In the process, the conditions of transmission interruption and breakpoint continuous transmission occur.
In order to enable a first terminal (data receiving terminal) to accurately index a data packet filling position when data transmission interruption and breakpoint continuous transmission occur, in the embodiment of the application, when the first terminal creates a temporary file locally, a file header is further set for the temporary file, and information of a file interval to be filled of the temporary file is recorded in file header information.
For example, as shown in fig. 5, a 16-byte header is added to the header of the temporary file, in the header, the first 4 bytes record the start mark of the header, the last 4 bytes record the end mark of the header, and the middle 8 bytes are used to record the start position and the end position of the file interval to be filled of the temporary file, that is, the start block number (block number, i.e., data block number) and the end block number of the blank file of the temporary file, respectively. For example, the interval [50,100] may indicate that the 50 th to 100 th block numbers of the temporary file are blank.
In order to ensure the accuracy of the file interval to be filled in the header information of the temporary file, the first terminal updates the file interval to be filled recorded in the header information of the temporary file after filling the received forward data packet and/or reverse data packet into the temporary file each time. Through the operation, the information of the file interval to be filled recorded in the file header information can be ensured to be strictly matched with the file interval to be filled in the dying file.
Based on the above record of the header information, when the first terminal executes the above step S205, sequentially forward fills the received forward packets into the temporary file created locally in advance according to the receiving order, and sequentially reverse fills the received reverse packets into the temporary file according to the receiving order, the following steps a1 and a2 are specifically executed:
a1, determining a forward filling position and a reverse filling position according to at least the file header information of the temporary file which is created locally in advance.
The forward padding position and the reverse padding position may be both represented by a block number of a to-be-padded file interval of the temporary file. Because the information of the file interval to be filled in the temporary file is recorded in the file header information of the temporary file, the positions of the data blocks to be filled in the forward direction and the reverse direction can be selected from the file interval to be filled in the temporary file by inquiring the information of the file interval to be filled.
Specifically, in a general scenario, when a file is transmitted between a first terminal and a second terminal, each data block in the file is transmitted according to a fixed sequence, and data transmission is not performed in a skip manner. The second terminal reads the data blocks in sequence according to the position relation of each data block in the file to be transmitted to obtain a data packet and sends the data packet to the first terminal; correspondingly, the first terminal fills the data packets into the temporary file in sequence according to the sequence of receiving the data packets. Even if data transmission interruption occurs, when data transmission is restarted, the data packets are still read in sequence according to the position relation of each data block.
For example, a first terminal downloads a certain movie from a second terminal, generally, after a downloading service starts running, all data of the movie needs to be downloaded to the first terminal, and during the downloading process, a user does not intervene in the downloading process. In this process, the second terminal continuously reads the data packets from the movie file and sequentially sends the data packets to the first terminal, and accordingly, the first terminal sequentially receives the data packets and fills the data packets into the temporary file. Even if the user clicks the pause of the downloading, when the downloading is continued again, the second terminal continuously reads the data packets from the movie file and sequentially sends the data packets to the first terminal, and the first terminal sequentially receives the data packets and fills the data packets into the temporary file.
In this case, each time the first terminal starts to perform data padding, it is only necessary to determine a data padding start position, and the first terminal sequentially pads the received data packets in the temporary file from the padding start position.
Therefore, the determining of the forward filling position and the reverse filling position at least according to the file header information of the temporary file created locally in advance includes:
the method comprises the steps of determining the starting position and the ending position of a file interval to be filled of a temporary file by inquiring file header information of the temporary file which is created locally in advance, determining the starting position of the file interval to be filled as a forward filling starting position, and determining the ending position of the file interval to be filled as a reverse filling starting position.
Specifically, file header information of the temporary file is inquired, a starting position of a file interval to be filled of the temporary file is determined and used as a forward filling starting position, and file header information of the temporary file is inquired, and ending position information of the file interval to be filled of the temporary file is determined and used as a reverse filling starting position.
The above-mentioned processes of determining the forward padding starting position and determining the reverse padding starting position may be executed when the first terminal starts a data transmission service and receives a first forward data packet and/or a reverse data packet.
A2, sequentially filling the received forward data packets into the temporary file in the forward direction according to the receiving sequence based on the determined forward filling position; and sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence based on the determined reverse filling position.
Specifically, when the first terminal starts to perform a data transmission service (for example, when the data transmission service is started when the data transmission service is established, or when data transmission is started after the data transmission service is interrupted), and after the forward filling start position and the reverse filling start position are determined respectively, the received forward packets are sequentially and forwardly filled into the temporary file according to the receiving sequence from the forward filling start position.
And sequentially reversely filling the received reverse data packets into the temporary file according to the receiving sequence from the reverse filling starting position.
When the size of the temporary file is equal to that of the file to be transmitted, and when the first terminal coincides with the forward filling and the reverse filling of the temporary file, the length of a file interval to be filled in the file header information of the temporary file is 0, and the file to be transmitted can be considered to be completely transmitted.
When the size of the temporary file is larger than that of the file to be transmitted, whether the file to be transmitted is completely transmitted or not can be determined by calculating whether the sum of the forward filling data amount and the reverse filling data amount is equal to the total data amount of the file to be transmitted or not. And when the sum of the data quantity filled in the forward direction and the data quantity filled in the reverse direction of the temporary file by the first terminal is equal to the total data quantity of the file to be transmitted, determining that the file to be transmitted is transmitted completely.
After the file transmission is completed, the temporary file can be further checked to judge whether the temporary file is the same as the file to be transmitted. For example, the MD5 value of the file to be transmitted may be obtained through a command or other means, then the MD5 value of the filled temporary file is calculated, if the MD5 values of the two are equal, the temporary file and the file to be transmitted may be considered to be the same, that is, the transmission of the file to be transmitted is successfully achieved, and at this time, the file header of the temporary file is removed, so that the complete transmission file may be obtained.
Based on the above record of the header information of the temporary file, the data transmission method provided in the embodiment of the present application can support breakpoint resume, and only needs to read the start position and/or the end position of the file interval to be filled from the header information of the temporary file when resuming is started, so as to determine the forward filling start position and/or the reverse filling start position, and then perform forward filling and/or reverse filling from the forward filling start position and/or the reverse filling start position.
In an actual data transmission service scenario, there may also be a data transmission requirement different from the above-mentioned continuous data transmission, but the transmission is started from a specified position of the file to be transmitted. For example, in an audio/video playing and transmission scenario, a user may adjust the audio/video playing progress, for example, directly adjust to start playing from a certain position.
In this scenario, when the user adjusts the play start position at the first terminal, the first terminal sends a data transmission instruction to the second terminal, where the data transmission instruction carries the play start position specified by the user, that is, the data transmission start position adjusted by the user.
And after receiving the data transmission instruction, the second terminal determines a data transmission starting position from the received data transmission instruction. And then, the second terminal sequentially reads the data in the forward direction from the data transmission initial position in the file to be transmitted to obtain a forward data packet. And sequentially sending each read forward data packet to the first terminal through the first data channel.
For example, assuming that the file to be transmitted is a movie with a duration of 100 minutes, and the user selects to start playing from the 50 th minute, the user may drag the playing progress bar to the 50 th minute at the first terminal, at this time, the first terminal sends a data transmission instruction to the second terminal, and the data transmission instruction carries a playing start position specified by the user, that is, the 50 th minute of the movie. After receiving the data transmission instruction, the second terminal determines that the data transmission starting position is at the 50 th minute of the movie from the received data transmission instruction.
Then, the second terminal jumps to the file position corresponding to the 50 th minute of the movie, sequentially reads data in the forward direction from the file position to obtain a forward data packet, and sequentially sends the read forward data packet to the first terminal through the first data channel.
Further, in the above scenario of continuing data transmission from the designated location, in order to facilitate the first terminal to correctly fill the data packet, the second terminal further adds data packet location number information to the transmitted data packet, that is, adds information indicating the location of the data packet in the file to be transmitted to the transmitted data packet. The location number information may be specifically represented by a block number of the data packet in the file to be transmitted.
Correspondingly, when the first terminal performs data filling, when executing step a1 and determining a forward filling position according to at least the header information of the temporary file created locally in advance, the following steps a11-a13 are specifically executed:
and A11, judging whether the received forward data packet is a fillable forward data packet or not according to the position number of the received forward data packet and the file header information of the temporary file.
Specifically, for each received forward data packet, the embodiment of the present application respectively determines the position number of the received forward data packet, compares the position number with the file interval to be filled of the temporary file, and determines whether the position number of the forward data packet is within the file interval to be filled of the temporary file. If the position number of the received forward data packet is within the range of the file interval to be filled of the temporary file, for example, the block number of the received forward data packet is greater than or equal to +1 of the starting position of the file interval to be filled of the temporary file, or less than or equal to-1 of the ending position of the file interval to be filled of the temporary file, and the positions are unfilled positions, so that data filling can be performed, the forward data packet is a fillable forward data packet, that is, the forward data packet can be filled into the file interval to be filled of the temporary file; if the position number of the received forward data packet is not in the range of the file interval to be filled of the temporary file, for example, the block number of the received forward data packet is less than or equal to the starting position of the file interval to be filled of the temporary file, or is greater than or equal to the ending position of the file interval to be filled of the temporary file, since the positions are already filled, data filling does not need to be performed again, and the forward data packet is not a fillable forward data packet.
If the received forward packet is a filable forward packet, step a12 is executed to determine a position corresponding to the position number of the received filable forward packet as a forward padding position.
Specifically, because the data package read from the file to be transmitted by the second terminal carries the position number information of the data package in the file to be transmitted, and under the condition that the size of the temporary file is the same as that of the file to be transmitted, the file positions of the temporary file correspond to the file positions of the file to be transmitted one by one, and the first terminal fills the received data package to the same position number in the temporary file, so that the filled temporary file is ensured to be the same as the file to be transmitted. Therefore, when receiving the fillable forward packet, the first terminal may directly determine, as the forward padding location, the location corresponding to the location number of the fillable forward packet, where the forward padding location is the location for padding the fillable forward packet.
Correspondingly, based on the above processing, the first terminal sequentially fills the received forward data packets into the temporary file in the forward direction according to the receiving order based on the determined forward filling position, specifically, fills the received fillable forward data packets into the file positions corresponding to the position numbers of the fillable forward data packets in the temporary file respectively according to the receiving order.
If the received forward data packet is not the padding forward data packet, step a13 is executed to delete the forward data packet.
In the foregoing data transmission service scenario, if the position number of the received fillable forward data packet is a position in the to-be-filled file interval in the temporary file that is not adjacent to both the start position and the end position of the to-be-filled file interval, for example, the position number of the received fillable forward data packet is a position number that is greater than +1 of the start position of the to-be-filled file interval, or a position number that is less than-1 of the end position of the to-be-filled file interval, the position number of the fillable forward data packet is defined as a number of an intermittent position.
It will be appreciated that the padding of the data packets at the above-mentioned positions of the gaps will result in the temporary file being padded intermittently. The file header information of the temporary file records the information of the continuous unfilled file intervals, and at this time, it cannot be accurately determined which file positions are filled and which file positions are unfilled according to the file header information of the temporary file.
For example, it is assumed that forward padding has proceeded to block number 40 of the temporary file before the user specifies the data transfer location. The file interval to be filled of the temporary file recorded at the moment is [41,80 ]; next, since the user designates the data transfer position, forward padding is performed again from the 50 th block number. If the file interval to be filled is recorded directly as [51,80] in the header information of the temporary file, it is obviously inaccurate because the [41,49] interval is not filled.
In the above-mentioned padding process of the intermittent positions, in order to determine more accurately which positions of the temporary file have been padded and which positions have not been padded, in the embodiment of the present application, when padding of the intermittent position data occurs, the first terminal records information of the padded file positions in the file to be padded interval of the temporary file recorded in the header information of the temporary file, that is, padded segment information, in the file trailer information of the temporary file.
In the data transmission process, if the position number of the currently received fillable forward data packet by the first terminal is the number of the discontinuous position, filling the fillable forward data packet to the file position corresponding to the position number of the fillable forward data packet in the temporary file, and then updating the filled segment information recorded in the file tail information of the temporary file.
The first terminal updates the filled segment information recorded in the file tail information of the temporary file, and at least adds the corresponding block number information of the current data filling to the file tail information.
Referring to fig. 6, the above-mentioned padded segment information may be designed into a 12-byte information segment format, wherein the first 4 bytes are used as the segmentation markers of the padded segment information; the middle 4 bytes are used to record the starting position of the padded segment, i.e. the starting block number; the last 4 bytes are used to record the end position of the padded segment, i.e. the end block number.
And if the block number of the data filling is adjacent to the initial block number or the ending block number of any filled segment information in the file tail information, combining the block number of the data filling into the filled segment information. And if the block number of the data filling of the cleavage is not adjacent to the start block number or the end block number of all the filled segment information in the file tail information, independently creating one filled segment information according to the block number of the data filling.
Furthermore, before adding the data to the file tail information to fill the corresponding block number information, the existing filled segment information in the file tail information can be merged and updated. For example, if the existing padded segment information includes [50,60], [61,70], [74, 80.. the segments, the segments [50,60], [61,70] may be merged into [50,70 ]. And after the merging, adding the data to the tail information of the file to fill the corresponding block number information.
Furthermore, after the padded segment information recorded in the file tail information of the temporary file is updated, the updated padded segment information and the information of the file interval to be padded of the temporary file are merged and updated.
Specifically, after the padded segment information recorded in the file end information of the temporary file is updated, it is further determined whether there is padded segment information that can be incorporated into the file header information in the file end information.
For example, assuming that the file interval to be padded recorded in the header information is [50,100], and the padded segment [50,70] is recorded in the footer information, the padded segment information may be incorporated into the header information, the file interval to be padded in the header information may be updated to [71,100], and at the same time, the padded segment [50,70] may be deleted from the footer information.
In the whole process of the discontinuous data padding, only the starting position of the forward padding is discontinuous due to the operation of the user, but the reverse padding process is not affected, so that the reverse padding process is always performed according to the continuous reverse padding process described in the above embodiment, and in the reverse padding process, the ending position of the file interval to be padded in the file header information of the temporary file is updated in real time.
When the padding of the padding forward direction packet is performed at the end position of the to-be-padded file interval of the temporary file in a certain padding forward direction packet padding action, it may be determined that all the block number positions after the end position have been padded reversely.
At this time, the first terminal requests data from the second terminal according to the filled segment information in the file tail information of the temporary file and the information of the file interval to be filled in the file header information of the temporary file, and fills the file interval to be filled in the temporary file until the temporary file is completely filled.
Specifically, according to the file interval to be filled recorded in the file header information of the temporary file and the filled segments in the file interval to be filled recorded in the file end information, it can be determined which segments or block numbers are not filled in the file interval to be filled.
Then, the first terminal requests the second terminal for data corresponding to the unfilled segments or block numbers, fills the unfilled segments or block numbers, and updates the interval information of the file to be filled in the file information, so that the temporary file is completely filled.
Through the processing, when the length of the file interval to be filled in the file header information is 0, the file to be transmitted can be considered to be completely transmitted to the first terminal. The first terminal may further check the temporary file to determine whether the temporary file is the same as the file to be transmitted. For example, the MD5 value of the file to be transmitted may be obtained through a command or other means, then the MD5 value of the filled temporary file is calculated, if the MD5 values of the two are equal, the temporary file and the file to be transmitted may be considered to be the same, that is, the transmission of the file to be transmitted is successfully achieved, and at this time, the file header of the temporary file is removed, so that the complete transmission file may be obtained.
It can be seen from the above description that, based on the file interval information to be filled recorded in the file header information of the temporary file and the filled segment information recorded in the file tail information, the first terminal can perform data filling on the temporary file in a jumping manner, so that the operation of designating a data transmission position by a user at will can be adapted, and meanwhile, the file to be transmitted can be transmitted to the first terminal completely, quickly and stably, and breakpoint continuous transmission can be supported.
It should be further understood that, in the above embodiment, for example, the size of the temporary file is equal to the size of the file to be transmitted, and whether data padding is completed is determined based on the file header information and the file end information of the temporary file. When the temporary file is larger than the file to be transmitted, a file interval to be filled, which has the same size as the file to be transmitted, may be located in the temporary file, and then forward and reverse data filling may be performed according to the method in the embodiment of the present application.
As can be seen from the above description, the data transmission method provided in the embodiment of the present application is actually a two-way data reading and transmission scheme implemented by the first terminal and the second terminal in cooperation.
Based on the above, the embodiment of the present application further provides a data transmission method applied to the first terminal, where the method specifically includes the following steps B1-B3:
and B1, receiving a forward data packet sent by the second terminal through the first data channel, wherein the forward data packet is a data packet which is read forward by the second terminal from the file to be transmitted.
B2, receiving a reverse data packet sent by the second terminal through the second data channel, where the reverse data packet is a data packet reversely read by the second terminal from the file to be transmitted.
B3, sequentially and forwardly filling the received forward data packets into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence;
the temporary file is a blank file with the same size as the file to be transmitted.
The execution sequence of the steps B1 and B2 is not limited, and the steps B1 and B2 may be executed simultaneously or sequentially.
The specific processing contents of the above steps B1-B3 and other processing contents of the above first terminal during data transmission can refer to the description about the processing contents of the first terminal in the above embodiments, and are not repeated here.
Correspondingly, the embodiment of the present application further provides a data transmission method applied to the second terminal, where the method specifically includes the following steps C1-C2:
c1, reading data from the file to be transmitted in a forward direction to obtain a forward data packet, and reading data from the file to be transmitted in a reverse direction to obtain a reverse data packet;
and C2, sending the read forward data packet to the first terminal through the first data channel, and sending the read reverse data packet to the first terminal through the second data channel, so that the first terminal uses the forward data packet to forward fill the temporary file in the first terminal, and uses the reverse data packet to reverse fill the temporary file.
Specifically, the specific content of each item of processing content of the second terminal in the data transmission method may refer to the processing content of the corresponding second terminal in the above method embodiment, and is not repeated here.
Based on the foregoing data transmission method, an embodiment of the present application further provides a data transmission system, where the data transmission system is composed of a first terminal and a second terminal, and a structure of the data transmission system is shown in fig. 1, where:
the first terminal and the second terminal establish connection through a first data channel and a second data channel;
the first terminal is used for receiving a forward data packet sent by the second terminal through the first data channel and receiving a reverse data packet sent by the second terminal through the second data channel; sequentially and forwardly filling all received forward data packets into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely filling all received reverse data packets into the temporary file according to the receiving sequence;
the second terminal is used for reading data from the file to be transmitted in a forward direction to obtain a forward data package and reading data from the file to be transmitted in a reverse direction to obtain a reverse data package; and sending the read forward data packet to the first terminal through a first data channel, and sending the read reverse data packet to the first terminal through a second data channel.
Specifically, the specific working contents of the first terminal and the second terminal in the data transmission system may refer to the corresponding contents in the embodiment of the data transmission method described above.
Based on the dual data channels between the first terminal and the second terminal, the first terminal and the second terminal can realize bidirectional synchronous data transmission by executing the data transmission method, and can also perform data transmission from any one of the first data channel and the second data channel according to the size and the type of a file to be transmitted.
For example, when the file to be transmitted is small, the file to be transmitted can be directly transmitted through a second data channel (bluetooth channel); when the file to be transmitted is large, the file can be transmitted through the first data channel (wifi channel), or bidirectional two-channel simultaneous transmission is performed by executing the data transmission method described in the above embodiment.
Corresponding to the data transmission method applied to the first terminal, the embodiment of the present application further provides a data transmission device, which can be applied to the first terminal of the data transmission system. Specifically, the data transmission device may be a separate data transmission device, and is used in combination with the first terminal to implement the steps of the data transmission method applied to the first terminal, or the data transmission device may be a partial structure of the first terminal, and through the operation of the data transmission device, the processing steps of the data transmission method applied to the first terminal are implemented.
Referring to fig. 7, the data transmission apparatus applied to the first terminal includes:
the data receiving unit 001 is configured to receive a forward data packet sent by a second terminal through a first data channel, where the forward data packet is a data packet that is read forward by the second terminal from a file to be transmitted; receiving a reverse data packet sent by a second terminal through a second data channel, wherein the reverse data packet is a data packet which is read reversely by the second terminal from the file to be transmitted;
the data filling unit 002 is configured to sequentially forward fill the received forward data packets into a temporary file created locally in advance according to the receiving order, and sequentially reverse fill the received reverse data packets into the temporary file according to the receiving order.
Optionally, sequentially forward filling each received forward data packet into a temporary file created locally in advance according to a receiving order, and sequentially reverse filling each received reverse data packet into the temporary file according to the receiving order, including:
determining a forward filling position and a reverse filling position at least according to file header information of a temporary file which is created locally in advance; the method comprises the steps that file header information of a temporary file records information of a file interval to be filled of the temporary file;
sequentially filling the received forward data packets into the temporary file in a forward direction according to the receiving sequence based on the determined forward filling position;
and sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence based on the determined reverse filling position.
Optionally, the determining, at least according to file header information of a temporary file created locally in advance, a forward padding location and a reverse padding location includes:
determining the initial position and the end position of a file interval to be filled of a temporary file by inquiring file header information of the temporary file which is created locally in advance, determining the initial position of the file interval to be filled as a forward filling initial position, and determining the end position of the file interval to be filled as a reverse filling initial position;
the forward filling, based on the determined forward filling position, sequentially and forward filling the received forward data packets into the temporary file according to the receiving order, including: sequentially and forwardly filling all the received forward data packets into the temporary file according to the receiving sequence from the forward filling starting position;
sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence based on the determined reverse filling positions, and the method comprises the following steps: and sequentially reversely filling the received reverse data packets into the temporary file according to the receiving sequence from the reverse filling starting position.
Optionally, the data padding unit 102 is further configured to:
and after filling the received forward data packet and/or reverse data packet into the temporary file each time, updating the file interval to be filled recorded in the file header information of the temporary file.
Optionally, determining the forward filling position at least according to file header information of a temporary file created locally in advance, including:
judging whether the received forward data packet is a fillable forward data packet or not according to the position number of the received forward data packet and the file header information of the temporary file; the forward data packet capable of being filled refers to a forward data packet of which the position number is within the range of the interval of the file to be filled of the temporary file; the position number of the forward data packet is used for representing the position of the data packet in the file to be transmitted;
and if the received forward data packet is the fillable forward data packet, determining a position corresponding to the position number of the received fillable forward data packet as a forward filling position.
Optionally, based on the determined forward filling position, sequentially and forward filling the received forward data packets into the temporary file according to the receiving order, including:
and filling the received fillable forward data packets to the file positions corresponding to the position numbers of the fillable forward data packets in the temporary file according to the receiving sequence.
Optionally, if the position number of the received fillable forward packet is a number of a discontinuous position, after filling the fillable forward packet into the file position corresponding to the position number of the fillable forward packet in the temporary file, the data filling unit 102 is further configured to:
updating the filled fragment information recorded in the file tail information of the temporary file, and merging and updating the updated filled fragment information and the information of the file interval to be filled of the temporary file;
the interruption position is a position which is not adjacent to the initial position and the end position of the file interval to be filled in the temporary file; the padded segment information includes information of padded file positions in a file interval to be padded of the temporary file.
Optionally, the data padding unit 102 is further configured to: and after the forward direction data packet can be filled to the end position of the file interval to be filled of the temporary file, requesting data from the second terminal and filling the file interval to be filled of the temporary file according to the filled segment information in the file tail information of the temporary file and the information of the file interval to be filled in the file header information of the temporary file until the temporary file is completely filled.
Specifically, please refer to the content of the corresponding method embodiment for the specific working content of each unit of the data transmission device, which is not described herein again.
Corresponding to the data transmission method applied to the second terminal, the embodiment of the present application also provides another data transmission device, which can be applied to the second terminal of the data transmission system. Specifically, the data transmission device may be a separate data transmission device, and is used in combination with the second terminal to implement the steps of the data transmission method applied to the second terminal, or the data transmission device may be a partial structure of the second terminal, and through the operation of the data transmission device, the processing steps of the data transmission method applied to the second terminal are implemented.
Referring to fig. 8, the data transmission apparatus applied to the second terminal includes:
the data reading unit 100 is configured to forward read data from a file to be transmitted to obtain a forward data packet, and reversely read data from the file to be transmitted to obtain a reverse data packet;
a data sending unit 110, configured to send the read forward data packet to a first terminal through a first data channel, and send the read reverse data packet to the first terminal through a second data channel, so that the first terminal performs forward padding on a temporary file in the first terminal by using the forward data packet, and performs reverse padding on the temporary file by using the reverse data packet.
Optionally, the forward reading data from the file to be transmitted to obtain a forward data packet, including:
receiving a data transmission instruction, and determining a data transmission starting position from the received data transmission instruction;
and sequentially reading data in a forward direction from the data transmission starting position in the file to be transmitted to obtain a forward data packet.
Specifically, please refer to the content of the corresponding method embodiment for the specific working content of each unit of the data transmission apparatus applied to the second terminal, which is not described herein again.
Another embodiment of the present application further provides a terminal device, as shown in fig. 9, where the terminal device includes:
a memory 200 and a processor 210;
wherein, the memory 200 is connected to the processor 210 for storing programs;
the processor 210 is configured to implement the data transmission method disclosed in any of the above embodiments by running the program stored in the memory 200.
Specifically, the terminal device may further include: a bus, a communication interface 220, an input device 230, and an output device 240.
The processor 210, the memory 200, the communication interface 220, the input device 230, and the output device 240 are connected to each other through a bus. Wherein:
a bus may include a path that transfers information between components of a computer system.
The processor 210 may be a general-purpose processor, such as a general-purpose Central Processing Unit (CPU), microprocessor, etc., an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs in accordance with the present invention. But may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The processor 210 may include a main processor and may also include a baseband chip, modem, and the like.
The memory 200 stores programs for executing the technical solution of the present invention, and may also store an operating system and other key services. In particular, the program may include program code including computer operating instructions. More specifically, memory 200 may include a read-only memory (ROM), other types of static storage devices that may store static information and instructions, a Random Access Memory (RAM), other types of dynamic storage devices that may store information and instructions, a disk storage, a flash, and so forth.
The input device 230 may include a means for receiving data and information input by a user, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor, among others.
Output device 240 may include equipment that allows output of information to a user, such as a display screen, a printer, speakers, and the like.
Communication interface 220 may include any device that uses any transceiver or the like to communicate with other devices or communication networks, such as an ethernet network, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
The processor 210 executes the program stored in the memory 200 and invokes other devices, which can be used to implement the steps of the data transmission method provided by the embodiment of the present application.
Another embodiment of the present application further provides a storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the data transmission method provided in any of the foregoing embodiments.
Specifically, the specific working contents of each part of the terminal device and the specific processing contents of the computer program on the storage medium when being executed by the processor may refer to the contents of each embodiment of the data transmission method, which are not described herein again.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present application is not limited by the order of acts or acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The steps in the method of each embodiment of the present application may be sequentially adjusted, combined, and deleted according to actual needs, and technical features described in each embodiment may be replaced or combined.
The modules and sub-modules in the device and the terminal in the embodiments of the application can be combined, divided and deleted according to actual needs.
In the several embodiments provided in the present application, it should be understood that the disclosed terminal, apparatus and method may be implemented in other manners. For example, the above-described terminal embodiments are merely illustrative, and for example, the division of a module or a sub-module is only one logical division, and there may be other divisions when the terminal is actually implemented, for example, a plurality of sub-modules or modules may be combined or integrated into another module, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules or sub-modules described as separate parts may or may not be physically separate, and parts that are modules or sub-modules may or may not be physical modules or sub-modules, may be located in one place, or may be distributed over a plurality of network modules or sub-modules. Some or all of the modules or sub-modules can be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, each functional module or sub-module in the embodiments of the present application may be integrated into one processing module, or each module or sub-module may exist alone physically, or two or more modules or sub-modules may be integrated into one module. The integrated modules or sub-modules may be implemented in the form of hardware, or may be implemented in the form of software functional modules or sub-modules.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software unit executed by a processor, or in a combination of the two. The software cells may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (15)

1. A method of data transmission, comprising:
receiving a forward data packet sent by a second terminal through a first data channel, wherein the forward data packet is a data packet which is read forward by the second terminal from a file to be transmitted;
receiving a reverse data packet sent by a second terminal through a second data channel, wherein the reverse data packet is a data packet which is read reversely by the second terminal from the file to be transmitted;
and sequentially and forwardly filling each received forward data packet into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely filling each received reverse data packet into the temporary file according to the receiving sequence.
2. The method according to claim 1, wherein the sequentially forward filling of the received forward packets into a temporary file created locally in advance according to the receiving order, and the sequentially reverse filling of the received reverse packets into the temporary file according to the receiving order, comprises:
determining a forward filling position and a reverse filling position at least according to file header information of a temporary file which is created locally in advance; the method comprises the steps that file header information of a temporary file records information of a file interval to be filled of the temporary file;
sequentially filling the received forward data packets into the temporary file in a forward direction according to the receiving sequence based on the determined forward filling position;
and sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence based on the determined reverse filling position.
3. The method according to claim 2, wherein determining the forward filling position and the reverse filling position according to at least file header information of a temporary file created locally in advance comprises:
determining the initial position and the end position of a file interval to be filled of a temporary file by inquiring file header information of the temporary file which is created locally in advance, determining the initial position of the file interval to be filled as a forward filling initial position, and determining the end position of the file interval to be filled as a reverse filling initial position;
the forward filling, based on the determined forward filling position, sequentially and forward filling the received forward data packets into the temporary file according to the receiving order, including: sequentially and forwardly filling all the received forward data packets into the temporary file according to the receiving sequence from the forward filling starting position;
sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence based on the determined reverse filling positions, and the method comprises the following steps: and sequentially reversely filling the received reverse data packets into the temporary file according to the receiving sequence from the reverse filling starting position.
4. The method according to any one of claims 1 to 3, further comprising:
and after filling the received forward data packet and/or reverse data packet into the temporary file each time, updating the file interval to be filled recorded in the file header information of the temporary file.
5. The method of claim 2, wherein determining the forward padding position according to at least header information of a temporary file created locally in advance comprises:
judging whether the received forward data packet is a fillable forward data packet or not according to the position number of the received forward data packet and the file header information of the temporary file; the forward data packet capable of being filled refers to a forward data packet of which the position number is within the range of the interval of the file to be filled of the temporary file; the position number of the forward data packet is used for representing the position of the data packet in the file to be transmitted;
and if the received forward data packet is the fillable forward data packet, determining a position corresponding to the position number of the received fillable forward data packet as a forward filling position.
6. The method of claim 5, wherein forward filling the received forward packets into the temporary file sequentially in the order of reception based on the determined forward filling position comprises:
and filling the received fillable forward data packets to the file positions corresponding to the position numbers of the fillable forward data packets in the temporary file according to the receiving sequence.
7. The method according to claim 6, wherein if the location number of the received fillable forward packet is a number of a break location, after filling the fillable forward packet to a file location in the temporary file corresponding to the location number of the fillable forward packet, the method further comprises:
updating the filled fragment information recorded in the file tail information of the temporary file, and merging and updating the updated filled fragment information and the information of the file interval to be filled of the temporary file;
the interruption position is a position which is not adjacent to the initial position and the end position of the file interval to be filled in the temporary file; the padded segment information includes information of padded file positions in a file interval to be padded of the temporary file.
8. The method according to claim 7, wherein after the forward direction data packet is filled to the end position of the file interval to be filled of the temporary file, according to the filled segment information in the end information of the temporary file and the information of the file interval to be filled in the header information of the temporary file, requesting data from the second terminal and filling the file interval to be filled of the temporary file until the temporary file is completely filled.
9. A method of data transmission, comprising:
the method comprises the steps that data are read from a file to be transmitted in a forward direction to obtain a forward data package, and data are read from the file to be transmitted in a reverse direction to obtain a reverse data package;
and sending the read forward data packet to a first terminal through a first data channel, and sending the read reverse data packet to the first terminal through a second data channel, so that the first terminal utilizes the forward data packet to carry out forward filling on a temporary file in the first terminal, and utilizes the reverse data packet to carry out reverse filling on the temporary file.
10. The method of claim 9, wherein the forward reading of data from the file to be transmitted to obtain a forward data packet comprises:
receiving a data transmission instruction, and determining a data transmission starting position from the received data transmission instruction;
and sequentially reading data in a forward direction from the data transmission starting position in the file to be transmitted to obtain a forward data packet.
11. A data transmission system, comprising:
the system comprises a first terminal and a second terminal, wherein the first terminal and the second terminal establish connection through a first data channel and a second data channel;
the first terminal is used for receiving a forward data packet sent by the second terminal through the first data channel and receiving a reverse data packet sent by the second terminal through the second data channel; sequentially and forwardly filling all received forward data packets into a temporary file which is created locally in advance according to a receiving sequence, and sequentially and reversely filling all received reverse data packets into the temporary file according to the receiving sequence;
the second terminal is used for reading data from the file to be transmitted in a forward direction to obtain a forward data package and reading data from the file to be transmitted in a reverse direction to obtain a reverse data package; and sending the read forward data packet to the first terminal through a first data channel, and sending the read reverse data packet to the first terminal through a second data channel.
12. A data transmission apparatus, comprising:
the data receiving unit is used for receiving a forward data packet sent by a second terminal through a first data channel, wherein the forward data packet is a data packet which is read forward by the second terminal from a file to be transmitted; receiving a reverse data packet sent by a second terminal through a second data channel, wherein the reverse data packet is a data packet which is read reversely by the second terminal from the file to be transmitted;
and the data filling unit is used for sequentially and forwardly filling the received forward data packets into a temporary file which is created locally in advance according to the receiving sequence, and sequentially and reversely filling the received reverse data packets into the temporary file according to the receiving sequence.
13. A data transmission apparatus, comprising:
the data reading unit is used for reading data from a file to be transmitted in a forward direction to obtain a forward data package and reading data from the file to be transmitted in a reverse direction to obtain a reverse data package;
and the data sending unit is used for sending the read forward data packet to a first terminal through a first data channel and sending the read reverse data packet to the first terminal through a second data channel, so that the first terminal utilizes the forward data packet to fill the temporary file in the first terminal in the forward direction and utilizes the reverse data packet to fill the temporary file in the reverse direction.
14. A terminal device, comprising:
a memory and a processor;
wherein the memory is connected with the processor and used for storing programs;
the processor is configured to implement the data transmission method according to any one of claims 1 to 10 by executing the program in the memory.
15. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when executed by a processor, implements a data transmission method according to any one of claims 1 to 10.
CN202110990254.2A 2021-08-26 2021-08-26 Data transmission method, device, system, storage medium and terminal equipment Pending CN113692007A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110990254.2A CN113692007A (en) 2021-08-26 2021-08-26 Data transmission method, device, system, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110990254.2A CN113692007A (en) 2021-08-26 2021-08-26 Data transmission method, device, system, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN113692007A true CN113692007A (en) 2021-11-23

Family

ID=78583282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110990254.2A Pending CN113692007A (en) 2021-08-26 2021-08-26 Data transmission method, device, system, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN113692007A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541419A (en) * 2023-07-06 2023-08-04 美云智数科技有限公司 Data import and export method and device, electronic equipment and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018093349A (en) * 2016-12-01 2018-06-14 株式会社インフォシティ Content distribution system
CN108551425A (en) * 2018-03-14 2018-09-18 固高科技(深圳)有限公司 Data transmission system, method based on Industrial Ethernet and communication equipment
CN110149374A (en) * 2019-04-28 2019-08-20 深圳市恒扬数据股份有限公司 A kind of document transmission method, terminal device and computer readable storage medium
CN110661726A (en) * 2019-08-30 2020-01-07 视联动力信息技术股份有限公司 Data sending method and device based on multilink aggregation
CN110995697A (en) * 2019-11-29 2020-04-10 济南慧天云海信息技术有限公司 Big data transmission method and system
CN111278050A (en) * 2019-07-24 2020-06-12 维沃移动通信有限公司 Resource allocation method, information transmission method and related equipment
CN112003684A (en) * 2019-05-27 2020-11-27 华为技术有限公司 Data transmission method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018093349A (en) * 2016-12-01 2018-06-14 株式会社インフォシティ Content distribution system
CN108551425A (en) * 2018-03-14 2018-09-18 固高科技(深圳)有限公司 Data transmission system, method based on Industrial Ethernet and communication equipment
CN110149374A (en) * 2019-04-28 2019-08-20 深圳市恒扬数据股份有限公司 A kind of document transmission method, terminal device and computer readable storage medium
CN112003684A (en) * 2019-05-27 2020-11-27 华为技术有限公司 Data transmission method and device
CN111278050A (en) * 2019-07-24 2020-06-12 维沃移动通信有限公司 Resource allocation method, information transmission method and related equipment
CN110661726A (en) * 2019-08-30 2020-01-07 视联动力信息技术股份有限公司 Data sending method and device based on multilink aggregation
CN110995697A (en) * 2019-11-29 2020-04-10 济南慧天云海信息技术有限公司 Big data transmission method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541419A (en) * 2023-07-06 2023-08-04 美云智数科技有限公司 Data import and export method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US10356194B2 (en) Method, system and client for uploading image, network server and computer storage medium
CN105262627B (en) Firmware upgrading method, device and system
US8078746B2 (en) Mobile terminal, contents delivery system, and contents reproduction program
CN110471692B (en) Over-the-air upgrading method, device, equipment and storage medium of terminal program
US20170331699A1 (en) Ecu for transmitting large data in hil test environment, system including the same and method thereof
CN111741276A (en) Method for sending key frame by video equipment, video equipment and storage device
CN109547524B (en) User behavior storage method, device, equipment and storage medium based on Internet of things
CN106484454A (en) The processing method and processing device of difference AKU, upgrade method, system and device
US20210289518A1 (en) Method for Navigation Control and Related Products
CN105027572A (en) Method for decreasing the bit rate needed to transmit videos over a network by dropping video frames
JP2022529103A (en) Communication method and communication device
CN113692007A (en) Data transmission method, device, system, storage medium and terminal equipment
JP6929946B2 (en) Data transmission method, device, transmitting end, receiving end and system
CN110446228A (en) Data transmission method, device, terminal device and storage medium
CN104243202A (en) Data processing method and device of parameter configuration and parameter configuration method and device
CN107465538B (en) Internet of things terminal migration method and gateway
CN112217610A (en) Data processing method and device, consumer machine, terminal and readable storage medium
CN115167907A (en) Terminal equipment upgrading method, server, electronic equipment and storage medium
CN105592143B (en) A kind of file loading method and device
CN112804027B (en) Data packet generation method and device and data reading method and device
CN109347589B (en) Data transmission method and network node
CN115412777A (en) Streaming media data transmission method, device and system
WO2008115033A1 (en) Method of providing mobile application and computer-readable medium having thereon program performing function embodying the same
CN101883419A (en) Synchronization method of client-side information and system
CN117785097B (en) Communication method, device and equipment for vehicle-mounted device and android display terminal and storage medium

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