[go: up one dir, main page]

CN113473645A - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN113473645A
CN113473645A CN202010170314.1A CN202010170314A CN113473645A CN 113473645 A CN113473645 A CN 113473645A CN 202010170314 A CN202010170314 A CN 202010170314A CN 113473645 A CN113473645 A CN 113473645A
Authority
CN
China
Prior art keywords
terminal
link
usb
wireless link
data
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
CN202010170314.1A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010170314.1A priority Critical patent/CN113473645A/en
Priority to PCT/CN2021/078868 priority patent/WO2021179970A1/en
Publication of CN113473645A publication Critical patent/CN113473645A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application provides a data transmission method and device, a first terminal can establish a USB wired link and a P2P wireless link between the first terminal and a second terminal based on sharing operation of a user, target data are divided into a plurality of data blocks, and the plurality of data blocks are sent to the second terminal in parallel by using the USB wired link and the P2P wireless link, because the target data are sent in parallel by using the USB wired link and the P2P wireless link, efficient data transmission can be realized.

Description

Data transmission method and device
Technical Field
The present application relates to communications technologies, and in particular, to a data transmission method and apparatus.
Background
As the terminal technology develops, the storage capacity of the terminal increases, and when a file with a large data volume is transmitted between terminals, a point-to-point (P2P) lan technology is generally used for transmission. P2P transmissions may include wireless transmissions, such as Bluetooth (Bluetooth) transmissions, Ultra Wide Band (UWB) transmissions, infrared transmissions, and the like; the P2P transport may also include wired transport, such as transport over an OTG (On-The-Go) Universal Serial Bus (USB).
However, in the prior art, data sharing and the like are generally performed by using P2P wireless transmission, but the data transmission rate is slow.
Disclosure of Invention
The embodiment of the application provides a data transmission method and device, so that efficient data transmission is realized.
A first aspect of an embodiment of the present application provides a data transmission method, including: detecting a sharing operation; the sharing operation is used for transmitting target data; establishing a Universal Serial Bus (USB) wired link and a point-to-point P2P wireless link with the second terminal based on the sharing operation; dividing target data into a plurality of data blocks; and transmitting a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, wherein the data blocks are used for representing that the USB wired link and the P2P wireless link jointly transmit target data. In this way, the first terminal can transmit a plurality of data blocks to the second terminal in parallel using the USB wired link and the P2P wireless link, and thus efficient data transmission can be achieved because the data blocks are transmitted in parallel using the USB wired link and the P2P wireless link.
In an exemplary manner, establishing a USB wired link and a P2P wireless link with a second terminal includes: responding to the wired connection operation of a USB interface between the first terminal and the second terminal, and establishing a USB wired link with the second terminal; a wireless link P2P is established with the second terminal using a USB wired link. In this way, the P2P wireless link between the first terminal and the second terminal can be conveniently and efficiently established by using the USB wired link.
In an exemplary manner, establishing a P2P wireless link with a second terminal using a USB wired link includes: sending a P2P wireless link establishment request to the second terminal using the USB wired link; upon receiving a message from the second terminal agreeing to establish a P2P wireless link, a P2P wireless link is established with the second terminal. In this way, the P2P wireless link is established with the second terminal under the condition that the second terminal agrees, and the current link establishment requirement of the second terminal can be met.
In an exemplary manner, establishing a USB wired link and a P2P wireless link with a second terminal includes: establishing a P2P wireless link with the second terminal in response to the P2P wireless link creation operation; and in response to the wired connection operation of the universal serial bus USB interface between the first terminal and the second terminal, establishing a USB wired link with the second terminal. In this way, any realizable manner can be adopted to realize the establishment of the USB wired link and the P2P wireless link between the first terminal and the second terminal, and the application range is wider.
In an exemplary manner, the parallel transmission of one or more data blocks to the second terminal using the USB wired link and the P2P wireless link comprises: according to the bandwidth of the USB wired link and the bandwidth of the P2P wireless link, a plurality of data blocks are distributed to the USB wired link and the P2P wireless link, and the plurality of data blocks are transmitted to the second terminal in parallel through the USB wired link and the P2P wireless link. Therefore, the adaptive data blocks can be allocated to each link by combining the actual bandwidth of each link, and the efficient transmission of data is realized.
In an exemplary manner, the parallel transmission of one or more data blocks to the second terminal using the USB wired link and the P2P wireless link comprises: setting M data blocks matched with the bandwidth of the USB wired link in a first cache; m is a natural number; setting N data blocks matched with the bandwidth of the P2P wireless link in a second cache; n is a natural number; when the data block in the first cache or the second cache is sent out, the unallocated data block in the plurality of data blocks is additionally set in the first cache or the second cache. Therefore, according to the specific situation of the USB wired link and the P2P wireless link, the data blocks can be dynamically allocated in the link with faster transmission, and the efficient transmission of the data blocks can be realized.
In an exemplary manner, the parallel transmission of one or more data blocks to the second terminal using the USB wired link and the P2P wireless link comprises: in the case of data transmission failure of the USB wired link, transmitting the data block transmitted in the USB wired link to the second terminal through the P2P wireless link; in case of failure of the P2P wireless link to transmit data, the data block transmitted in the P2P wireless link is transmitted to the second terminal through the USB wired link. Thus, according to the specific situation of the USB wired link and the P2P wireless link, the data blocks can be dynamically allocated in the link capable of realizing data transmission, and the efficient transmission of the data blocks can be realized.
In an exemplary manner, in the case that the USB wired link fails to transmit data, transmitting the data block transmitted in the USB wired link to the second terminal through the P2P wireless link includes: under the condition that the data block is detected to be unsuccessfully transmitted in the USB wired link beyond the first time threshold value or the USB wired link is disconnected, the data block transmitted in the USB wired link is taken out, and the taken out data block is transmitted to the second terminal through the P2P wireless link;
or, in case of data transmission failure of the P2P wireless link, transmitting the data block transmitted in the P2P wireless link to the second terminal through the USB wired link, including: and in the case of detecting that the data block is not successfully transmitted in the P2P wireless link beyond the second time threshold or the P2P wireless link is disconnected, extracting the data block transmitted in the P2P wireless link and transmitting the extracted data block to the second terminal through the USB wired link.
In an exemplary manner, the method for transmitting a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link comprises the following steps: transmitting basic information and preview data of the target data to the second terminal by using a P2P wireless link; and in the case of receiving a reception response message returned by the second terminal, the first terminal sends one or more data blocks to the second terminal through the USB wired link and the P2P wireless link, wherein the reception response message is sent by the second terminal to the first terminal in response to successfully receiving the basic information and the preview data of the target data. In this way, if the second terminal can receive the basic information and the preview data and can send a reception response message for identifying successful reception of the basic information and the preview data, the first terminal can send the target data to the second terminal through the USB wired link and the P2P wireless link, thereby further ensuring that the data can be successfully sent to the second terminal.
In an exemplary manner, the method for transmitting a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link comprises the following steps: receiving a first verification identifier sent by the second terminal by using a USB wired link and a second verification identifier sent by the second terminal through a P2P wireless link; and in the case that the first authentication identifier and the second authentication identifier meet the authentication condition, transmitting a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link. Therefore, the security of data transmission can be improved in an authentication mode.
In an exemplary mode, the roles of the first terminal and the second terminal in P2P wireless link transmission are obtained; and under the condition that the capability of the first terminal for sending data to the second terminal is smaller than the capability of the second terminal for sending data to the first terminal, the first terminal and the second terminal exchange roles. In this way, the first terminal may be enabled to transmit data to the second terminal at a faster rate.
In an exemplary manner, the method further comprises: charging between USB wired links is stopped. Thus, the excessive power consumption of the terminal as the power supplier can be avoided, and the heating caused by the charging process can be avoided.
In an exemplary manner, when the first terminal is a battery-powered device, and when the device temperature of the first terminal is detected to be higher than a first threshold value, the charging between the USB wired links is stopped. This may allow overheating of the first terminal due to charging.
In an exemplary manner, the power of the first terminal and the power of the second terminal are obtained; and under the condition that the electric quantity of the first terminal is smaller than the electric quantity threshold value, setting the charging direction as that the second terminal charges the first terminal. In this way, the first terminal can be made to obtain sufficient power for data transmission.
In an exemplary manner, in the case that the device temperature of the first terminal is higher than a second threshold value, the operating frequency of a Central Processing Unit (CPU) of the first terminal is reduced; wherein the second threshold is higher than the temperature set by limiting the CPU operation frequency when the first terminal does not transmit data. This allows overheating of the first terminal.
In an exemplary manner, establishing a USB wired link and a point-to-point P2P wireless link with a second terminal based on a sharing operation includes: displaying a first user interface based on the sharing operation; the first user interface includes: one or more user identities, and a P2P mode available for each user identity; the user identification is the identification of the scanned end user, and the available P2P modes comprise P2P wired and/or P2P wireless; and under the condition that a triggering operation for the user identification of the second terminal equipment is received in the first user interface, and the available P2P mode of the user identification of the second terminal equipment is a P2P wired mode and a P2P wireless mode, establishing a Universal Serial Bus (USB) wired link and a point-to-point P2P wireless link with the second terminal. Therefore, the user can flexibly select the data transmission mode, and the user experience is improved.
In an exemplary manner, in the case that a triggering operation for a user identifier of a second terminal device is received in a first user interface, and an available P2P manner for the user identifier of the second terminal device is a P2P wired manner and a P2P wireless manner, a Universal Serial Bus (USB) wired link and a point-to-point P2P wireless link are established with the second terminal, including: receiving a triggering operation of a user identifier of a second terminal device in a first user interface; displaying a second user interface, the second user interface comprising: a check control for selecting P2P wireless transmission, a check control for selecting P2P wired transmission, and a check control for selecting P2P wireless and P2P wired simultaneous transmission; and receiving the checking operation of the checking control for selecting the wireless and wired simultaneous transmission of the P2P and the P2P in the second user interface, and establishing a Universal Serial Bus (USB) wired link and a P2P wireless link with the second terminal. Therefore, the user can flexibly select the data transmission mode, and the user experience is improved.
In one exemplary approach, detecting a sharing operation includes: and detecting a checking operation on the target data and a sending operation for sending the target data.
In one exemplary approach, a third user interface is displayed, the third user interface including controls for indicating a USB wired link and controls for indicating a P2P wireless link; under the condition that the trigger operation of a control used for indicating the USB wired link is detected, disconnecting or starting the transmission of the USB wired link; alternatively, in the event that a triggering operation of a control indicating a P2P wireless link is detected, the transmission of the P2P wireless link is disconnected or turned on. Therefore, the user can flexibly switch the transmission mode in the data transmission process.
A second aspect of the embodiments of the present application provides a data transmission apparatus, which is applied to a first terminal, and includes: the device comprises a processing module, a USB control module and a sending module; the processing module is used for detecting sharing operation; the sharing operation is used for transmitting target data; the processing module is also used for controlling the USB control module to establish a Universal Serial Bus (USB) wired link and a point-to-point P2P wireless link with the second terminal based on the sharing operation; the processing module is also used for dividing the target data into a plurality of data blocks; and the sending module is further used for sending a plurality of data blocks to the second terminal in parallel by utilizing the USB wired link and the P2P wireless link, and the data blocks are used for representing that the USB wired link and the P2P wireless link jointly transmit target data.
In an exemplary manner, the processing module is specifically configured to: responding to the wired connection operation of a USB interface between the first terminal and the second terminal, and controlling the USB control module to establish a USB wired link with the second terminal; and establishing a P2P wireless link with the second terminal using the USB wired link.
In an exemplary manner, the system further comprises a receiving module; the sending module is further used for sending a P2P wireless link establishment request to the second terminal by using the USB wired link; and the processing module is specifically configured to establish a P2P wireless link with the second terminal when the receiving module receives the message agreeing to establish the P2P wireless link from the second terminal.
In an exemplary manner, the processing module is specifically configured to: establishing a P2P wireless link with the second terminal in response to the P2P wireless link creation operation; and responding to the wired connection operation of the universal serial bus USB interface between the first terminal and the second terminal, and establishing a USB wired link between the USB control module and the second terminal.
In an exemplary manner, the processing module is further configured to allocate a plurality of data blocks to the USB wired link and the P2P wireless link according to a bandwidth of the USB wired link and a bandwidth of the P2P wireless link;
and the sending module is also used for sending a plurality of data blocks to the second terminal in parallel through the USB wired link and the P2P wireless link.
In an exemplary manner, the processing module is specifically configured to: setting M data blocks matched with the bandwidth of the USB wired link in a first cache; m is a natural number; setting N data blocks matched with the bandwidth of the P2P wireless link in a second cache; n is a natural number; when the data block in the first cache or the second cache is sent out, the unallocated data block in the plurality of data blocks is additionally set in the first cache or the second cache.
In an exemplary manner, the sending module is specifically configured to: in the case of data transmission failure of the USB wired link, transmitting the data block transmitted in the USB wired link to the second terminal through the P2P wireless link; in case of failure of the P2P wireless link to transmit data, the data block transmitted in the P2P wireless link is transmitted to the second terminal through the USB wired link. In an exemplary manner, the sending module is specifically configured to: under the condition that the data block is detected to be unsuccessfully transmitted in the USB wired link beyond the first time threshold value or the USB wired link is disconnected, the data block transmitted in the USB wired link is taken out, and the taken out data block is transmitted to the second terminal through the P2P wireless link; alternatively, in the case where it is detected that the data block is not successfully transmitted in the P2P wireless link beyond the second time threshold, or the P2P wireless link is disconnected, the data block transmitted in the P2P wireless link is taken out, and the taken out data block is transmitted to the second terminal through the USB wired link.
In an exemplary manner, the sending module is specifically configured to: transmitting basic information and preview data of the target data to the second terminal by using a P2P wireless link; and in the case of receiving a reception response message returned by the second terminal, transmitting one or more data blocks to the second terminal through the USB wired link and the P2P wireless link, wherein the reception response message is transmitted by the second terminal to the first terminal in response to successfully receiving the basic information and the preview data of the target data.
In an exemplary manner, the system further comprises a receiving module; the receiving module is used for receiving a first verification identifier sent by the second terminal by using a USB wired link and a second verification identifier sent by the second terminal through a P2P wireless link; and the sending module is further used for sending a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link under the condition that the first verification identifier and the second verification identifier meet the verification condition.
In an exemplary manner, the processing module is further configured to: acquiring roles of a first terminal and a second terminal in P2P wireless link transmission; and under the condition that the capability of the first terminal for sending data to the second terminal is smaller than the capability of the second terminal for sending data to the first terminal, the first terminal and the second terminal exchange roles.
In an exemplary manner, the processing module is further configured to control the USB control module to stop charging between the USB wired links.
In an exemplary manner, the processing module is further configured to, in a case that the first terminal is a battery-powered device, obtain a device temperature of the first terminal; and the processing module is further used for controlling the USB control module to stop charging between the USB wired links when the equipment temperature of the first terminal is higher than a first threshold value.
In an exemplary manner, the processing module is further configured to set a charging direction to charge the first terminal with the second terminal when detecting that the electric quantity of the first terminal is smaller than the electric quantity threshold.
In an exemplary manner, the processing module is further configured to reduce the operating frequency of the central processing unit CPU of the first terminal when the device temperature of the first terminal is higher than a second threshold; wherein the second threshold is higher than the temperature set by limiting the CPU operation frequency when the first terminal does not transmit data.
In an exemplary manner, the system further comprises a display module; the display module is used for displaying a first user interface based on the sharing operation; the first user interface includes: one or more user identities, and a P2P mode available for each user identity; the user identification is the identification of the scanned end user, and the available P2P modes comprise P2P wired and/or P2P wireless; and the processing module is further used for establishing a Universal Serial Bus (USB) wired link and a point-to-point P2P wireless link with the second terminal under the condition that the triggering operation of the user identifier of the second terminal equipment is received in the first user interface and the available P2P mode of the user identifier of the second terminal equipment is a P2P wired mode and a P2P wireless mode.
In an exemplary manner, the display module is further configured to receive, in the first user interface, a trigger operation for a user identifier of the second terminal device; the display module is further used for displaying a second user interface, and the second user interface comprises: a check control for selecting P2P wireless transmission, a check control for selecting P2P wired transmission, and a check control for selecting P2P wireless and P2P wired simultaneous transmission; and the processing module is also used for receiving the checking operation of the checking control for selecting the wireless and wired simultaneous transmission of the P2P and the P2P in the second user interface, and establishing a Universal Serial Bus (USB) wired link and a P2P wireless link with the second terminal.
In an exemplary manner, the processing module is further configured to detect a checking operation on the target data, and a sending operation for sending the target data.
In one exemplary approach, the display module is configured to display a third user interface, the third user interface including controls for indicating a USB wired link and controls for indicating a P2P wireless link; the processing module is further used for disconnecting or starting transmission of the USB wired link under the condition that the triggering operation of the control used for indicating the USB wired link is detected; or, the processing module is further configured to disconnect or open transmission of the P2P wireless link in case of detecting a triggering operation on a control indicating the P2P wireless link.
A third aspect of the embodiments of the present application provides an electronic device, including: one or more processors, transceivers, memories, and interface circuits; the one or more processors, transceivers, memories, and interface circuits communicate over one or more communication buses; the interface circuit is for communicating with other apparatus, the one or more computer programs being stored in the memory and configured for execution by the one or more processors or transceivers to cause the electronic device to perform the method as set forth in the first aspect or any one of the possible designs of the first aspect.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing instructions that, when executed, cause a computer to perform a method as set forth in the first aspect or any one of the possible designs of the first aspect.
It should be understood that the second aspect to the fourth aspect of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by the aspects and the corresponding possible implementations are similar and will not be described again.
Drawings
Fig. 1 is a schematic diagram of functional units that may be included in a first terminal or a second terminal according to an embodiment of the present disclosure;
fig. 2 is a schematic view of an application scenario of the data transmission method according to the embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a process of performing USB link negotiation between a first terminal and a second terminal according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating an embodiment of a wireless link establishment procedure for P2P with USB-based assistance;
FIG. 5 is a diagram illustrating a process for dynamically allocating data according to an embodiment of the present application;
FIG. 6 is a schematic diagram of another process for dynamically allocating data according to an embodiment of the present application;
fig. 7 is a schematic diagram illustrating a double link authentication process according to an embodiment of the present application;
FIG. 8 is a schematic interface diagram according to an embodiment of the present application;
fig. 9 is a schematic flowchart of a data transmission method according to an embodiment of the present application;
FIG. 10 is a schematic view of a user interface according to an embodiment of the present application;
FIG. 11 is a schematic view of another user interface according to an embodiment of the present application;
FIG. 12 is a schematic view of another embodiment of a user interface;
FIG. 13 is a schematic view of another embodiment of a user interface;
fig. 14 is a schematic flowchart of another data transmission method according to an embodiment of the present application;
fig. 15 is a schematic flowchart of a data transmission method according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of another data transmission apparatus according to an embodiment of the present application.
Detailed Description
Generally, data transmission methods that may be used between terminals such as mobile phones, tablet computers, and Personal Computers (PCs) include: a cellular network based transmission scheme, or a P2P lan technology based transmission scheme, etc.
The cellular network may be, for example, a fourth Generation mobile communication (4Generation, 4G), a fifth Generation mobile communication (5Generation, 5G) or a future-capable communication system. The data transmission method based on the cellular network has the characteristics of simplicity and convenience, for example, the data transmission can be conveniently realized based on the cellular network by using a third-party Application (APP) in a mobile phone. However, the data transmission method based on the cellular network needs to consume data traffic, has a slow rate, needs to transmit data through other intermediate devices, and has low security.
The P2P lan technology may be Wireless P2P such as Wireless Fidelity (WiFi) -P2P, Bluetooth or UWB, and the lan technology may be wired P2P, P2P using USB or network cable, etc. to enable direct data transmission between terminals. The transmission mode can avoid consuming data flow, and data does not need to be transmitted through other intermediate equipment, so that the security is higher.
Therefore, in a scenario where the amount of data to be transmitted is large, it is a better transmission method to implement data transmission by the lan technology of P2P. For example, in a scenario of transferring data in an old mobile phone to a new mobile phone or copying data in a mobile phone to a mobile phone assistant application on a PC, the amount of data involved may exceed 100G, and data transmission may be implemented by the local area network technology of P2P.
The WiFi-P2P technology can be divided into 2.4GHZ and 5GHZ channels according to frequency, the theoretical rate of P2P at the frequency of 2.4GHZ is only 54Mbps, and the theoretical rate of P2P at the frequency of 5GHZ is about 2 Gbps. Although the Wifi-P2P theoretical transmission rate of the 5GHZ frequency is higher, for a transmission scenario with a large data volume, the transmission time is usually longer, and long-time transmission may cause the device to consume energy faster and the device to generate heat seriously, so when Wifi-P2P transmission is actually adopted, in order to maintain lower power consumption and temperature of the device, the adopted transmission rate may be smaller than the theoretical rate, that is, the actual transmission rate is lower. And Wifi-P2P is easily subjected to electromagnetic interference, the transmission process is easily interrupted, and the reliability is not high.
Bluetooth generally has a theoretical transmission rate of only 48Mbps, which is low.
The infrared transmission rate is low and the diffraction ability for obstacles is poor.
The P2P wired transmission method using USB is generally high in transmission rate. In the USB protocol, the maximum theoretical transmission rate of USB2.0 is 480Mbps, USB3.0 is 5Gbps, and USB3.1 is 10 Gbps. The USB2.0 and later protocols support OTG, allowing two USB devices to communicate directly with each other without an independent USB host. However, depending on the transmission line in the wired transmission, users are required to carry the transmission line frequently, which is inconvenient, and the transmission line may cause a data transmission terminal if the transmission line fails or loosens. Also, in the USB link, the terminal as the master device charges the terminal as the slave device, resulting in high power consumption of the terminal as the master device.
The mode of utilizing the network cable to carry out P2P wired transmission is more complicated than that of utilizing a USB, more network setting parameters need to be changed, and the number of mobile devices supporting the network port is small at present, so that the application scene is more limited.
In summary, it is difficult to realize flexible and efficient data transmission in the conventional P2P transmission method.
The embodiment of the application provides a data transmission method, taking two devices for data transmission as a first terminal and a second terminal as an example, the first terminal can establish a USB wired link and a P2P wireless link between the first terminal and the second terminal based on the sharing operation of a user on target data, divide the target data into a plurality of data blocks in an application layer, and send the plurality of data blocks to the second terminal by using the USB wired link and the P2P wireless link in parallel, because the data blocks are sent by using the USB wired link and the P2P wireless link in parallel, not only the efficiency is high, but also when any one link has a transmission problem, the other link can ensure the normal operation of transmission, and therefore, the embodiment of the application can realize flexible and efficient data transmission.
In the embodiment of the present application, an execution subject for executing the method on the first terminal side or the second terminal side may be a terminal, or may be a device in the terminal (it should be noted that, in the embodiment provided in the present application, description is given by taking the terminal as an example). For example, the terminal may be a mobile phone, a tablet, a PC, or the like, and the device in the terminal may be a chip system, a circuit, a module, or the like, which is not limited in this application.
The first terminal or the second terminal according to the embodiment of the present application may include a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a Central Processing Unit (CPU), a Memory Management Unit (MMU), and a memory (also referred to as a main memory). The operating system may be any one or more computer operating systems that implement business processing through processes (processes), such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer comprises applications such as a browser, an address list, word processing software, instant messaging software and the like.
For example, fig. 1 is a schematic diagram of functional units that may be included in a first terminal or a second terminal according to an embodiment of the present application.
As shown in fig. 1, the first terminal or the second terminal may include: a wireless communication unit 11, a central processor unit 12, a data storage unit 13, a device search unit 14, and a wired communication unit 15.
The wireless communication unit can perform information interaction or data transmission with other devices through a wireless link. The central processing unit may be responsible for processing data and control commands of the device. The data storage unit may be responsible for reading and writing data. The device search unit may be responsible for searching for other devices within a certain range that can communicate with the present device. The wired communication unit can perform data transmission with other devices through wired links.
According to the embodiment of the application, a USB wired link and a P2P wireless link can be established between the first terminal and the second terminal.
For example, fig. 2 is a schematic diagram of a possible application scenario according to an embodiment of the present application. As shown in fig. 2, a USB wired link and a P2P wireless link may be established between the first terminal 10 and the second terminal 20, and further, the first terminal 10 and the second terminal 20 may perform wireless data transmission through a P2P wireless local area network, or may perform wired data transmission through a USB-OTG function.
The USB wired link is established between the first terminal and the second terminal according to the embodiment of the application, and an open accessory protocol (AOA) protocol or a Media Transfer Protocol (MTP) protocol may be used to perform negotiation, determine port information of the USB link between the first terminal and the second terminal, and obtain whether an opposite terminal supports a data transfer function of the USB.
Exemplarily, fig. 3 shows a schematic diagram of a first terminal performing USB link negotiation with a second terminal, where the second terminal is a slave device (slave) when the first terminal is a master device (master); and when the second terminal is the master device, the first terminal is the slave device.
As shown in fig. 3, the master device may query whether the master device itself supports USB, may further query whether a Distributed Trusted Content Protocol (DTCP) supports USB if the support supports USB, may add a USB capability-local field (USB-ability-1) if the support supports DTCP, and may create a DTCP USB information fragment, and send the DTCP USB information fragment of the master device to the slave device through a DTCP command prompt (DTCP CMD) channel.
Suitably, the slave device may also send the DTCP USB message segment of the slave device to the master device using a similar procedure.
The master device and the slave device may negotiate a USB link according to the USB enable states of the opposite terminal and the slave device, respectively. It is understood that in the case where the master device and the slave device are both USB-availability-local-1, the master device and the slave device may establish a USB link.
The P2P wireless link established between the first terminal and the second terminal according to the embodiment of the present application may be established in a normal P2P wireless link establishment manner. The P2P wireless link establishment may also be based on the assistance of a USB wired link between the first terminal and the second terminal.
For example, the normal P2P wireless link establishment method may be: users of the first terminal and the second terminal need to respectively open wireless networks of the local terminal device, such as wireless networks of WiFi, bluetooth, and the like. The first terminal and the second terminal send out broadcast messages. The data sharing side device (for example, the first terminal) searches for all devices that can be connected to itself within the current range. The user selects a target device (for example, a second terminal) which is to share data among the searched target devices. The first terminal and the second terminal then establish and negotiate wireless transmission channel information.
It can be understood that in the normal P2P wireless link establishment mode, the wireless channel transmission needs broadcasting, scanning, and two active operations by the user. The action of the device and the interaction of the user are complex, the time consumed by the P2P wireless link establishment is usually more than 20S, and the user experience is poor.
The method for establishing the P2P wireless link with the assistance of the USB wired link between the first terminal and the second terminal is provided in the embodiment of the present application, and can implement fast P2P wireless link establishment.
Illustratively, fig. 4 shows a flow diagram of a P2P wireless link establishment based on the assistance of a USB wired link between a first terminal and a second terminal.
It is understood that, in the embodiment of the present application, a USB wired link may be established between the first terminal and the second terminal in advance in response to the wired connection operation of the USB interface, and then, a fast P2P wireless link establishment is performed based on the assistance of the USB wired link. Since the first terminal and the second terminal have already established the USB wired link, the second terminal is known to the first terminal when the first terminal establishes the P2P wireless link with the second terminal, and therefore, the first terminal does not need to determine the second terminal that needs to establish the P2P wireless link based on broadcasting, scanning, user selection, or the like, and the first terminal can directly send a P2P wireless link establishment request to the second terminal using the USB wired link, and establish the P2P wireless link with the second terminal upon receiving a message from the second terminal agreeing to establish the P2P wireless link. During this process, the user may be unaware.
For example, as shown in fig. 4, wirelessly establishing a P2P link with the assistance of a USB wired link between a first terminal and a second terminal may include:
s401: the first terminal sends a wireless channel connection request to the second terminal.
S402: the second terminal sends the connection result to the first terminal.
In the embodiment of the present application, the radio path connection request may also be referred to as a P2P radio link establishment request, and the like. The wireless channel connection request may be any character, number, and the like, and this is not particularly limited in this embodiment of the application.
The connection result may include any information used for establishing a P2P wireless link, for example, a Port number (Port) and a stream number (stream number) required for wireless communication, and the connection result may also be referred to as a message granting establishment of a P2P wireless link, and the like, which is not specifically limited in this embodiment of the present application.
After the first terminal sends the wireless channel connection request to the second terminal, the second terminal may negotiate wireless link information and send the connection result to the first terminal, and then the first terminal may establish a P2P wireless link with the second terminal.
Optionally, before S401, the first terminal and the second terminal may further determine whether each has wireless network capability. For example, as shown in fig. 4, the first terminal may transmit a message for inquiring whether the network of the second terminal is open to the second terminal using the USB wired link in the case of confirming that itself has the wireless network capability (e.g., the wireless network of the first terminal is in an open state), and may perform a procedure of establishing a P2P wireless link with the second terminal if the network of the second terminal is already open. If the network of the second terminal is not opened, the second terminal may be requested to open the network, for example, a pop-up window pops up in a user interface of the second terminal to prompt the user to open the network, and the user may perform an operation of agreeing to open the network to open the wireless network of the second terminal. The second terminal informs the first terminal that the wireless network has been opened, the first terminal may perform a procedure of establishing a P2P wireless link with the second terminal.
Optionally, the first terminal and the second terminal may also negotiate a role of wireless communication, for example, as shown in fig. 4, the first terminal may send an infinite channel setup negotiation request to the second terminal. The second terminal establishes a wireless communication role and sends a channel negotiation result to the first terminal, so that the negotiation of the wireless communication role of the first terminal and the second terminal is realized.
In a typical USB communication application scenario, the communication roles typically include a master device and a slave device. The hardware performance of the master device is often better than that of the slave device, so in a general USB protocol, when the master device sends data to the slave device, the maximum read buffer (buffer) is specified to be 16K, which results in a slower rate when the master device sends data to the slave device, and therefore the master device is a device with a weaker capability of sending data. Since there is no limitation in transmitting data from the slave device to the master device, the slave device has a strong capability of transmitting data.
Therefore, in the embodiment of the present application, taking the example that the first terminal sends data to the second terminal, in the USB wired link, the first terminal device is taken as a slave device, so that the data transmission rate can be increased.
In a possible implementation manner, the setting of the first terminal as the slave device may be performed automatically by the first terminal, for example, when an operation of data transmission is detected in the first terminal, the role of the first device is automatically set as the slave device.
In another possible implementation manner, setting the first terminal as the slave device may be implemented based on an operation of a user, for example, the user may set the first terminal device as the slave device by using an operation of role setting.
In practical application, the specific manner of setting the first terminal as the slave device may also be set according to an actual application scenario, which is not specifically limited in the embodiment of the present application.
It will be appreciated that the second terminal device may be arranged as a slave device if it is the second terminal that transmits data to the first terminal. In a possible scenario, it is preset that the first terminal is a slave device, the second terminal is a master device, and subsequently, the second terminal sends data to the first terminal, so that roles of the first terminal and the second terminal may be exchanged, and the role exchange may be specifically realized through negotiation and the like, which is not specifically limited in this embodiment of the present application.
It should be noted that, in the embodiment of the present application, no matter whether the first terminal and the second terminal implement establishing the USB wired link and the P2P wireless link in the first terminal and the second terminal by using the normal USB wired establishing manner and the P2P wireless establishing manner, or implement performing the P2P wireless establishing based on the assistance of the USB wired link between the first terminal and the second terminal, it is possible to implement the subsequent first terminal to divide the target data into a plurality of data blocks in the application layer, and to transmit the plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, and the embodiment of the present application does not specifically limit the manner of implementing establishing the USB wired link and the P2P wireless link in the first terminal and the second terminal.
The division of the target data into the plurality of data blocks described in the embodiment of the present application may be implemented at the application layer, because in the embodiment of the present application, the USB wired link and the P2P wireless link are used to implement parallel data transmission, and the bottom layer communication protocol followed by the USB wired link is different from the bottom layer communication protocol followed by the P2P wireless link, so that the target data may be uniformly divided into the plurality of data blocks at the application layer, and thus, it may be avoided that the data blocks are not distributed reasonably due to the different communication protocols adopted by the two links.
In specific application, when the application layer divides the block to be transmitted into a plurality of data blocks, the size of each data block may be related to the actual transmission capability of the USB wired link and the P2P wireless link.
The parallelism described in the embodiments of the present application may be used to mean that the USB wired link and the P2P wireless link jointly transmit the target data. The first terminal transmits a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, which may mean that the first terminal distributes the plurality of data blocks in the USB wired link and the P2P wireless link, respectively, and transmits the data blocks to the second terminal simultaneously by using the USB wired link and the P2P wireless link, so that the efficiency of data transmission may be improved.
It is understood that, in a specific application, when allocating data blocks to the USB wired link and the P2P wireless link, the data blocks can be allocated according to the actual situation of the USB wired link or the P2P wireless link, so that the data blocks can be transmitted faster.
By way of example, one particular implementation may be: the first terminal distributes a plurality of data blocks to the USB wired link and the P2P wireless link according to the bandwidth of the USB wired link and the bandwidth of the P2P wireless link, and sends the plurality of data blocks to the second terminal in parallel through the USB wired link and the P2P wireless link.
In the embodiment of the application, appropriate data can be allocated to the USB wired link and the P2P wireless link according to the bandwidth of the USB wired link and the bandwidth of the P2P wireless link, so that the problem of low transmission speed caused by the fact that the data volume is not adaptive to the bandwidth of each link can be solved. For example, the first terminal may measure, in real time, a time consumption of the USB wired link for transmitting data and a time consumption of the P2P wireless link for transmitting data, and dynamically allocate appropriate data to the USB wired link and the P2P wireless link according to the measured results, so that the bandwidth of each link can be used more optimally, and the transmission rate is further increased.
Optionally, a first buffer corresponding to the USB wired link and a second buffer corresponding to the P2P wireless link may be provided, where M data blocks matching the bandwidth of the USB wired link may be provided in the first buffer, and N data blocks matching the bandwidth of the P2P wireless link may be provided in the second buffer, where M and N are both natural numbers. When the data block in the first cache or the second cache is sent out, the unallocated data block in the plurality of data blocks is set in the first cache or the second cache in a supplementing way.
For example, the first buffer may include one or more first queues and the second buffer may include one or more second queues. The M data blocks in the first queue may follow a first-in first-out rule, or may implement other in and out rules based on the indication of a pointer or the like. The N data blocks in the second queue may follow a first-in first-out rule, or may implement other in and out rules based on the indication of a pointer or the like. Each data block may carry a sequence number, etc., and after receiving the data packets respectively sent by the USB wired link and the P2P wireless link, the second terminal may perform processing according to the sequence number, etc. of the data packets, and restore the data packets to obtain the target data in the first terminal.
It is understood that, considering the difference between the transmission rate of the USB wired link and the transmission rate of the P2P wireless link, the capacity of the first buffer and the capacity of the second buffer may be set differently, for example, more data blocks may be set in the buffer corresponding to the link with the faster transmission rate.
In the transmission process, if any cache has a data packet to send out, a new data packet is timely supplemented for the cache. If the data block in any queue in the first buffer or the second buffer is not sent for a long time, the data packet in the queue which does not send the data packet for a long time can be adjusted to the queue which sends the data packet at a high speed, so that the dynamic allocation in the transmission process is realized, the data packets with similar serial numbers can be sent to the second terminal as soon as possible for combined lamp processing, and the data transmission efficiency is improved.
If packet loss occurs in transmission, retransmission can be performed, and the like.
If the USB wired link fails, for example, the USB line is pulled out, etc., the data block sent in the USB wired link can be taken out from the USB wired link and sent to the second terminal by the P2P wireless link, so that the data can be ensured to be successfully transmitted from the first terminal to the second terminal.
If the P2P wireless link fails, for example, the P2P wireless link is closed, etc., the data block transmitted in the P2P wireless link can be taken out of the P2P wireless link and handed over to the USB wired link for transmission to the second terminal, so that the data can be guaranteed to be successfully transmitted from the first terminal to the second terminal.
For example, fig. 5 shows a schematic process diagram of dynamically allocating data, as shown in fig. 5, taking a USB wired link and a P2P wireless link as an example, which correspond to a session (session) i and a session j respectively, initially allocating n data blocks for session i, and allocating m data blocks for session j, where values of n and m may be determined according to an actual application scenario, and if it is detected that a time consumption t1 for transmitting n data blocks by session i is less than a time consumption t2 for transmitting m data blocks by session j exceeds a preset value (e.g., any value from 0.1 to 0.2), in subsequent allocation, the value of n may be increased. If the time t1 for transmitting n data blocks by the session i is detected to be greater than the time t2 for transmitting m data blocks by the session j, which exceeds the preset value, the value m can be increased in the subsequent distribution. It can be understood that if the difference between t1 and t2 is smaller than the preset value, the values of n and m may not be adjusted, which is not specifically limited in the embodiment of the present application.
Illustratively, FIG. 6 shows another process diagram for dynamically allocating data allocations. As shown in fig. 6, the USB wired link and the P2P wireless link correspond to session1 and session2, respectively. If transmission of the data block of the session1 fails, the failure information and the data block Identifier (ID) may be reported to a session manager, the session manager may count the number of times n of the transmission failure of the data block, and if n is less than a certain value, the session manager may continue to allocate the data block to the session 1. If n is greater than or equal to a certain value (e.g., 3, etc.), then the allocation of data for session1 is stopped and a data block for session1 is allocated to session 2. Further, the upper layer application may also be notified to reinitialize the link corresponding to the session1, and if the initialization is successful, it may be considered that the session1 reestablishes the connection, and the session1 is recovered to be normal, and the data block may be reallocated to the session 1.
In order to ensure the security of data transmission, in the embodiment of the present application, when the first terminal sends a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, authentication may also be performed. For example, the first terminal may receive a first authentication identifier sent by the second terminal using a USB wired link, and a second authentication identifier sent by the second terminal via a P2P wireless link; and in the case that the first authentication identifier and the second authentication identifier meet the authentication condition, transmitting a plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link.
The first authentication identifier and the second authentication identifier may be Random Numbers (RNs) or the like.
The verification condition may mean that the first verification identifier is the same as the second verification identifier, or the second verification identifier and the second verification identifier satisfy a certain association, and the like, which is not specifically limited in this embodiment of the application.
Fig. 7 is a schematic diagram illustrating a dual link authentication process. As shown in fig. 7, the second terminal may generate a Random Number (RN) 2 in the application program and transmit RN2 to the USB wired processing part and the P2P wireless processing part, respectively, and then RN2 may transmit to the USB wired processing part of the first terminal through the USB wired link and to the P2P wireless processing part of the first terminal through the P2P wireless link, respectively, and the first terminal may check whether the random number received through the USB wired link and the random number received through the P2P wireless link satisfy the authentication condition (e.g., whether they are the same) and consider the second terminal to check if the authentication condition is satisfied.
Adaptively, the first terminal may also generate RN1 and transmit it to the second terminal via the USB wired link and the P2P wireless link, respectively, and the second terminal checks whether the random number received via the USB wired link and the random number received via the P2P wireless link satisfy the verification condition based on the similar manner of the first terminal, and if the verification condition is satisfied, the first terminal checks.
It can be understood that in the verification of the first terminal or the second terminal, if the verification fails, the data transmission can be performed by using only the USB wired link or only the P2P wireless link, so that the data transmission can be ensured.
In data transmission, there are also problems of device heating and charging and discharging.
For example, in a USB link, a terminal as a master device generally charges a terminal as a slave device, so during data transmission, the power consumption of the master device is large, heat generation is severe, the efficiency of data transmission is affected, and the terminal with severe heat generation may start over-temperature protection to terminate data transmission.
In the embodiment of the application, roles of the first terminal and the second terminal may be detected, and if the first terminal performs data transmission with the second terminal as a slave device, charging between the USB links may be stopped. Or stopping charging between the USB links when detecting that the device temperature of the first terminal is higher than a first threshold (the first threshold may be determined according to an actual application scenario, and is, for example, any value from 38 degrees celsius to 42 degrees celsius, etc.).
For example, stopping the charging between the USB links may be closing the charging interface of the first terminal, and the like. The charging interface may be, for example, a VBUS interface as shown in fig. 8. So that the charging of the battery, screen or central processor of the first terminal can be switched off and the discharging of the second terminal can be reduced. Other pins for normal communication by using the USB, such as TX/RX pins for transmitting/receiving data of the USB3.x protocol, are not turned off, so that the data transmission process is not interrupted.
In a specific application, the first terminal may be a power supply device, such as a PC. The first terminal may also be a battery powered device, such as a mobile device like a mobile phone, tablet, etc. The second terminal may be a power supply device, such as a PC or the like. The second terminal may also be a battery powered device, such as a mobile device like a cell phone, tablet, etc.
One possible method for detecting that the first terminal or the second terminal is a power supply device or a battery supply device is as follows: the method comprises the steps that a channel used for transmitting messages between a first terminal and a second terminal is detected, the channel used for transmitting messages between a power supply device and a battery supply device, the channel used for transmitting messages between the power supply device and the power supply device, and the channel used for transmitting messages between the battery supply device and the battery supply device are different, the first terminal can judge that the second terminal is the power supply device or the battery supply device based on the channel used for transmitting messages between the first terminal and the second terminal, and the second terminal can judge that the first terminal is the power supply device or the battery supply device based on the channel used for transmitting messages between the second terminal and the second terminal.
If the first terminal and the second terminal are both power supply equipment, charging and discharging control for closing a charging interface of the first terminal and the like may not be performed.
If the first terminal is a battery power supply device, the second terminal is a power supply device, and the second terminal can be used as a discharging party to charge the first terminal, operations such as closing a charging interface of the first terminal and the like can be omitted.
If the first terminal and the second terminal are both battery power supply equipment, the charging interface of the terminal serving as the slave equipment can be closed, and the phenomenon that the electric quantity of the master equipment is consumed too fast and heat is generated due to charging and discharging is avoided.
If the first terminal and the second terminal are both battery-powered devices, such as a mobile phone, the electric quantity of the first terminal and the electric quantity of the second terminal may also be obtained, and if the electric quantity of the first terminal is smaller than an electric quantity threshold (the electric quantity threshold may be set according to an actual application scenario, for example, may be any value between 1% and 20%, and the like, and the embodiment of the present application is not limited), the charging direction may be set to charge the second terminal to the first terminal, or it may be understood that the first terminal is a device that receives charging, and the second terminal is a device that charges outwards, so that the first terminal may receive charging of the second terminal. For example, the first terminal may be set as a slave device, the second terminal may be set as a master device, and the like. So that the first terminal can have enough power for data transmission. In a possible implementation manner, when the first terminal receives the charge of the second terminal, the charge between the USB wired links may also be stopped, for example, the charging interface of the first terminal is closed, when the electric quantity of the first terminal is greater than a certain value or the electric quantity of the second terminal is lower than a certain value.
Or, if the electric quantity of the second terminal is less than the electric quantity threshold, the charging direction may be set to charge the first terminal to the second terminal, or it may be understood that the second terminal is a device receiving charging, and the first terminal is a device charging outward, so that the second terminal may receive charging of the first terminal. For example, the second terminal may be set as a slave device, the first terminal may be set as a master device, and the like. So that the second terminal can have sufficient power for data transmission. In a possible implementation manner, when the first terminal charges the second terminal, the charging between the USB wired links may also be stopped, for example, the charging interface of the first terminal is closed, when the electric quantity of the second terminal is greater than a certain value or the electric quantity of the first terminal is lower than a certain value.
Alternatively, the charging direction may be set to charge the second terminal to the first terminal when the power of the first terminal is less than or equal to a smaller power threshold (the smaller power threshold is relative to a larger power threshold, and the smaller power threshold may be set according to an actual application scenario, for example, may be any value between 1% and 20%, and the embodiment of the present application is not limited), and the second terminal device is greater than or equal to a higher power threshold (the larger power threshold is relative to a larger power threshold, and the larger power threshold may be set according to an actual application scenario, for example, may be any value between 50% and 100%, and the embodiment of the present application is not limited).
Or, when the electric quantity of the second terminal is smaller than or equal to the smaller electric quantity threshold value and the first terminal device is larger than or equal to the higher electric quantity threshold value, setting the charging direction to charge the first terminal to the second terminal.
In specific applications, the charging direction between the first terminal and the second terminal may also be flexibly set according to different application scenarios, which is not specifically limited in the embodiment of the present application.
In the process of data transmission between the first terminal and the second terminal, the systems of the first terminal and the second terminal are in a continuous wake-up working state, which may cause overheating of the systems, and measures such as reducing the running frequency of the CPU may be taken to limit the continuous rise of the temperature of the device.
Generally, if the device temperature of the first device is higher than 40 degrees celsius, measures such as reducing the operating frequency of the CPU are taken. Therefore, in the embodiment of the application, in a scenario where the first terminal and the second terminal perform data transmission, a temperature threshold to be reached for executing measures such as reducing the operating frequency of the CPU may be increased, where the temperature threshold is higher than a temperature set for limiting the operating frequency of the CPU when the first terminal does not perform data transmission. For example, the temperature threshold may be set to a value of about 43 degrees celsius, so that the condition for triggering the reduction of the operating frequency of the CPU is high, and thus the data transmission rate may be increased.
For example, the method for identifying the scenario of data transmission between the first terminal and the second terminal may be: identifying through whether foreground application is backup or clone application, or identifying through running state of background key data backup service; or by the data transmission status, etc., which is not specifically limited in this embodiment of the present application.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following embodiments may be implemented independently or in combination, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 9 is a flowchart illustrating a data transmission method according to an embodiment of the present application. As shown in fig. 9, the method includes:
s901: detecting a sharing operation; the sharing operation is used for transmitting target data.
S902: and establishing a USB wired link and a P2P wireless link with the second terminal based on the sharing operation.
S903: the target data is divided into a plurality of data blocks.
S904: and transmitting the plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link.
In this embodiment, the sharing operation may also be referred to as a sending operation or a transmitting operation, and the like, and is used to trigger transmission of the target data.
In a first possible application scenario, the user operation for data transmission may be: the user can be connected with the first terminal and the second terminal through a Type-C pair Type-C line, the user selects data to be transmitted at the first terminal and triggers to share the data to be transmitted, and data transmission is carried out between the first terminal and the second terminal.
Illustratively, the user connects the first terminal and the second terminal through a Type-C to Type-C line, the interface of the first terminal may be a user interface as shown in fig. 10, for example, the user interface of the first terminal may pop up a floating frame 31, in the floating frame 31, the user may select the purpose of the USB connection, and the user may select the USB connection for transmitting pictures or files through clicking or the like.
In a specific implementation, the transmission between the battery power supply device and the computer power supply device may be an MTP protocol, and when the battery power supply device is in wired connection with the computer power supply device, the user interface of fig. 10 may need to be displayed for a user to select a file to be transmitted. In a case that the first terminal and the second terminal are both battery-powered devices (e.g., mobile phones), an AOA protocol may be used, and when the user connects the first terminal and the second terminal through a Type-C to Type-C line, the first terminal may not pop up the user interface shown in fig. 10, which is not specifically limited in this embodiment of the present application.
For example, a user selects data to be transmitted at a first terminal and triggers to Share the data to be transmitted, the first terminal may obtain the data to be transmitted (e.g., one or more pictures, one or more files, or the like) selected by the user, and display a user interface as shown in fig. 11a, for example, the user may select a file to be transmitted, trigger a sharing control, display a mark "Huawei sharing (Share)" 41 of a sharing application program in the user interface of the first terminal, and the user may trigger a button for sending data in Huawei Share to implement sharing operation.
Then, in one possible implementation manner, based on the sharing operation, the first terminal may establish a P2P wireless link with the second terminal based on the manner of establishing the P2P wireless link with the second terminal, and display the user interface as shown in fig. 11 b. The progress of the file transfer may be displayed in the user interface shown in FIG. 11b, for example, a progress bar 43 is displayed in the icon of "Huawei Share".
The wireless identifier 44 and the wired identifier 45 can also be displayed in the user interface of fig. 11b, the wireless identifier 44 can be used to indicate whether the P2P wireless link is used in the current data transmission, and for example, whether the P2P wireless link is used in the current data transmission can be indicated by setting different background colors, font colors, fonts and the like in the wireless identifier 44. For example, when the background color of the wireless identifier 44 is green, it indicates that the P2P wireless link is currently being used for data transmission, and when the background color of the wireless identifier 44 is red, it indicates that the P2P wireless link is not currently being used for data transmission; alternatively, when the font of the wireless identifier 44 is a normal font, it indicates that the P2P wireless link is currently being used for data transmission, and when the font of the wireless identifier 44 is grayed, it indicates that the P2P wireless link is not currently being used for data transmission. The wired flag 45 may have different states, for example, whether the USB wired link is used in the current data transmission may be indicated by different background colors, font colors, fonts, or the like, and the wired flag 45 may be used to indicate whether the USB wired link is used in the current data transmission, and for example, whether the USB wired link is used in the current data transmission may be indicated by setting different background colors, font colors, fonts, or the like in the wired flag 45. For example, when the background color of the wired flag 45 is green, it indicates that the USB wired link is currently being used for data transmission, and when the background color of the wired flag 45 is red, it indicates that the USB wired link is not currently being used for data transmission; or, when the font of the wired identifier 45 is a normal font, it indicates that the USB wired link is currently used for data transmission, and when the font of the wired identifier 45 is grayed, it indicates that the USB wired link is not currently used for data transmission.
In one possible implementation, the wireless identifier 44 may be provided in the control, and the wired identifier 45 may be provided in the control. When a user triggers a control of the wireless identifier 44 by clicking, dragging, or the like, the transmission state of the P2P wireless link may be changed, for example, if the user currently uses the P2P wireless link to transmit data, and receives a trigger of the user on the wireless identifier 44, the P2P wireless link may be disconnected; alternatively, if the P2P wireless link is not currently being used to transmit data, the P2P wireless link may be opened upon receiving a user trigger to the wireless identity 44. When a user triggers the control of the wired identifier 45 through operations such as clicking, dragging and the like, the transmission state of the USB wired link can be changed, for example, if the USB wired link is currently used for transmitting data, the USB wired link can be disconnected when the user triggers the wired identifier 45; or, if the USB wired link is not currently used to transmit data, the USB wired link may be opened when the trigger of the user on the wired identifier 45 is received.
Also displayed in the user interface of fig. 11b may be a user identification 42 of the second terminal (which may include, for example, one or more of a user image, a nickname, a phone number, etc.), and a status of the data transfer (e.g., how many files have been sent, how many files have not been sent, etc.). Other content may also be displayed in the user interface, which is not specifically limited in this embodiment of the application. For the process that the first terminal divides the target data into a plurality of data blocks in the application layer and sends the plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, reference is made to the description in the foregoing embodiments, and details are not repeated here.
In another possible implementation manner, based on the sharing operation, the first terminal may display a user interface as shown in fig. 11 c; the user interface includes: one or more user identities, and a P2P mode available for each user identity; the user ID is the ID of the scanned end user, and the available P2P mode includes P2P wired and/or P2P wireless.
For example, as shown in fig. 11c, the user identifier 42 of the second terminal connected to the first terminal by wire may be displayed, and the P2P mode available to the second terminal is both P2P wireless and P2P wired, so that the identifier for indicating wired availability and the identifier for indicating wireless availability may be simultaneously displayed near the user identifier 42. And the first terminal scans the user identifications 46 of other devices which are nearby and can carry out wireless transmission, and if the available P2P mode of the user identifications 46 is P2P wireless, the identifications used for representing the wireless availability can be correspondingly displayed nearby the user identifications 46. The number of the user identifier of the other device may be multiple, and is similar to the display described above, and this is not particularly limited in this embodiment of the present application. The user can trigger the operation of the user identifier 42 in the user interface of fig. 11c, establish a USB wired link and a point-to-point P2P wireless link with the second terminal, and display the user interface as shown in fig. 11b, which will not be described herein.
In another possible implementation manner, based on the sharing operation, the first terminal may display a user interface as shown in fig. 11 d; the user interface includes: one or more user identities, and a P2P mode available for each user identity; the user ID is the ID of the scanned end user, and the available P2P mode includes P2P wired and/or P2P wireless.
For example, as shown in fig. 11d, a user identifier 42 of a second terminal connected to a first terminal by wire may be displayed, and a P2P mode available to the second terminal is both P2P wireless and P2P wired, and then an identifier indicating both wired and wireless availability may be displayed near the user identifier 42. And the first terminal scans the user identifications 46 of other devices which are nearby and can carry out wireless transmission, and if the available P2P mode of the user identifications 46 is P2P wireless, the identifications used for representing the wireless availability can be correspondingly displayed nearby the user identifications 46. The number of the user identifier of the other device may be multiple, and is similar to the display described above, and this is not particularly limited in this embodiment of the present application.
The user may trigger the operation of the user identifier 42 in the user interface of fig. 11d, and the first terminal further displays a user interface as shown in fig. 11e, which includes: a check control 471 for selecting P2P wireless transmission, a check control 472 for selecting P2P wired transmission, and a check control 473 for selecting P2P wireless and P2P wired simultaneous transmission; the user can select the pointing control 473 for selecting the simultaneous wireless transmission of P2P and the wired transmission of P2P, establish a USB wired link with the second terminal and a point-to-point P2P wireless link, and display the user interface as shown in FIG. 11b, which will not be described in detail herein.
In a second possible application scenario, the user operation for data transmission may be: the user selects the data to be transmitted at the first terminal, the user can connect the first terminal with the second terminal through a Type-C pair Type-C line, the user triggers and shares the data to be transmitted, and data transmission is carried out between the first terminal and the second terminal.
The user can select data to be transmitted in the first terminal based on a usual operation. For example, the user may select data to be transmitted using the usual "Huawei Share" triggering operation. Or, the user may open a "mobile phone cloning" application program (the application program may be used to implement a key switch) at the first terminal and the second terminal, respectively, and then select data to be transmitted.
The user connects the first terminal and the second terminal through a Type-C to Type-C line, and the interface of the first terminal may be a user interface as shown in fig. 10, or the first terminal may not pop up the user interface, which is not specifically limited in this embodiment of the application.
And the user triggers and shares the data to be transmitted. If the user selects the data to be transmitted by using the trigger operation of "Huawei Share", the first terminal may display the user interface shown in fig. 11 and perform the data transmission process as described above with respect to fig. 11, which is not described herein again. If the user selects the data to be transmitted by adopting the trigger operation of the 'cell phone clone' application program, any user interface conforming to the scene can be displayed, the first terminal can divide the target data into a plurality of data blocks in an application layer, and the plurality of data blocks are sent to the second terminal in parallel by utilizing the USB wired link and the P2P wireless link, which is not described herein again.
In a third specific application scenario, the user operation for data transmission may be: a user establishes a P2P wireless link between a first terminal and a second terminal by adopting a common P2P connection method, the user selects data to be transmitted at the first terminal, the user triggers and shares the data to be transmitted, the user can connect the first terminal with the second terminal through a Type-C to Type-C line, and the first terminal and the second terminal carry out data transmission.
For example, the user may search for the second terminal in the first terminal based on the general wireless P2P technology, establish a P2P wireless link with the second terminal, and select and transmit data to be transmitted based on the general P2P wireless link transmission method.
In the process, a user connects the first terminal with the second terminal through the transmission line, and establishes the USB wired link with the second terminal, then the first terminal establishes the USB wired link and the P2P wireless link with the second terminal, and further the first terminal can divide the remaining target data into a plurality of data blocks in the application layer, and send the plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link. The embodiment of the present application is not particularly limited to this.
In a fourth possible application scenario, the user operation for data transmission may be: the user can be connected with the first terminal and the second terminal through a Type-C pair Type-C line, the user starts an application (for example, a mobile phone cloning application) of a key switch in the first terminal and the second terminal, the user selects data to be transmitted at the first terminal and triggers to share the data to be transmitted, and data transmission is carried out between the first terminal and the second terminal.
For example, as shown in a of fig. 12, a user may start a cell phone cloning application in a first terminal, establish a P2P wireless connection with a second terminal based on a general cell phone cloning manner, and display a user interface as shown in fig. 12b in the first terminal, where a checkbox of an application capable of migration may be displayed in the user interface, for example, the checkbox may include a checkbox 51 of a picture, and the like, and the user clicks a control for starting migration, so as to implement a sharing operation on the checked data. Based on the sharing operation, the first terminal may establish a P2P wireless link and a USB wired link with the second terminal based on the above, and display a user interface as shown in fig. 12 c. A file transmission progress bar 55 may be displayed in the user interface shown in fig. 12 c.
The wireless identifier 53 and the wired identifier 54 may also be displayed in the user interface, the wireless identifier 53 may be used to indicate whether the P2P wireless link is used in the current data transmission, and for example, whether the P2P wireless link is used in the current data transmission may be indicated by setting a different background color, font style, or the like in the wireless identifier 53. For example, when the background color of the wireless identity 53 is green, it indicates that the P2P wireless link is currently being used for data transmission, and when the background color of the wireless identity 53 is red, it indicates that the P2P wireless link is not currently being used for data transmission; alternatively, when the font of the wireless identity 53 is a normal font, it indicates that the P2P wireless link is currently being used for data transmission, and when the font of the wireless identity 53 is grayed, it indicates that the P2P wireless link is not currently being used for data transmission. The wired flag 54 may have different states, for example, the wired flag 54 may indicate whether the USB wired link is used in the current data transmission by different background colors, font colors, fonts, etc. for example, the wired flag 54 may indicate whether the USB wired link is used in the current data transmission by setting different background colors, font colors, fonts, etc. in the wired flag 54. For example, when the background color of the wired flag 54 is green, it indicates that the USB wired link is currently being used for data transmission, and when the background color of the wired flag 54 is red, it indicates that the USB wired link is not currently being used for data transmission; or, when the font of the wired identifier 54 is a normal font, it indicates that the USB wired link is currently being used for data transmission, and when the font of the wired identifier 54 is grayed, it indicates that the USB wired link is not currently used for data transmission.
In one possible implementation, the wireless identifier 53 may be provided in the control, and the wired identifier 54 may be provided in the control. When a user triggers a control of the wireless identifier 53 through clicking, dragging and the like, the transmission state of the P2P wireless link can be changed, for example, if the user uses the P2P wireless link to transmit data currently, and the user triggers the wireless identifier 53, the P2P wireless link can be disconnected; alternatively, if the P2P wireless link is not currently being used to transmit data, the P2P wireless link may be opened when a user trigger for the wireless identity 53 is received. When a user triggers the control of the wired identifier 54 by clicking, dragging, or the like, the transmission state of the USB wired link may be changed, for example, if the USB wired link is currently used to transmit data, the USB wired link may be disconnected when the user triggers the wired identifier 54; alternatively, if the USB wired link is not currently being used to transmit data, the USB wired link may be opened when a user trigger to the wired identifier 54 is received.
The status of data transmission (e.g., how many files have been sent, how many files have not been sent, etc.) may also be displayed in the user interface, and a flag indicating that wired link transmission and wireless link transmission are used simultaneously may also be displayed in the user interface. Other content may also be displayed in the user interface, which is not specifically limited in this embodiment of the application. For the process that the first terminal divides the target data into a plurality of data blocks in the application layer and sends the plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, reference is made to the description in the foregoing embodiments, and details are not repeated here.
In a possible implementation mode, a user can connect a first terminal with a second terminal through a Type-C pair Type-C line, the user selects data to be transmitted at the first terminal and triggers to share the data to be transmitted, and data transmission is performed between the first terminal and the second terminal.
For example, a user interface shown as 13a may be displayed in the first terminal, where the user interface includes a file to be transmitted that is checked by a user, a user identifier 61 (which may include one or more of a user image, a nickname, a phone number, and the like) of a second terminal where the first terminal establishes a USB wired connection, a user identifier of another device that is discovered by the first terminal based on a wireless scan, and the like, in one possible implementation, in the user interface shown in fig. 13a, a data transmission manner that is used to identify an available data transmission manner between the user and the first terminal may also be displayed around the user identifier, and for example, a wired identifier 65 and a wireless identifier 66 may be displayed around the user identifier 61, and are used to identify that data transmission between the first terminal and the second terminal may use a USB wireless link, or a P2P wireless link; a wireless identity may be displayed around the user ID2 to identify the first terminal and the user ID2 may transmit data using the P2P wireless link. In case the first terminal transmits data to the second terminal, the user may trigger the user identification 61 into the user interface as shown in fig. 13 b.
The wireless identifier 62 and the wired identifier 63 can also be displayed in the user interface of fig. 13b, the wireless identifier 62 can be used to indicate whether the P2P wireless link is used in the current data transmission, and for example, whether the P2P wireless link is used in the current data transmission can be indicated by setting different background colors, font colors, fonts and the like in the wireless identifier 62. For example, when the background color of the wireless identifier 62 is green, it indicates that the P2P wireless link is currently being used for data transmission, and when the background color of the wireless identifier 62 is red, it indicates that the P2P wireless link is not currently being used for data transmission; or, when the font of the wireless identifier 62 is a normal font, it indicates that the P2P wireless link is currently being used for data transmission, and when the font of the wireless identifier 62 is grayed, it indicates that the P2P wireless link is not currently being used for data transmission. The wired flag 63 may have different states, for example, whether the USB wired link is used in the current data transmission may be indicated by different background colors, font colors, fonts, or the like, and the wired flag 63 may be used to indicate whether the USB wired link is used in the current data transmission. For example, when the background color of the wired identification 63 is green, it indicates that the USB wired link is currently being used for data transmission, and when the background color of the wired identification 63 is red, it indicates that the USB wired link is not currently being used for data transmission; or, when the font of the wired identifier 63 is a normal font, it indicates that the USB wired link is currently used for data transmission, and when the font of the wired identifier 63 is grayed, it indicates that the USB wired link is not currently used for data transmission.
In one possible implementation, the wireless identifier 62 may be provided in the control, and the wired identifier 63 may be provided in the control. When a user triggers a control of the wireless identifier 62 through clicking, dragging and the like, the transmission state of the P2P wireless link can be changed, for example, if the user uses the P2P wireless link to transmit data currently, and the user triggers the wireless identifier 62, the P2P wireless link can be disconnected; alternatively, if the P2P wireless link is not currently being used to transmit data, the P2P wireless link may be opened when a user trigger for the wireless identity 62 is received. When a user triggers the control of the wired identification 63 through operations such as clicking, dragging and the like, the transmission state of the USB wired link can be changed, for example, if the USB wired link is currently used for transmitting data, the USB wired link can be disconnected when the user triggers the wired identification 63; or, if the USB wired link is not currently used to transmit data, the USB wired link may be opened when the trigger of the user on the wired identifier 63 is received.
The user interface of fig. 13b may also display the user identification 61 of the second terminal, as well as the status of the data transfer (e.g. how many files have been sent, how many files have not been sent, etc.), a progress bar 64, etc. Other content may also be displayed in the user interface, which is not specifically limited in this embodiment of the application. For the process that the first terminal divides the target data into a plurality of data blocks in the application layer and sends the plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, reference is made to the description in the foregoing embodiments, and details are not repeated here.
In a possible implementation manner, during the data transmission between the first terminal and the second terminal, the first terminal may further detect whether the USB wired link and the P2P wireless link between the first terminal and the second terminal are available, and adapt to modify the states of the wireless identifier 62 and the wired identifier 63 in fig. 13b according to whether the USB wired link and the P2P wireless link are available. For example, in the data transmission process, initially, the USB wired link is available, the background color of the wired identification 63 is green, if the USB wired link is abnormal or disconnected, the P2P wireless link may be used for transmission, and the background color of the wired identification 63 is set to red, if the USB wired link is recovered, the background color of the wired identification 63 may be set to green again, and data is allocated to the USB wired link again; or, in the data transmission process, initially, the P2P wireless link is available, the background color of the wireless identifier 62 is green, if the P2P wireless link is abnormal or disconnected, the USB wired link can be used for transmission, and the background color of the wireless identifier 62 is set to red, if the P2P wireless link is recovered, the background color of the wireless identifier 62 can be set to green again, and data is allocated to the P2P wireless link again. So that the user can learn the specific link in the user interface on which the data transfer is to take place.
It can be understood that the data transmission method according to the embodiment of the present application may also be applied to other application scenarios according to actual requirements, because in the embodiment of the present application, the first terminal and the second terminal may transmit data in parallel by using the USB wired link and the P2P wireless link, and the transmission efficiency is high.
In a possible implementation manner, before the first terminal transmits the data to the second terminal, basic information and preview data of the target data may also be sent to the second terminal, where the basic information may include a size, content, and the like of the data, and the preview data may be a part of thumbnail content of the data and the like. If the second terminal can receive the basic information and the preview data and can send a receiving response message for identifying successful reception of the basic information and the preview data, the first terminal can send the target data to the second terminal through the USB wired link and the P2P wireless link, so that it can be further ensured that the data can be successfully sent to the second terminal.
Illustratively, fig. 14 shows a schematic diagram of a data transmission process. As shown in fig. 14, the first terminal is taken as a master device, and the second terminal is taken as a slave device. The process of the first terminal transmitting data to the second terminal may include:
the first terminal and the second terminal exchange state information of their own P2P wireless channel and state information of their own P2P wired channel with each other by using their respective P2P wireless control modules, and determine that both terminals have functions of a P2P wired link and a P2P wireless link.
The P2P wired links (for example, USB channels) of the first terminal and the second terminal perform link initialization, negotiate role information of both sides, and determine link information such as interfaces (interfaces), functions (functions), end points (endpoints) and the like of the respective USB ports.
The first terminal and the second terminal exchange session (session) IDs of both parties using their respective P2P wireless links.
The first terminal sends the basic information of the file, the preview data and other contents to the second terminal.
The second terminal confirms the reception of the data and may transmit a response message.
The first terminal determines the number of streams and port number of the P2P wireless link to the second terminal by using respective P2P wireless control module negotiation. And implementing bidirectional authentication based on RN1 and RN 2.
After the first terminal passes the bidirectional authentication to the second terminal, the data is transmitted to the second terminal in parallel through the P2P wired link and the P2P wireless link.
After the data is successfully sent and received, the first terminal informs the second terminal of the upper layer application by using the respective P2P wireless control module, and prompts the user that the file transmission is finished.
In summary, in the embodiment of the present application, the first terminal may establish a USB wired link and a P2P wireless link between the first terminal and the second terminal based on the sharing operation of the target data by the user, divide the target data into a plurality of data blocks at the application layer, and send the plurality of data blocks to the second terminal in parallel by using the USB wired link and the P2P wireless link, because the data blocks are sent in parallel by using the USB wired link and the P2P wireless link, efficient data transmission can be achieved.
On the basis of the embodiment corresponding to fig. 9, in the process of data transmission, a suitable P2P link may also be flexibly selected according to the availability of the P2P link between the first terminal and the second terminal. Exemplarily, fig. 15 shows a schematic flow chart of a data transmission method according to an embodiment of the present application. As shown in fig. 15, the method includes:
s1301: the first terminal determines available P2P links with the second terminal, the available P2P links including at least one of: a P2P wired link or a P2P wireless link.
During the data transmission process between the first terminal and the second terminal, the first terminal may detect an available P2P link with the second terminal, and confirm whether the first terminal and the second terminal are capable of P2P wireless communication or P2P wired communication.
Illustratively, the first terminal may communicate with the second terminal based on a cellular network. For example, the second terminal may notify the first terminal of the P2P communication supported by the second terminal through a session message or the like, and the first terminal confirms the available P2P link with the second terminal in combination with the P2P communication supported by the first terminal.
Alternatively, the first terminal may confirm the available P2P link with the second terminal based on the user's selection. For example, a user interface may be provided in the first terminal or the second terminal, the user interface may include possible P2P communication manners of the first terminal and the second terminal, and the user may select a P2P link to be used between the first terminal and the second terminal in the user interface according to the user's own needs.
Alternatively, the first terminal device may determine an available P2P link with the second terminal based on the USB protocol or the WIFI-P2P protocol.
For example, in the wired transmission system using the network cable, it is possible to confirm whether the IP address settings of the first terminal and the second terminal are correct or not, and whether the message can reach the other party or not.
For a wireless channel using P2P, the first terminal and the second terminal may negotiate a Port number and a Stream number (Stream Num) required for wireless communication to establish a P2P wireless link.
For the USB link, the first terminal and the second terminal may negotiate using AOA or MTP protocol, determine port information of the USB link of the first terminal and the second terminal, and obtain whether the opposite terminal supports the data transmission function of the USB.
S1302: the first terminal sends data of a target application to the second terminal over the available P2P link.
In the embodiment of the present application, the available P2P link between the first terminal and the second terminal may include only a P2P wired link, only a P2P wireless link, or both a P2P wired link and a P2P wireless link, according to an actual application scenario.
The target application may be an application selected by the user for transmitting data, and may be, for example, a Huawei Share application or any other application capable of being used for P2P transmission, which is not specifically limited in this embodiment of the present invention.
The first terminal may be adapted to transmit selected data of the target application to the second terminal via a P2P wired link, a P2P wireless link, or a P2P wired link and a P2P wireless link in parallel. Since the P2P link between the first terminal and the second terminal can be determined according to the current application scenario, the embodiments of the present application can implement flexible and efficient data transmission through the P2P link suitable for the current application scenario.
In one possible implementation, the determining, by the first terminal, an available point-to-point P2P link with the second terminal includes: in the case where a P2P wired link and a P2P wireless link exist between the first terminal and the second terminal, the first terminal determines that the available P2P links include a P2P wired link and a P2P wireless link; in the event that there is only a P2P wired link between the first terminal and the second terminal, the first terminal determines that the available P2P link includes only a P2P wired link; in the event that there is only a P2P wireless link between the first terminal and the second terminal, the first terminal determines that the available P2P link includes only a P2P wireless link.
In the actual usage scenario of P2P data transmission, the following situations may be encountered: in the first case, no wired medium is carried (e.g., Type-c versus Type-c OTG line), so the data transmission options for the first and second terminals use a P2P wireless link. In the second case, where the first terminal or the second terminal is low on power, the P2P wired link is selected for power consumption considerations.
The first terminal may automatically perceive whether a wired link or a wireless link is available upon starting initialization. For the first case, there is no OTG line connection between the first terminal and the second terminal, and the first terminal device may confirm that the available P2P link is a P2P wireless link. For the second case, the first terminal may confirm that the available P2P link is a P2P wired link.
With sufficient power at the first terminal or the second terminal and the presence of a wired connection, it may be confirmed that the available P2P links include a P2P wired link and a P2P wireless link.
In this way, the first terminal can flexibly determine the available P2P link with the second terminal according to the actual application scenario.
In another possible implementation, the determining, by the first terminal, an available point-to-point P2P link with the second terminal includes: in the case that a P2P wired link and a P2P wireless link exist between the first terminal and the second terminal, the first terminal displays a link selection interface; the first terminal receives a selection signal input by a user through the link selection interface, wherein the selection signal is used for indicating at least one of communication using a P2P wired link and a P2P wireless link; the first terminal determines available P2P links including a P2P wired link and/or a P2P wireless link according to the selection signal.
In the embodiment of the application, in the case that a P2P wired link and a P2P wireless link exist between the first terminal and the second terminal, in order to meet the user requirement as much as possible, a link selection interface may be displayed on the first terminal, so that the user may select a required transmission mode in the link selection interface.
In another possible implementation, the determining, by the first terminal, an available point-to-point P2P link with the second terminal includes: in the case where there is a P2P wired link and a P2P wireless link between the first terminal and the second terminal, the first terminal is based on one or more of the following information: the data volume of the target data in the target application, the channel state of the P2P wired link and the channel state of the P2P wireless link, determining whether the P2P wired link and the P2P wireless link are available; in the event that both a P2P wired link and a P2P wireless link are available, the first terminal determines that the available P2P links include a P2P wired link and a P2P wireless link; in the event that only a P2P wired link is available, the first terminal determines that the available P2P link includes only a P2P wired link; in the case where only the P2P wireless link is available, the first terminal determines that the available P2P link includes only the P2P wireless link.
In the embodiment of the application, in the case that a P2P wired link and a P2P wireless link exist between the first terminal and the second terminal, the amount of data that can be carried by the P2P wired link or the P2P wireless link, and the channel state of the P2P wired link or the P2P wireless link may be different, so that a scheme capable of efficiently transmitting data may be selected in further combination with the data amount of the target data, the channel state of the P2P wireless link, and the channel state of the P2P wired link.
For example, if the P2P wireless link between the first terminal and the second terminal is poor in signal and a transmission error may occur in the subsequent data transmission, the P2P wireless link may be considered as unavailable, and the first terminal determines that the available P2P link only includes the P2P wired link.
Or, if a USB cable is inserted between the first terminal and the second terminal, but the USB link fails to initialize, and a transmission error may occur in subsequent data transmission, the P2P wired link may be considered to be unavailable, and the first terminal determines that the available P2P link only includes the P2P wireless link.
Or, the amount of data to be transmitted between the first terminal and the second terminal is small, and faster transmission can be achieved only through the P2P wired link or only through the P2P wireless link, and then only the P2P wired link or only the P2P wireless link can be selected as an available link. The embodiment of the present application is not particularly limited to this.
In practice, in the current P2P wireless transmission, such as WiFi-P2P with 5GHz, the highest rate is 80MB/S, and the power consumption is about 250 mA. The highest file transmission rate of the Bluetooth is 200KB/s, and the power consumption is about 30 mA. The data transmission is carried out by utilizing a wired USB channel, the speed is about 160MB/S, and the power consumption of the USB module is about 1500mA under the condition that the charging and discharging are not realized. In the scene of the flexible selection of the P2P wired link and the P2P wireless link provided by the embodiment of the application, the highest rate can reach 230MB/S, the transmission rate is effectively improved, and the power consumption of the USB module is about 55mA and is far less than the power consumption caused by the traditional wired USB transmission.
In the case of dividing each functional module by corresponding functions, as shown in fig. 16, a schematic diagram of a possible structure of a data transmission device provided in the embodiment of the present application is shown, where the electronic device includes: a USB control module 1401, a processing module 1402 and a sending module 1403.
The USB control module 1401 is configured to support the data transmission apparatus to perform the steps related to the USB in the foregoing embodiments, for example, the operation of assisting in establishing the USB wired link in S902 or other processes of the technologies described in the embodiments of the present application may be performed.
A processing module 1402, configured to enable the data transmission apparatus to perform the operations in S901, S902, and S903 in the foregoing method embodiments, or other processes of the technology described in the embodiments of the present application.
A sending module 1403, configured to enable the data transmission apparatus to perform the operation in S904 in the foregoing embodiment or other processes of the technology described in the embodiment of the present application.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
Of course, the data transmission device includes, but is not limited to, the above listed unit modules. In addition, the functions that can be specifically realized by the functional units also include, but are not limited to, the functions corresponding to the method steps described in the above examples, and for the detailed description of other units of the electronic device, reference may be made to the detailed description of the corresponding method steps, which is not described herein again in this embodiment of the present application.
In the case of an integrated unit, the electronic device involved in the above embodiments may include: the device comprises a processing module, a storage module and a communication module. And the storage module is used for storing the program codes and the data of the electronic equipment. The communication module is used for supporting the communication between the electronic equipment and other network entities so as to realize the functions of communication, data interaction, Internet access and the like of the electronic equipment.
The processing module is used for controlling and managing the action of the electronic equipment. The processing module may be a processor or a controller. The communication module may be a transceiver, an RF circuit or a communication interface, etc. The storage module may be a memory.
Further, the electronic device may further include an input module and a display module. The display module may be a screen or a display. The input module may be a touch screen, a voice input device, or a fingerprint sensor, etc.
As shown in fig. 17, a schematic diagram illustrating still another possible structure of an electronic device provided in the embodiment of the present application is shown, including: one or more processors 1501, memory 1502, transceiver 1503, and interface circuit 1504; the various devices described above may communicate via one or more communication buses 1506.
Wherein the one or more computer programs are 1505 stored in the memory 1502 and configured to be executed by the one or more processors 1501; the one or more computer programs 1505 include instructions for performing the method of any of the steps described above. Of course, electronic devices include, but are not limited to, the above listed devices, for example, the above electronic devices may also include radio frequency circuits, positioning devices, sensors, and the like.
Embodiments of the present application also provide a computer storage medium, which includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device is caused to perform the method according to any of the steps described above.
Embodiments of the present application also provide a computer program product, which when run on a computer causes the computer to perform the method of any of the above steps.
The embodiment of the application also provides a device which has a function of realizing the behavior of the electronic equipment in the methods. The above functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions.
In addition, the electronic device, the computer storage medium, the computer program product, or the apparatus provided in the embodiments of the present application are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer storage medium, the computer program product, or the apparatus can refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, 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 units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or wholly or partially embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (32)

1.一种数据传输方法,其特征在于,应用于第一终端,包括:1. a data transmission method, is characterized in that, is applied to the first terminal, comprises: 检测分享操作;所述分享操作用于发送目标数据;Detecting a sharing operation; the sharing operation is used to send target data; 基于所述分享操作,与第二终端建立通用串行总线USB有线链路和点对点P2P无线链路;Based on the sharing operation, establish a universal serial bus (USB) wired link and a point-to-point P2P wireless link with the second terminal; 将所述目标数据分为多个数据块;dividing the target data into a plurality of data blocks; 利用所述USB有线链路和所述P2P无线链路并行的向所述第二终端发送所述多个数据块;所述并行用于表示所述USB有线链路和所述P2P无线链路共同传输所述目标数据。The multiple data blocks are sent to the second terminal in parallel by using the USB wired link and the P2P wireless link; the parallel is used to indicate that the USB wired link and the P2P wireless link are common The target data is transmitted. 2.根据权利要求1所述的方法,其特征在于,所述与第二终端建立USB有线链路和P2P无线链路,包括:2. The method according to claim 1, wherein the establishing a USB wired link and a P2P wireless link with the second terminal comprises: 响应于所述第一终端与所述第二终端之间的USB接口的有线连接操作,建立与所述第二终端之间的USB有线链路;In response to a wired connection operation of the USB interface between the first terminal and the second terminal, establishing a USB wired link with the second terminal; 利用所述USB有线链路建立与所述第二终端之间的P2P无线链路。Using the USB wired link to establish a P2P wireless link with the second terminal. 3.根据权利要求2所述的方法,其特征在于,所述利用所述USB有线链路建立与所述第二终端之间的P2P无线链路,包括:3. The method according to claim 2, wherein the establishing a P2P wireless link with the second terminal by using the USB wired link comprises: 利用所述USB有线链路向所述第二终端发送P2P无线链路建立请求;Send a P2P wireless link establishment request to the second terminal by using the USB wired link; 在接收到来自所述第二终端的同意建立P2P无线链路的消息的情况下,建立与所述第二终端之间的P2P无线链路。In the case of receiving a message from the second terminal agreeing to establish a P2P wireless link, a P2P wireless link with the second terminal is established. 4.根据权利要求1-3任一项所述的方法,其特征在于,所述利用所述USB有线链路和所述P2P无线链路并行的向所述第二终端发送所述一个或多个数据块,包括:4. The method according to any one of claims 1-3, wherein the sending the one or more data to the second terminal in parallel by using the USB wired link and the P2P wireless link data blocks, including: 在第一缓存中设置与所述USB有线链路的带宽匹配的M个数据块;M为自然数;M data blocks matching the bandwidth of the USB wired link are set in the first cache; M is a natural number; 在第二缓存中设置与所述P2P无线链路的带宽匹配的N个数据块;N为自然数;N data blocks matching the bandwidth of the P2P wireless link are set in the second cache; N is a natural number; 在所述第一缓存或所述第二缓存中的数据块发出的情况下,向所述第一缓存或所述第二缓存中补充设置所述多个数据块中未分配的数据块。When the data blocks in the first cache or the second cache are sent out, the unallocated data blocks in the plurality of data blocks are supplementarily set to the first cache or the second cache. 5.根据权利要求1-4任一项所述的方法,其特征在于,所述利用所述USB有线链路和所述P2P无线链路并行的向所述第二终端发送所述一个或多个数据块,包括:5. The method according to any one of claims 1-4, wherein the sending the one or more data to the second terminal in parallel by using the USB wired link and the P2P wireless link data blocks, including: 在所述USB有线链路传输数据失败的情况下,将所述USB有线链路中发送的数据块通过所述P2P无线链路发送给所述第二终端;或者,In the case that the data transmission on the USB wired link fails, send the data block sent in the USB wired link to the second terminal through the P2P wireless link; or, 在所述P2P无线链路传输数据失败的情况下,将所述P2P无线链路中发送的数据块通过所述USB有线链路发送给所述第二终端。In the case that the P2P wireless link fails to transmit data, the data block sent in the P2P wireless link is sent to the second terminal through the USB wired link. 6.根据权利要求5所述的方法,其特征在于,所述在所述USB有线链路传输数据失败的情况下,将所述USB有线链路中发送的数据块通过所述P2P无线链路发送给所述第二终端,包括:6 . The method according to claim 5 , wherein, in the case that the data transmission of the USB wired link fails, the data block sent in the USB wired link is passed through the P2P wireless link. 7 . sent to the second terminal, including: 在检测到所述USB有线链路中超出第一时间阈值没有成功发送数据块,或所述USB有线链路断开的情况下,将所述USB有线链路中发送的数据块取出,并将取出的数据块通过所述P2P无线链路发送给所述第二终端;When it is detected that the USB wired link fails to send a data block beyond the first time threshold, or the USB wired link is disconnected, the data block sent in the USB wired link is taken out, and the sending the extracted data block to the second terminal through the P2P wireless link; 或者,在所述P2P无线链路传输数据失败的情况下,将所述P2P无线链路中发送的数据块通过所述USB有线链路发送给所述第二终端,包括:Or, in the case that the P2P wireless link fails to transmit data, sending the data block sent in the P2P wireless link to the second terminal through the USB wired link, including: 在检测到所述P2P无线链路中超出第二时间阈值没有成功发送数据块,或所述P2P无线链路断开的情况下,将所述P2P无线链路中发送的数据块取出,并将取出的数据块通过所述USB有线链路发送给所述第二终端。When it is detected that the P2P wireless link exceeds the second time threshold and the data block is not successfully sent, or the P2P wireless link is disconnected, the data block sent in the P2P wireless link is taken out, and the The retrieved data block is sent to the second terminal through the USB wired link. 7.根据权利要求1-6任一项所述的方法,其特征在于,所述利用所述USB有线链路和所述P2P无线链路并行的向所述第二终端发送所述多个数据块,包括:7. The method according to any one of claims 1-6, wherein the multiple data are sent to the second terminal in parallel by using the USB wired link and the P2P wireless link blocks, including: 接收所述第二终端利用所述USB有线链路发送的第一验证标识,以及所述第二终端通过所述P2P无线链路发送的第二验证标识;receiving a first verification identifier sent by the second terminal using the USB wired link, and a second verification identifier sent by the second terminal through the P2P wireless link; 在所述第一验证标识和所述第二验证标识满足验证条件的情况下,利用所述USB有线链路和所述P2P无线链路并行的向所述第二终端发送所述多个数据块。In the case that the first verification identifier and the second verification identifier satisfy the verification condition, the multiple data blocks are sent to the second terminal in parallel by using the USB wired link and the P2P wireless link . 8.根据权利要求1-7任一项所述的方法,其特征在于,还包括:8. The method according to any one of claims 1-7, further comprising: 获取所述第一终端与所述第二终端在所述P2P无线链路传输中的角色;acquiring the roles of the first terminal and the second terminal in the P2P wireless link transmission; 在所述第一终端向所述第二终端发送数据的能力小于所述第二终端向所述第一终端发送数据的能力的情况下,将所述第一终端与所述第二终端交换角色。In the case that the capability of the first terminal to send data to the second terminal is smaller than the capability of the second terminal to send data to the first terminal, the first terminal and the second terminal are exchanged for roles . 9.根据权利要求1-8任一项所述的方法,其特征在于,还包括:9. The method according to any one of claims 1-8, further comprising: 停止所述USB有线链路之间的充电。Stop charging between the USB wired links. 10.根据权利要求1-9任一项所述的方法,其特征在于,还包括:10. The method according to any one of claims 1-9, characterized in that, further comprising: 在所述第一终端为电池供电设备的情况下,获取所述第一终端的设备温度;In the case that the first terminal is a battery-powered device, acquiring the device temperature of the first terminal; 在所述第一终端的设备温度高于第一阈值的情况下,停止所述USB有线链路之间的充电。In the case that the temperature of the device of the first terminal is higher than the first threshold, the charging between the USB wired links is stopped. 11.根据权利要求1-10任一项所述的方法,其特征在于,还包括:11. The method according to any one of claims 1-10, further comprising: 检测到所述第一终端的电量小于电量阈值的情况下,设置充电方向为所述第二终端向所述第一终端充电。When it is detected that the power of the first terminal is less than the power threshold, the charging direction is set so that the second terminal charges the first terminal. 12.根据权利要求1-11任一项所述的方法,其特征在于,还包括:12. The method according to any one of claims 1-11, further comprising: 在所述第一终端的设备温度高度第二阈值的情况下,降低所述第一终端的中央处理器CPU运行频率;其中,所述第二阈值高于所述第一终端未进行数据传输时的限制CPU运行频率所设置的温度。In the case where the device temperature of the first terminal is higher than the second threshold, the operating frequency of the central processing unit of the first terminal is reduced; wherein the second threshold is higher than when the first terminal does not transmit data The temperature set by the limit CPU operating frequency. 13.根据权利要求1-12任一项所述的方法,其特征在于,所述基于所述分享操作,与第二终端建立通用串行总线USB有线链路和点对点P2P无线链路,包括:13. The method according to any one of claims 1-12, wherein the establishing a universal serial bus (USB) wired link and a point-to-point P2P wireless link with the second terminal based on the sharing operation comprises: 基于所述分享操作,显示第一用户界面;所述第一用户界面中包括:一个或多个用户标识,以及各所述用户标识可用的P2P方式;所述用户标识为扫描得到的终端用户的标识,所述可用的P2P方式包括P2P有线和/或P2P无线;Based on the sharing operation, a first user interface is displayed; the first user interface includes: one or more user IDs, and P2P modes available for each of the user IDs; the user ID is the scanned terminal user's ID. identifier, the available P2P methods include P2P wired and/or P2P wireless; 在所述第一用户界面中接收到对所述第二终端设备的用户标识的触发操作,且所述第二终端设备的用户标识可用的P2P方式为P2P有线和P2P无线的情况下,与所述第二终端建立通用串行总线USB有线链路和点对点P2P无线链路。When a triggering operation for the user identity of the second terminal device is received in the first user interface, and the P2P modes available for the user identity of the second terminal device are P2P wired and P2P wireless, the same The second terminal establishes a universal serial bus (USB) wired link and a point-to-point P2P wireless link. 14.根据权利要求13所述的方法,其特征在于,在所述第一用户界面中接收到对所述第二终端设备的用户标识的触发操作,且所述第二终端设备的用户标识可用的P2P方式为P2P有线和P2P无线的情况下,与所述第二终端建立通用串行总线USB有线链路和点对点P2P无线链路,包括:14 . The method according to claim 13 , wherein a trigger operation for the user identity of the second terminal device is received in the first user interface, and the user identity of the second terminal device is available. 15 . In the case where the P2P mode is P2P wired and P2P wireless, establishing a USB wired link and a point-to-point P2P wireless link with the second terminal, including: 在所述第一用户界面中接收到对所述第二终端设备的用户标识的触发操作;receiving, in the first user interface, a triggering operation for the user identity of the second terminal device; 显示第二用户界面,所述第二用户界面包括:用于选择P2P无线传输的勾选控件、用于选择P2P有线传输的勾选控件,以及用于选择P2P无线和P2P有线同时传输的勾选控件;A second user interface is displayed, the second user interface includes: a check control for selecting P2P wireless transmission, a check control for selecting P2P wired transmission, and a check for selecting P2P wireless and P2P wired transmission simultaneously control; 在所述第二用户界面中接收对所述用于选择P2P无线和P2P有线同时传输的勾选控件的勾选操作,与所述第二终端建立通用串行总线USB有线链路和P2P无线链路。receiving, in the second user interface, a check operation for the check control for selecting simultaneous P2P wireless and P2P wired transmission, and establishing a USB wired link and a P2P wireless link with the second terminal road. 15.根据权利要求1-14任一项所述的方法,其特征在于,还包括:15. The method according to any one of claims 1-14, further comprising: 显示第三用户界面,所述第三用户界面包括用于指示USB有线链路的控件和用于指示P2P无线链路的控件;displaying a third user interface, the third user interface includes a control for indicating a USB wired link and a control for indicating a P2P wireless link; 在检测到对所述用于指示USB有线链路的控件的触发操作的情况下,断开或开启USB有线链路的传输;Disconnecting or starting the transmission of the USB wired link in the case of detecting the triggering operation of the control for indicating the USB wired link; 或者,在检测到对所述用于指示P2P无线链路的控件的触发操作的情况下,断开或开启P2P无线链路的传输。Alternatively, when a triggering operation of the control for indicating the P2P wireless link is detected, the transmission of the P2P wireless link is disconnected or turned on. 16.一种数据传输装置,其特征在于,应用于第一终端,包括:处理模块、USB控制模块和发送模块;16. A data transmission device, characterized in that, applied to a first terminal, comprising: a processing module, a USB control module and a sending module; 所述处理模块,用于检测分享操作;所述分享操作用于传输目标数据;The processing module is used to detect a sharing operation; the sharing operation is used to transmit target data; 所述处理模块,还用于基于所述分享操作,控制所述USB控制模块与第二终端建立通用串行总线USB有线链路和点对点P2P无线链路;The processing module is further configured to control the USB control module to establish a USB wired link and a point-to-point P2P wireless link with the second terminal based on the sharing operation; 所述处理模块,还用于将所述目标数据分为多个数据块;The processing module is further configured to divide the target data into a plurality of data blocks; 所述发送模块,还用于利用所述USB有线链路和所述P2P无线链路并行的向所述第二终端发送所述多个数据块;所述并行用于表示所述USB有线链路和所述P2P无线链路共同传输所述目标数据。The sending module is further configured to use the USB wired link and the P2P wireless link to send the multiple data blocks to the second terminal in parallel; the parallel is used to represent the USB wired link The target data is transmitted together with the P2P wireless link. 17.根据权利要求16所述的装置,其特征在于,所述处理模块,具体用于:17. The apparatus according to claim 16, wherein the processing module is specifically configured to: 响应于所述第一终端与所述第二终端之间的USB接口的有线连接操作,控制所述USB控制模块建立与所述第二终端之间的USB有线链路;以及利用所述USB有线链路建立与所述第二终端之间的P2P无线链路。In response to a wired connection operation of the USB interface between the first terminal and the second terminal, controlling the USB control module to establish a USB wired link with the second terminal; and utilizing the USB wired connection The link establishes a P2P wireless link with the second terminal. 18.根据权利要求17所述的装置,其特征在于,还包括接收模块;18. The apparatus of claim 17, further comprising a receiving module; 所述发送模块,还用于利用所述USB有线链路向所述第二终端发送P2P无线链路建立请求;The sending module is further configured to send a P2P wireless link establishment request to the second terminal by using the USB wired link; 所述处理模块,具体用于在所述接收模块接收到来自所述第二终端的同意建立P2P无线链路的消息的情况下,建立与所述第二终端之间的P2P无线链路。The processing module is specifically configured to establish a P2P wireless link with the second terminal when the receiving module receives a message from the second terminal for agreeing to establish a P2P wireless link. 19.根据权利要求16-18任一项所述的装置,其特征在于,所述处理模块,具体用于:19. The device according to any one of claims 16-18, wherein the processing module is specifically configured to: 在第一缓存中设置与所述USB有线链路的带宽匹配的M个数据块;M为自然数;M data blocks matching the bandwidth of the USB wired link are set in the first cache; M is a natural number; 在第二缓存中设置与所述P2P无线链路的带宽匹配的N个数据块;N为自然数;N data blocks matching the bandwidth of the P2P wireless link are set in the second cache; N is a natural number; 在所述第一缓存或所述第二缓存中的数据块发出时,向所述第一缓存或所述第二缓存中补充设置所述多个数据块中未分配的数据块。When the data blocks in the first cache or the second cache are sent out, the unallocated data blocks in the plurality of data blocks are supplemented and set in the first cache or the second cache. 20.根据权利要求16-19任一项所述的装置,其特征在于,所述发送模块具体用于:20. The device according to any one of claims 16-19, wherein the sending module is specifically configured to: 在所述USB有线链路传输数据失败的情况下,将所述USB有线链路中发送的数据块通过所述P2P无线链路发送给所述第二终端;或者In the case that the data transmission through the USB wired link fails, send the data block sent in the USB wired link to the second terminal through the P2P wireless link; or 在所述P2P无线链路传输数据失败的情况下,将所述P2P无线链路中发送的数据块通过所述USB有线链路发送给所述第二终端。In the case that the P2P wireless link fails to transmit data, the data block sent in the P2P wireless link is sent to the second terminal through the USB wired link. 21.根据权利要求20所述的装置,其特征在于,所述发送模块具体用于:21. The device according to claim 20, wherein the sending module is specifically configured to: 在检测到所述USB有线链路中超出第一时间阈值没有成功发送数据块,或所述USB有线链路断开的情况下,将所述USB有线链路中发送的数据块取出,并将取出的数据块通过所述P2P无线链路发送给所述第二终端;或者,When it is detected that the USB wired link fails to send a data block beyond the first time threshold, or the USB wired link is disconnected, the data block sent in the USB wired link is taken out, and the sending the retrieved data block to the second terminal through the P2P wireless link; or, 在检测到所述P2P无线链路中超出第二时间阈值没有成功发送数据块,或所述P2P无线链路断开的情况下,将所述P2P无线链路中发送的数据块取出,并将取出的数据块通过所述USB有线链路发送给所述第二终端。When it is detected that the P2P wireless link exceeds the second time threshold and the data block is not successfully sent, or the P2P wireless link is disconnected, the data block sent in the P2P wireless link is taken out, and the The retrieved data block is sent to the second terminal through the USB wired link. 22.根据权利要求16-21任一项所述的装置,其特征在于,还包括接收模块;22. The device according to any one of claims 16-21, further comprising a receiving module; 所述接收模块,用于接收所述第二终端利用所述USB有线链路发送的第一验证标识,以及所述第二终端通过所述P2P无线链路发送的第二验证标识;the receiving module, configured to receive a first verification identifier sent by the second terminal using the USB wired link, and a second verification identifier sent by the second terminal through the P2P wireless link; 所述发送模块,还用于在所述第一验证标识和所述第二验证标识满足验证条件的情况下,利用所述USB有线链路和所述P2P无线链路并行的向所述第二终端发送所述多个数据块。The sending module is further configured to use the USB wired link and the P2P wireless link in parallel to the second verification identifier when the first verification identifier and the second verification identifier meet verification conditions. The terminal transmits the plurality of data blocks. 23.根据权利要求16-22任一项所述的装置,其特征在于,所述处理模块,还用于:23. The device according to any one of claims 16-22, wherein the processing module is further configured to: 获取所述第一终端与所述第二终端在所述P2P无线链路传输中的角色;acquiring the roles of the first terminal and the second terminal in the P2P wireless link transmission; 在所述第一终端向所述第二终端发送数据的能力小于所述第二终端向所述第一终端发送数据的能力的情况下,将所述第一终端与所述第二终端交换角色。In the case that the capability of the first terminal to send data to the second terminal is smaller than the capability of the second terminal to send data to the first terminal, the first terminal and the second terminal are exchanged for roles . 24.根据权利要求16-23任一项所述的装置,其特征在于,24. The device of any one of claims 16-23, wherein 所述处理模块,还用于控制所述USB控制模块停止所述USB有线链路之间的充电。The processing module is further configured to control the USB control module to stop charging between the USB wired links. 25.根据权利要求16-24任一项所述的装置,其特征在于,25. The device according to any one of claims 16-24, characterized in that, 所述处理模块,还用于检测到所述第一终端的设备温度高于第一阈值的情况下,控制所述USB控制模块停止所述USB有线链路之间的充电。The processing module is further configured to control the USB control module to stop charging between the USB wired links when it is detected that the temperature of the device of the first terminal is higher than a first threshold. 26.根据权利要求16-25任一项所述的装置,其特征在于,26. The device of any one of claims 16-25, wherein 所述处理模块,还用于获取所述第一终端的电量与所述第二终端的电量;The processing module is further configured to obtain the power of the first terminal and the power of the second terminal; 所述处理模块,还用于在所述第一终端的电量小于电量阈值的情况下,设置充电方向为所述第二终端向所述第一终端充电。The processing module is further configured to set a charging direction for the second terminal to charge the first terminal when the power of the first terminal is less than a power threshold. 27.根据权利要求16-25任一项所述的装置,其特征在于,27. The device according to any one of claims 16-25, characterized in that, 所述处理模块,还用于在所述第一终端的设备温度高度第二阈值的情况下,降低所述第一终端的中央处理器CPU运行频率;其中,所述第二阈值高于所述第一终端未进行数据传输时的限制CPU运行频率所设置的温度。The processing module is further configured to reduce the operating frequency of the central processing unit CPU of the first terminal when the temperature of the device of the first terminal is higher than a second threshold; wherein the second threshold is higher than the second threshold The temperature set by limiting the operating frequency of the CPU when the first terminal is not performing data transmission. 28.根据权利要求16-27任一项所述的装置,其特征在于,还包括显示模块;28. The device according to any one of claims 16-27, further comprising a display module; 所述显示模块,用于基于所述分享操作,显示第一用户界面;所述第一用户界面中包括:一个或多个用户标识,以及各所述用户标识可用的P2P方式;所述用户标识为扫描得到的终端用户的标识,所述可用的P2P方式包括P2P有线和/或P2P无线;The display module is configured to display a first user interface based on the sharing operation; the first user interface includes: one or more user identifiers, and a P2P mode available for each user identifier; the user identifier For the identification of the terminal user obtained by scanning, the available P2P methods include P2P wired and/or P2P wireless; 所述处理模块,还用于在所述第一用户界面中接收到对所述第二终端设备的用户标识的触发操作,且所述第二终端设备的用户标识可用的P2P方式为P2P有线和P2P无线的情况下,与所述第二终端建立通用串行总线USB有线链路和点对点P2P无线链路。The processing module is further configured to receive, in the first user interface, a triggering operation for the user identification of the second terminal device, and the P2P modes available for the user identification of the second terminal device are P2P wired and In the case of P2P wireless, a universal serial bus (USB) wired link and a point-to-point P2P wireless link are established with the second terminal. 29.根据权利要求28所述的装置,其特征在于,29. The apparatus of claim 28, wherein 所述显示模块,还用于在所述第一用户界面中接收到对所述第二终端设备的用户标识的触发操作;The display module is further configured to receive, in the first user interface, a triggering operation for the user identifier of the second terminal device; 所述显示模块,还用于显示第二用户界面,所述第二用户界面包括:用于选择P2P无线传输的勾选控件、用于选择P2P有线传输的勾选控件,以及用于选择P2P无线和P2P有线同时传输的勾选控件;The display module is further configured to display a second user interface, where the second user interface includes: a check control for selecting P2P wireless transmission, a check control for selecting P2P wired transmission, and a check control for selecting P2P wireless transmission Tick control for simultaneous transmission with P2P cable; 所述处理模块,还用于在所述第二用户界面中接收对所述用于选择P2P无线和P2P有线同时传输的勾选控件的勾选操作,与所述第二终端建立通用串行总线USB有线链路和P2P无线链路。The processing module is further configured to receive, in the second user interface, a check operation for the check control for selecting simultaneous P2P wireless and P2P wired transmission, and establish a universal serial bus with the second terminal USB wired link and P2P wireless link. 30.根据权利要求16-29任一项所述的装置,其特征在于,还包括显示模块;30. The device according to any one of claims 16-29, further comprising a display module; 所述显示模块,用于显示第三用户界面,所述第三用户界面包括用于指示USB有线链路的控件和用于指示P2P无线链路的控件;the display module, configured to display a third user interface, where the third user interface includes a control for indicating a USB wired link and a control for indicating a P2P wireless link; 所述处理模块,还用于在检测到对所述用于指示USB有线链路的控件的触发操作的情况下,断开或开启USB有线链路的传输;The processing module is further configured to disconnect or enable the transmission of the USB wired link in the case of detecting a triggering operation on the control for indicating the USB wired link; 或者,所述处理模块,还用于在检测到对所述用于指示P2P无线链路的控件的触发操作的情况下,断开或开启P2P无线链路的传输。Alternatively, the processing module is further configured to disconnect or enable the transmission of the P2P wireless link when a triggering operation of the control for indicating the P2P wireless link is detected. 31.一种电子设备,其特征在于,包括:一个或多个处理器、收发器、存储器和接口电路;所述一个或多个处理器、所述收发器、所述存储器和和所述接口电路通过一个或多个通信总线通信;所述接口电路用于与其它装置通信,一个或多个计算机程序被存储在所述存储器中,并被配置为被所述一个或多个处理器或所述收发器执行以使得所述电子设备执行如权利要求1-15任一项所述的方法。31. An electronic device, characterized by comprising: one or more processors, a transceiver, a memory and an interface circuit; the one or more processors, the transceiver, the memory and the interface The circuits communicate through one or more communication buses; the interface circuits are used to communicate with other devices, and one or more computer programs are stored in the memory and configured to be used by the one or more processors or The transceiver performs to cause the electronic device to perform the method of any of claims 1-15. 32.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有指令,当所述指令被执行时,使得计算机执行如权利要求1-15任一项所述的方法。32. A computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed, cause a computer to perform the method according to any one of claims 1-15.
CN202010170314.1A 2020-03-12 2020-03-12 Data transmission method and device Pending CN113473645A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010170314.1A CN113473645A (en) 2020-03-12 2020-03-12 Data transmission method and device
PCT/CN2021/078868 WO2021179970A1 (en) 2020-03-12 2021-03-03 Data transmission method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010170314.1A CN113473645A (en) 2020-03-12 2020-03-12 Data transmission method and device

Publications (1)

Publication Number Publication Date
CN113473645A true CN113473645A (en) 2021-10-01

Family

ID=77671216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010170314.1A Pending CN113473645A (en) 2020-03-12 2020-03-12 Data transmission method and device

Country Status (2)

Country Link
CN (1) CN113473645A (en)
WO (1) WO2021179970A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745451A (en) * 2022-04-26 2022-07-12 Oppo广东移动通信有限公司 Data transmission method and device, electronic equipment and computer readable medium
CN114793349A (en) * 2022-04-21 2022-07-26 中国联合网络通信集团有限公司 Data transmission method, device, equipment and storage medium
CN115379280A (en) * 2022-10-19 2022-11-22 深圳沛喆微电子有限公司 Information source channel intercommunication transmission method and device and intelligent photo frame
CN115562570A (en) * 2022-04-27 2023-01-03 荣耀终端有限公司 Data migration method, system and electronic device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115038115B (en) * 2022-06-21 2024-11-29 美的集团股份有限公司 Data transmission method, device, electronic equipment, storage medium and product
CN119011918A (en) * 2023-05-19 2024-11-22 广州视源电子科技股份有限公司 Data transmission method, device, equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388689A (en) * 2008-10-28 2009-03-18 深圳华为通信技术有限公司 Data multi-bearing parallel transmission method and device
CN103580966A (en) * 2013-11-04 2014-02-12 惠州Tcl移动通信有限公司 Wireless link and wire link parallel data transmission method and system
CN108235363A (en) * 2017-12-30 2018-06-29 广东欧珀移动通信有限公司 terminal wireless data transmission method, device, terminal and storage medium
WO2019218282A1 (en) * 2018-05-16 2019-11-21 华为技术有限公司 Data transmission method and terminal
WO2019225829A1 (en) * 2018-05-23 2019-11-28 엘지전자 주식회사 Method for ma-usb-based p2p communication, and wireless device using same

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9900150B2 (en) * 2009-10-30 2018-02-20 International Business Machines Corporation Dispersed storage camera device and method of operation
CN112306941B (en) * 2019-07-26 2023-12-08 华为技术有限公司 Transmission method, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388689A (en) * 2008-10-28 2009-03-18 深圳华为通信技术有限公司 Data multi-bearing parallel transmission method and device
CN103580966A (en) * 2013-11-04 2014-02-12 惠州Tcl移动通信有限公司 Wireless link and wire link parallel data transmission method and system
CN108235363A (en) * 2017-12-30 2018-06-29 广东欧珀移动通信有限公司 terminal wireless data transmission method, device, terminal and storage medium
WO2019218282A1 (en) * 2018-05-16 2019-11-21 华为技术有限公司 Data transmission method and terminal
WO2019225829A1 (en) * 2018-05-23 2019-11-28 엘지전자 주식회사 Method for ma-usb-based p2p communication, and wireless device using same

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114793349A (en) * 2022-04-21 2022-07-26 中国联合网络通信集团有限公司 Data transmission method, device, equipment and storage medium
CN114745451A (en) * 2022-04-26 2022-07-12 Oppo广东移动通信有限公司 Data transmission method and device, electronic equipment and computer readable medium
CN114745451B (en) * 2022-04-26 2024-07-12 Oppo广东移动通信有限公司 Data transmission method and device, electronic equipment and computer readable medium
CN115562570A (en) * 2022-04-27 2023-01-03 荣耀终端有限公司 Data migration method, system and electronic device
CN115562570B (en) * 2022-04-27 2023-09-12 荣耀终端有限公司 Data migration method, system and electronic device
CN115379280A (en) * 2022-10-19 2022-11-22 深圳沛喆微电子有限公司 Information source channel intercommunication transmission method and device and intelligent photo frame
CN115379280B (en) * 2022-10-19 2023-01-31 深圳沛喆微电子有限公司 Information source channel intercommunication transmission method and device and intelligent photo frame

Also Published As

Publication number Publication date
WO2021179970A1 (en) 2021-09-16

Similar Documents

Publication Publication Date Title
WO2021179970A1 (en) Data transmission method and apparatus
CN109041262B (en) Data transmission method and related device
JP7273180B2 (en) Method for connecting to network access device, terminal and computer readable storage medium
WO2020147627A1 (en) Link selection method and related apparatus
CN107682844B (en) Communication device
CN113014483B (en) Multi-path transmission method and equipment
WO2019218951A1 (en) Method and terminal for transmitting file
CN103402191B (en) Communication means, computer-readable recording medium and the wireless connection system of main frame, main frame and equipment
US20140196125A1 (en) Deploying wireless docking as a service
US20070288680A1 (en) Device and connection control method
CN109362097A (en) transmission control method and related device
CN107432043B (en) A paging method between NAN equipment and NAN equipment
CN104541570A (en) Wireless communication device, wireless communication method, and wireless communication control program
US9832279B2 (en) Station, target apparatus, initiator apparatus, communication system, and communication method
US11252610B2 (en) Method and apparatus for remapping QoS flow, and computer storage medium
CN114765818A (en) Cell switching method and related product
JP2010050652A (en) Communication device, communication system, communication method, and program
CN110429982A (en) data transmission method and related device
CN114765901A (en) Multi-link equipment connection management method, device, equipment and storage medium
TWI724139B (en) D2d based communication method and terminal
TWI481243B (en) Method of quality of service negotiation cross multi-media
CN115720386B (en) Direct link establishment method, device, equipment and storage medium
JP7664951B2 (en) Method, network device, and system for establishing multiple connections
WO2023217024A1 (en) Sidelink (sl) communication method and apparatus, and terminal
WO2023179137A1 (en) Device communication method and related product

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