WO2021175300A1 - 数据传输方法、装置、电子设备和可读存储介质 - Google Patents

数据传输方法、装置、电子设备和可读存储介质 Download PDF

Info

Publication number
WO2021175300A1
WO2021175300A1 PCT/CN2021/079178 CN2021079178W WO2021175300A1 WO 2021175300 A1 WO2021175300 A1 WO 2021175300A1 CN 2021079178 W CN2021079178 W CN 2021079178W WO 2021175300 A1 WO2021175300 A1 WO 2021175300A1
Authority
WO
WIPO (PCT)
Prior art keywords
communication channel
data
electronic device
transmitted
type
Prior art date
Application number
PCT/CN2021/079178
Other languages
English (en)
French (fr)
Inventor
董继阳
黄卿
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021175300A1 publication Critical patent/WO2021175300A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections

Definitions

  • This application relates to the field of communication technology, and in particular to a data transmission method, device, electronic equipment, and computer-readable storage medium.
  • BT Bluetooth
  • BLE Bluetooth Low Energy
  • Wi-Fi Wi-Fi Peer to Peer
  • Wi-Fi Wi-Fi Peer to Peer
  • P2P Wi-Fi
  • the embodiments of the present application provide a data transmission method, device, electronic device, and computer-readable storage medium, which can automatically establish a communication channel that meets the transmission service requirements when the current transmission channel does not meet the transmission service requirements, or the current optimal communication Channel to improve user experience.
  • an embodiment of the present application provides a data transmission method, which may be applied to a first electronic device, and the method may include: acquiring first data to be transmitted; and then determining whether the first communication channel satisfies the first to-be-transmitted data For data transmission service requirements, the first communication channel is an existing connection channel between the first electronic device and the second electronic device; if the first communication channel does not meet the transmission service requirements of the first data to be transmitted, the first communication channel Establish a second communication channel that meets the transmission service requirements of the first data to be transmitted; transmit the first data to be transmitted to the second electronic device through the second communication channel.
  • the first electronic device detects that the existing connection channel does not meet the transmission service requirements of the first data to be transmitted, it automatically establishes the transmission of the first data to be transmitted through the existing connection channel without the user's perception.
  • the second communication channel for business requirements uses the second communication channel to transmit the first data to be transmitted to the second electronic device, which improves data transmission performance and improves user experience.
  • the first electronic device is a mobile phone
  • the second electronic device is a smart TV
  • both the mobile phone and the smart TV are connected under the same wireless router.
  • the mobile phone obtains the projection data stream, and then determines that the existing connection channel does not meet the transmission business requirements of the projection data stream (for example, the packet loss rate of the existing connection channel does not meet the projection data stream.
  • the screen data stream requires packet loss rate), it will automatically establish a Wi-Fi P2P connection with the smart TV through the existing connection channel to meet the transmission business requirements of the screen data stream, and use the Wi-Fi P2P connection to complete the screen projection service.
  • the first electronic device when determining whether the first communication channel meets the transmission service requirements of the first data to be transmitted, may first determine the transmission service type of the first data to be transmitted,
  • the transmission service type may include message transmission service, file transmission service and multimedia streaming service. Since different transmission service types correspond to different transmission service requirements, the transmission service requirement of the first data to be transmitted can be determined according to the transmission service type of the first data to be transmitted. After obtaining the transmission service requirement of the first data to be transmitted, according to the transmission service requirement, it is determined whether the first communication channel meets the transmission service requirement.
  • the transmission service requirement may refer to the requirements of the transmission channel performance for the transmission data, which may be specifically embodied in the transmission delay, bandwidth, and packet loss rate of the communication channel.
  • the transmission delay, bandwidth, and packet loss rate of the first communication channel at the current moment can be compared with the requirements for transmission delay, bandwidth, and packet loss rate in the transmission service requirements of the first data to be transmitted. Yes, to determine whether the first communication channel can meet the transmission service requirements of the first data to be transmitted.
  • the transmission delay, packet loss rate, and bandwidth of the first communication channel at the current moment are within the range corresponding to the transmission service requirements of the first data to be transmitted, it can be determined that the first communication channel can meet the first data to be transmitted On the contrary, it is determined that the first communication channel does not meet the transmission service requirements of the first data to be transmitted.
  • the transmission service type of the projection data stream is a multimedia stream transmission service
  • the transmission service requirement of the multimedia stream transmission service is: the highest packet loss rate is 10%, the maximum transmission delay is 100ms. It is monitored that the packet loss rate of the first communication channel at the current moment is 15%, and the transmission delay is 70 ms.
  • the transmission delay of the first communication channel can meet the requirements of multimedia streaming transmission services, since the packet loss rate of the first communication channel is higher than the maximum packet loss rate allowed by the multimedia streaming transmission service, it can be determined The first communication channel does not meet the transmission service requirements of the first data to be transmitted.
  • the data to be transmitted is divided into different transmission service types, and different transmission service types correspond to different transmission service requirements. Then, according to the transmission service type of the transmission data, it is determined whether the first communication channel meets the transmission service requirements. The transmission characteristics of the communication channel and the data to be transmitted are more consistent, and the data transmission rate is further improved.
  • the first electronic device may establish the second communication channel through the first communication channel.
  • the second communication channel can also be established in other ways, not limited to the first communication channel.
  • the process of establishing a second communication channel that meets the transmission service requirements of the first data to be transmitted may include:
  • the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device determine the target communication that meets the transmission service requirements of the first data to be transmitted Channel type.
  • the first communication capability information may include first communication connection information used to characterize the communication connection type supported by the first electronic device
  • the second communication capability information may include first communication connection information used to characterize the communication connection type supported by the second electronic device.
  • the second communication capability information of the second electronic device may be obtained by the first electronic device from the second electronic device after it is determined that the first communication channel does not meet the transmission service requirements of the first data to be transmitted; or it may be When the first electronic device and the second electronic device establish a connection for the first time, they are sent by the second electronic device to the first electronic device.
  • the first electronic device may obtain the second communication capability information of the second electronic device through the first communication channel.
  • the first communication connection information (which may also be referred to as a communication capability set) and the second communication connection information may characterize the type of communication connection supported by the electronic device.
  • the communication connection types supported by the mobile phone are BLE, Wi-Fi and Wi-FiP2P
  • the first communication connection of the mobile phone is BLE, Wi-Fi and Wi-FiP2P
  • related information for example, BEL version information, Wi-Fi protocol information
  • the first communication capability information and the second communication capability information may not only include information characterizing the communication connection type supported by the electronic device, but also include at least one of device status information and signal quality information.
  • the first electronic device may establish a target communication channel corresponding to the target communication channel type with the second electronic device, and use the target communication channel as the second communication channel.
  • the first electronic device can establish a second communication channel with the second electronic device through the first communication channel.
  • the channel type that meets the transmission service requirements is automatically determined, and the communication channel corresponding to the channel type is automatically established. It can dynamically make decisions and establish the transmission service that meets the transmission service without the user's perception. The required communication channel improves the user experience.
  • the transmission service type of the first data to be transmitted the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device, it is determined that the first data to be transmitted is satisfied
  • the process of transmitting the target communication channel type of business requirements can include:
  • the first candidate communication channel type is a channel type that meets the transmission service requirements of the first data to be transmitted.
  • the communication connection type supported by both the first electronic device and the second electronic device may be determined. Then, the currently monitored packet loss rate, transmission delay, and bandwidth of various communication connection types can be combined to select a communication channel type that both devices support and meet the transmission service requirements as the first candidate communication channel type.
  • the communication channel type with the highest priority is determined from the first candidate communication channel types, and the communication channel type with the highest priority is used as the target communication channel type.
  • the communication channel priority may be preset, and different transmission service types correspond to different communication channel priorities.
  • the priority of the communication channel can be set according to factors such as the transmission delay and throughput of the communication channel.
  • the priority of the communication channel for file transfer services is: Wi-Fi P2P 5G> Wi-Fi 5G> Wi-Fi P2P 2G> Wi-Fi 2G> Classic Bluetooth BR. If the candidate communication channel types of mobile phones and smart TVs are Wi-Fi and Wi-FiP2P, Wi-FiP2P can be determined as the target communication channel type according to the priority of the communication channel.
  • the second communication connection information based on the first communication connection information, the second communication connection information, and the type of transmission service, it automatically decides which transmission link can meet the transmission service requirements, and then selects the best one as the target according to the channel priority.
  • the communication channel type further improves the data transmission rate.
  • the communication connection type supported by both electronic devices only according to the first communication connection information and the second communication connection information, and use the communication connection type as the first candidate communication channel type. Then, according to the communication channel priority of the transmission service type of the first data to be transmitted, the channel with the highest priority is selected from the first candidate communication channel types as the target communication channel type.
  • the type of communication channel selected in this way may not meet the requirements of transmission services.
  • the device status information and signal quality information can also be combined to determine the target communication channel type.
  • Target communication channel types for business requirements including:
  • the transmission service type of the first data to be transmitted, the first communication capability information, and the second communication capability information are input to the pre-trained classifier, and the communication channel type output by the classifier is used as the target communication channel type.
  • the classifier can be a deep learning model, a neural network model, or a decision tree. After the classifier is pre-trained, the transmission service type and the communication capability information of the devices at both ends can be input into the classifier, and the classifier can output a communication channel type that can meet the needs of the transmission service.
  • the input of the classifier is different, and the target communication channel type of the output may be different.
  • the target communication channel type of the output may be different.
  • the input information of the classifier does not include information such as the signal throughput and signal strength of each communication channel at the current moment, it may cause the target communication channel type output by the classifier to fail to meet the transmission service requirements.
  • the first communication capability information further includes at least one of the device status information and signal quality information of the first electronic device
  • the second communication capability information further includes the information of the second electronic device. At least one of device status information and signal quality information.
  • the first communication channel before determining whether the first communication channel meets the transmission service requirements of the first to-be-transmitted data, it may be detected whether there is a first electronic device between the first electronic device and the second electronic device. Communication channel; if there is no first communication channel between the first electronic device and the second electronic device, a third communication channel is established with the second electronic device, and the third communication channel is used as the first communication channel. In this way, the user's unawareness can be further improved, thereby improving user experience.
  • the first electronic device in the process of transmitting the first data to be transmitted through the second communication channel, the first electronic device newly acquires the second data to be transmitted, and the data of the second data to be transmitted is The priority is higher than the data priority of the first data to be transmitted.
  • the first communication capability information of the first electronic device If neither the first communication channel nor the second communication channel meets the transmission service requirements of the first data to be transmitted, then according to the transmission service type of the second data to be transmitted, the first communication capability information of the first electronic device, and the second electronic device The second communication capability information of the second communication capability information to determine the fourth communication channel type that meets the transmission service requirements of the second data to be transmitted;
  • the type of the fourth communication channel is the same as the type of the second communication channel, transmit the second data to be transmitted to the second electronic device through the second communication channel, switch the first data to be transmitted to the first communication channel for transmission, or establish The fifth communication channel transmits the first data to be transmitted to the second electronic device through the fifth communication channel.
  • the transmission channel is used to transmit data with higher data priority, and the data with lower data priority is switched to another communication channel for transmission. Ensure to further improve data transmission performance.
  • the first data to be transmitted can be switched to the second communication channel for transmission, that is, the first data to be transmitted is switched back to the second communication channel for transmission again.
  • a fifth communication channel was previously created for transmitting the first data to be transmitted, it is first determined whether there is a corresponding service on the fifth communication channel, and if there is no service, the fifth communication channel can be dismantled. Therefore, the influence of the fifth communication channel on the second communication channel is reduced, and the performance of the second communication channel is improved.
  • an embodiment of the present application provides a data transmission method applied to a first electronic device.
  • the method may include: determining the transmission service type of the first data to be transmitted; and then acquiring the second communication capability of the second electronic device Information, the second communication capability information includes second communication connection information used to characterize the communication connection type supported by the second electronic device.
  • the second communication capability information may be obtained in advance and stored locally in the first electronic device. For example, when the first electronic device and the second electronic device establish a connection for the first time, the second electronic device sends the second communication capability information to the first electronic device, and then the first electronic device stores it locally. At this time, the first electronic device can obtain the information by reading the local second communication capability information.
  • the second communication capability information may also be obtained from the second electronic device through the first communication channel when the first electronic device needs the second communication capability of the second electronic device.
  • the target communication channel type of the first data to be transmitted is determined;
  • a piece of communication capability information includes first communication connection information used to characterize the type of communication connection supported by the first electronic device, and the target communication channel type is the type of the optimal communication channel for transmitting the first data to be transmitted.
  • the optimal channel may be the channel with the best transmission performance, for example, the highest bandwidth and the lowest transmission delay.
  • the optimal channel can also be determined according to the transmission service type of the first service data to be transmitted. For example, for message-type transmission services, the channel with the lowest transmission delay is the optimal transmission channel.
  • the channel with the smallest end-to-end transmission time is the optimal transmission channel.
  • the channel with the least connection restriction can be used as the optimal communication channel.
  • the connection establishment limit can include but is not limited to the number of connections that can be connected. The greater the number of connections, the smaller the connection establishment limit.
  • both Wi-Fi connection and Wi-Fi P2P connection can meet the video of a certain bit rate.
  • the requirements for streaming data, and the number of Wi-Fi connections that can be connected is 10, and the number of Wi-Fi P2P connections is 4, and the Wi-Fi connection is used as the optimal communication channel.
  • the target communication channel type is the same as the first communication channel type. If the target communication channel type is the same as the type of the first communication channel, the first data to be transmitted is transmitted to the second electronic device through the first communication channel; wherein, the first communication channel is between the first electronic device and the second electronic device Of existing connection channels;
  • a second communication channel corresponding to the target communication channel type is established with the second electronic device, and the first data to be transmitted is transmitted to the second electronic device through the second communication channel.
  • the embodiment of the present application automatically determines the optimal communication channel for transmitting the first data to be transmitted at the current moment through the transmission service type, the first communication capability information, and the second communication capability information. If the optimal communication channel is an existing connection channel, the existing connection channel is used directly to transmit data. If the optimal communication channel is not an existing connection channel, the optimal communication channel can be newly established and the optimal communication channel can be used to transmit data. Improve data transmission efficiency and improve user experience.
  • the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device determine the first The specific process of the target communication channel type of the data to be transmitted may include:
  • a second candidate communication channel type is determined, and the second candidate communication channel type is a communication channel type supported by both the first electronic device and the second electronic device.
  • the communication channel type with the highest priority is determined from the second candidate communication channel types, and the communication channel type with the highest priority is used as the target communication channel type.
  • the first communication capability information further includes at least one of the device status information and signal quality information of the first electronic device
  • the second communication capability information further includes the information of the second electronic device. At least one of device status information and signal quality information;
  • determining the target communication channel type of the first data to be transmitted includes:
  • the device status information and signal quality information of the first electronic device determines the first pending communication channel type from the second candidate communication channel type.
  • the method further includes: acquiring the second data to be transmitted; determining the transmission service type of the second data to be transmitted , Wherein the data priority of the second data to be transmitted is higher than the data priority of the first data to be transmitted; according to the transmission service type of the second data to be transmitted, the first communication capability information of the first electronic device, and the data priority of the second electronic device
  • the second communication capability information determines the type of the fourth communication channel for the second data to be transmitted, where the fourth communication channel type is the type of the optimal communication channel for transmitting the second data to be transmitted; if the fourth communication channel The type is the same as that of the second communication channel, the second data to be transmitted is transmitted to the second electronic device through the second communication channel, the first data to be transmitted is switched to the first communication channel for transmission, or the fifth communication channel is established, The first data to be transmitted is transmitted to the second electronic device through the fifth communication channel.
  • the optimal channel may be the channel with the best transmission performance, for example, the highest bandwidth and the lowest transmission delay.
  • the optimal channel can also be determined according to the transmission service type of the first service data to be transmitted. For example, for message-type transmission services, the channel with the lowest transmission delay is the optimal transmission channel.
  • the channel with the smallest end-to-end transmission time is the optimal transmission channel.
  • the channel with the least connection restriction can be used as the optimal communication channel.
  • the connection establishment limit can include but is not limited to the number of connections that can be connected. The greater the number of connections, the smaller the connection establishment limit.
  • both Wi-Fi connection and Wi-Fi P2P connection can meet the video of a certain bit rate.
  • the requirements for streaming data, and the number of Wi-Fi connections that can be connected is 10, and the number of Wi-Fi P2P connections is 4, and the Wi-Fi connection is used as the optimal communication channel.
  • the transmission channel is used to transmit data with higher data priority, and the data with lower data priority is switched to another communication channel for transmission. Ensure to further improve data transmission performance.
  • the first data to be transmitted can be switched to the second communication channel for transmission, that is, originally due to factors such as data priority, the second communication channel is switched to the second data to be transmitted Data transmission is performed, and after the transmission of the second data to be transmitted is completed, the first data to be transmitted is switched back to the second communication channel for transmission.
  • the fifth communication channel is newly established before to transmit the first data to be transmitted, it can be determined first whether there is a corresponding service on the fifth communication channel. If there is no corresponding service on the fifth communication channel, the fifth communication channel can be removed. In order to reduce the influence of the fifth communication channel on the second communication channel, the performance of the second communication channel is improved.
  • the first communication channel before determining whether the first communication channel meets the transmission service requirements of the first data to be transmitted, it may be detected whether there is a first electronic device between the first electronic device and the second electronic device. Communication channel; if there is no first communication channel between the first electronic device and the second electronic device, a third communication channel is established with the second electronic device, and the third communication channel is used as the first communication channel. If there is an existing first communication channel between the first electronic device and the second electronic device, it is determined whether the first communication channel meets the transmission service requirement of the first data to be transmitted. In this way, the user's unawareness can be further improved, and the user experience can be improved.
  • an embodiment of the present application provides a data transmission device, which may be applied to a first electronic device, and the device may include: a first acquisition module for acquiring first data to be transmitted; a first determination module , Used to determine whether the first communication channel meets the transmission service requirements of the first to-be-transmitted data, the first communication channel is an existing connection channel between the first electronic device and the second electronic device; the first establishment module is used if The first communication channel does not meet the transmission service requirements of the first data to be transmitted.
  • a second communication channel that meets the transmission service requirements of the first data to be transmitted is established; the first transmission module is used to communicate through the second The channel transmits the first data to be transmitted to the second electronic device.
  • the foregoing apparatus may further include:
  • the first transmission service type determining module is configured to determine the transmission service type of the first data to be transmitted, where the transmission service type includes message transmission service, file transmission service and multimedia streaming transmission service;
  • the first transmission service requirement determination module is configured to secondly determine the transmission service requirement of the first data to be transmitted according to the transmission service type of the first data to be transmitted.
  • the above-mentioned first establishment module may be specifically used for:
  • the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device determine the target communication channel type that meets the transmission service requirements of the first data to be transmitted , wherein the second communication capability information of the second electronic device is obtained by the first electronic device from the second electronic device after determining that the first communication channel does not meet the transmission service requirements of the first to-be-transmitted data, or is obtained in the first
  • the first communication capability information includes information used to characterize the support of the first electronic device
  • the first communication connection information of the communication connection type, and the second communication capability information includes second communication connection information used to characterize the communication connection type supported by the second electronic device;
  • the target communication channel corresponding to the target communication channel type is established with the second electronic device, and the target communication channel is used as the second communication channel.
  • the first establishment module may be specifically used for:
  • the first candidate communication channel type is a channel type that meets the transmission service requirements of the first data to be transmitted;
  • the communication channel type with the highest priority is determined from the first candidate communication channel types, and the communication channel type with the highest priority is used as the target communication channel type.
  • the first establishment module may be specifically used for:
  • the transmission service type of the first data to be transmitted, the first communication capability information, and the second communication capability information are input to the pre-trained classifier, and the communication channel type output by the classifier is used as the target communication channel type.
  • the first communication capability information further includes at least one of the device status information and signal quality information of the first electronic device
  • the second communication capability information further includes the information of the second electronic device. At least one of device status information and signal quality information.
  • the foregoing apparatus may further include:
  • the detection module is used to detect whether there is a first communication channel between the first electronic device and the second electronic device;
  • the second establishment module is configured to establish a third communication channel with the second electronic device if there is no first communication channel between the first electronic device and the second electronic device, and use the third communication channel as the first communication channel.
  • the foregoing device may further include:
  • the second acquisition module is configured to acquire second data to be transmitted, wherein the data priority of the second data to be transmitted is higher than the data priority of the first data to be transmitted;
  • the second transmission service type determining module is configured to determine the transmission service type of the second data to be transmitted, and determine the transmission service requirement of the second data to be transmitted according to the transmission service type of the second data to be transmitted;
  • the second transmission service requirement determination module is configured to determine whether the first communication channel and the second communication channel meet the transmission service requirement of the second data to be transmitted;
  • the channel type determining module is configured to, if neither the first communication channel nor the second communication channel meet the transmission service requirements of the first data to be transmitted, according to the transmission service type of the second data to be transmitted, the first communication of the first electronic device.
  • the capability information and the second communication capability information of the second electronic device determine the fourth communication channel type that meets the transmission service requirements of the second data to be transmitted;
  • the first switching module is configured to, if the type of the fourth communication channel is the same as the type of the second communication channel, transmit the second data to be transmitted to the second electronic device through the second communication channel, and switch the first data to be transmitted to the first
  • the communication channel performs transmission, or a fifth communication channel is established, and the first data to be transmitted is transmitted to the second electronic device through the fifth communication channel.
  • the foregoing apparatus may further include:
  • the switching transmission module is used to switch the first data to be transmitted to the second communication channel for transmission;
  • the removal module is used to determine whether the fifth communication channel has a corresponding service; if the fifth communication channel does not have a corresponding service, the fifth communication channel is removed.
  • an embodiment of the present application provides a data transmission device, which may be applied to a first electronic device, and the device may include:
  • the third transmission service type determining module is used to determine the transmission service type of the first data to be transmitted
  • the capability information acquisition module is configured to acquire second communication capability information of the second electronic device, where the second communication capability information includes second communication connection information used to characterize the communication connection type supported by the second electronic device.
  • the optimal channel type determining module is used to determine the first data to be transmitted according to the transmission service type of the first data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device
  • the target communication channel type where the first communication capability information includes first communication connection information used to characterize the communication connection type supported by the first electronic device, and the target communication channel type is the optimal communication for transmitting the first data to be transmitted
  • the type of channel
  • the second transmission module is configured to transmit the first data to be transmitted to the second electronic device through the first communication channel if the target communication channel type is the same as that of the first communication channel, where the first communication channel is the first electronic device Existing connection channel with the second electronic device;
  • the third transmission module is used to establish a second communication channel corresponding to the target communication channel type with the second electronic device if the target communication channel type is not the same as the first communication channel type, and transmit the first data to be transmitted through the second communication channel Transfer to the second electronic device.
  • the above-mentioned optimal channel type determination module is specifically configured to:
  • the communication channel type with the highest priority is determined from the second candidate communication channel types, and the communication channel type with the highest priority is used as the target communication channel type.
  • the first communication capability information further includes at least one of the device status information and signal quality information of the first electronic device
  • the second communication capability information further includes the information of the second electronic device. At least one of device status information and signal quality information;
  • the optimal channel type determining module can be specifically used for:
  • the transmission service type of the first data to be transmitted at least one of the device status information and signal quality information of the first electronic device, and at least one of the device status information and signal quality information of the second electronic device, from the first Determine the target communication channel type of the first data to be transmitted among the two candidate communication channel types.
  • the foregoing apparatus may further include:
  • the third acquiring module is used to acquire the second data to be transmitted
  • a fourth transmission service type determining module configured to determine the transmission service type of the second data to be transmitted, wherein the data priority of the second data to be transmitted is higher than the data priority of the first data to be transmitted;
  • the fourth channel type determining module is used to determine the second communication capability information of the second data to be transmitted according to the transmission service type of the second data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device Four communication channel types, where the fourth communication channel type is the optimal communication channel type for transmitting the second data to be transmitted;
  • the second switching module is configured to, if the type of the fourth communication channel is the same as the type of the second communication channel, transmit the second data to be transmitted to the second electronic device through the second communication channel, and switch the first data to be transmitted to the first
  • the communication channel performs transmission, or a fifth communication channel is established, and the first data to be transmitted is transmitted to the second electronic device through the fifth communication channel.
  • an embodiment of the present application provides an electronic device including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor executes the computer program when the computer program is executed. The method according to any one of the first aspect or the second aspect above.
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the above-mentioned first or second aspects. The method described in the item.
  • embodiments of the present application provide a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute the method described in any one of the first aspect or the second aspect.
  • FIG. 1 is a schematic block diagram of the flow of a data transmission method provided by an embodiment of this application;
  • FIG. 2 is a schematic block diagram of another flow of a data transmission method provided by an embodiment of the application.
  • FIG. 3 is a schematic block diagram of another flow of a data transmission method provided by an embodiment of this application.
  • FIG. 4 is a schematic diagram of a distributed scenario provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of a wireless projection service process provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of a multi-screen collaborative business scenario provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of a screen projection scene provided by an embodiment of the application.
  • FIG. 8 is a schematic diagram of a file transmission service scenario provided by an embodiment of the application.
  • Fig. 9 is a schematic diagram of a data transmission scene between a mobile phone and a car provided by an embodiment of the application.
  • FIG. 10 is a schematic block diagram of the hardware structure of an electronic device 100 provided by an embodiment of the application.
  • 11 is a block diagram of the software structure of the electronic device 100 provided by an embodiment of the application.
  • FIG. 12 is a structural block diagram of a data transmission device provided by an embodiment of the application.
  • FIG. 13 is a structural block diagram of a data transmission device provided by an embodiment of the application.
  • the electronic device can automatically establish a communication channel between the two electronic devices that meets the current transmission service requirements according to the transmission service type and the communication capability information of the devices at both ends.
  • the existing communication channel between the devices can be dynamically changed, and the communication channel that meets the current transmission service requirements can be established without the user's perception.
  • automatically establishing a communication channel that meets the current transmission service requirements, and using the communication channel to transmit service data can ensure the performance of data transmission to a certain extent and also improve user experience.
  • the user can only continue to use the existing communication channel to transmit service data, or manually change the communication channel between the devices, and the user experience is poor. .
  • the user needs to transmit the audio data stream of the mobile phone to the smart speaker, and use the smart speaker to play the audio data stream.
  • the mobile phone and the smart speaker are connected via Bluetooth, that is, there is an existing connection channel between the mobile phone and the smart speaker.
  • the existing connection between the mobile phone and the smart speaker cannot meet the transmission demand of audio stream data.
  • the user can continue to use the existing connection channel to transmit audio stream data.
  • the user can manually change the communication channel between the mobile phone and the smart speaker, so that the newly established communication channel meets the current transmission service requirements and ensures data transmission performance.
  • the existing Bluetooth signal is relatively poor, and the user can manually close the Bluetooth connection and switch to the Wi-Fi connection.
  • the user experience is poor.
  • users cannot even perceive whether the communication channel between the devices meets the current transmission service requirements. Even if the user perceives that the communication channel between the devices does not meet the current transmission service requirements, they cannot determine which communication channel is the most suitable and which communication channel can meet the current transmission service requirements.
  • the electronic device can automatically determine the type of communication channel that can meet the current transmission service based on the transmission service type and the communication capability information of the device, and then establish the device according to the communication channel type. Through the target communication channel, the transmission service is completed through the target communication channel. In this process, there is no need for the user to participate, and based on the inherent hardware conditions of the current device, a communication channel between the devices that can meet the current transmission service can be established without the user's perception, which improves the user experience.
  • FIG. 1 shows a schematic block diagram of the flow of a data transmission method provided by an embodiment of the present application
  • the method is applied to a first electronic device, and the method may include the following steps:
  • Step S101 The first electronic device obtains first data to be transmitted.
  • the data type of the first data to be transmitted may be arbitrary.
  • the data to be transmitted may be, but not limited to, instructions, files, audio, or video.
  • Step S102 The first electronic device determines whether the first communication channel meets the transmission service requirements of the first to-be-transmitted data, and the first communication channel is an existing connection channel between the first electronic device and the second electronic device.
  • the first electronic device is the sender of the data to be transmitted
  • the second electronic device is the receiver of the data to be transmitted.
  • the number of the second electronic device can be one or more than two. That is, the first electronic device can transmit the data to be transmitted to one second electronic device, or can transmit the data to be transmitted to at least two second electronic devices at the same time.
  • the above-mentioned first communication channel refers to a communication channel that has been established between the first electronic device and the second electronic device, and the number and channel types of the communication channels are arbitrary.
  • a Wi-Fi connection and a Wi-Fi P2P connection can exist simultaneously between a mobile phone and a computer.
  • the above-mentioned transmission service requirements of the first data to be transmitted may refer to the transmission performance requirements of the data to be transmitted.
  • Data of different transmission service types have different characteristics, and the transmission performance requirements may be different. That is, the transmission service requirements corresponding to different transmission service types will also be different.
  • the first electronic device may first determine the transmission service type of the first data to be transmitted, and then obtain the transmission service requirement of the first data to be transmitted according to the correspondence between the transmission service type and the transmission service requirement. Then determine whether the first communication channel meets the transmission service requirements.
  • the transmission service type of the first data to be transmitted can be determined by the corresponding parameter (for example, type parameter) of the data to be transmitted, that is, the first electronic device can determine the data to be transmitted by identifying the corresponding parameter in the first data to be transmitted The type of transmission service.
  • the relationship between different parameter values and transmission service types can be defined in advance. Later, the transmission service type of the data to be transmitted can be determined by identifying the parameter value and the corresponding relationship between the parameter value and the transmission service type.
  • the corresponding transmission service type is a message transmission service
  • the corresponding transmission service type is a file transmission service
  • the transmission service type is multimedia streaming service.
  • the transmission service type of the first data to be transmitted can also be determined in other ways.
  • the underlying transmission service of the electronic device can provide the corresponding software development kit (SDK) for the upper-layer data transmission service.
  • SDK can include predefined interfaces and corresponding functions, and the functions can include the above type parameter.
  • the electronic device can set the type parameter value to a corresponding value according to the type of data to be transmitted. Thereafter, the electronic device can send the data carrying the type parameter value to the peer device.
  • transmission services can be divided into several different types in advance according to the characteristics of different data.
  • the transmission service type may include, but is not limited to, a message transmission service, a file transmission service, and a multimedia streaming service.
  • the data characteristics corresponding to the message transmission service are: the amount of data is small, but the transmission delay and reliability requirements are high.
  • the control instruction data that is, the transmission service type of the control instruction data is a message transmission service.
  • the corresponding data characteristics of file transfer services are: large data volume and high reliability requirements.
  • video file data, audio file data, and picture file data that is, the transmission service type of video file data, audio file data, and picture file data is a file transmission service.
  • the corresponding data characteristics of multimedia streaming services are: high requirements for bandwidth and high requirements for transmission delay.
  • data such as projection data stream, video stream, and audio stream, that is, the transmission service type of streaming media data such as projection data stream, video stream, and audio stream, is a multimedia stream transmission service.
  • the characteristics of message data are: small amount of data, high requirements for transmission reliability and transmission delay, and low requirements for bandwidth.
  • the transmission service requirements of the message transmission service type may be: low transmission delay and high transmission reliability.
  • the characteristics of file-type data are: large data volume and high transmission reliability.
  • the transmission service requirements of file transmission services may be: high transmission reliability and high bandwidth.
  • streaming media data is characterized by higher requirements for bandwidth and transmission delay. Based on this, the transmission service requirements of the multimedia streaming service can be: high bandwidth and low transmission delay.
  • the transmission performance of the communication channel can be determined by indicators such as transmission delay, bandwidth, and packet loss rate.
  • the transmission reliability of the channel is lower.
  • the size of the bandwidth can affect the data transmission rate. The higher the bandwidth, the higher the transmission rate.
  • the transmission delay can characterize the time difference between the initiator of the data initiating the data transmission and the data receiver responding to the data. For example, a command data is transmitted from device A to device B. The time point when device A initiates data transmission and device B responds to the data. The difference between the time points of the instruction data is the transmission delay.
  • the transmission delay of each communication channel is not fixed and may be affected by the actual network status.
  • Different types of data may have different requirements for transmission delay.
  • the required transmission delay generally needs to be less than or equal to 20ms.
  • it is possible to determine whether a certain communication channel meets the current transmission service requirements by judging whether the transmission delay, bandwidth, and packet loss rate of a certain communication channel meet the needs of the data to be transmitted.
  • the first data to be transmitted is instruction data, which requires high transmission reliability and transmission delay. If the packet loss rate of a communication channel is very high, or the transmission delay is high, it can be determined The communication channel does not meet the current transmission service requirements.
  • the data to be transmitted is picture data, which requires high transmission reliability and bandwidth. If a certain communication channel has a high bandwidth and a low packet loss rate, it can be determined that the communication channel meets the current transmission service requirements.
  • the transmission service requirements of different types of data may be different, that is, different types of data may have different requirements for transmission delay, bandwidth, and packet loss rate.
  • different types of data may have different requirements for transmission delay, bandwidth, and packet loss rate.
  • specific values can be used to quantify whether a certain communication channel meets the needs of transmission services. That is, specific values such as packet loss rate, bandwidth, and transmission delay can be preset in various transmission service types. In the subsequent judgment process, the relationship between the index value of the communication channel at the current moment and the set index value can be compared to determine whether a certain communication channel can meet the transmission service requirements of the data to be transmitted.
  • the data transmission service requirements of the message transmission service may be specifically: packet loss rate: 0%, transmission delay: less than or equal to 20 ms, and bandwidth: 50-100 kb/s.
  • the first communication channel is a BLE connection
  • the packet loss rate of the BLE connection at the current moment is 5%
  • the transmission delay is 15 ms
  • the bandwidth is 70 kb/s.
  • the first data to be transmitted is instruction data. Since the packet loss rate of the BLE connection is 5%, which does not meet the packet loss rate requirements of instruction data, it is determined that the BLE at the current moment does not meet the transmission service of the first data to be transmitted need.
  • the data transmission service requirements of file transmission services can be specifically: packet loss rate: 0%, the higher the bandwidth, the better, and there is no specific requirement for transmission delay.
  • the value range of bandwidth and transmission delay can be set according to actual application scenarios. When the bandwidth and transmission delay of the first communication channel fall within the set value range, it can be determined that the bandwidth and transmission delay meet Current transmission business needs.
  • the first data to be transmitted is file data
  • the first communication channel is Wi-Fi connection.
  • the packet loss rate of the Wi-Fi connection at the current moment is 0%
  • the transmission delay is 20ms
  • the bandwidth It is 10m/s.
  • the data transmission service requirements of the multimedia streaming service can be specifically: packet loss rate: 5%-10%, bandwidth can be determined according to the bit rate of the data stream, and transmission delay: 70-100ms.
  • the first data to be transmitted is streaming media data
  • the first communication channel is a Wi-Fi P2P connection.
  • the packet loss rate of the Wi-Fi P2P connection at the current moment is 15%, and the bandwidth is 50 Mbs.
  • the delay is 50ms.
  • the packet loss rate of the Wi-Fi P2P connection does not meet the packet loss rate requirements of streaming media data, it can be determined that the current Wi-Fi P2P connection does not meet the transmission service requirements of the first data to be transmitted.
  • data streams with different bit rates may have different bandwidth requirements.
  • a video data stream with a code rate of 4K or higher may have a bandwidth requirement of 120 Mbs
  • a video data stream with a code rate of less than 1080P may have a bandwidth requirement of 50 Mbps.
  • each communication channel it can be determined whether each communication channel meets the current transmission service requirements. When all the first communication channels do not meet the transmission service requirements of the data to be transmitted, it can be determined that the first communication channel between the first electronic device and the second electronic device does not meet the transmission service requirements of the data to be transmitted. Conversely, if one or more of the first communication channels can meet the transmission service requirements of the data to be transmitted, it can be determined that the first communication channel between the first electronic device and the second electronic device meets the transmission service requirements of the data to be transmitted need.
  • the two communication channels are a BLE connection and a Wi-Fi connection.
  • the data to be transmitted is the screen data stream, and the mobile phone can determine whether the current BLE connection and Wi-Fi connection can meet the transmission service requirements of the screen data stream.
  • the existing connection channel between the two cannot meet the transmission business requirements of the projection data stream.
  • the first electronic device when the first electronic device simultaneously transmits the first data to be transmitted to at least two second electronic devices, the first electronic device can respectively determine whether the existing connection channel with the opposite device meets the requirements of the first data to be transmitted Transmission business needs.
  • a mobile phone needs to cast a screen to a tablet computer and a smart TV at the same time.
  • the existing connection channel between the mobile phone and the tablet computer is a Wi-Fi connection
  • the existing connection channel between the mobile phone and the smart TV is a Wi-Fi P2P connection.
  • the mobile phone determines that the Wi-Fi connection does not meet the transmission business requirements of the projection data stream, and according to the bandwidth, transmission delay and packet loss of the Wi-Fi P2P connection It is determined that Wi-Fi P2P connection can meet the transmission business needs of projection data stream.
  • the first electronic device may first detect whether there is a first communication channel between the first electronic device and the second electronic device, and if there is, then go to step S102; if not, the third communication channel may be established first, and the The three communication channels serve as the above-mentioned first communication channel.
  • the mobile phone can establish a new communication channel with the smart TV through ad hoc network technology (for example, BLE mesh), and then Proceed to step S102.
  • ad hoc network technology for example, BLE mesh
  • Step S103 If the first communication channel does not meet the transmission service requirements of the data to be transmitted, establish a second communication channel that meets the transmission service requirements of the first data to be transmitted through the first communication channel.
  • the second communication channel can be established through the first communication channel.
  • the second communication channel can also be established in other ways, not limited to the first communication channel.
  • the process of establishing the second communication channel through the first communication channel may include the following steps:
  • Step 1 According to the transmission service type of the first data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device, determine what meets the transmission service requirements of the first data to be transmitted Target communication channel type.
  • the second communication capability information of the second electronic device is obtained by the first electronic device from the second electronic device after it is determined that the first communication channel does not meet the transmission service requirements of the first data to be transmitted. Or it is sent by the second electronic device to the first electronic device when the first electronic device and the second electronic device establish a connection for the first time.
  • the first communication capability information includes first communication connection information used to characterize the communication connection type supported by the first electronic device, and the second communication capability information includes second communication connection information used to characterize the communication connection type supported by the second electronic device .
  • the foregoing first communication capability information may refer to information that characterizes the communication capability of the first electronic device, which may include, but is not limited to, the first communication connection information (which may also be referred to as a communication capability set), device status information, signal quality information, etc.
  • the first communication capability information may include first communication connection information, device status information, and signal quality information; may include first communication connection information and device status information; and may also include first communication connection information and signal quality information. Of course, it may also include only the first communication connection information.
  • the first communication connection information may characterize which communication connections are supported by the first electronic device, that is, the communication connections supported by the first electronic device may be known through the first communication connection information.
  • the mobile phone supports Wi-Fi, Wi-FiP2P, and BLE.
  • the first communication connection information (that is, the communication capability set) includes Wi-Fi, Wi-FiP2P, and BLE and corresponding related information (for example, Wi-FiP2P Protocol information, version information, etc.).
  • the above-mentioned device status information refers to information that can characterize the current status of the first electronic device.
  • the device status information of the mobile phone can include whether it is in a charging state, current remaining power, current flow usage status, and so on.
  • the above-mentioned signal quality information refers to the signal quality that can characterize the current various communication connections of the first electronic device, for example, the current Wi-Fi signal quality.
  • the signal quality can be determined by signal strength and throughput.
  • the foregoing second communication capability information may refer to information that characterizes the communication capability of the second electronic device, which may include, but is not limited to, the second communication connection information (which may also be referred to as a communication capability set), device status information, signal quality information, etc.
  • the second communication capability information may include second communication connection information, device status information, and signal quality information; may include second communication connection information and device status information; and may also include second communication connection information and signal quality information. Of course, it may also include only the second communication connection information.
  • the second communication connection information may characterize which communication connections the second electronic device supports, that is, the communication connections supported by the second electronic device can be known through the second communication connection information.
  • the second communication connection information (ie, communication capability set) includes Wi-Fi, Wi-FiP2P and corresponding related information (for example, Wi-FiP2P protocol information, Version information, etc.).
  • the above-mentioned device status information refers to information that can characterize the current status of the second electronic device.
  • the device status information of the mobile phone can include whether it is in a charging state, the current remaining power, the current flow usage, and so on.
  • the above-mentioned signal quality information refers to the signal quality that can characterize the current various communication connections of the second electronic device, for example, the signal quality of Wi-Fi.
  • the signal quality can be determined by signal strength and throughput.
  • first communication capability information may be information obtained in advance and stored locally in the first electronic device.
  • the first electronic device can read the first communication capability information locally.
  • the second communication capability information may be obtained by the first electronic device through the first communication channel.
  • the first electronic device may obtain the second communication capability information of the second electronic device through the first communication channel in advance. For example, when the first electronic device and the second electronic device establish a connection for the first time, the second The electronic device is sent to the first electronic device; it can also be obtained through the first communication channel when needed. For example, the first electronic device passes the first communication channel after determining that the first communication channel does not meet the transmission service requirements of the first data to be transmitted. Obtained in one channel.
  • the first electronic device may, according to the transmission service type, the first communication capability information of the first electronic device and the second communication capability information of the second electronic device, Establish a second communication channel with the second electronic device that meets the transmission service requirements of the data to be transmitted.
  • the number and type of the second communication channels can be arbitrary. Generally, there may be only one second communication channel, and the bandwidth of the second communication channel is greater than the bandwidth of the first communication channel. In special cases, there may be multiple second communication channels. At this time, the bandwidth of one or more of the multiple second communication channels may be less than the bandwidth of the first communication channel, and the multiple second communication channels jointly complete data transmission. business.
  • the second communication channel may be the optimal communication channel among the channels that can meet the transmission service requirements of the first data to be transmitted at the current moment.
  • the second communication channel can be the optimal channel among the multiple; and if only one communication channel can meet the transmission of the first data to be transmitted For business requirements, this communication channel is the optimal channel.
  • the optimal channel may be the channel with the best transmission performance, for example, the highest bandwidth and the lowest transmission delay.
  • the optimal channel can also be determined according to the transmission service type of the first service data to be transmitted. For example, for message-type transmission services, the channel with the lowest transmission delay is the optimal transmission channel.
  • the channel with the smallest end-to-end transmission time is the optimal transmission channel.
  • the channel with the least connection restriction can be used as the optimal communication channel.
  • the connection establishment limit can include but is not limited to the number of connections that can be connected. The greater the number of connections, the smaller the connection establishment limit. For example, at a certain moment, both Wi-Fi connection and Wi-Fi P2P connection can meet the video of a certain bit rate. The requirements for streaming data, and the number of Wi-Fi connections that can be connected is 10, and the number of Wi-Fi P2P connections is 4, and the Wi-Fi connection is used as the optimal communication channel.
  • an optimal channel can be selected from these communication channels as the second communication. aisle. That is, although the second communication channel at this time cannot meet the transmission service requirements of the first data to be transmitted, it is the optimal communication channel among all the transmission links at the current moment. In this way, when the existing connection channel cannot meet the needs of the transmission service, dynamic decision-making and establishment of the optimal communication channel at the current moment, using the optimal communication channel to transmit data, can also increase the data transmission rate to a certain extent and increase the user Experience. In this case, the method for determining the optimal channel can be referred to the method mentioned above, which will not be repeated here.
  • the first electronic device can establish a second communication channel with the second electronic device according to the transmission service type and the communication capability information of the devices at both ends, including but not limited to the following two methods.
  • the communication channel priority of various transmission service types is preset.
  • the message-type transmission service is characterized by a small amount of data, but requires high transmission delay and reliability.
  • the priority of the communication channel of the message transmission service can be set as: existing communication channel>temporary new communication channel. That is, for message-type transmission services, if the existing communication channel can meet the transmission service requirements, there is no need to temporarily create a new communication channel. If the existing communication channel cannot meet the transmission service requirements, a communication channel that can meet the transmission service requirements can be determined according to the transmission service type, the first communication capability information, and the second communication capability information.
  • the channel with a short link establishment time and that can meet the transmission service requirements is preferred.
  • the priority of the temporary new communication channel of the message transmission service may be: Wi-Fi STA>BLE>Wi-FiP2P>BR.
  • File transfer services are characterized by a large amount of data and high reliability requirements.
  • the communication channel priority of file transfer services can be set as: high-bandwidth communication channel>low-bandwidth communication channel. Specifically, it can be: USB>Wi-Fi P2P 5G> Wi-Fi 5G> Wi-Fi P2P 2G> Wi-Fi 2G> Classic Bluetooth BR.
  • the corresponding data characteristics of multimedia streaming services are large data volume, high bandwidth requirements, and high transmission delay requirements.
  • the priority of communication channels corresponding to streaming media data of different bit rates may be different.
  • the communication channel priority of streaming media data with a bit rate higher than 1080P is: Wi-Fi P2P 5G>Wi-Fi 5G>Wi-Fi P2P 2G>Wi-Fi 2G>Classic Bluetooth BR.
  • the priority of the communication channel of streaming media data with a code rate of 1080P and below is: Wi-Fi 5G>Wi-Fi 2G>Classic Bluetooth BR.
  • the priority of the communication channel corresponding to the transmission service type is obtained.
  • the corresponding communication channel priority can be USB>Wi-Fi P2P 5G> Wi-Fi 5G> Wi-Fi P2P 2G> Wi-Fi 2G> Classic Bluetooth BR.
  • first communication capability information and the second communication capability information contain different information, the process of determining the target communication channel type may be different, and the determined target communication channel type may also be different.
  • the process of determining the target communication channel type may include: obtaining the location of the first electronic device according to the first communication connection information. Supported communication connection, obtain the communication connection supported by the second electronic device according to the second communication connection information, and then determine the candidate channel type corresponding to the service type to be transmitted.
  • the candidate channel type may satisfy the transmission of the first data to be transmitted The type of communication channel required by the business. Then, according to the preset communication channel priority corresponding to the transmission service type of the first data to be transmitted, the communication channel type with the highest priority is determined from the candidate channel types, and the communication channel type with the highest priority is used as the target communication channel type .
  • the target communication channel type determined only based on the first communication connection information, the second communication connection information, and the channel priority corresponding to the transmission service type may not meet the transmission service requirements of the first data to be transmitted. Because the priority of the communication channel is determined based on the theoretical maximum bandwidth and minimum delay, in actual situations, there will be various factors that affect the bandwidth, packet loss rate, and transmission delay of the communication channel. However, the determined target communication channel type can still increase the data transmission rate to a certain extent and improve user experience. Of course, taking into account the influence of various factors in practical applications, it can be determined by combining indicators such as the bandwidth, delay, and packet loss rate of the communication channel at the current moment.
  • the process of determining the type of target communication channel can also include:
  • the first candidate communication channel type is a channel type that meets the transmission service requirements of the first data to be transmitted.
  • the communication connection type supported by both the first electronic device and the second electronic device may be determined. Then, the currently monitored packet loss rate, transmission delay, and bandwidth of various communication connections can be combined to select a communication channel type that both devices support and meet the transmission service requirements as the first candidate communication channel type. For the judgment of whether the transmission service requirements are met, please refer to the relevant content mentioned above, which will not be repeated here.
  • the communication channel type with the highest priority may be determined from the first candidate communication channel types according to the communication channel priority corresponding to the transmission service type of the first data to be transmitted, and the priority is the highest.
  • the communication channel type of is used as the target communication channel type.
  • the target communication channel type determined by the latter is more effective than the former. And the latter can decide an optimal communication channel from multiple transmission links that meet the needs of transmission services, which can further increase the data transmission rate.
  • the first electronic device is a mobile phone
  • the second electronic device is a smart TV.
  • the mobile phone needs to be screened to the smart TV, that is, the data to be transmitted is a screen-casting data stream.
  • the mobile phone and smart TV are connected under the same wireless router.
  • the wireless router can be used as a wireless access point ((Access Point, AP) (hereinafter may be referred to as wireless AP or AP).
  • the communication connections supported by the mobile phone are: Wi-Fi P2P , Wi-Fi, BLE.
  • the communication connections supported by smart TVs are: Wi-Fi P2P, Wi-Fi.
  • the communication connections supported by mobile phones and smart TVs are: Wi-Fi P2P, Wi-Fi.
  • the screen data stream belongs to multimedia Streaming transmission services, and the channel priority of multimedia streaming transmission services can be: Wi-Fi P2P>Wi-Fi.
  • the target communication channel type between mobile phones and smart TVs is Wi-Fi P2P.
  • the first communication capability information includes not only the first communication connection information, but also at least one of device status information and signal quality information of the first electronic device.
  • the second communication capability information also includes at least one of the device status information and signal quality information of the second electronic device.
  • the process of determining the target communication channel type may include: The connection information and the second communication connection information are used to obtain the communication connection supported by both the first electronic device and the second electronic device; based on the channel priority of the communication connection supported by both electronic devices, combining the device status information and the signal quality information At least one, the target communication channel type is determined.
  • the first electronic device may first base on the first communication connection information and the second communication connection information.
  • the communication connection information determines the communication connection supported by both the first electronic device and the second electronic device, and then determines the target communication channel type according to the channel priority and the device status information.
  • the device state information may include charging state and non-charging state, and power information of the device, that is, through the device state information, it can be known whether the electronic device is in a charging state, and the current remaining power and other information.
  • the first electronic device is a mobile phone
  • the second electronic device is a computer
  • the data to be transmitted is image file data, which belongs to the file-type transmission business.
  • the existing connection channel between the mobile phone and the computer is a Wi-Fi connection. According to the set of communication capabilities of the mobile phone and the computer, it can be determined that the communication connections supported by both the mobile phone and the computer are Wi-Fi P2P, Wi-Fi, and BLE.
  • the priority of the communication channel corresponding to the file transfer service is Wi-Fi P2P>Wi-Fi>BLE.
  • the mobile phone is in a non-charging state, and the current remaining power of the mobile phone is very low (for example, the remaining power is lower than a certain power threshold), and the computer is in a charging state, and the current remaining power is 100%.
  • the low power of the mobile phone if the power consumption of the communication channel is too high, the power of the mobile phone will be exhausted quickly, resulting in the incomplete transmission of picture file data to the computer.
  • a communication channel with lower power consumption and higher priority of the communication channel can be selected as the target communication channel type.
  • Wi-Fi P2P has the highest power consumption, followed by Wi-Fi, and BLE has the lowest power consumption.
  • Wi-Fi connection or BLE connection can be selected as the target communication channel type.
  • the first electronic device may first base on the first communication connection information and the second communication connection information. Information, determine the communication connections supported by both the first electronic device and the second electronic device, and then combine the communication channel priority and signal quality information to determine the target communication channel type.
  • the signal quality information can characterize the signal quality of each communication connection, that is, the signal quality information of the device can be used to know the signal quality of the communication connection supported by the device.
  • the first electronic device is a mobile phone
  • the second electronic device is a smart TV.
  • the mobile phone needs to be screened to the smart TV.
  • the data to be transmitted is a screen-casting data stream, which belongs to the multimedia streaming service.
  • the existing connection channels of the mobile phone and the smart TV are classics. Bluetooth. According to the communication capability set of the mobile phone and the communication capability set of the smart TV, it is determined that the communication connections supported by both the mobile phone and the smart TV are Wi-Fi P2P, Wi-Fi, and BLE.
  • the channel priority of multimedia streaming services is Wi-Fi P2P>Wi-Fi>BLE.
  • the distance between the mobile phone and the smart TV is very long, and it is known from the signal quality information of the mobile phone and the smart TV that the Wi-Fi P2P signal is very poor.
  • the communication channel with better signal quality and higher channel priority can be selected as the target communication channel type.
  • the mobile phone can select Wi-Fi connection as the target communication channel type.
  • the first electronic device may first The communication connection information and the second communication connection information determine the communication connections supported by both the first electronic device and the second electronic device, and then combine the communication channel priority, device status information and signal quality information to determine the target communication channel type. For example, select a communication channel with lower power consumption, higher signal quality, and higher priority of the communication channel as the target communication channel.
  • the training process of the classifier may include: first setting up some typical input and corresponding output relationships to generate the initial classifier; then using several typical transmission service types, using multiple connection links for data communication, and collecting two The status information of the end device is recorded, and the selection result of the transmission link during each data transmission is recorded; then, according to the collected data of the two end devices, the classifier is continuously revised to obtain the trained classifier.
  • the type of the above-mentioned classifier may be arbitrary.
  • the classifier may be a deep learning model, a neural network model, or a decision tree.
  • the training data set of the classifier can include, but is not limited to, the type of service to be transmitted, the communication connection (that is, the communication capability set) supported by the device, tag information, and the corresponding information of various communication connections (for example, throughput, signal strength) And available bandwidth, etc.).
  • the above-mentioned tag information may characterize the target communication channel type corresponding to the data to be transmitted, and the target communication channel type is preset. Use the training data set to train a pre-built classifier to obtain a trained classifier.
  • the classifier can be continuously modified according to the output result of the classifier to continuously improve the classification accuracy of the classifier. Specifically, the target communication channel type output by the classifier is recorded, and then the target communication channel type is artificially determined whether the target communication channel type is optimal, and if it is not, the classifier is corrected accordingly according to the difference between the two.
  • the trained classifier can output a communication channel type that can meet the business requirements of the business data to be transmitted based on the input related information. Specifically, the first electronic device inputs the transmission service type of the service data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device into the trained classifier to obtain the classification The type of target communication channel output by the device.
  • the first electronic device may only determine the target communication channel type based on the first communication connection information and the second communication connection information, or it may additionally be based on the first communication connection information and the second communication connection information. Combining at least one of the device status information and the signal quality information to determine the target communication channel type. In comparison, the target communication channel type determined by the latter is more in line with the transmission service requirements of the data to be transmitted, and the user experience is higher.
  • Step 2 Establish a target communication channel corresponding to the target communication channel type with the second electronic device, and use the target communication channel as the second communication channel.
  • the second communication channel corresponding to the target communication channel type can be established with the second electronic device through the first communication channel.
  • the established second communication channel may be a communication link that meets the current transmission service requirements, but is not an optimal communication link; it may also be an optimal communication link that meets the current transmission service requirements and is an optimal communication link. It may also be the optimal communication channel at the current moment that does not meet the current transmission service requirements.
  • Step S104 The first electronic device transmits the first data to be transmitted to the second electronic device through the second communication channel.
  • the first electronic device when the first electronic device detects that the existing connection channel does not meet the current transmission service requirements of the data to be transmitted, it automatically communicates with the first electronic device according to the transmission service type and the communication capability information of the first electronic device and the second electronic device. Second, the electronic device establishes a second communication channel that meets the needs of the transmission service, which increases the data transmission rate and improves the user experience.
  • FIG. 2 shows a schematic block diagram of another flow chart of the data transmission method provided by the embodiment of the present application
  • the method is applied to the first electronic device, and the method may include the following steps:
  • Step S201 The first electronic device obtains first data to be transmitted.
  • Step S202 The first electronic device detects whether there is a first communication channel between the first electronic device and the second electronic device. If yes, go to step S203, if not, go to step S209.
  • the first electronic device may first determine the transmission service type of the first data to be transmitted, and determine the transmission service requirement of the first data to be transmitted according to the transmission service type . Then, go to step S203 again.
  • Step S203 The first electronic device determines whether the first communication channel meets the transmission service requirement of the first data to be transmitted. If it can be satisfied, then go to step S204, if not, then go to step S205.
  • Step S204 The first electronic device transmits the first data to be transmitted to the second electronic device through the first communication channel.
  • Step S205 The first electronic device obtains its own first communication capability information, and obtains the second communication capability information of the second electronic device through the first communication channel.
  • Step S206 The first electronic device determines, according to the transmission service type, the first communication capability information, and the second communication capability information, a target communication channel type that meets the transmission service requirements of the first data to be transmitted.
  • the second electronic device may also determine the above-mentioned target communication channel type according to the first communication capability information and the second communication capability information in combination with the transmission service type. Specifically, after the first electronic device obtains the data to be transmitted, it first determines the transmission service type of the data to be transmitted; then, the first electronic device can transmit the transmission service type and its own first communication capability information to the The second electronic device; finally, the second electronic device determines the target communication channel type according to the first communication capability information, the second communication capability information, and the transmission service type. After the second electronic device determines the target communication channel type, it can establish a corresponding target communication channel with the first electronic device through the first communication channel. Wherein, the process of determining the target communication channel type by the second electronic device is the same as the process of determining the target communication channel type by the first electronic device, which will not be repeated here.
  • Step S207 The first electronic device establishes a target communication channel (ie, a second communication channel) corresponding to the target communication channel type with the second electronic device through the first communication channel.
  • a target communication channel ie, a second communication channel
  • the first electronic device can use the first communication channel to establish the corresponding target communication channel. For example, if the target communication channel type is Wi-Fi P2P, and the first communication channel is Wi-Fi connection, the existing Wi-Fi connection is used to establish a Wi-Fi P2P connection between the two devices.
  • Step S208 The first electronic device transmits the first data to be transmitted to the second electronic device through the target communication channel (ie, the second communication channel).
  • the target communication channel ie, the second communication channel
  • step S209 the first electronic device and the second electronic device establish a third communication channel, use the third communication channel as the first communication channel, and return to the foregoing step S203 or step S205.
  • a third communication channel is first established. Then, the third communication channel can be used as the first communication channel, and steps S203 to S208 are executed. In some other embodiments, step S203 may not be executed, but steps S205 to S208 may be entered, that is, it is not necessary to monitor whether the third communication channel can meet the transmission service requirements of the data to be transmitted, but directly obtain the data through the third communication channel.
  • the communication capability set, device status, signal quality and other data of the second electronic device determine the target communication channel type that can meet the current transmission service requirements. If the determined target communication channel type is the third communication channel, then the third communication channel is used as the target communication channel. If the third communication channel is not the target communication channel, the third communication channel is used to establish the target communication channel.
  • the first electronic device is a mobile phone
  • the second electronic device is a smart TV.
  • the mobile phone first establishes a new communication channel with the smart TV, and the type of the newly established communication channel can be arbitrary.
  • a mobile phone and a smart TV can first establish a BLE connection through the BLE mesh networking technology. After the mobile phone and the smart TV establish a BLE connection, the mobile phone can first detect whether the BLE connection can meet the current transmission service requirements. The data automatically determines the target communication channel type that meets the current transmission business needs.
  • the mobile phone After determining the target communication channel type that meets the current transmission service requirements, the mobile phone can establish the target communication channel corresponding to the communication channel type through the established BLE connection, for example, establish the Wi-Fi connection between the mobile phone and the smart TV through the BLE connection. FiP2P connection.
  • the mobile phone can also not detect whether the newly established BLE connection can meet the current transmission service requirements, but obtain the smart TV's communication capability set, device status, signal quality and other data through the BLE connection, and automatically decide to meet the current transmission.
  • the type of communication channel required by the business and then determine whether the target communication channel type is a newly established BLE connection, if so, use the newly established BLE connection to transmit business data; if the target communication channel type is not a newly established BLE connection , The target communication channel corresponding to the target communication channel type is established through the BLE connection.
  • the first electronic device when the first electronic device and the second electronic device use the second communication channel to transmit service data, the first electronic device can monitor the second communication channel in real time to monitor whether the second communication channel can satisfy the transmission service. need. If it is detected that the second communication channel cannot meet the transmission service requirements, switch to another existing communication channel, or merge the second communication channel with the existing communication channel, and use the merged multiple communication channels to transmit the service data to be transmitted.
  • the second communication channel is a Wi-Fi P2P connection
  • the first communication channel is a Wi-Fi connection.
  • the first electronic device uses the Wi-Fi P2P connection to transmit data and detects that the signal quality of the Wi-Fi P2P connection is poor, it can switch to the Wi-Fi connection, that is, use the Wi-Fi connection to transmit business data.
  • the first electronic device may also integrate Wi-Fi P2P connection and Wi-Fi connection, that is, use Wi-Fi P2P connection and Wi-Fi connection to transmit data.
  • the first electronic device may also allocate or establish a corresponding communication channel for the data to be transmitted according to the priority of the data to be transmitted.
  • the process of transmitting the first data to be transmitted through the second communication channel if a new piece of second data to be transmitted comes, it can be determined according to the data priority of the second data to be transmitted and the first data to be transmitted.
  • the communication channel for transmitting the second data to be transmitted is not limited to the data priority of the second data to be transmitted.
  • the second data to be transmitted is acquired.
  • the data priority of the second data to be transmitted is higher than the data priority of the first data to be transmitted.
  • the first electronic device determines the transmission service type of the second data to be transmitted, and determines the transmission service requirement of the second data to be transmitted according to the transmission service type of the second data to be transmitted.
  • the first electronic device can determine whether the first communication channel and the second communication channel meet the transmission service requirements of the second data to be transmitted. If neither the first communication channel nor the second communication channel meets the transmission service requirements of the first data to be transmitted, then according to the transmission service type of the second data to be transmitted, the first communication capability information of the first electronic device, and the second electronic device The second communication capability information of the second communication capability information to determine the fourth communication channel type that meets the transmission service requirements of the second data to be transmitted;
  • the type of the fourth communication channel is the same as the type of the second communication channel, transmit the second data to be transmitted to the second electronic device through the second communication channel, switch the first data to be transmitted to the first communication channel for transmission, or establish The fifth communication channel transmits the first data to be transmitted to the second electronic device through the fifth communication channel.
  • the second communication channel meets the transmission service requirements of the second data to be transmitted, it may be because the second communication channel already has the corresponding transmission service, that is, the resources of the second communication channel have been occupied, so It is determined that the second communication channel cannot meet the transmission service requirements of the second to-be-transmitted data. However, the decision is made based on the transmission service type and the communication capability information of the devices at both ends, etc., and it is determined that the second communication channel is the optimal channel. At this time, since the priority of the second data to be transmitted is higher than the first data to be transmitted, the first data to be transmitted that originally occupied the second communication channel can be switched to other communication channels, and then the second communication channel can be used to transmit the first data. Second, data to be transmitted.
  • the first electronic device may switch the first data to be transmitted to the second communication channel for transmission. Moreover, if there is a fifth communication channel, it can be determined first whether there is a corresponding service on the fifth communication channel, and if not, the fifth communication channel can be removed.
  • the priority of the data to be transmitted can be set according to the application corresponding to the data to be transmitted.
  • the priority of the data to be transmitted of the foreground application is higher than the priority of the data to be transmitted of the background application.
  • the priority of the data to be transmitted by the application is higher than the priority of the data to be transmitted by the third-party application.
  • the high-priority data to be transmitted can preempt the communication channel of the low-priority data to be transmitted. In this way, the user experience can be further improved.
  • the priority of the data to be transmitted can be determined based on several principles. These principles can be: the priority of the control type of business is higher than the priority of the data type of business, and the priority of the data to be transmitted in the foreground application is higher. The priority of the data to be transmitted in the background application and the priority of the data to be transmitted in the system-level application are higher than the priority of the data to be transmitted in the third-party application.
  • the control service may include control instruction data
  • the data service may include files and multimedia stream data.
  • System-level applications and third-party applications can be distinguished by the size of the user identification (UID) of the application.
  • system-level applications can be, for example, phones, photo albums, and related applications that support the basic functions of the mobile phone.
  • control service data may generally include control instruction data
  • data service data may generally include file data and multimedia stream data
  • the second communication channel can be used to transmit the data B to be transmitted, and a new communication channel can be established to transmit the data A to be transmitted, or other existing communication channels can also be used to transmit the data A to be transmitted.
  • the first electronic device is a mobile phone
  • the second electronic device is a smart TV
  • the mobile phone needs to be screened to the smart TV.
  • the first communication channel is a Wi-Fi connection
  • the mobile phone can first detect whether the Wi-Fi connection can meet the transmission business requirements of the projection data stream. If the Wi-Fi connection cannot meet the transmission service requirements of the projection data stream, the mobile phone can determine the current optimal connection channel as the Wi-Fi P2P connection according to the transmission service type and the communication capability information of the devices at both ends. Then, the mobile phone establishes a Wi-Fi P2P connection (that is, the second communication channel) with the smart TV, which is used to transmit the screen projection data stream and realize the screen projection service.
  • a Wi-Fi P2P connection that is, the second communication channel
  • the mobile phone and smart TV use Wi-Fi P2P connection to transmit the screen data stream
  • the user sends a control instruction to the smart TV through the mobile phone, and the control instruction is used to control the smart TV to turn on its own camera.
  • the mobile phone can first determine whether the existing Wi-Fi P2P connection can meet the transmission service requirements of the control command data. If the Wi-Fi P2P connection can meet the needs of the transmission service, the mobile phone determines that the existing Wi-Fi P2P connection is the best channel according to the communication channel priority of the message transmission service: existing connection channel> temporary new communication channel.
  • the Wi-Fi P2P connection can be used to transmit the control instruction to the smart TV, and the projection data stream can use another communication connection (for example, Wi-Fi )transmission.
  • the mobile phone can also re-establish a new communication channel through the solution provided in the embodiment of the present application for transmitting the screen data stream.
  • the transmission channel is used to transmit data with higher data priority, and the data with lower data priority is switched to another communication channel for transmission. Ensure to further improve data transmission performance.
  • multiple communication channels may exist between devices at the same time. For example, at certain moments, there are Wi-Fi connections and Wi-Fi P2P connections between the mobile phone and the smart TV. When there are multiple communication channels, multiple communication channels can be mutually equipped. When one communication channel does not meet the requirements of the current transmission service, it can be switched to another communication channel. In addition, multiple communication channels can also be integrated for data transmission.
  • one or more of the communication channels can be automatically removed first to improve the transmission bandwidth and other performance of one of the target communication channels. After the data transmission is completed, the previously dismantled communication channel is automatically established according to business requirements.
  • the first electronic device or the second electronic device can also remove other communication channels according to the actual situation to improve The data transmission performance of the second communication channel further improves user experience.
  • the first electronic device or the second electronic device can first determine whether other communication channels have corresponding services. If the other communication channels do not have corresponding services, the other communication channels can be removed first to improve the performance of the second communication channel. After the transmission of the data to be transmitted is completed, or other communication channels need to be used, the other communication channels that were removed before are re-established; if other communication channels have corresponding services, other communication channels are not removed. For example, other communication channels are Wi-Fi connections. If the user is using Wi-Fi to surf the Internet, the Wi-Fi connection will not be removed. If you are not using a Wi-Fi connection, you can remove the Wi-Fi connection first to improve the performance of the Wi-Fi P2P connection.
  • a Wi-Fi connection and a Wi-Fi P2P connection exist between two electronic devices at the same time.
  • the bandwidth of the Wi-Fi P2P connection will be affected and the performance will be poor.
  • the Wi-Fi connection between the devices can be automatically disconnected, thereby making the bandwidth of the Wi-Fi P2P connection higher and improving the performance of the Wi-Fi P2P connection.
  • Wi-Fi and Wi-Fi P2P connections exist between a mobile phone and a smart TV at the same time, and the mobile phone and smart TV transmit wireless projection service data through the Wi-FiP2P connection.
  • Factors such as poor quality) make Wi-Fi P2P connections no longer meet the data transmission requirements of wireless projection services.
  • Wi-Fi connection can't satisfy the business transmission demand either.
  • the Wi-Fi connection channel and Wi-Fi P2P connection can be merged, and the merged connection channel can be used to transmit business data; the Wi-Fi connection can also be automatically removed to improve the performance of the Wi-Fi P2P connection, so that Wi-Fi FiP2P connection can meet current business transmission needs.
  • the first electronic device After acquiring the first data to be transmitted, the first electronic device can determine whether the existing connection channel can meet the transmission service requirements according to the transmission service type of the first data to be transmitted. If not, then according to the transmission service type and the equipment at both ends For the communication capability information, a second communication channel for transmitting the first to-be-transmitted data is automatically established.
  • the method may include the following steps:
  • Step S301 The first electronic device determines the transmission service type of the first data to be transmitted.
  • Step S302 The first electronic device obtains second communication capability information of the second electronic device, where the second communication capability information includes second communication connection information used to characterize the communication connection type supported by the second electronic device.
  • the second communication capability information may be obtained in advance and stored locally in the first electronic device. For example, when the first electronic device and the second electronic device establish a connection for the first time, the second electronic device sends the second communication capability information to the first electronic device, and then the first electronic device stores it locally. At this time, the first electronic device can obtain the information by reading the local second communication capability information.
  • the second communication capability information may also be obtained from the second electronic device through the first communication channel when the first electronic device needs the second communication capability of the second electronic device.
  • Step S303 The first electronic device determines the target communication of the first data to be transmitted according to the transmission service type of the first data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device Channel type; the first communication capability information includes first communication connection information used to characterize the type of communication connection supported by the first electronic device.
  • the target communication channel type is the optimal communication channel type for transmitting the first data to be transmitted.
  • the target communication channel type is the optimal communication channel type for transmitting the first data to be transmitted in the current state.
  • the optimal communication channel may be the optimal channel type that meets the transmission service requirements of the first data to be transmitted, or may not meet the transmission service requirements of the first data to be transmitted, but is the optimal communication channel type under current conditions.
  • the optimal channel can be defined according to the service type. For example, the optimal channel corresponding to a message-type service is the channel with the smallest transmission delay. Of course, it can also be defined according to the bandwidth and packet loss rate.
  • steps S301 to S303 are similar to the related content of the embodiment corresponding to FIG. 1 and FIG.
  • Step S304 If the type of the target communication channel is the same as the type of the first communication channel, the first electronic device transmits the first data to be transmitted to the second electronic device through the first communication channel.
  • the first communication channel is an existing connection channel between the first electronic device and the second electronic device.
  • the first electronic device can transmit the first to-be-transmitted data to the second electronic device through the first communication channel.
  • Step S305 If the target communication channel type is different from the first communication channel type, the first electronic device and the second electronic device establish a second communication channel corresponding to the target communication channel type, and transmit the first data to be transmitted through the second communication channel Transfer to the second electronic device.
  • the first communication channel is a BLE connection and the target communication channel type is a Wi-Fi P2P connection, it is considered that the target communication channel type is different from the first communication channel type, and the first electronic device can communicate with the second electronic device through the first communication channel.
  • the device establishes a second communication channel, and uses the second communication channel to transmit the first data to be transmitted.
  • the process of determining the target communication channel type may include: determining the second candidate communication channel type according to the first communication connection information and the second communication connection information; according to the priority of the communication channel corresponding to the transmission service type, starting from the first Determine the communication channel type with the highest priority among the two candidate communication channel types, and use the communication channel type with the highest priority as the target communication channel type.
  • the first communication capability information further includes at least one of device status information and signal quality information of the first electronic device
  • the second communication capability information further includes device status information and signal quality information of the second electronic device. At least one of the information;
  • the second candidate communication channel type is a communication channel type supported by both the first electronic device and the second electronic device;
  • the device state information and signal quality information of the first electronic device determine the first to-be-transmitted type from the second candidate communication channel type The target communication channel type of the data.
  • a transmission link with low power consumption may be selected as the target communication channel type according to the device status information and the like.
  • a transmission link with good signal quality is selected as the target communication channel type according to the signal quality information.
  • a transmission link with appropriate signal quality and appropriate power consumption is selected as the target communication channel type according to the device status information and signal quality information.
  • the data priority of the second data to be transmitted is higher than that of the first data to be transmitted. class. First determine the transmission service type of the second data to be transmitted, and then determine that the second communication capability is satisfied according to the transmission service type of the second data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device.
  • the fourth communication channel type is the type of the optimal communication channel for transmitting the second data to be transmitted.
  • the method for determining the optimal communication channel can be referred to the corresponding content above, which will not be repeated here.
  • the type of the fourth communication channel is the same as the type of the second communication channel, transmit the second data to be transmitted to the second electronic device through the second communication channel, switch the first data to be transmitted to the first communication channel for transmission, or establish The fifth communication channel transmits the first data to be transmitted to the second electronic device through the fifth communication channel.
  • a fourth communication channel corresponding to the fourth communication channel type is newly established, and the fourth communication channel is used to transmit the second data to be transmitted.
  • the solution for establishing a communication connection provided in the embodiments of the present application can be applied to various business scenarios such as wireless screen projection, wireless mutual transmission, and multi-screen collaboration.
  • various business scenarios such as wireless screen projection, wireless mutual transmission, and multi-screen collaboration.
  • the following will exemplarily combine several possible scenarios for introduction.
  • the mobile phone 41, the tablet 42 and the smart TV 43 are all connected to the same wireless router 44, that is, the mobile phone 41, the tablet 42 and the smart TV 43 can be connected wirelessly.
  • the router 44 communicates, that is, there is an existing connection channel between the mobile phone 41, the tablet 42 and the smart TV 43.
  • the existing connection channel is a connection channel based on a wireless AP (Access Point), that is, between the mobile phone, the tablet and the smart TV.
  • the wireless AP can communicate with each other.
  • Mobile phones, tablets, and smart TVs are all distributed devices.
  • the mobile phone 41 can support Wi-Fi P2P, Wi-Fi, BR and BLE.
  • the tablet 42 may support Wi-Fi P2P, Wi-Fi, BR and BLE.
  • the smart TV 43 can support Wi-Fi P2P, Wi-Fi, BR and BLE.
  • the mobile phone 41 needs to project the screen to the smart TV 43.
  • the interaction process of the mobile phone 41 and the smart TV 43 refer to the schematic diagram of the wireless screen projection business process shown in FIG. 5.
  • the wireless screen projection business process may include:
  • Step S501 The mobile phone obtains the data to be projected.
  • Step S502 When the mobile phone detects that the existing connection channel cannot meet the transmission service requirements of the data to be projected, it acquires data such as the communication capability set, device status, and signal quality of the smart TV through the existing connection channel.
  • the mobile phone can first detect whether there is an existing communication channel between the smart TV and the mobile phone when the user initiates the wireless projection service data transmission. If so, it is further checked whether the existing communication channel can meet the transmission demand of wireless projection service data.
  • the existing connection channel may not meet the data transmission requirements of the wireless projection service.
  • Step S503 The mobile phone determines that the target communication channel type that meets the transmission service requirements of the data to be projected is Wi- Fi P2P connection. Or, it is determined that the current optimal communication channel is Wi-FiP2P.
  • Step S504 The mobile phone establishes a Wi-Fi P2P connection between the mobile phone and the smart TV through the existing connection channel.
  • the mobile phone and the smart TV transmit the link establishment information of the Wi-Fi P2P connection through the existing connection channel, and then the mobile phone and the smart TV perform a Wi-Fi P2P handshake according to the link establishment information to establish a Wi-Fi P2P connection.
  • the Wi-Fi P2P link establishment information may include, but is not limited to, channel, Media Access Control Address (MAC address), Password, Service Set Identifier (SSID), etc.
  • Step S505 The mobile phone transmits the data to be projected to the smart TV through the Wi-Fi P2P connection, so as to realize the wireless projecting service.
  • the technical solution provided by the embodiments of the present application can automatically determine the communication channel that can meet the wireless projection data transmission service requirements when the existing connection channel does not meet the wireless projection data transmission requirements, and then use the existing connection channel.
  • There is a connection channel to automatically establish a Wi-Fi P2P connection so based on the inherent hardware foundation of the mobile phone and smart TV, the most suitable connection channel between the mobile phone and the smart TV is established without the user's perception, and the user experience is improved.
  • the mobile phone when the wireless projection service data is transmitted between the mobile phone and the smart TV through the Wi-Fi P2P connection, the mobile phone can monitor in real time whether the Wi-Fi P2P connection can meet the transmission requirements of the wireless projection service data. If not, the mobile phone can integrate the two communication channels of Wi-Fi P2P connection and Wi-Fi connection, and use multiple communication channels to transmit wireless projection service data.
  • the mobile phone 41 needs to project the screen to the tablet 42 and the smart TV 43, that is, the mobile phone 41 transmits the projection data stream to the tablet 42 and the smart TV 43 at the same time.
  • the existing connection channel between the mobile phone 41 and the tablet 42, the mobile phone 41 and the smart TV 33 is a Wi-Fi P2P connection.
  • the bandwidth of Wi-Fi P2P connection is very high, and it can generally meet the transmission service requirements of projection data stream.
  • the mobile phone 41 has two Wi-Fi P2P connections, and both of the two communication channels need to occupy a certain bandwidth, and the bandwidth allocated to each of them does not meet the transmission service requirements of the projection data stream.
  • the mobile phone can integrate Wi-FiP2P and Wi-Fi, and use Wi-FiP2P and Wi-Fi to transmit the screen data stream.
  • the mobile phone can also switch one of the Wi-Fi P2P connections to a Wi-Fi connection.
  • the decision can also be made in conjunction with the data priority of the data to be transmitted.
  • the mobile phone 41 when the mobile phone 41 is using Wi-Fi P2P to transfer file data to the tablet 42, the user is also watching a video on the mobile phone at the same time, and needs to project the video on the mobile phone to the smart TV 43.
  • the mobile phone can use Wi-FiP2P to transmit video stream data according to the data priority, and switch the file transmission service that is using Wi-FiP2P to another communication channel.
  • the mobile phone 41 can first determine whether the existing wireless router-based connection channel meets the file data transmission service requirements.
  • the mobile phone 41 determines that the router-based connection channel cannot meet the file data transmission service requirements, it will be based on the file data transmission service type, the mobile phone’s communication capability set, device status information and signal quality information, and the tablet’s communication capability set, Device status information and signal quality information determine that the communication channel that meets the requirements of file data transmission services is Wi-FiP2P. Then, the mobile phone 41 and the tablet 42 establish a Wi-Fi P2P connection.
  • the connection channel is used to transfer file data.
  • the user needs to project the video being played on the mobile phone 41 to the smart TV 43.
  • the video playback application of the mobile phone 31 runs in the foreground
  • the file transfer application runs in the background.
  • the priority of the data to be transmitted of the background application is generally lower than the priority of the data to be transmitted of the foreground application, that is, the priority of the projection data stream is higher than the priority of the file data.
  • the mobile phone 41 uses the established Wi-Fi P2P connection to stream the screen projection data to the smart TV 43 to realize the screen projection service.
  • the mobile phone 41 and the smart TV 43 newly establish a Wi-Fi connection, and switch the file transfer service to the Wi-Fi connection, that is, transfer file data through the newly established Wi-Fi connection.
  • the higher-bandwidth Wi-Fi P2P connection can be used to transmit the higher priority screencast data stream, and the lower priority file data can be switched to the newly established Wi-Fi connection.
  • a new Wi-Fi P2P connection can be established to transmit the screen data stream using the solution in the embodiment of this application; a new Wi-Fi connection can also be established using the solution in the embodiment of this application. Transmit screen data stream; you can also use the same Wi-FiP2P to transfer file data and screen data stream.
  • the projection effect of these two schemes is poor.
  • Wi-Fi P2P to transmit data with high priority
  • Wi-Fi to transmit data with low priority
  • both the mobile phone 61 and the tablet 62 need to be screened to the smart TV 63.
  • the mobile phone 61 needs to project the screen to the smart TV 63
  • the tablet 62 needs to project the video screen being played to the smart TV 63.
  • the mobile phone 61 and the smart TV 63, the tablet computer 62 and the smart TV 63 may all perform a process similar to that of FIG. 5 to establish a corresponding second communication channel. Then, the mobile phone 61 and the tablet 62 can project to the smart TV 63 through the established second communication channel.
  • the mobile phone 71 needs to project the lyrics playback interface or video, MV, etc. to the screen of the smart TV 53, and the audio file needs to be transmitted to the smart speaker 72 . In this way, the user can play the audio of the music through the smart speaker 72 and display the lyrics on the smart TV.
  • Both the mobile phone 71 and the smart TV 73 can support Wi-Fi P2P, Wi-Fi, BR and BLE, while the smart speaker 72 can support BLE, BR and Wi-Fi, but does not support Wi-Fi P2P.
  • Both the mobile phone 71 and the smart TV 73 are connected under the same wireless router, that is, the mobile phone 71 and the smart TV 73 have existing connection channels. However, there is no existing connection channel between the mobile phone 71 and the smart speaker 72.
  • the mobile phone 71 when the mobile phone 71 initiates audio file transmission to the smart speaker 72, the mobile phone 71 first detects whether there is an existing communication channel with the smart speaker 72. If not, use BLE ad-hoc networking technology to establish a BLE connection.
  • the mobile phone 71 obtains data such as the communication capability set, device status, and signal quality of the smart speaker through the BLE connection. Then according to the smart speaker's communication capability set, device status, and signal quality, as well as its own communication capability set, device status, and signal quality, determine the target communication channel type that can meet the audio file transmission requirements.
  • the audio file data transmission belongs to the file-type transmission service.
  • the priority of the communication channel corresponding to the file-type transmission service it can be determined that both the mobile phone and the smart speaker support, and the communication channel with the highest priority is the Wi-Fi connection.
  • the communication channel type between the mobile phone and the smart speaker that can meet the audio file data transmission needs is Wi-Fi.
  • the mobile phone 71 can be connected via BLE to establish a Wi-Fi connection with the smart speaker. After the Wi-Fi connection is established, the mobile phone 71 can transmit the audio file of the song to the smart speaker through the Wi-Fi connection.
  • the mobile phone 71 may first determine whether the existing connection channel meets the wireless projection data transmission service requirements. If it cannot be satisfied, the optimal connection channel type is determined to be Wi-Fi P2P based on the respective communication capability sets, device status, and signal quality of mobile phones and smart TVs. The mobile phone 71 then establishes a Wi-Fi P2P connection between the mobile phone and the smart TV according to the existing connection channel.
  • the mobile phone 71 can transmit audio files to the smart speaker 72 through a Wi-Fi connection, and transmit wireless projection data to the smart TV 73 through a Wi-Fi P2P connection.
  • the mobile phone 81 needs to share the photos 83 in the album to the mobile phone 82. There is no existing communication channel between the mobile phone 81 and the mobile phone 82. Both the mobile phone 81 and the mobile phone 82 can support Wi-Fi P2P, Wi-Fi and BLE.
  • the mobile phone 81 detects that there is no existing communication channel with the mobile phone 82.
  • the mobile phone 81 uses the ad hoc network technology to establish a long connection with the mobile phone 82.
  • the BLE ad hoc network technology can be used to establish a Mesh network of the mobile phone 81 and the mobile phone 82.
  • the mobile phone 81 obtains data such as the communication capability set, device status, and signal quality of the mobile phone 82 through the newly established long connection.
  • the mobile phone 81 determines the type of communication channel that can meet the current transmission service requirements as Wi-Fi P2P based on its own communication capability set, device status, and signal quality, as well as the communication capability set, device status, and signal quality of the mobile phone 82.
  • the mobile phone 81 can establish a Wi-Fi P2P connection with the mobile phone 82 through the newly established long connection.
  • the mobile phone 81 can transfer the picture 83 to the mobile phone 82 through the Wi-FiP2P connection.
  • the mobile phone 81 and the mobile phone 82 may also establish a long connection through a mobile hotspot.
  • the mobile phone 81 can open the mobile hotspot, and the mobile phone 82 is connected to the mobile hotspot of the mobile phone 81, so that a long connection is established between the mobile phone 81 and the mobile phone 82.
  • the mobile phone 81 and the mobile phone 82 can determine the communication channel type that can meet the current transmission service requirements, and establish the corresponding target communication channel.
  • FIG. 9 for a schematic diagram of a data transmission scene between a mobile phone and a car machine (also called a car terminal).
  • the mobile phone 91 and the car machine 92 are usually connected in communication based on the Bluetooth connection channel 93.
  • the user may connect the mobile phone 91 and the car machine 92 through the USB data line 94.
  • the mobile phone 91 and the car machine 92 both support BLE and USB.
  • a user when a user initiates a transmission service, it can automatically determine the type of communication channel that can meet the current transmission service requirements based on the device’s communication capability set, device status, signal quality and other data. And use the target communication channel corresponding to the communication channel type to transmit business data.
  • the mobile phone 91 detects that there is no existing connection channel with the car machine 92, and the BLE connection between the mobile phone 91 and the car machine 92 can be established first.
  • the mobile phone 91 obtains the communication capability set, device status, and signal quality of the vehicle 92 through BLE, and then combines its own communication capability set, device status, and signal quality to determine the type of communication channel that meets the current transmission service requirements. USB connection.
  • both the mobile phone 91 and the car machine 92 support BLE and USB, and it can be known from the device status of the mobile phone that the mobile phone is in a charging state, and the song file transfer service data belongs to the file transfer service.
  • the priority of the communication channel corresponding to the file transfer service is: USB>Wi-Fi P2P 5G> Wi-Fi 5G> Wi-Fi P2P 2G> Wi-Fi 2G> BLE. From this, it can be determined that the type of communication channel between the mobile phone 91 and the car machine 92 that can meet the current transmission service requirements is USB.
  • the mobile phone 91 transfers the song file to the car machine 92 through the USB connection.
  • the car machine 92 parses the song file to obtain the audio file and the lyrics file, plays the corresponding audio file, and displays the corresponding lyrics on the display screen according to the lyrics file.
  • the optimal connection channel between the mobile phone 91 and the car machine 92 is USB
  • all the service data transmitted between the mobile phone 91 and the car machine 92 can use the USB connection first.
  • the mobile phone 91 can first switch to the existing BLE connection channel, and then re-determine the target communication channel type that meets the current transmission service requirements through the BLE connection channel to establish a new The target communication channel.
  • USB when USB is used to transmit data between a mobile phone and a car, there may be multiple transmission services that use USB transmission, resulting in a very limited bandwidth allocated to each transmission data, resulting in USB not meeting the current transmission service requirements .
  • the solution provided in the embodiment of the application can be used between the mobile phone and the car to establish a BLE connection between the mobile phone and the car, and use the BLE connection to transmit instruction data and the like.
  • a Wi-Fi P2P connection needs to be established and the Wi-Fi P2P connection is used to transmit service data.
  • the device role in the Wi-Fi P2P network can be automatically determined according to the type of service and the direction of the service data flow.
  • GO group owner
  • GC group client
  • the device role in the Wi-Fi P2P network is determined according to the service type and the direction of the service data flow, which can ensure the data transmission rate to a certain extent and ensure the real-time nature of the data.
  • two devices between mobile phones, smart TVs, and smart speakers need to conduct GO negotiation to determine their respective roles in the Wi-Fi P2P network, that is, to determine who is the GO and who is the GC.
  • the GO negotiation between two devices is determined by the random number sent between the two devices, which device has a larger random number, and which device is the GO node. In other words, the GO negotiation cannot specify which device is the GO node, and the randomness of the GO node is relatively large.
  • smart TVs are randomly determined as GO nodes, and mobile phones and smart speakers are randomly selected as GC nodes. Since the two GC nodes cannot communicate with each other, if the mobile phone needs to transmit audio to the smart speaker, it must first be transmitted to the smart TV as the GO node. The smart TV transmits the audio data to the smart speaker, which will cause audio data to be corrupted. Real-time performance is poor.
  • the mobile phone is determined as the GO node according to the service type and data flow direction. After the mobile phone establishes a Wi-Fi P2P connection with the smart TV and smart speaker, the mobile phone can send audio data directly to the smart speaker without forwarding through the smart TV, which improves the real-time performance of audio data.
  • the electronic device can call a preset interface to determine which device serves as the GO node according to the type of transmission service and the direction of the data flow.
  • the type and data of the electronic device in the embodiment of the present application may be arbitrary.
  • the electronic device may be a mobile phone, a tablet, a computer, or a car machine.
  • the electronic device may include, but is not limited to: at least one processor, a memory, and a computer program stored in the memory and running on the at least one processor.
  • the processor executes the computer program to implement the steps in any of the foregoing method embodiments.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, and a power supply.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter/receiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic illustration, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, and the like.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194. Pressure sensor 180A
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and apply to applications such as horizontal and vertical screen switching, pedometers, and so on.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal.
  • the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations applied to different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
  • the electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 may also be compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
  • FIG. 11 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and so on.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify that the download is complete, and message reminders.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • FIG. 12 shows a structural block diagram of a data transmission device provided in an embodiment of the present application. For ease of description, only parts related to the embodiment of the present application are shown.
  • the apparatus is applied to a first electronic device, and the apparatus may include:
  • the first obtaining module 1201 is configured to obtain the first data to be transmitted
  • the first determining module 1202 is configured to determine whether the first communication channel meets the transmission service requirements of the first to-be-transmitted data, and the first communication channel is an existing connection channel between the first electronic device and the second electronic device;
  • the first establishment module 1203 is configured to, if the first communication channel does not meet the transmission service requirements of the first data to be transmitted, establish a second communication channel that meets the transmission service requirements of the first data to be transmitted through the first communication channel;
  • the first transmission module 1204 is configured to transmit the first data to be transmitted to the second electronic device through the second communication channel.
  • the foregoing apparatus may further include:
  • the first transmission service type determining module is used to determine the transmission service type of the first data to be transmitted; wherein, the transmission service type includes message transmission service, file transmission service and multimedia streaming transmission service;
  • the first transmission service requirement determination module is configured to determine the transmission service requirement of the first data to be transmitted according to the transmission service type of the first data to be transmitted.
  • the first establishment module is specifically used to:
  • the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device determine the target communication channel type that meets the transmission service requirements of the first data to be transmitted ;
  • the second communication capability information of the second electronic device is obtained by the first electronic device from the second electronic device after it is determined that the first communication channel does not meet the transmission service requirements of the first to-be-transmitted data, or is obtained in the first electronic device.
  • the electronic device and the second electronic device are sent by the second electronic device to the first electronic device when a connection is established for the first time;
  • the first communication capability information includes a first communication connection used to characterize the communication connection type supported by the first electronic device Information
  • the second communication capability information includes second communication connection information used to characterize the communication connection type supported by the second electronic device;
  • the target communication channel corresponding to the target communication channel type is established with the second electronic device, and the target communication channel is used as the second communication channel.
  • the first establishment module is specifically used to:
  • the first candidate communication channel type is a channel type that meets the transmission service requirements of the first data to be transmitted;
  • the communication channel type with the highest priority is determined from the first candidate communication channel types, and the communication channel type with the highest priority is used as the target communication channel type.
  • the first establishment module is specifically used to:
  • the transmission service type of the first data to be transmitted, the first communication capability information, and the second communication capability information are input to the pre-trained classifier, and the communication channel type output by the classifier is used as the target communication channel type.
  • the first communication capability information further includes at least one of device status information and signal quality information of the first electronic device
  • the second communication capability information further includes device status information and signal quality information of the second electronic device At least one of them.
  • the foregoing apparatus may further include:
  • the detection module is used to detect whether there is a first communication channel between the first electronic device and the second electronic device;
  • the second establishment module is configured to establish a third communication channel with the second electronic device if there is no first communication channel between the first electronic device and the second electronic device, and use the third communication channel as the first communication channel.
  • the foregoing apparatus may further include:
  • the second acquisition module is configured to acquire second data to be transmitted, wherein the data priority of the second data to be transmitted is higher than the data priority of the first data to be transmitted;
  • the second transmission service type determining module is configured to determine the transmission service type of the second data to be transmitted, and determine the transmission service requirement of the second data to be transmitted according to the transmission service type of the second data to be transmitted;
  • the second transmission service requirement determination module is configured to determine whether the first communication channel and the second communication channel meet the transmission service requirement of the second data to be transmitted;
  • the channel type determining module is configured to, if neither the first communication channel nor the second communication channel meet the transmission service requirements of the first data to be transmitted, according to the transmission service type of the second data to be transmitted, the first communication of the first electronic device.
  • the capability information and the second communication capability information of the second electronic device determine the fourth communication channel type that meets the transmission service requirements of the second data to be transmitted;
  • the first switching module is configured to, if the type of the fourth communication channel is the same as the type of the second communication channel, transmit the second data to be transmitted to the second electronic device through the second communication channel, and switch the first data to be transmitted to the first
  • the communication channel performs transmission, or a fifth communication channel is established, and the first data to be transmitted is transmitted to the second electronic device through the fifth communication channel.
  • the foregoing apparatus may further include:
  • the switching transmission module is used to switch the first data to be transmitted to the second communication channel for transmission;
  • the removal module is used to determine whether the fifth communication channel has a corresponding service; if the fifth communication channel does not have a corresponding service, the fifth communication channel is removed.
  • the above-mentioned data transmission device has the function of realizing the above-mentioned data transmission method.
  • This function can be realized by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions, and the module may be software. And/or hardware.
  • FIG. 13 shows a structural block diagram of a data transmission device provided in an embodiment of the present application. For ease of description, only parts related to the embodiment of the present application are shown.
  • the apparatus is applied to a first electronic device, and the apparatus may include:
  • the third transmission service type determining module 1301 is configured to determine the transmission service type of the first data to be transmitted;
  • the capability information acquiring module 1302 is configured to acquire second communication capability information of the second electronic device, where the second communication capability information includes second communication connection information used to characterize the communication connection type supported by the second electronic device.
  • the optimal channel type determining module 1303 is configured to determine the first data to be transmitted according to the transmission service type of the first data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device The target communication channel type; wherein, the first communication capability information includes first communication connection information used to characterize the communication connection type supported by the first electronic device, and the target communication channel type is the optimum for transmitting the first data to be transmitted Type of communication channel;
  • the second transmission module 1304 is configured to transmit the first data to be transmitted to the second electronic device through the first communication channel if the target communication channel type is the same as that of the first communication channel; wherein, the first communication channel is the first electronic device.
  • the third transmission module 1305 is configured to establish a second communication channel corresponding to the target communication channel type with the second electronic device if the target communication channel type is not the same as the first communication channel type, and transmit the first to-be-transmitted first communication channel through the second communication channel The data is transmitted to the second electronic device.
  • the optimal channel type determining module is specifically used for:
  • the communication channel type with the highest priority is determined from the second candidate communication channel types, and the communication channel type with the highest priority is used as the target communication channel type.
  • the first communication capability information further includes at least one of device status information and signal quality information of the first electronic device
  • the second communication capability information further includes device status information and signal quality information of the second electronic device At least one of
  • the optimal channel type determination module is specifically used for:
  • the device status information and signal quality information of the first electronic device determine the first to-be-transmitted type from the second candidate communication channel types The target communication channel type of the data.
  • the foregoing apparatus may further include:
  • the third acquisition module is used for the second data to be transmitted
  • a fourth transmission service type determining module configured to determine the transmission service type of the second data to be transmitted, wherein the data priority of the second data to be transmitted is higher than the data priority of the first data to be transmitted;
  • the fourth channel type determining module is used to determine the second communication capability information of the second data to be transmitted according to the transmission service type of the second data to be transmitted, the first communication capability information of the first electronic device, and the second communication capability information of the second electronic device Four communication channel types, the fourth communication channel type is the type of the optimal communication channel used to transmit the second data to be transmitted;
  • the second switching module is configured to, if the type of the fourth communication channel is the same as the type of the second communication channel, transmit the second data to be transmitted to the second electronic device through the second communication channel, and switch the first data to be transmitted to the first
  • the communication channel performs transmission, or a fifth communication channel is established, and the first data to be transmitted is transmitted to the second electronic device through the fifth communication channel.
  • the above-mentioned data transmission device has the function of realizing the above-mentioned data transmission method.
  • This function can be realized by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above-mentioned functions, and the module may be software. And/or hardware.
  • the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium stores a computer program.
  • the computer program is executed by a processor, the steps in the foregoing method embodiments can be realized.
  • the embodiments of the present application provide a computer program product.
  • the computer program product runs on an electronic device, the electronic device can realize the steps in the foregoing method embodiments when the electronic device is executed.

Abstract

本申请实施例适用于通信技术领域,公开了一种数据传输方法、装置、电子设备和计算机可读存储介质,方法包括:第一电子设备获取待传输数据;第一电子设备确定第一通信通道是否满足待传输数据的传输业务需求,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道;若第一通信通道不满足待传输数据的传输业务需求,第一电子设备通过第一通信通道,与第二电子设备建立满足待传输数据的传输业务需求的第二通信通道,再通过第二通信通道将待传输数据传输至第二电子设备。本申请实施例可以在当前传输通道不满足传输业务需求时,根据待传输数据的传输业务需求,自动建立满足传输业务需求的通信通道,提高了用户体验。

Description

数据传输方法、装置、电子设备和可读存储介质
本申请要求于2020年03月06日提交国家知识产权局、申请号为202010155811.4、申请名称为“数据传输方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种数据传输方法、装置、电子设备和计算机可读存储介质。
背景技术
随着通信技术和终端技术的不断发展,电子设备的形态也越来越多元化。
目前,电子设备的连接方式有很多,例如,蓝牙(Bluetooth,BT)、低功耗蓝牙(Bluetooth Low Energy,BLE)、Wi-Fi和Wi-Fi点对点(Wi-Fi Peer to Peer,Wi-Fi P2P)等。电子设备之间可以通过所建立的通信通道相互通信,相互传输业务数据。
然而,现有的电子设备在通过已建立的通信通道传输业务数据时,由于业务数据类型的不同等原因,可能导致已建立的通信连接无法有效满足当前业务数据传输的需求。
发明内容
本申请实施例提供一种数据传输方法、装置、电子设备和计算机可读存储介质,可以在当前传输通道不满足传输业务需求时,自动建立满足传输业务需求的通信通道,或者当前最优的通信通道,以提高用户体验。
第一方面,本申请实施例提供一种数据传输方法,该方法可以应用于第一电子设备,该方法可以包括:获取第一待传输数据;然后,确定第一通信通道是否满足第一待传输数据的传输业务需求,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道;若第一通信通道不满足第一待传输数据的传输业务需求,通过第一通信通道,建立满足第一待传输数据的传输业务需求的第二通信通道;通过第二通信通道将第一待传输数据传输至第二电子设备。
可以看出,第一电子设备在检测到既有连接通道不满足第一待传输数据的传输业务需求时,在用户无感知的情况下自动通过既有连接通道建立满足第一待传输数据的传输业务需求的第二通信通道,使用该第二通信通道传输第一待传输数据至第二电子设备,提高了数据传输性能,提高了用户体验。
作为示例而非限定,第一电子设备为手机,第二电子设备为智能电视,手机和智能电视均连接在同一个无线路由器下。用户需要将手机投屏至智能电视时,手机获取到投屏数据流,然后再确定既有连接通道不满足投屏数据流的传输业务需求(例如,既有连接通道的丢包率不满足投屏数据流对于丢包率的需求),则自动通过既有连接通道,与智能电视建立满足投屏数据流的传输业务需求的Wi-FiP2P连接,使用 Wi-FiP2P连接完成投屏业务。
在第一方面的一种可能的实现方式中,第一电子设备在确定第一通信通道是否满足第一待传输数据的传输业务需求时,可以先确定出第一待传输数据的传输业务类型,该传输业务类型可以包括消息类传输业务、文件传输类业务和多媒体流类传输业务。由于不同传输业务类型对应不同的传输业务需求,则可以根据第一待传输数据的传输业务类型,确定第一待传输数据的传输业务需求。得到第一待传输数据的传输业务需求之后,再根据该传输业务需求,确定第一通信通道是否满足该传输业务需求。
其中,传输业务需求可以是指传输数据对传输通道性能的要求,具体可以体现在通信通道的传输时延、带宽和丢包率等方面。换句话说,可以将当前时刻下的第一通信通道的传输时延、带宽和丢包率,和第一待传输数据的传输业务需求中对传输时延、带宽和丢包率等要求进行比对,以确定第一通信通道是否能满足第一待传输数据的传输业务需求。如果当前时刻下的第一通信通道的传输时延、丢包率和带宽等均满足第一待传输数据的传输业务需求对应的范围内,则可以确定第一通信通道能满足第一待传输数据的传输业务需求,反之,则确定第一通信通道不满足第一待传输数据的传输业务需求。
作为示例而非限定,如果第一待传输数据为投屏数据流,该投屏数据流的传输业务类型是多媒体流类传输业务,多媒体流类传输业务的传输业务需求为:丢包率最高为10%,传输时延最高为100ms。监测到当前时刻下的第一通信通道的丢包率为15%,传输时延为70ms。此时,虽然第一通信通道的传输时延可以满足多媒体流类传输业务的要求,但是由于第一通信通道的丢包率高于多媒体流类传输业务所允许的最高丢包率,故可以确定第一通信通道不满足第一待传输数据的传输业务需求。当然,在具体应用中,还可以关注多媒体流类数据的码率和带宽之间的关系。
需要指出的是,将待传输数据划分成不同的传输业务类型,不同传输业务类型对应不同的传输业务需求,再根据传输数据的传输业务类型,确定第一通信通道是否满足传输业务需求,可以使得通信通道与待传输数据的传输特点更加相符,进一步提高了数据传输速率。
在第一方面的一种可能的实现方式中,第一电子设备可以通过第一通信通道建立第二通信通道。也可以通过其它方式建立第二通信通道,并不仅仅限于通过第一通信通道。
其中,通过第一通信通道,建立满足第一待传输数据的传输业务需求的第二通信通道的过程可以包括:
首先,根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定满足第一待传输数据的传输业务需求的目标通信通道类型。
其中,第一通信能力信息可以包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息,第二通信能力信息可以包括用于表征第二电子设备所支持的通信连接类型的第二通信连接信息。该第二电子设备的第二通信能力信息可以是在确定第一通信通道不满足第一待传输数据的传输业务需求后,由第一电子设备向第二电子设备获取的;或者也可以是在第一电子设备和第二电子设备在初次建立连接时,由第 二电子设备发送给第一电子设备的。具体应用中,第一电子设备可以通过第一通信通道获取到第二电子设备的第二通信能力信息。
第一通信连接信息(也可以称为通信能力集)和第二通信连接信息可以表征电子设备所支持的通信连接类型。作为示例而非限定,手机所能支持的通信连接类型有BLE、Wi-Fi和Wi-FiP2P,则该手机的第一通信连接为BLE、Wi-Fi和Wi-FiP2P,以及相关信息(例如,BEL版本信息,Wi-Fi协议信息)。
第一通信能力信息和第二通信能力信息除了可以包括表征电子设备所支持的通信连接类型信息之外,还可以包括设备状态信息和信号质量信息中的至少一种。
然后,确定出目标通信通道类型之后,第一电子设备可以与第二电子设备建立目标通信通道类型对应的目标通信通道,将目标通信通道作为第二通信通道。具体应用中,第一电子设备可以通过第一通信通道,与第二电子设备建立第二通信通道。
基于传输业务类型,两端设备的通信能力信息,自动决策出满足传输业务需求的通道类型,并自动建立该通道类型对应的通信通道,可以在用户无感知情况下动态地决策并建立满足传输业务需求的通信通道,提高了用户体验。
进一步地,在一些实施例中,根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定满足第一待传输数据的传输业务需求的目标通信通道类型的过程可以包括:
首先,根据第一通信连接信息和第二通信连接信息,确定第一候选通信通道类型。该第一候选通信通道类型是满足第一待传输数据的传输业务需求的通道类型。
具体地,可以先根据第一通信连接信息和第二通信连接信息,确定出第一电子设备和第二电子设备均支持的通信连接类型。然后,可以再结合当前监测的各种通信连接类型的丢包率、传输时延和带宽等,选取出两个设备均支持且满足传输业务需求的通信通道类型作为第一候选通信通道类型。
然后,根据所述第一待传输数据的传输业务类型对应的通信通道优先级,从第一候选通信通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
其中,通信通道优先级可以是预先设定的,不同传输业务类型对应不同的通信通道优先级。该通信通道优先级可以是根据通信通道的传输时延和吞吐量等因素去设定。
作为示例而非限定,文件传输类业务的通信通道优先级为:Wi-Fi P2P 5G>Wi-Fi 5G>Wi-Fi P2P 2G>Wi-Fi 2G>经典蓝牙BR。如果手机和智能电视的候选通信通道类型为Wi-Fi和Wi-FiP2P,根据通信通道优先级可以将Wi-FiP2P确定为目标通信通道类型。
需要说明的是,通过第一通信连接信息,第二通信连接信息,以及传输业务类型,自动决策出哪个传输链路能满足传输业务需求,再根据通道优先级选取出其中一个最优的作为目标通信通道类型,进一步提高了数据传输速率。
当然,在其它一些实施例中,也可以只根据第一通信连接信息和第二通信连接信息确定出两个电子设备均支持的通信连接类型,将该通信连接类型作为第一候选通信通道类型。然后,根据第一待传输数据的传输业务类型的通信通道优先级,从第一候选通信通道类型中选取优先级最高的通道作为目标通信通道类型。但是,这种方式选 取出的通信通道类型有一定可能不满足传输业务需求。另外,还可以结合设备状态信息和信号质量信息来确定目标通信通道类型。
在另一些实施例中,根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定满足第一待传输数据的传输业务需求的目标通信通道类型,包括:
将第一待传输数据的传输业务类型、第一通信能力信息以及第二通信能力信息输入至预先训练完成的分类器,将分类器输出的通信通道类型作为目标通信通道类型。
具体应用中,该分类器可以是深度学习模型、神经网络模型或者决策树等。预先训练好分类器后,可以将传输业务类型和两端设备的通信能力信息等输入到分类器中,该分类器可以输出能满足传输业务需求的通信通道类型。
分类器的输入不同,输出的目标通信通道类型可能会有所不同。一般情况下,需要将传输业务类型,两端设备的通信能力集,以及当前时刻下的各通信连接的信号吞吐量、信号强度等信息输入至分类器,分类器则可以输出能满足当前传输业务需求的目标通信通道类型。
当前,在其它一些情况下,如果分类器的输入信息中没有当前时刻下各通信通道的信号吞吐量和信号强度等信息,可能会导致分类器输出的目标通信通道类型不能满足传输业务需求。
在第一方面的一种可能的实现方式中,第一通信能力信息还包括第一电子设备的设备状态信息和信号质量信息中的至少一种,第二通信能力信息还包括第二电子设备的设备状态信息和信号质量信息中的至少一种。
在第一方面的一种可能的实现方式中,在确定第一通信通道是否满足第一待传输数据的传输业务需求之前,可以先检测第一电子设备和第二电子设备之间是否存在第一通信通道;若第一电子设备和第二电子设备之间不存在第一通信通道,与第二电子设备之间建立第三通信通道,将第三通信通道作为第一通信通道。这样,可以进一步提高用户的无感知程度,从而提高用户体验。
在第一方面的一种可能的实现方式中,在通过第二通信通道传输第一待传输数据的过程中,第一电子设备新获取到第二待传输数据,该第二待传输数据的数据优先级高于第一待传输数据的数据优先级。此时,可以先确定第二待传输数据的传输业务类型,根据第二待传输数据的传输业务类型确定第二待传输数据的传输业务需求;再确定第一通信通道和第二通信通道是否满足第二待传输数据的传输业务需求;
若第一通信通道和第二通信通道均不满足第一待传输数据的传输业务需求,则根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定满足第二待传输数据的传输业务需求的第四通信通道类型;
若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
需要指出的是,当两个待传输数据均可以用同一个传输通道传输时,使用该传输通道传输数据优先级更高的数据,而数据优先级低的数据切换至另一条通信通道传输, 可以保证进一步提高数据传输性能。
进一步地,在第二待传输数据传输完成后,可以将第一待传输数据切换到第二通信通道进行传输,即重新将第一待传输数据重新切换回第二通信通道进行传输。并且,如果之前是新建了第五通信通道,用于传输第一待传输数据,则先确定第五通信通道上是否有对应的业务,如果没有业务,则可以拆除第五通信通道。从而减少第五通信通道对第二通信通道的影响,提高第二通信通道的性能。
第二方面,本申请实施例提供一种数据传输方法,应用于第一电子设备,该方法可以包括:确定第一待传输数据的传输业务类型;然后,获取第二电子设备的第二通信能力信息,第二通信能力信息包括用于表征第二电子设备支持的通信连接类型的第二通信连接信息。
具体应用中,该第二通信能力信息可以是预先获得的并存储在第一电子设备本地的。例如,第一电子设备和第二电子设备在初次建立连接时,由第二电子设备将第二通信能力信息发送给第一电子设备,然后由第一电子设备存储在本地。此时,第一电子设备可以通过读取本地的第二通信能力信息,获取到该信息。或者,该第二通信能力信息也可以是在第一电子设备需要第二电子设备的第二通信能力时,通过第一通信通道从第二电子设备获取的。
再根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定第一待传输数据的目标通信通道类型;其中,第一通信能力信息包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息,目标通信通道类型是用于传输第一待传输数据的最优通信通道的类型。
其中,最优的通道可以是传输性能最好的通道,例如,带宽最高、传输时延最低。当然,最优的通道也可以根据第一待传输业务数据的传输业务类型来确定。例如,对于消息类传输业务,传输时延最低的通道是最优的传输通道。而对于文件传输类业务来说,端对端传输时间最小的通道是最优的传输通道。对于多媒体流类传输业务来说,在满足流媒体数据的码率要求时,可以将建立连接限制最少的通道作为最优通信通道。而建立连接限制可以包括但不限于可连接数量,可连接数量越多,建立连接限制越小,例如,某一时刻下,Wi-Fi连接和Wi-FiP2P连接均能满足某个码率的视频流数据的要求,而Wi-Fi连接的可连接数量为10个,Wi-FiP2P连接的可连接数量为4个,则将Wi-Fi连接作为最优通信通道。
接着,可以判定目标通信通道类型是否与第一通信通道类型相同。若目标通信通道类型与第一通信通道的类型相同,通过第一通信通道将第一待传输数据传输至第二电子设备;其中,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道;
若目标通信通道类型与第一通信通道的类型不相同,与第二电子设备建立目标通信通道类型对应的第二通信通道,通过第二通信通道将第一待传输数据传输至第二电子设备。
可以看出,本申请实施例通过传输业务类型、第一通信能力信息和第二通信能力信息自动决策出当前时刻下用于传输第一待传输数据的最优通信通道。如果最优通信通道是既有连接通道,则直接使用既有连接通道传输数据,如果最优通信通道不是既有连接通道,则可以新建立该最优通信通道,使用最优通信通道传输数据,提高了数 据传输效率,提高了用户体验。
在第二方面的一种可能的实现方式中,根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定第一待传输数据的目标通信通道类型的具体过程可以包括:
首先,根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型,该第二候选通信通道类型是第一电子设备和第二电子设备均支持的通信通道类型。
然后,根据第一待传输数据的传输业务类型的通信通道优先级,从第二候选通信通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
在第二方面的一种可能的实现方式中,第一通信能力信息还包括第一电子设备的设备状态信息和信号质量信息中的至少一种,第二通信能力信息还包括第二电子设备的设备状态信息和信号质量信息中的至少一种;
根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定第一待传输数据的目标通信通道类型,包括:
根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型,第二候选通信通道类型是第一电子设备和第二电子设备均支持的通信通道类型;
根据第一电子设备的设备状态信息和信号质量信息中的至少一种,以及第二电子设备的设备状态信息和信号质量信息中的至少一种,从第二候选通信通道类型中确定第一待传输数据的目标通信通道类型。
在第二方面的一种可能的实现方式中,在通过第二通信通道传输第一待传输数据的过程中,方法还包括:获取第二待传输数据;确定第二待传输数据的传输业务类型,其中第二待传输数据的数据优先级高于第一待传输数据的数据优先级;根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定第二待传输数据的第四通信通道类型,其中该第四通信通道类型是用于传输所述第二待传输数据的最优通信通道的类型;若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
其中,最优的通道可以是传输性能最好的通道,例如,带宽最高、传输时延最低。当然,最优的通道也可以根据第一待传输业务数据的传输业务类型来确定。例如,对于消息类传输业务,传输时延最低的通道是最优的传输通道。而对于文件传输类业务来说,端对端传输时间最小的通道是最优的传输通道。对于多媒体流类传输业务来说,在满足流媒体数据的码率要求时,可以将建立连接限制最少的通道作为最优通信通道。而建立连接限制可以包括但不限于可连接数量,可连接数量越多,建立连接限制越小,例如,某一时刻下,Wi-Fi连接和Wi-FiP2P连接均能满足某个码率的视频流数据的要求,而Wi-Fi连接的可连接数量为10个,Wi-FiP2P连接的可连接数量为4个,则将Wi-Fi连接作为最优通信通道。
需要指出的是,当两个待传输数据均可以用同一个传输通道传输时,使用该传输通道传输数据优先级更高的数据,而数据优先级低的数据切换至另一条通信通道传输, 可以保证进一步提高数据传输性能。
进一步地,在第二待传输数据传输完成后,可以将第一待传输数据切换到第二通信通道进行传输,即原本由于数据优先级等因素,将第二通信通道切换给第二待传输数据进行数据传输,等到第二待传输数据传输完成后,将第一待传输数据重新切换回第二通信通道进行传输。此时如果之前是新建立了第五通信通道,用于传输第一待传输数据,则可以先确定第五通信通道上是否有对应的业务。如果第五通信通道上没有对应的业务,则可以拆除第五通信通道。以减少第五通信通道对第二通信通道的影响,提高第二通信通道的性能。
在第二方面的一种可能的实现方式中,在确定第一通信通道是否满足第一待传输数据的传输业务需求之前,可以先检测第一电子设备和第二电子设备之间是否存在第一通信通道;若第一电子设备和第二电子设备之间不存在第一通信通道,与第二电子设备之间建立第三通信通道,将第三通信通道作为第一通信通道。若第一电子设备和第二电子设备之间存在既有的第一通信通道,再确定该第一通信通道是否满足第一待传输数据的传输业务需求。这样,可以进一步提高用户的无感知程度,提高用户体验。
第三方面,本申请实施例提供一种数据传输装置,该数据传输装置可以应用于第一电子设备,该装置可以包括:第一获取模块,用于获取第一待传输数据;第一确定模块,用于确定第一通信通道是否满足第一待传输数据的传输业务需求,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道;第一建立模块,用于若第一通信通道不满足第一待传输数据的传输业务需求,通过第一通信通道,建立满足第一待传输数据的传输业务需求的第二通信通道;第一传输模块,用于通过第二通信通道将第一待传输数据传输至第二电子设备。
在第三方面的一种可能的实现方式中,上述装置还可以包括:
第一传输业务类型确定模块,用于确定第一待传输数据的传输业务类型,其中,传输业务类型包括消息类传输业务、文件传输类业务和多媒体流类传输业务;
第一传输业务需求确定模块,用于第二根据第一待传输数据的传输业务类型确定第一待传输数据的传输业务需求。
在第三方面的一种可能的实现方式中,上述第一建立模块可以具体用于:
根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定满足第一待传输数据的传输业务需求的目标通信通道类型,其中,第二电子设备的第二通信能力信息是在确定第一通信通道不满足第一待传输数据的传输业务需求后,由第一电子设备向第二电子设备获取的,或者是在第一电子设备和第二电子设备在初次建立连接时,由第二电子设备发送给第一电子设备,并存储在第一电子设备中;第一通信能力信息包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息,第二通信能力信息包括用于表征第二电子设备支持的通信连接类型的第二通信连接信息;
与第二电子设备建立目标通信通道类型对应的目标通信通道,将目标通信通道作为第二通信通道。
进一步地,该第一建立模块可以具体用于:
根据第一通信连接信息和第二通信连接信息,确定第一候选通信通道类型,第一 候选通信通道类型为满足第一待传输数据的传输业务需求的通道类型;
根据第一待传输数据的传输业务类型对应的通信通道优先级,从第一候选通信通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
或者进一步地,该第一建立模块可以具体用于:
将第一待传输数据的传输业务类型、第一通信能力信息以及第二通信能力信息输入至预先训练完成的分类器,将分类器输出的通信通道类型作为目标通信通道类型。
在第三方面的一种可能的实现方式中,第一通信能力信息还包括第一电子设备的设备状态信息和信号质量信息中的至少一种,第二通信能力信息还包括第二电子设备的设备状态信息和信号质量信息中的至少一种。
在第三方面的一种可能的实现方式中,上述装置还可以包括:
检测模块,用于检测第一电子设备和第二电子设备之间是否存在第一通信通道;
第二建立模块,用于若第一电子设备和第二电子设备之间不存在第一通信通道,与第二电子设备之间建立第三通信通道,将第三通信通道作为第一通信通道。
在第三方的一种可能的实现方式中,上述装置还可以包括:
第二获取模块,用于获取第二待传输数据,其中,第二待传输数据的数据优先级高于第一待传输数据的数据优先级;
第二传输业务类型确定模块,用于确定第二待传输数据的传输业务类型,根据第二待传输数据的传输业务类型确定第二待传输数据的传输业务需求;
第二传输业务需求确定模块,用于确定第一通信通道和第二通信通道是否满足第二待传输数据的传输业务需求;
通道类型确定模块,用于若第一通信通道和第二通信通道均不满足第一待传输数据的传输业务需求,则根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定满足第二待传输数据的传输业务需求的第四通信通道类型;
第一切换模块,用于若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
在第三方面的一种可能的实现方式中,上述装置还可以包括:
切换传输模块,用于将第一待传输数据切换到第二通信通道进行传输;
拆除模块,用于确定第五通信通道是否有对应的业务;若第五通信通道没有对应的业务,拆除第五通信通道。
第四方面,本申请实施例提供一种数据传输装置,该装置可以应用于第一电子设备,该装置可以包括:
第三传输业务类型确定模块,用于确定第一待传输数据的传输业务类型;
能力信息获取模块,用于获取第二电子设备的第二通信能力信息,第二通信能力信息包括用于表征第二电子设备支持的通信连接类型的第二通信连接信息。
最优通道类型确定模块,用于根据第一待传输数据的传输业务类型,第一电子设 备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定第一待传输数据的目标通信通道类型,其中,第一通信能力信息包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息,目标通信通道类型是用于传输第一待传输数据的最优通信通道的类型;
第二传输模块,用于若目标通信通道类型与第一通信通道的类型相同,通过第一通信通道将第一待传输数据传输至第二电子设备,其中,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道;
第三传输模块,用于若目标通信通道类型与第一通信通道的类型不相同,与第二电子设备建立目标通信通道类型对应的第二通信通道,通过第二通信通道将第一待传输数据传输至第二电子设备。
在第四方面的一种可能的实现方式中,上述最优通道类型确定模块具体用于:
根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型,第二候选通信通道类型是第一电子设备和第二电子设备均支持的通信通道类型;
根据第一待传输数据的传输业务类型对应的通信通道优先级,从第二候选通信通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
在第四方面的一种可能的实现方式中,第一通信能力信息还包括第一电子设备的设备状态信息和信号质量信息中的至少一种,第二通信能力信息还包括第二电子设备的设备状态信息和信号质量信息中的至少一种;
此时,该最优通道类型确定模块可以具体用于:
根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型,第二候选通信通道类型是第一电子设备和第二电子设备均支持的通信通道类型;
根据第一待传输数据的传输业务类型,第一电子设备的设备状态信息和信号质量信息中的至少一种,以及第二电子设备的设备状态信息和信号质量信息中的至少一种,从第二候选通信通道类型中确定第一待传输数据的目标通信通道类型。
在第四方面的一种可能的实现方式中,上述装置还可以包括:
第三获取模块,用于获取第二待传输数据;
第四传输业务类型确定模块,用于确定第二待传输数据的传输业务类型,其中第二待传输数据的数据优先级高于第一待传输数据的数据优先级;
第四通道类型确定模块,用于根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定第二待传输数据的第四通信通道类型,该第四通信通道类型是用于传输第二待传输数据的最优通信通道的类型;
第二切换模块,用于若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
第五方面,本申请实施例提供一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序 时实现如上述第一方面或者第二方面任一项所述的方法。
第六方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面或第二方面任一项所述的方法。
第七方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面或者第二方面任一项所述的方法。
可以理解的是,上述第二方面至第七方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
图1为本申请实施例提供的一种数据传输方法的流程示意框图;
图2为本申请实施例提供的数据传输方法的另一种流程示意框图;
图3为本申请实施例提供的数据传输方法的另一种流程示意框图;
图4为本申请实施例提供的一种分布式场景示意图;
图5为本申请实施例提供的无线投屏业务流程示意图;
图6为本申请实施例提供的多屏协同业务场景示意图;
图7为本申请实施例提供的一种投屏场景示意图;
图8为本申请实施例提供的文件传输业务场景的示意图;
图9为本申请实施例提供的手机和车机的数据传输场景示意图;
图10为本申请实施例提供的电子设备100的硬件结构示意框图;
图11为本申请实施例提供的电子设备100的软件结构框图;
图12为本申请实施例提供的数据传输装置的结构框图;
图13为本申请实施例提供的数据传输装置的结构框图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。
本申请实施例中,电子设备可以根据传输业务类型,以及两端设备的通信能力信息,自动在两个电子设备之间建立满足当前传输业务需求的通信通道。这样,在设备间的传输链路不符合或者不满足当前的传输业务需求时,可以动态地改变设备间既有的通信通道,在用户无感知的情况下建立满足当前传输业务需求的通信通道,提高了用户体验。另一方面,自动建立满足当前传输业务需求的通信通道,使用该通信通道传输业务数据,可以在一定程度上保证数据传输的性能,也能提高用户体验。
而现有技术中,如果设备间的通信通道不满足当前的传输业务需求时,用户只能继续使用既有的通信通道传输业务数据,或者,手动地改变设备间的通信通道,用户体验较差。
举例来说,用户需要将手机的音频数据流传输至智能音箱,使用智能音箱进行播放音频数据流,手机和智能音箱通过蓝牙连接,即手机和智能音箱之间存在既有连接通道。在某一个时刻,由于信号质量变差等原因,手机和智能音箱之间的既有连接不能满足音频流数据的传输需求。在现有技术中,面对这种情况,用户可以继续使用既 有连接通道传输音频流数据。或者,用户可以手动地改变手机和智能音箱之间的通信通道,以使得新建立的通信通道满足当前传输业务需求,确保数据传输性能。例如,现有的蓝牙信号比较差,用户可以手动关闭蓝牙连接,并切换至Wi-Fi连接。但是,无论是哪种方式,用户的体验均较差。
在一些特殊情况下,用户甚至无法感知设备间的通信通道是否满足当前的传输业务需求。即使用户感知到设备间的通信通道不满足当前的传输业务需求,也无法确定出哪种通信通道是最合适的,哪种通信通道能满足当前的传输业务需求。
而通过本申请实施例提供的数据传输的方案,电子设备可以自动根据传输业务类型和设备的通信能力信息等数据,自动决策出能满足当前传输业务的通信通道类型,再根据通信通道类型建立设备间的目标通信通道,通过目标通信通道完成传输业务。在该过程中不用用户参与,可以基于当前设备的固有硬件条件,在用户无感知的情况下建立设备间能满足当前传输业务的通信通道,提高了用户体验。
下面将详细阐述本申请实施例提供的技术方案。
参见图1示出的本申请实施例提供的一种数据传输方法的流程示意框图,该方法应用于第一电子设备,该方法可以包括以下步骤:
步骤S101、第一电子设备获取第一待传输数据。
需要说明的是,上述第一待传输数据的数据类型可以是任意的。作为示例而非限定,该待传输数据可以为但不限于指令、文件、音频或视频等。
步骤S102、第一电子设备确定第一通信通道是否满足第一待传输数据的传输业务需求,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道。
需要说明的是,第一电子设备是待传输数据的发送方,第二电子设备是待传输数据的接收方。第二电子设备的数量可以是一个,也可以是两个以上,即第一电子设备可以向一个第二电子设备传输待传输数据,也可以同时向至少两个第二电子设备传输待传输数据。
上述第一通信通道是指第一电子设备和第二电子设备之间已经建立的通信通道,该通信通道的数量和通道类型均是任意的。例如,手机和电脑之间可以同时存在Wi-Fi连接和Wi-FiP2P连接。
上述第一待传输数据的传输业务需求可以是指待传输数据对传输性能的要求,不同传输业务类型的数据具备不同的特点,对传输性能的要求可能会有所不同。即不同传输业务类型对应的传输业务需求也会有所不同的。
在一些实施例中,第一电子设备可以先确定第一待传输数据的传输业务类型,再根据传输业务类型和传输业务需求的对应关系,得到第一待传输数据的传输业务需求。然后再判断第一通信通道是否满足传输业务需求。
第一待传输数据的传输业务类型可以通过待传输数据的相应参数(例如,type参数)确定,即第一电子设备可以通过识别第一待传输数据中的相应参数,即可确定出待传输数据的传输业务类型。具体应用中,可以预先定义不同的参数值与传输业务类型之间的关系,后续可以通过识别参数值,并根据参数值与传输业务类型之间的对应关系,确定待传输数据的传输业务类型。例如,定义type参数的值为A时,对应的传输业务类型为消息类传输业务;type参数的值为B时,对应的传输业务类型为文件传 输类业务;type参数的值为C时,对应的传输业务类型为多媒体流类传输业务。当然,也可以通过其它方式确定第一待传输数据的传输业务类型。具体应用中,电子设备的底层传输服务可以给上层数据传输业务提供相应的软件工具开发包(Software Development Kit,SDK),该SDK中可以包括预先定义的接口和相应的函数,函数中可以包括上述type参数。当上层数据传输业务需要传输数据,电子设备可以根据待传输数据的类型,相应地将type参数值设置为对应数值,此后,电子设备可以将携带有type参数值的数据发送给对端设备。
具体应用中,可以根据不同数据的特点,预先将传输业务划分为几种不同的类型。
作为示例而非限定,传输业务类型可以包括但不限于消息类传输业务、文件传输类业务和多媒体流类传输业务。
其中,消息类传输业务对应的数据特点是:数据量小,但传输时延和可靠性要求较高。例如,控制指令数据,即控制指令数据的传输业务类型是消息类传输业务。
文件传输类业务对应的数据特点是:数据量大,可靠性要求较高。例如,视频文件数据、音频文件数据和图片文件数据,即视频文件数据、音频文件数据和图片文件数据的传输业务类型是文件传输类业务。
多媒体流类传输业务对应的数据特点是:对带宽要求高,对传输时延要求高。例如,投屏数据流、视频流和音频流等数据,即投屏数据流、视频流和音频流等流媒体类数据的传输业务类型是多媒体流类传输业务。
基于不同数据的特点,确定各种传输业务类型对应的传输业务需求。
例如,消息类数据的特点是:数据量小,且对传输可靠性和传输时延要求较高,对带宽要求较低。基于此,消息类传输业务类型的传输业务需求可以是:传输延迟低和传输可靠性高。又例如,文件类数据的特点是:数据量大,对传输可靠性较高。基于此,文件传输类业务的传输业务需求可以是:传输可靠性高和带宽高。又例如,流媒体类数据的特点是:对带宽和传输时延要求较高。基于此,多媒体流类传输业务的传输业务需求可以是:带宽高和传输时延低。
而通信通道的传输性能好坏可以通过传输时延、带宽和丢包率等指标进行确定,其中,丢包率越低,通信通道的传输可靠性越高,反之,丢包率越高,通信通道的传输可靠性越低。带宽的大小可以影响数据传输速率的高低,带宽越高,传输速率越高。传输时延可以表征数据的发起方发起数据传输与数据接收方响应该数据之间的时间差,例如,一个指令数据从设备A传输至设备B,设备A发起数据传输的时间点和设备B响应该指令数据的时间点之间的差值为传输时延。各个通信通道的传输时延不是固定不变的,可能会受到实际网络状态的影响。不同类型的数据对传输时延的要求可能会有所不同。例如,对于指令类数据来说,要求传输时延一般需要小于或等于20ms。在具体应用中,可以通过判断某个通信通道的传输时延、带宽和丢包率等是否满足待传输数据的需求,来判断某一个通信通道是否满足当前传输业务需求。
例如,第一待传输数据为指令类数据,指令类数据对传输可靠性和传输时延要求较高,假如某一个通信通道的丢包率很高,或者传输时延很高,则可以确定该通信通道不满足当前传输业务需求。
又例如,待传输数据为图片数据,图片数据对传输可靠性和带宽要求较高,假如 某一个通信通道的带宽很高,丢包率很低,则可以确定该通信通道满足当前传输业务需求。
不同类型的数据的传输业务需求可能会有所不同,即不同类型的数据对传输时延、带宽和丢包率的要求可能会有所不同。一般情况下,需要传输时延、带宽和丢包率同时满足要求时,才会确定通信通道满足传输业务需求。当然,在一些特殊情况下,也可以在传输时延、带宽和丢包率中的任意一个或多个满足要求时,确定通信通道满足传输业务需求。
实际应用中,可以通过具体数值来量化某一个通信通道是否满足传输业务需求。即可以预先设定各种传输业务类型中,对于丢包率、带宽和传输时延等具体数值。后续判断过程,可以比对当前时刻下通信通道的指标数值和设定的指标数值之间的关系,来确定某一个通信通道是否能满足待传输数据的传输业务需求。
作为示例而非限定,消息类传输业务的数据的传输业务需求可以具体为:丢包率:0%,传输时延:小于或等于20ms,带宽:50~100kb/s。
例如,第一通信通道为BLE连接,当前时刻下的BLE连接的丢包率为5%,传输时延为15ms,带宽为70kb/s。第一待传输数据为指令类数据,由于BLE连接的丢包率为5%,不符合指令类数据对于丢包率的要求,故确定当前时刻下的BLE不满足第一待传输数据的传输业务需求。
文件类传输类业务的数据的传输业务需求可以具体为:丢包率:0%,带宽越高越好,传输时延没有特定要求。具体应用中,可以根据实际应用场景,设定带宽和传输时延的数值范围,当第一通信通道的带宽和传输时延落入该设定的数值范围时,可以确定带宽和传输时延满足当前传输业务需求。
例如,第一待传输数据为文件类数据,第一通信通道为Wi-Fi连接,通过监测可以得知当前时刻下的Wi-Fi连接的丢包率为0%,传输时延为20ms,带宽为10m/s,此时,可以确定Wi-Fi连接满足第一待传输数据的传输业务需求。
多媒体流类传输业务的数据的传输业务需求可以具体为:丢包率:5%~10%,带宽可以根据数据流的码率来确定,传输时延:70~100ms。
例如,第一待传输数据为流媒体类数据,第一通信通道为Wi-FiP2P连接,通过监测可以得知当前时刻下的Wi-FiP2P连接的丢包率为15%,带宽为50Mbs,传输时延为50ms。此时,由于Wi-FiP2P连接的丢包率不满足流媒体类数据对于丢包率的要求,故可以确定当前的Wi-FiP2P连接不满足第一待传输数据的传输业务需求。
其中,流媒体播放时,不同码率的数据流对带宽可能有不同的需求。作为示例而非限定,码率为4K以上的视频数据流对带宽的要求可以为120Mbs,而码率为1080P以下的视频数据流对带宽的需求可以为50Mbps。
可以理解的是,当第一通信通道有至少两条时,可以分别判断每条通信通道是否满足当前传输业务需求。当所有的第一通信通道均不满足待传输数据的传输业务需求时,才可以确定第一电子设备和第二电子设备之间的第一通信通道不满足待传输数据的传输业务需求。反之,如果有其中一条或者多条第一通信通道可以满足待传输数据的传输业务需求时,则可以确定第一电子设备和第二电子设备之间的第一通信通道满足待传输数据的传输业务需求。
例如,手机和智能电视之间存在两条通信通道,这两条通信通道分别为BLE连接和Wi-Fi连接。此时,待传输数据为投屏数据流,手机可以分别判断当前BLE连接和Wi-Fi连接是否能满足投屏数据流的传输业务需求,如果两者均不能满足,则确定手机和智能电视之间的既有连接通道不能满足投屏数据流的传输业务需求。
可以理解的是,当第一电子设备同时向至少两个第二电子设备传输第一待传输数据时,第一电子设备可以分别判断与对端设备的既有连接通道是否满足第一待传输数据的传输业务需求。
例如,手机需要同时投屏至平板电脑和智能电视,手机和平板电脑之间的既有连接通道为Wi-Fi连接,手机和智能电视之间的既有连接通道为Wi-FiP2P连接。手机根据Wi-Fi连接的带宽、传输时延和丢包率等,确定出Wi-Fi连接不满足投屏数据流的传输业务需求,而根据Wi-FiP2P连接的带宽、传输时延和丢包率等,确定出Wi-FiP2P连接可以满足投屏数据流的传输业务需求。
在其它一些实施例中,在用户发起传输业务时,第一电子设备和第二电子设备之间可能不存在既有连接通道,即不存在第一通信通道。此时,第一电子设备可以先检测第一电子设备和第二电子设备之间是否存在第一通信通道,如果有,则进入步骤S102;如果没有,则可以先建立第三通信通道,将第三通信通道作为上述第一通信通道。
例如,在用户发起传输业务时,手机和智能电视之间不存在既有连接通道,此时,手机可以通过自组网技术(例如,BLE mesh),与智能电视建立新的通信通道,然后可以进入步骤S102。
步骤S103、若第一通信通道不满足待传输数据的传输业务需求,通过第一通信通道,建立满足第一待传输数据的传输业务需求的第二通信通道。
具体应用中,可以通过第一通信通道建立第二通信通道。当然,也可以通过其它方式建立第二通信通道,并不仅仅限于通过第一通信通道。
在一些实施例中,通过第一通信通道建立第二通信通道的过程可以包括以下步骤:
第一步:根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定满足第一待传输数据的传输业务需求的目标通信通道类型。
其中,第二电子设备的第二通信能力信息是在确定第一通信通道不满足第一待传输数据的传输业务需求后,由第一电子设备向第二电子设备获取的。或者是在第一电子设备和第二电子设备在初次建立连接时,由第二电子设备发送给第一电子设备的。
第一通信能力信息包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息,第二通信能力信息包括用于表征第二电子设备支持的通信连接类型的第二通信连接信息。
上述第一通信能力信息可以是指表征第一电子设备的通信能力的信息,其可以包括但不限于第一通信连接信息(也可以称为通信能力集)、设备状态信息和信号质量信息等中的一种或多种。一般地,第一通信能力信息可以包括第一通信连接信息、设备状态信息和信号质量信息;可以包括第一通信连接信息和设备状态信息;也可以包括第一通信连接信息和信号质量信息。当然,也可以只包括第一通信连接信息。
其中,第一通信连接信息可以表征第一电子设备支持哪些通信连接,即通过该第一通信连接信息可以得知第一电子设备所支持的通信连接。
例如,手机支持Wi-Fi、Wi-FiP2P和BLE,此时,第一通信连接信息(即通信能力集)包括Wi-Fi、Wi-FiP2P和BLE和对应的相关信息(例如,Wi-FiP2P的协议信息、版本信息等)。
上述设备状态信息是指可以表征第一电子设备当前所处的状态信息,例如,手机的设备状态信息可以包括是否处于充电状态,当前剩余电量,当前流量使用状态等。
上述信号质量信息是指可以表征第一电子设备当前各种通信连接的信号质量情况,例如,当前Wi-Fi的信号质量。具体应用中,信号质量的好坏可以通过信号强度和吞吐量等决定。
上述第二通信能力信息可以是指表征第二电子设备的通信能力的信息,其可以包括但不限于第二通信连接信息(也可以称为通信能力集)、设备状态信息和信号质量信息等中的一种或多种。一般地,第二通信能力信息可以包括第二通信连接信息、设备状态信息和信号质量信息;可以包括第二通信连接信息和设备状态信息;也可以包括第二通信连接信息和信号质量信息。当然,也可以只包括第二通信连接信息。
其中,第二通信连接信息可以表征第二电子设备支持哪些通信连接,即通过该第二通信连接信息可以得知第二电子设备所支持的通信连接。
例如,智能电视支持Wi-Fi、Wi-FiP2P,此时,第二通信连接信息(即通信能力集)包括Wi-Fi、Wi-FiP2P和对应的相关信息(例如,Wi-FiP2P的协议信息、版本信息等)。
上述设备状态信息是指可以表征第二电子设备当前所处的状态信息,例如,手机的设备状态信息可以包括是否处于充电状态,当前剩余电量,当前流量使用情况等。
上述信号质量信息是指可以表征第二电子设备当前各种通信连接的信号质量情况,例如,Wi-Fi的信号质量。具体应用中,信号质量的好坏可以通过信号强度和吞吐量等决定。
需要指出的是,上述第一通信能力信息可以是预先获取,并存储在第一电子设备本地的信息。在需要使用第一通信能力信息时,第一电子设备可以从本地读取到第一通信能力信息。
而第二通信能力信息可以是第一电子设备通过第一通信通道获取的。具体应用中,第一电子设备可以预先通过第一通信通道获取到第二电子设备的第二通信能力信息,例如,可以在第一电子设备和第二电子设备在初次建立连接时,由第二电子设备发给第一电子设备;也可以是在需要时通过第一通信通道获取的,例如,第一电子设备在确定第一通信通道不满足第一待传输数据的传输业务需求后再通过第一通道获取的。
第一电子设备在确定出第一通信通道不能满足待传输数据的传输业务需求后,可以根据传输业务类型,第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,与第二电子设备建立满足待传输数据的传输业务需求的第二通信通道。
该第二通信通道的数量和类型可以是任意的。一般地,第二通信通道可以只有一条,且第二通信通道的带宽大于第一通信通道的带宽。特殊情况下,第二通信通道可以有多条,此时,多条二通信通道中的一条或多条通道的带宽可以小于第一通信通道 的带宽,由多条第二通信通道共同完成数据传输业务。
需要指出的是,第二通信通道可以是当前时刻下,能满足第一待传输数据的传输业务需求的通道中最优的通信通道。当有多条通信通道能满足第一待传输数据的传输业务需求时,第二通信通道可以是这多条之中最优的通道;而如果只有一条通信通道能满足第一待传输数据的传输业务需求,则这一条通信通道则为最优的通道。最优的通道可以是传输性能最好的通道,例如,带宽最高、传输时延最低。当然,最优的通道也可以根据第一待传输业务数据的传输业务类型来确定。例如,对于消息类传输业务,传输时延最低的通道是最优的传输通道。而对于文件传输类业务来说,端对端传输时间最小的通道是最优的传输通道。对于多媒体流类传输业务来说,在满足流媒体数据的码率要求时,可以将建立连接限制最少的通道作为最优通信通道。而建立连接限制可以包括但不限于可连接数量,可连接数量越多,建立连接限制越小,例如,某一时刻下,Wi-Fi连接和Wi-FiP2P连接均能满足某个码率的视频流数据的要求,而Wi-Fi连接的可连接数量为10个,Wi-FiP2P连接的可连接数量为4个,则将Wi-Fi连接作为最优通信通道。
当然,在其它一些情况下,可能当前时刻下的所有的通信通道都不满足第一待传输数据的传输业务需求,此时,可以从这些通信通道中选择出一条最优的通道作为第二通信通道。即此时的第二通信通道虽然不能满足待第一待传输数据的传输业务需求,却是当前时刻下所有传输链路中最优的通信通道。这样,在既有连接通道不能满足传输业务需求时,动态决策并建立当前时刻下最优的通信通道,使用该最优的通信通道传输数据,也可以在一定程度下提高数据传输速率,提高用户体验。这种情况下,最优通道的确定方法可以参见上文提及的方法,在此不再赘述。
具体应用中,第一电子设备可以根据传输业务类型和两端设备的通信能力信息,与第二电子设备建立第二通信通道的方式可以包括但不限于以下两种方式。
第一种方式:
首先,基于各个传输业务类型的特点,结合各个通信通道的传输时延和带宽,预先设置各种传输业务类型的通信通道优先级。
作为示例而非限定,消息类传输业务的特点是数据量小,但传输时延和可靠性要求较高。基于此,可以设置消息类传输业务的通信通道优先级为:既有通信通道>临时新建通信通道。即,对于消息类传输业务,如果既有通信通道即可满足传输业务需求,无需临时新建通信通道。如果既有通信通道不能满足传输业务需求,可以根据传输业务类型、第一通信能力信息和第二通信能力信息确定出能满足传输业务需求的通信通道。
对于消息类传输业务,如果既有通信通道不能满足传输业务需求,则会优先选择建链时间短的,且能满足传输业务需求的通路。作为示例而非限定,消息类传输业务的临时新建通信通道的优先级可以为:Wi-Fi STA>BLE>Wi-FiP2P>BR。
文件传输类业务的特点是是数据量大,可靠性要求较高。基于此,可以设置文件传输类业务的通信通道优先级为:高带宽通信通道>低带宽通信通道。具体可以为:USB>Wi-Fi P2P 5G>Wi-Fi 5G>Wi-Fi P2P 2G>Wi-Fi 2G>经典蓝牙BR。
多媒体流类传输业务对应的数据特点是数据量大,对带宽要求高,对传输时延要 求高。另外,不同码率的流媒体类数据对应的通信通道优先级可能会有所不同。作为示例而非限定,码率高于1080P的流媒体数据的通信通道优先级为:Wi-FiP2P 5G>Wi-Fi 5G>Wi-Fi P2P 2G>Wi-Fi 2G>经典蓝牙BR。码率为1080P及以下的流媒体数据的通信通道优先级为:Wi-Fi 5G>Wi-Fi 2G>经典蓝牙BR。
然后,根据待传输数据的传输业务类型,获得该传输业务类型对应的通信通道优先级。例如,待传输数据的传输业务类型为文件传输类业务时,对应的通信通道优先级可以为USB>Wi-Fi P2P 5G>Wi-Fi 5G>Wi-Fi P2P 2G>Wi-Fi 2G>经典蓝牙BR。
最后,结合第一通信能力信息和第二通信能力信息,根据通信通道优先级,确定出满足待传输数据的传输业务需求的目标通信通道类型,再通过第一通信通道建立与目标通信通道类型对应的目标通信通道。
需要说明的是,第一通信能力信息和第二通信能力信息所包含的信息不同,确定目标通信通道类型的过程可能会有所不同,所确定出的目标通信通道类型可能也会有所不同。
若第一通信能力信息只包括第一通信连接信息,第二通信能力信息只包括第二通信连接信息时,确定目标通信通道类型的过程可以包括:根据第一通信连接信息获得第一电子设备所支持的通信连接,根据第二通信连接信息获得第二电子设备所支持的通信连接,再确定出待传输业务类型对应的侯选通道类型,该候选通道类型可以是满足第一待传输数据的传输业务需求的通信通道类型。然后,再根据第一待传输数据的传输业务类型对应的预设的通信通道优先级,从候选通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
此时,仅仅根据第一通信连接信息、第二通信连接信息和传输业务类型对应的通道优先级确定出的目标通信通道类型可能会不能满足第一待传输数据的传输业务需求。因为通信通道优先级是基于理论的最大带宽和最小时延等确定,实际情况下,会存在各种因素影响通信通道的带宽、丢包率和传输时延。但是,所确定出的目标通信通道类型仍然可以在一定程度上提高数据传输速率,提高用户体验。当然,考虑到实际应用中各种因素的影响,可以结合当下时刻的通信通道的带宽、时延和丢包率等指标去确定。确定目标通信通道类型的过程也可以包括:
首先,根据第一通信连接信息和第二通信连接信息,确定第一候选通信通道类型。该第一候选通信通道类型是满足第一待传输数据的传输业务需求的通道类型。
具体地,可以先根据第一通信连接信息和第二通信连接信息,确定出第一电子设备和第二电子设备均支持的通信连接类型。然后,可以再结合当前监测的各种通信连接的丢包率、传输时延和带宽等,选取出两个设备均支持且满足传输业务需求的通信通道类型作为第一候选通信通道类型。而是否满足传输业务需求的判断可以参见上文提及的相关内容,在此不再赘述。
可选地,可以再根据所述第一待传输数据的传输业务类型对应的通信通道优先级,从所述第一候选通信通道类型中确定优先级最高的通信通道类型,将所述优先级最高的通信通道类型作为所述目标通信通道类型。
相较而言,后者决策出的目标通信通道类型比前者的效果更佳。且后者可以从多个满足传输业务需求的传输链路中决策出一个最优的通信通道,可以进一步提高数据 传输速率。
举例来说,第一电子设备为手机,第二电子设备为智能电视,手机需要投屏至智能电视,即待传输数据为投屏数据流。手机和智能电视同连在一个无线路由器下,该无线路由器可以作为无线接入点((Access Point,AP)(后文可以简称无线AP或者AP)。手机支持的通信连接有:Wi-Fi P2P,Wi-Fi,BLE。智能电视支持的通信连接有:Wi-Fi P2P,Wi-Fi。手机和智能电视均支持的通信连接有:Wi-Fi P2P,Wi-Fi。投屏数据流属于多媒体流类传输业务,而多媒体流类传输业务的通道优先级可以为:Wi-Fi P2P>Wi-Fi。手机和智能电视之间的目标通信通道类型为Wi-Fi P2P。
若第一通信能力信息除了包括第一通信连接信息之外,还包括第一电子设备的设备状态信息和信号质量信息中的至少一种。且第二通信能力信息除了包括第二通信连接信息之外,还包括第二电子设备的设备状态信息和信号质量信息中的至少一种,确定目标通信通道类型的过程可以包括:根据第一通信连接信息和第二通信连接信息,获得第一电子设备和第二电子设备均支持的通信连接;基于两个电子设备均支持的通信连接的通道优先级,结合设备状态信息和信号质量信息中的至少一种,确定出目标通信通道类型。
其中,若第一通信能力信息包括第一通信连接信息和设备状态信息,第二通信能力信息包括第二通信连接信息和设备状态信息,第一电子设备可以先根据第一通信连接信息和第二通信连接信息确定出第一电子设备和第二电子设备均支持的通信连接,然后再根据通道优先级和设备状态信息,确定出目标通信通道类型。
例如,设备状态信息可以包括充电状态和非充电状态,以及设备的电量信息,即通过设备状态信息可以得知电子设备是否处于充电状态,且当前剩余电量等信息。第一电子设备为手机,第二电子设备为电脑,待传输数据为图片文件数据,属于文件类传输业务。手机和电脑之间的既有连接通道为Wi-Fi连接。根据手机和电脑的通信能力集,可以确定出手机和电脑均支持的通信连接为Wi-Fi P2P、Wi-Fi和BLE。文件类传输业务对应的通信通道优先级为Wi-Fi P2P>Wi-Fi>BLE。而通过两个电子设备的设备状态信息可以得知,手机处于非充电状态,且手机当前剩余电量很低(例如,剩余电量低于某个电量阈值),而电脑处于充电状态,当前剩余电量为100%。考虑到手机的电量较低,如果通信通道的功耗过高,手机的电量会很快耗完,导致图片文件数据不能完整地传输至电脑。此时,可以基于通信通道优先级,选取出功耗较低且通信通道优先级较高的通信通道作为目标通信通道类型。作为示例而非限定,Wi-Fi P2P的功耗最高,Wi-Fi次之,BLE的功耗最低,可以选择Wi-Fi连接或者BLE连接作为目标通信通道类型。
若第一通信能力信息包括第一通信连接信息和信号质量信息,第二通信能力信息包括第二通信连接信息和信号质量信息,第一电子设备可以先根据第一通信连接信息和第二通信连接信息,确定出第一电子设备和第二电子设备均支持的通信连接,然后再结合通信通道优先级和信号质量信息,确定出目标通信通道类型。
例如,信号质量信息可以表征各个通信连接的信号质量好坏,即通过设备的信号质量信息可以得知该设备所支持的通信连接的信号质量好坏。第一电子设备为手机,第二电子设备为智能电视,手机需要投屏至智能电视,待传输数据为投屏数据流,属 于多媒体流类传输业务,手机和智能电视的既有连接通道为经典蓝牙。根据手机的通信能力集和智能电视的通信能力集,确定出手机和智能电视均支持的通信连接为Wi-Fi P2P、Wi-Fi和BLE。多媒体流类传输业务的通道优先级为Wi-Fi P2P>Wi-Fi>BLE。在一种情况下,手机和智能电视的距离很远,通过手机和智能电视的信号质量信息得知,Wi-Fi P2P的信号很差。这种情况下,可以选择信号质量较好,通道优先级较高的通信通道作为目标通信通道类型。作为示例而非限定,手机可以选择Wi-Fi连接作为目标通信通道类型。
若第一通信能力信息包括第一通信连接信息、信号质量信息和设备状态信息,第二通信能力信息包括第二通信能力信息、信号质量信息和设备状态信息,第一电子设备可以先根据第一通信连接信息和第二通信连接信息,确定出第一电子设备和第二电子设备均支持的通信连接,然后再结合通信通道优先级、设备状态信息和信号质量信息,确定出目标通信通道类型。例如,选择功耗较低,信号质量较高,通信通道优先级较高的通信通道作为目标通信通道。第二种方式:
预先训练一个分类器。该分类器的训练过程可以包括:先设置一些典型的输入和对应的输出关系,生成初始的分类器;再使用几种典型的传输业务类型,采用多种连接链路进行数据通信,同时收集两端设备的状态信息,并记录每次数据传输时传输链路的选择结果;然后,根据所收集的两端设备的数据,不断修正分类器,得到训练完成的分类器。
其中,上述分类器的类型可以是任意的,作为示例而非限定,该分类器可以为深度学习模型,神经网络模型,或者决策树等。
分类器的训练数据集可以包括但不限于待传输数据的业务类型,设备所支持的通信连接(即通信能力集),标签信息,以及各种通信连接的对应信息(例如,吞吐量、信号强度和可用带宽等)。上述标签信息可以表征待传输数据对应的目标通信通道类型,该目标通信通道类型是预先设定的。使用该训练数据集训练预先构建的分类器,得到训练好的分类器。
在使用分类器的过程中,可以根据分类器的输出结果不断地修正分类器,以不断地提高分类器的分类准确率。具体地,记录分类器输出的目标通信通道类型,然后再人为地确定该目标通信通道类型是否为最优的,如果不是,则根据两者之间的差异相应地修正分类器。
训练完成的分类器可以根据输入的相关信息,输出能满足待传输业务数据的业务需求的通信通道类型。具体地,第一电子设备将待传输业务数据的传输业务类型、第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息等输入至训练好的分类器,获得分类器输出的目标通信通道类型。
第一通信能力信息和第二通信能力信息的相关介绍可以参见上文提及的第一种方式的相关介绍,在此不再赘述。
需要指出的是,第一电子设备可以只根据第一通信连接信息和第二通信连接信息,确定出目标通信通道类型,也可以在第一通信连接信息和第二通信连接信息的基础上,额外结合设备状态信息和信号质量信息中的至少一种,确定目标通信通道类型。相较而言,后者确定出的目标通信通道类型更加符合待传输数据的传输业务需求,用户体 验更高。
第二步:与第二电子设备建立目标通信通道类型对应的目标通信通道,将目标通信通道作为第二通信通道。
具体应用中,可以通过第一通信通道,与第二电子设备建立目标通信通道类型对应的第二通信通道。
需要说明的是,所建立的第二通信通道可以是满足当前传输业务需求,但不是最优的通信链路;也可以是满足当前传输业务需求,且是最优的通信链路。也可以是不满足当前传输业务需求,但是当前时刻下最优的通信通道。第一电子设备确定出目标通信通道类型后,可以通过第一通信通道,与第二电子设备之间建立目标通信通道类型对应的第二通信通道。建立第二通信通道后,可以通过该第二通信通道传输待传输数据至第二电子设备。
步骤S104、第一电子设备通过第二通信通道将第一待传输数据传输至第二电子设备。
由上可见,第一电子设备在检测到既有连接通道不满足当前的待传输数据的传输业务需求时,根据传输业务类型、第一电子设备和第二电子设备的通信能力信息,自动与第二电子设备建立满足传输业务需求的第二通信通道,提高了数据传输速率,提高了用户体验。
参见图2示出的本申请实施例提供的数据传输方法的另一种流程示意框图,该方法应用于第一电子设备,该方法可以包括以下步骤:
步骤S201、第一电子设备获取第一待传输数据。
步骤S202、第一电子设备检测第一电子设备和第二电子设备之间是否存在第一通信通道。如果有,则进入步骤S203,如果没有则进入步骤S209。
可选地,第一电子设备在确定第一通信通道是否满足传输业务需求之前,还可以先确定第一待传输数据的传输业务类型,并根据传输业务类型确定第一待传输数据的传输业务需求。接着,再进入步骤S203。
步骤S203、第一电子设备确定第一通信通道是否满足第一待传输数据的传输业务需求。如果能满足,则进入步骤S204,如果不能满足,则进入步骤S205。
步骤S204、第一电子设备通过第一通信通道将第一待传输数据传输至第二电子设备。
步骤S205、第一电子设备获取自身的第一通信能力信息,并通过第一通信通道获取第二电子设备的第二通信能力信息。
步骤S206、第一电子设备根据传输业务类型、第一通信能力信息和第二通信能力信息,确定满足第一待传输数据的传输业务需求的目标通信通道类型。
当然,在其它一些实施例中,也可以由第二电子设备根据第一通信能力信息和第二通信能力信息,结合传输业务类型,确定出上述目标通信通道类型。具体地,第一电子设备获取到待传输数据后,先确定待传输数据的传输业务类型;然后,第一电子设备可以通过第一通信通道将传输业务类型和自身的第一通信能力信息传输至第二电子设备;最后,第二电子设备再根据第一通信能力信息、第二通信能力信息和传输业 务类型,确定出目标通信通道类型。第二电子设备确定出目标通信通道类型之后,可以通过第一通信通道,与第一电子设备建立对应的目标通信通道。其中,第二电子设备确定目标通信通道类型与第一电子设备确定目标通信通道类型的过程相同,在此不再赘述。
步骤S207、第一电子设备通过第一通信通道,与第二电子设备建立目标通信通道类型对应的目标通信通道(即第二通信通道)。
具体地,第一电子设备确定出目标通信通道类型后,第一电子设备可以使用第一通信通道,建立对应的目标通信通道。例如,目标通信通道类型是Wi-Fi P2P,第一通信通道为Wi-Fi连接,则使用既有的Wi-Fi连接建立两个设备之间的Wi-Fi P2P连接。
步骤S208、第一电子设备通过目标通信通道(即第二通信通道)将第一待传输数据传输至第二电子设备。
步骤S209、第一电子设备和第二电子设备建立第三通信通道,将第三通信通道作为第一通信通道,返回上述步骤S203或者步骤S205。
需要说明的是,如果第一电子设备和第二电子设备之间不存在第一通信通道,则新建立第三通信通道,然后将第二通信通道作为第一通信通道,返回至上述步骤S203~S208。
具体来说,如果两个设备之间不存在第一通信通道,则先建立一个第三通信通道。然后,可以将第三通信通道作为第一通信通道,执行步骤S203~S208。在其它一些实施例中,也可以不执行步骤S203,而是进入步骤S205~S208,即可以不用监测第三通信通道是否能满足待传输数据的传输业务需求,而是直接通过第三通信通道获取第二电子设备的通信能力集、设备状态和信号质量等数据,确定出能满足当前传输业务需求的目标通信通道类型。如果确定出的目标通信通道类型是第三通信通道,则将第三通信通道作为目标通信通道。如果第三通信通道不是目标通信通道,则使用第三通信通道建立目标通信通道。
举例来说,第一电子设备为手机,第二电子设备为智能电视。手机和智能电视之间不存在既有连接。此时,手机先和智能电视新建立一个通信通道,该新建立的通信通道的类型可以是任意的。作为示例而非限定,手机和智能电视可以先通过BLE mesh组网技术建立BLE连接。手机和智能电视建立BLE连接后,手机可以先检测BLE连接是否能满足当前的传输业务需求,如果不能,才通过该BLE连接获取智能电视的通信能力集、设备状态和信号质量等数据,根据这些数据自动决策出满足当前传输业务需求的目标通信通道类型。确定出满足当前传输业务需求的目标通信通道类型后,手机可以通过已经建立的BLE连接,建立该通信通道类型对应的目标通信通道,例如,通过BLE连接,建立手机和智能电视之间的Wi-FiP2P连接。
当然,手机也可以不检测新建立的BLE连接是否能满足当前的传输业务需求,而是通过该BLE连接获取智能电视的通信能力集、设备状态和信号质量等数据,自动决策出能满足当前传输业务需求的通信通道类型,然后,再判断该目标通信通道类型是否是新建立的BLE连接,如果是,则使用新建立的BLE连接传输业务数据;如果该目标通信通道类型不是新建立的BLE连接,则通过该BLE连接建立目标通信通道类型对应的目标通信通道。
需要说明的是,本申请实施例与上文图1对应的实施例的相同或相似之处,可以相互参见,在此不再赘述。
在一些实施例中,第一电子设备和第二电子设备使用第二通信通道传输业务数据的过程中,第一电子设备可以实时监测第二通信通道,以监测第二通信通道是否能满足传输业务需求。如果监测到第二通信通道不能满足传输业务需求,则切换至其它既有通信通道,或者将第二通信通道和既有通信通道进行融合,使用融合后的多条通信通道传输待传输业务数据。
例如,第二通信通道为Wi-Fi P2P连接,第一通信通道为Wi-Fi连接。第一电子设备在使用Wi-Fi P2P连接传输数据,监测到Wi-Fi P2P连接的信号质量较差时,则可以切换至Wi-Fi连接,即使用Wi-Fi连接传输业务数据。第一电子设备也可以融合Wi-Fi P2P连接和Wi-Fi连接,即使用Wi-Fi P2P连接和Wi-Fi连接传输数据。
在一些实施例中,第一电子设备还可以根据待传输数据的优先级,为待传输数据的分配或者建立对应的通信通道。
具体地,在通过第二通信通道传输第一待传输数据的过程中,如果新来了一个第二待传输数据,可以根据第二待传输数据和第一待传输数据的数据优先级,确定用于传输第二待传输数据的通信通道。
具体来说,第一电子设备使用第一通信通道传输第一待传输数据的过程中,获取到了第二待传输数据。其中,第二待传输数据的数据优先级高于第一待传输数据的数据优先级。
然后,第一电子设备确定第二待传输数据的传输业务类型,并根据第二待传输数据的传输业务类型确定第二待传输数据的传输业务需求。
接着,第一电子设备可以确定第一通信通道和第二通信通道是否满足第二待传输数据的传输业务需求。若第一通信通道和第二通信通道均不满足第一待传输数据的传输业务需求,则根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定满足第二待传输数据的传输业务需求的第四通信通道类型;
若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
需要说明的是,在确定第二通信通道是否满足第二待传输数据的传输业务需求时,可能由于第二通信通道已经有相应的传输业务了,即第二通信通道的资源已经被占用,故确定第二通信通道不能满足第二待传输数据的传输业务需求。但是,根据传输业务类型和两端设备的通信能力信息等进行决策,还是确定了第二通信通道是最优的通道。此时,由于第二待传输数据的优先级高于第一待传输数据,故可以把原本占用第二通信通道的第一待传输数据切换到其它通信通道上,再使用第二通信通道传输第二待传输数据。
进一步地,在第二待传输数据传输完成后,第一电子设备可以将第一待传输数据切换到第二通信通道进行传输。并且,如果存在第五通信通道,可以先确定第五通信通道上是否有对应的业务,如果没有,则可以拆除该第五通信通道。
作为示例而非限定,可以根据待传输数据对应的应用程序设置待传输数据的优先级,一般情况下,前台应用的待传输数据的优先级高于后台应用的待传输数据的优先级,系统级应用的待传输数据的优先级高于第三方应用的待传输数据的优先级。优先级高的待传输数据可以抢占优先级低的待传输数据的通信通道。这样,可以进一步提高用户体验。
具体应用中,待传输数据的优先级可以依据几个原则来确定,这几个原则可以为:控制类业务的优先级高于数据类业务的优先级,前台应用的待传输数据的优先级高于后台应用的待传输数据的优先级,以及系统级应用的待传输数据的优先级高于第三方应用的待传输数据的优先级。其中,示例性的,控制类业务可以包括控制指令类数据,数据类业务可以包括文件和多媒体流数据。系统级应用和第三方应用可以通过应用程序的用户标识符(User Identification,UID)的大小来区分。作为示例而非限定,UID小于10000的是系统级应用,大于10000是第三方应用。一般情况下,对于手机来说,系统级应用可以例如为电话、相册和支持手机基本功能的相关应用程序。
其中,控制类业务数据一般可以包括控制指令类数据,而数据类业务数据一般可以包括文件数据和多媒体流数据。
具体来说,第一电子设备和第二电子设备之间通过第二通信通道传输待传输数据A时,如果来了一个待传输数据B,该待传输数据B的优先级要高于待传输数据A。此时,可以使用第二通信通道来传输待传输数据B,再新建立一个通信通道用来传输待传输数据A,或者,也可以使用其它既有通信通道传输待传输数据A。
举例来说,第一电子设备为手机,第二电子设备为智能电视,手机需要投屏至智能电视。此时,第一通信通道为Wi-Fi连接,手机可以先检测Wi-Fi连接是否能满足投屏数据流的传输业务需求。如果Wi-Fi连接不能满足投屏数据流的传输业务需求,手机可以根据传输业务类型,以及两端设备的通信能力信息等,确定出当前最优的连接通道为Wi-FiP2P连接。然后,手机再与智能电视建立Wi-FiP2P连接(即第二通信通道),用于传输投屏数据流,实现投屏业务。手机和智能电视在使用Wi-FiP2P连接传输投屏数据流时,用户通过手机向智能电视发送一个控制指令,该控制指令用于控制智能电视打开自身的摄像头。此时,由于控制指令数据属于消息类传输业务,手机可以先确定既有的Wi-FiP2P连接是否能满足该控制指令数据的传输业务需求。如果Wi-FiP2P连接能满足传输业务需求,手机根据消息类传输业务的通信通道优先级:既有连接通道>临时新建通信通道,确定出既有的Wi-FiP2P连接是最优通道。而由于控制指令数据的优先级高于投屏数据流的优先级,则可以使用Wi-FiP2P连接将控制指令传输至智能电视,而投屏数据流可以使用另外的通信连接(例如,Wi-Fi)传输。具体应用中,手机也可以通过本申请实施例提供的方案重新建立一个新的通信通道,用于传输投屏数据流。
需要指出的是,当两个待传输数据均可以用同一个传输通道传输时,使用该传输通道传输数据优先级更高的数据,而数据优先级低的数据切换至另一条通信通道传输,可以保证进一步提高数据传输性能。
需要说明的是,本申请实施例中,设备之间可能同时存在多条通信通道,例如,某一些时刻,手机和智能电视之间存在Wi-Fi连接和Wi-Fi P2P连接。存在多条通信 通道时,多条通信通道可以互为载备,当一条通信通道不符合当前传输业务的需求时,则可以切换至另一条通信通道。另外,也可以融合多条通信通道进行数据传输。
除此之外,在多条通信通道之间相互影响时,可以先自动拆除其中一条或多条通信通道,以提高其中一条目标通信通道的传输带宽等性能。等到数据传输完成后,再根据业务需求自动建立之前拆除的通信通道。
也就是说,在一些实施例中,第一电子设备和第二电子设备建立第二通信通道之后,第一电子设备或者第二电子设备还可以根据实际情况,相应地拆除其它通信通道,以提高第二通信通道的数据传输性能,进一步提高用户体验。
具体来说,第一电子设备和第二电子设备建立第二通信通道之后,第一电子设备和第二电子设备之间可能存在多条通信通道。多条通信通道同时存在,会影响到第二通信通道的数据传输性能,例如,降低第二通信通道的带宽和传输时延等。此时,第一电子设备或者第二电子设备可以先确定其它通信通道是否有相应的业务,如果其它通信通道没有相应的业务,则可以先拆除其它通信通道,以提高第二通信通道的性能。等到待传输数据传输完成后,或者需要使用其它通信通道时,再重新建立之前拆除的其它通信通道;如果其它通信通道有相应的业务,则不拆除其它通信通道。例如,其他通信通道为Wi-Fi连接,如果用户正在使用Wi-Fi上网,则不拆除该Wi-Fi连接。如果没有在用Wi-Fi连接,则可以先拆除该Wi-Fi连接,以提高Wi-FiP2P连接的性能。
例如,某两个电子设备之间同时存在Wi-Fi连接和Wi-Fi P2P连接,由于这两种连接同时存在时,Wi-Fi P2P连接的带宽等会受到影响,性能较差。此时,如果当前时刻下Wi-Fi连接没有相应地业务,则可以自动拆除设备间的Wi-Fi连接,从而使得Wi-FiP2P连接的带宽更高,提高Wi-FiP2P连接的性能。
例如,手机和智能电视之间同时存在Wi-Fi和Wi-Fi P2P连接,手机和智能电视通过Wi-FiP2P连接传输无线投屏业务数据,此时,Wi-FiP2P由于某种原因(例如,信号质量变差)等因素,使得Wi-Fi P2P连接不再满足无线投屏业务数据的传输需求。而Wi-Fi连接也不能满足业务传输需求。此时,可以将Wi-Fi连接通道和Wi-Fi P2P连接进行融合,使用融合后的连接通道传输业务数据;也可以自动拆除Wi-Fi连接,以提高Wi-FiP2P连接的性能,使得Wi-FiP2P连接可以满足当前业务传输需求。
第一电子设备在获取到第一待传输数据后,可以根据第一待传输数据的传输业务类型,确定既有连接通道是否能满足传输业务需求,如果不能,再根据传输业务类型和两端设备的通信能力信息,自动建立一个用于传输第一待传输数据的第二通信通道。
而在另一些实施例中,也可以不判断既有连接通道是否满足传输业务需求,而是先确定出目标通信通道类型,再根据目标通信通道类型确定是否建立新的通信通道。下面将对这种情况进行介绍。
参加图3示出的数据传输方法的另一种流程示意框图,该方法可以包括以下步骤:
步骤S301、第一电子设备确定第一待传输数据的传输业务类型。
步骤S302、第一电子设备获取第二电子设备的第二通信能力信息,该第二通信能力信息包括用于表征第二电子设备支持的通信连接类型的第二通信连接信息。
具体应用中,该第二通信能力信息可以是预先获得的并存储在第一电子设备本地的。例如,第一电子设备和第二电子设备在初次建立连接时,由第二电子设备将第二 通信能力信息发送给第一电子设备,然后由第一电子设备存储在本地。此时,第一电子设备可以通过读取本地的第二通信能力信息,获取到该信息。或者,该第二通信能力信息也可以是在第一电子设备需要第二电子设备的第二通信能力时,通过第一通信通道从第二电子设备获取的。
步骤S303、第一电子设备根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定第一待传输数据的目标通信通道类型;第一通信能力信息包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息。该目标通信通道类型是用于传输第一待传输数据的最优通信通道的类型。
需要说明的是,目标通信通道类型是当前状态下用于传输第一待传输数据的最优通信通道的类型。该最优通信通道可以是满足第一待传输数据的传输业务需求中最优的通道类型,也可以不满足第一待传输数据的传输业务需求,但是当前条件下最优的通信通道类型。最优通道可以根据业务类型去定义,例如,消息类业务对应的最优通道是传输时延最小的通道。当然,也可以根据带宽高低、丢包率高低等去定义。
需要说明的是,步骤S301~S303与上文图1、图2对应的实施例的相关内容相似,具体介绍请参见上文相应内容,在此不再赘述。
步骤S304、若目标通信通道类型与第一通信通道的类型相同,第一电子设备通过第一通信通道将第一待传输数据传输至第二电子设备。第一通信通道是第一电子设备和第二电子设备之间的既有连接通道。
例如,若第一通信通道为Wi-Fi连接,目标通信通道类型为Wi-Fi连接,则认为目标通信通道类型和第一通信通道的类型相同。此时,第一电子设备可以通过第一通信通道将第一待传输数据传输至第二电子设备。
步骤S305、若目标通信通道类型与第一通信通道的类型不相同,第一电子设备与第二电子设备建立目标通信通道类型对应的第二通信通道,通过第二通信通道将第一待传输数据传输至第二电子设备。
例如,第一通信通道为BLE连接,目标通信通道类型为Wi-FiP2P连接,则认为目标通信通道类型与第一通信通道的类型不相同,第一电子设备可以通过第一通信通道与第二电子设备建立第二通信通道,并使用第二通信通道传输第一待传输数据。
在一些实施例中,目标通信通道类型的确定过程可以包括:根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型;根据传输业务类型对应的通信通道优先级,从第二候选通信通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
需要说明的是,根据第一通信连接信息和第二通信连接信息确定目标通信通道类型的过程介绍可以参见上文图1和图2对应实施例的相关介绍,在此不再赘述。
在另一些实施例中,第一通信能力信息还包括第一电子设备的设备状态信息和信号质量信息中的至少一种,第二通信能力信息还包括第二电子设备的设备状态信息和信号质量信息中的至少一种;
此时,还可以先根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型,第二候选通信通道类型是第一电子设备和第二电子设备均支持的通信通道 类型;
根据第一电子设备的设备状态信息和信号质量信息中的至少一种,第二电子设备的设备状态信息和信号质量信息中的至少一种,从第二候选通信通道类型中确定第一待传输数据的目标通信通道类型。
具体地,确定出第二候选通信通道类型之后,还可以根据设备状态信息等选取功耗低的传输链路作为目标通信通道类型。或者,根据信号质量信息选取信号质量好的传输链路作为目标通信通道类型。又或者,根据设备状态信息和信号质量信息等选择信号质量合适和功耗合适的传输链路作为目标通信通道类型。
第一电子设备在通过第二通信通道传输第一待传输数据的过程中,如果新获取到第二待传输数据,该第二待传输数据的数据优先级高于第一待传输数据的数据优先级。先确定第二待传输数据的传输业务类型,再根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定满足第二待传输数据的传输业务需求的第四通信通道类型。第四通信通道类型是用于传输所述第二待传输数据的最优通信通道的类型。最优通信通道的确定方式可以参见上文相应内容,在此不再赘述。
若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
若第四通信通道类型与第二通信通道的类型不相同,则新建立第四通信通道类型对应的第四通信通道,使用第四通信通道传输第二待传输数据。
需要说明的是,本实施例的内容与上文图1和图2对应实施例的内容可以相互参照。
具体应用中,本申请实施例提供的建立通信连接的方案可以应用诸如无线投屏、无线互传和多屏协同等多种业务场景。下面将示例性地结合几种可能涉及的场景进行介绍。
参见图4示出的一种分布式场景示意图,如图4所示,手机41、平板42和智能电视43均连接至同一个无线路由器44,即手机41、平板42和智能电视43可以通过无线路由器44进行通信,也即手机41、平板42和智能电视43之间存在既有连接通道,该既有连接通道为基于无线AP(Access Point)的连接通道,即手机、平板和智能电视之间可以通过该无线AP相互通信。手机、平板和智能电视均为分布式设备。
手机41可以支持Wi-Fi P2P、Wi-Fi、BR和BLE。平板42可以支持Wi-Fi P2P、Wi-Fi、BR和BLE。智能电视43可以支持Wi-Fi P2P、Wi-Fi、BR和BLE。
在无线投屏业务场景下,手机41需要投屏至智能电视43。手机41和智能电视43的交互流程可以参见图5示出的无线投屏业务流程示意图。
如图5所示,该无线投屏业务流程可以包括:
步骤S501、手机获取待投屏数据。
步骤S502、手机检测到既有连接通道不能满足待投屏数据的传输业务需求时,则通过既有连接通道获取智能电视的通信能力集、设备状态和信号质量等数据。
具体应用中,手机在用户发起无线投屏业务数据传输时,可以先检测智能电视和 手机之间是否存在既有通信通道。如果有,则进一步检测既有通信通道能不能满足无线投屏业务数据的传输需求。
可以理解的是,在某一些情况下,例如,Wi-Fi信号不好,或者Wi-Fi网络不稳定等,可能会导致既有连接通道不能满足无线投屏业务数据的传输需求。
步骤S503、手机根据智能电视的通信能力集、设备状态和信号质量,和自身的通信能力集、设备状态和信号质量等,确定满足待投屏数据的传输业务需求的目标通信通道类型为Wi-Fi P2P连接。或者,确定出当前最优的通信通道为Wi-FiP2P。
需要指出的是,可以通过上文提及的两种方式确定满足当前传输业务需求的目标通信通道类型,在此不再赘述。
步骤S504、手机通过既有连接通道,建立手机和智能电视之间的Wi-FiP2P连接。
具体地,手机和智能电视之间通过既有连接通道传递Wi-FiP2P连接的建链信息,然后,手机和智能电视之间再根据建链信息进行Wi-FiP2P握手,建立Wi-FiP2P连接。作为示例而非限定,Wi-FiP2P的建链信息可以包括但不限于信道、介质访问控制地址(Media Access Control Address,MAC地址)、Password和服务集标识(Service Set Identifier,SSID)等。步骤S505、手机通过Wi-FiP2P连接将待投屏数据传输至智能电视,实现无线投屏业务。
可以看出,通过本申请实施例提供的技术方案可以在既有连接通道不满足无线投屏业务数据传输需求时,自动确定出能满足无线投屏数据的传输业务需求的通信通道,然后使用既有连接通道自动建立Wi-FiP2P连接,从而基于手机和智能电视的固有硬件基础下,在用户无感知的情况下,建立手机和智能电视之间最合适的连接通道,提高了用户体验。
在其它一些实施例中,手机和智能电视之间通过Wi-FiP2P连接传输无线投屏业务数据的时候,手机可以实时监测Wi-FiP2P连接是否能满足无线投屏业务数据的传输需求。如果不能,手机可以融合Wi-FiP2P连接和Wi-Fi连接两个通信通道,使用多通信通道传输无线投屏业务数据。
在其它一些实施例中,手机41需要投屏至平板42和智能电视43,即手机41同时向平板42和智能电视43传输投屏数据流。此时,手机41和平板42,手机41和智能电视33之间的既有连接通道是Wi-FiP2P连接。Wi-FiP2P连接的带宽很高,一般情况下可以满足投屏数据流的传输业务需求。但是,手机41存在两条Wi-FiP2P连接,这两条通信通道均需要占用一定的带宽,分配给每一条的带宽不满足投屏数据流的传输业务需求。这个情况下,手机可以将Wi-FiP2P和Wi-Fi进行融合,使用Wi-FiP2P和Wi-Fi传输投屏数据流。当然,手机也可以将其中一条Wi-FiP2P连接切换至Wi-Fi连接。
在其它一些实施例中,还可以结合待传输数据的数据优先级,进行决策。例如,手机41正在使用Wi-FiP2P传输文件数据至平板42时,用户也同时在使用手机在看视频,并需要将手机上的视屏投屏至智能电视43。此时,为了保证投屏效果,手机可以根据数据优先级,使用Wi-FiP2P传输视频流数据,而将正在使用Wi-FiP2P的文件传输业务切换至另一条通信通道。具体来说,基于图4,在另一种场景下,用户使用手机41向平板42传输文件时,手机41可以先根据确定现有的基于无线路由器的连接通 道是否满足文件数据的传输业务需求。手机41在确定出基于路由器的连接通道不能满足文件数据的传输业务需求时,则根据文件数据的传输业务类型,手机的通信能力集、设备状态信息和信号质量信息,以及平板的通信能力集、设备状态信息和信号质量信息,确定出满足文件数据的传输业务需求的通信通道为Wi-FiP2P。接着,手机41则与平板42之间建立Wi-FiP2P连接。
手机41与平板42建立Wi-FiP2P连接之后,则使用该连接通道传输文件数据。在传输文件的过程中,用户需要将手机41正在播放的视频投屏至智能电视43。此时,手机31视频播放应用位于前台运行,文件传输应用位于后台运行。后台应用的待传输数据的优先级一般低于前台应用的待传输数据的优先级,即投屏数据流的优先级要高于文件数据的优先级。
这种情况下,手机41使用已建立的Wi-FiP2P连接,将投屏数据流传输至智能电视43,实现投屏业务。另外,手机41和智能电视43新建立Wi-Fi连接,将文件传输业务切换至Wi-Fi连接,即通过新建立的Wi-Fi连接传输文件数据。这样,可以使用带宽较高的Wi-FiP2P连接传输优先级较高的投屏数据流,将优先级较低的文件数据切换至新建立的Wi-Fi连接。
需要指出的是,在面对上述情况时,即在使用已建立的Wi-FiP2P连接(即第二通信通道)传输文件数据时(即第一待传输数据),新来了投屏数据流(即第二待传输数据),可以使用本申请实施例的方案再新建立一条Wi-Fi P2P连接来传输投屏数据流;也可以使用本申请实施例的方案再新建立一条Wi-Fi连接来传输投屏数据流;也可以使用同一条Wi-FiP2P来传输文件数据和投屏数据流。但是,这两种方案的投屏效果较差。相较于前述的两种方案,根据传输数据的优先级,使用Wi-Fi P2P传输优先级高的数据,使用Wi-Fi传输优先级低的数据,投屏效果更佳,且不会影响到文件传输业务,进一步提高了用户体验。
在多屏协同业务场景下,参见图6示出的多屏协同业务场景示意图,手机61、平板62均需要投屏至智能电视63。如图6所示,手机61需要将屏幕投屏至智能电视63,而平板62需要将正在播放的视频画面投屏至智能电视63。
在该业务场景下,手机61和智能电视63,平板电脑62和智能电视63可以均进行与图5类似的过程,建立相应的第二通信通道。然后,手机61和平板62可以通过建立的第二通信通道投屏至智能电视63。
参见图7示出的一种投屏场景示意图,如图7所示,手机71需要将歌词播放界面或者视频、MV等投屏至智能电视53的屏幕上,需要将音频文件传输至智能音箱72。这样,用户可以通过智能音箱72播放音乐的音频,在智能电视上显示歌词。
手机71和智能电视73均可以支持Wi-Fi P2P、Wi-Fi、BR和BLE,而智能音箱72可以支持BLE、BR和Wi-Fi,不支持Wi-Fi P2P。
手机71和智能电视73均连接在同一个无线路由器下,即手机71和智能电视73存在既有连接通道。而手机71和智能音箱72之间不存在既有连接通道。
首先,手机71向智能音箱72发起音频文件传输时,手机71先检测与智能音箱72之间是否存在既有通信通道。如果没有,则使用BLE自组网技术,建立BLE连接。
然后,手机71通过BLE连接获取到智能音箱的通信能力集、设备状态和信号质 量等数据。再根据智能音箱的通信能力集、设备状态和信号质量,以及自身的通信能力集、设备状态和信号质量,确定出能满足音频文件传输需求的目标通信通道类型。
作为示例而非限定,音频文件数据传输属于文件类传输业务,根据文件类传输业务对应的通信通道优先级,可以确定手机和智能音箱均支持的,且优先级最高的通信通道为Wi-Fi连接,则确定手机和智能音箱之间的能满足音频文件数据传输需求的通信通道类型为Wi-Fi。
接着,手机71可以通过BLE连接,和智能音箱建立Wi-Fi连接。建立Wi-Fi连接之后,手机71可以将歌曲的音频文件通过Wi-Fi连接传输至智能音箱。
另一方面,手机71向智能电视73发起无线投屏数据传输业务时,手机71可以先确定既有连接通道是否满足无线投屏数据的传输业务需求。如果不能满足,根据手机和智能电视各自的通信能力集、设备状态和信号质量等,确定出最优连接通道类型为Wi-Fi P2P。手机71再根据既有连接通道建立手机和智能电视之间的Wi-Fi P2P连接。
最后,手机71可以通过Wi-Fi连接将音频文件传输至智能音箱72,通过Wi-FiP2P连接将无线投屏数据传输至智能电视73。
参见图8示出的文件传输业务场景的示意图,如图8所示,手机81需要将相册里面的照片83分享给手机82。手机81和手机82之间不存在既有通信通道。手机81和手机82均可以支持Wi-Fi P2P、Wi-Fi和BLE。
首先,手机81在用户发起图片传输请求时,手机81检测到与手机82之间不存在既有通信通道。手机81则通过自组网技术建立与手机82之间的长连接,作为示例而非限定,可以使用BLE自组网技术建立手机81和手机82的Mesh网络。
然后,手机81通过新建立的长连接,获取到手机82的通信能力集、设备状态和信号质量等数据。手机81再根据自身的通信能力集、设备状态和信号质量,以及手机82的通信能力集、设备状态和信号质量等,确定能满足当前传输业务需求的通信通道类型为Wi-Fi P2P。
接着,手机81则可以通过新建立的长连接,与手机82建立Wi-Fi P2P连接。
建立Wi-FiP2P连接之后,手机81则可以通过Wi-FiP2P连接将图片83传输至手机82。
需要指出的是,在其它一些实施例中,手机81和手机82之间也可以通过移动热点的方式建立长连接。具体地,手机81可以打开移动热点,手机82连接到手机81的移动热点,这样手机81和手机82之间则建立长连接。通过移动热点,手机81和手机82之间可以确定出能满足当前传输业务需求的通信通道类型,建立对应的目标通信通道。
参见图9示出的手机和车机(也可以称车载终端)的数据传输场景示意图。如图9所示,手机91和车机92通常情况下是基于蓝牙连接通道93通信连接的,而在一些情况下,用户可能会通过USB数据线94连接手机91和车机92。例如,用户想要在车内给手机充电,则通过USB数据连续将手机791连接至车机92,为手机91充电。其中,手机91和车机92均支持BLE和USB。
此时,通过本申请实施例提供的技术方案,可以在用户发起传输业务时,根据设备的通信能力集、设备状态和信号质量等数据,自动决策出能满足当前传输业务需求 的通信通道类型,并使用该通信通道类型对应的目标通信通道传输业务数据。
具体来说,在用户发起歌曲文件传输业务时,手机91检测到与车机92之间不存在既有连接通道,则可以先建立手机91和车机92的BLE连接。
然后,手机91通过BLE获取到车机92的通信能力集、设备状态和信号质量等数据,再结合自身的通信能力集、设备状态和信号质量,确定出满足当前传输业务需求的通信通道类型为USB连接。
作为示例而非限定,手机91和车机92均支持BLE和USB,且通过手机的设备状态可以得知手机正处于充电状态,而歌曲文件传输业务数据属于文件类传输业务。文件类传输业务对应的通信通道优先级为:USB>Wi-Fi P2P 5G>Wi-Fi 5G>Wi-Fi P2P 2G>Wi-Fi 2G>BLE。由此可以确定,手机91和车机92之间的能满足当前传输业务需求的通信通道类型为USB。
最后,手机91通过USB连接将歌曲文件传输至车机92。车机92解析歌曲文件获得音频文件和歌词文件,播放对应的音频文件,并根据歌词文件在显示屏上显示对应的歌词。
进一步地,确定出手机91和车机92之间的最优连接通道为USB后,手机91和车机92之间所有的传输业务数据都可以优先使用USB连接。
在其它一些实施例中,用户如果拔掉USB连接,手机91可以先切换至既有的BLE连接通道,再通过该BLE连接通道重新确定出满足当前传输业务需求的目标通信通道类型,以建立新的目标通信通道。
在其它一些实施例中,手机和车机之间使用USB传输数据时,可能存在多个传输业务均使用USB传输,导致分配给每个传输数据的带宽十分有限,导致USB不满足当前传输业务需求。此时,手机和车机之间可以使用本申请实施例提供的方案,建立手机和车机之间的BLE连接,使用该BLE连接传输指令类数据等。
可以理解的是,上文提及的几种场景仅仅是示例性场景,且各个场景中与上文实施例之间相同或相似部分,可以参见上文实施例的介绍,在此不再赘述。
还需要指出的是,在本申请实施例的一些场景下,需要建立Wi-Fi P2P连接,并使用Wi-Fi P2P连接传输业务数据。为了保证数据传输性能,可以根据业务类型和业务数据流的方向自动确定出Wi-FiP2P网络中的设备角色。
Wi-FiP2P网络中的设备角色包括两种,分别为组所有者(Group Owner,GO)节点和组客户端(Group Client,GC)节点。现有技术中,GO和GC的角色可以通过GO协商确定,而GO协商是随机确定哪个设备作为GO节点的。
本申请实施例中,根据业务类型和业务数据流的方向确定出Wi-FiP2P网络中的设备角色,可以在一定程度保证数据传输速率,确保数据的实时性。
举例来说,以手机、智能电视和智能音箱为例,此时需要将手机的歌词播放界面投屏至智能电视,将手机的歌曲播放音频投屏至智能音箱。
现有技术,手机、智能电视和智能音箱间两两设备需要进行GO协商,以确定各自在Wi-Fi P2P网络中的角色,即确定谁是GO,谁是GC。两个设备间的GO协商是通过两个设备间发送的随机数确定,哪个设备的随机数大,哪个设备就作为GO节点。也就是说,GO协商不能指定哪个设备作为GO节点,GO节点的随机性较大。
在一些情况下,在手机和智能电视的GO协商过程,以及智能电视和智能音箱的GO协商过程中,随机确定了智能电视作为GO节点,手机和智能音箱作为GC节点。由于两个GC节点间不能相互通信,所以手机如果需要将音频传输至智能音箱,则需要先传输给作为GO节点的智能电视,由智能电视将音频数据传输至智能音箱,这样会造成音频数据的实时性较差。
而如果使用本申请实施例提供的方案,根据业务类型和数据流向等,确定手机为GO节点。手机与智能电视和智能音箱建立Wi-Fi P2P连接后,手机可以将音频数据直接发送至智能音箱,不用通过智能电视转发,提高了音频数据的实时性。
具体应用中,电子设备可以根据传输业务类型和数据流方向,调用预先设置的接口确定哪个设备作为GO节点。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本申请实施例中的电子设备的类型和数据可以是任意的。例如,电子设备可以为手机、平板、电脑或者车机等。
该电子设备可以包括但不限于:至少一个处理器、存储器以及存储在存储器中并可在至少一个处理器上运行的计算机程序,处理器执行计算机程序时实现上述任意各个方法实施例中的步骤。
作为示例而非限定,如图10所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令 操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示 屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例 中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行 算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A
的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。 在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不 同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图11是本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图11所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图10所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完 成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
对应于上文实施例的数据传输方法,图12示出了本申请实施例提供的数据传输装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图12,该装置应用于第一电子设备,该装置可以包括:
第一获取模块1201,用于获取第一待传输数据;
第一确定模块1202,用于确定第一通信通道是否满足第一待传输数据的传输业务需求,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道;
第一建立模块1203,用于若第一通信通道不满足第一待传输数据的传输业务需求,通过第一通信通道,建立满足第一待传输数据的传输业务需求的第二通信通道;
第一传输模块1204,用于通过第二通信通道将第一待传输数据传输至第二电子设备。
在一些实施例中,上述装置还可以包括:
第一传输业务类型确定模块,用于确定第一待传输数据的传输业务类型;其中,传输业务类型包括消息类传输业务、文件传输类业务和多媒体流类传输业务;
第一传输业务需求确定模块,用于根据第一待传输数据的传输业务类型确定第一待传输数据的传输业务需求。
在一些实施例中,第一建立模块具体用于:
根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及 第二电子设备的第二通信能力信息,确定满足第一待传输数据的传输业务需求的目标通信通道类型;
其中,第二电子设备的第二通信能力信息是在确定第一通信通道不满足第一待传输数据的传输业务需求后,由第一电子设备向第二电子设备获取的,或者是在第一电子设备和第二电子设备在初次建立连接时,由第二电子设备发送给第一电子设备的;第一通信能力信息包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息,第二通信能力信息包括用于表征第二电子设备支持的通信连接类型的第二通信连接信息;
与第二电子设备建立目标通信通道类型对应的目标通信通道,将目标通信通道作为第二通信通道。
在一些实施例中,第一建立模块具体用于:
根据第一通信连接信息和第二通信连接信息,确定第一候选通信通道类型,第一候选通信通道类型为满足第一待传输数据的传输业务需求的通道类型;
根据第一待传输数据的传输业务类型对应的通信通道优先级,从第一候选通信通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
在一些实施例中,第一建立模块具体用于:
将第一待传输数据的传输业务类型、第一通信能力信息以及第二通信能力信息输入至预先训练完成的分类器,将分类器输出的通信通道类型作为目标通信通道类型。
在一些实施例中,第一通信能力信息还包括第一电子设备的设备状态信息和信号质量信息中的至少一种,第二通信能力信息还包括第二电子设备的设备状态信息和信号质量信息中的至少一种。
在一些实施例中,上述装置还可以包括:
检测模块,用于检测第一电子设备和第二电子设备之间是否存在第一通信通道;
第二建立模块,用于若第一电子设备和第二电子设备之间不存在第一通信通道,与第二电子设备之间建立第三通信通道,将第三通信通道作为第一通信通道。
在一些实施例中,上述装置还可以包括:
第二获取模块,用于获取第二待传输数据,其中,第二待传输数据的数据优先级高于第一待传输数据的数据优先级;
第二传输业务类型确定模块,用于确定第二待传输数据的传输业务类型,根据第二待传输数据的传输业务类型确定第二待传输数据的传输业务需求;
第二传输业务需求确定模块,用于确定第一通信通道和第二通信通道是否满足第二待传输数据的传输业务需求;
通道类型确定模块,用于若第一通信通道和第二通信通道均不满足第一待传输数据的传输业务需求,则根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定满足第二待传输数据的传输业务需求的第四通信通道类型;
第一切换模块,用于若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信 通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
在一些实施例中,上述装置还可以包括:
切换传输模块,用于将第一待传输数据切换到第二通信通道进行传输;
拆除模块,用于确定第五通信通道是否有对应的业务;若第五通信通道没有对应的业务,拆除第五通信通道。
上述数据传输装置具有实现上述数据传输方法的功能,该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现,硬件或软件包括一个或多个与上述功能相对应的模块,模块可以是软件和/或硬件。
对应于上文实施例的数据传输方法,图13示出了本申请实施例提供的数据传输装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图13,该装置应用于第一电子设备,该装置可以包括:
第三传输业务类型确定模块1301,用于确定第一待传输数据的传输业务类型;
能力信息获取模块1302,用于获取第二电子设备的第二通信能力信息,第二通信能力信息包括用于表征第二电子设备支持的通信连接类型的第二通信连接信息。
最优通道类型确定模块1303,用于根据第一待传输数据的传输业务类型,第一电子设备的第一通信能力信息,以及第二电子设备的第二通信能力信息,确定第一待传输数据的目标通信通道类型;其中,第一通信能力信息包括用于表征第一电子设备所支持的通信连接类型的第一通信连接信息,目标通信通道类型是用于传输第一待传输数据的最优通信通道的类型;
第二传输模块1304,用于若目标通信通道类型与第一通信通道的类型相同,通过第一通信通道将第一待传输数据传输至第二电子设备;其中,第一通信通道是第一电子设备和第二电子设备之间的既有连接通道;
第三传输模块1305,用于若目标通信通道类型与第一通信通道的类型不相同,与第二电子设备建立目标通信通道类型对应的第二通信通道,通过第二通信通道将第一待传输数据传输至第二电子设备。
在一些实施例中,最优通道类型确定模块具体用于:
根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型,第二候选通信通道类型是第一电子设备和第二电子设备均支持的通信通道类型;
根据传输业务类型对应的通信通道优先级,从第二候选通信通道类型中确定优先级最高的通信通道类型,将优先级最高的通信通道类型作为目标通信通道类型。
在一些实施例中,第一通信能力信息还包括第一电子设备的设备状态信息和信号质量信息中的至少一种,第二通信能力信息还包括第二电子设备的设备状态信息和信号质量信息中的至少一种;
最优通道类型确定模块具体用于:
根据第一通信连接信息和第二通信连接信息,确定第二候选通信通道类型,第二候选通信通道类型是第一电子设备和第二电子设备均支持的通信通道类型;
根据第一电子设备的设备状态信息和信号质量信息中的至少一种,第二电子设备的设备状态信息和信号质量信息中的至少一种,从第二候选通信通道类型中确定第一 待传输数据的目标通信通道类型。
在一些实施例中,上述装置还可以包括:
第三获取模块,用于第二待传输数据;
第四传输业务类型确定模块,用于确定第二待传输数据的传输业务类型,其中第二待传输数据的数据优先级高于第一待传输数据的数据优先级;
第四通道类型确定模块,用于根据第二待传输数据的传输业务类型、第一电子设备的第一通信能力信息以及第二电子设备的第二通信能力信息,确定第二待传输数据的第四通信通道类型,第四通信通道类型是用于传输所述第二待传输数据的最优通信通道的类型;
第二切换模块,用于若第四通信通道类型与第二通信通道的类型相同,通过第二通信通道将第二待传输数据传输至第二电子设备,将第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过第五通信通道将第一待传输数据传输至第二电子设备。
上述数据传输装置具有实现上述数据传输方法的功能,该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现,硬件或软件包括一个或多个与上述功能相对应的模块,模块可以是软件和/或硬件。
需要说明的是,上述装置/模块之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现可实现上述各个方法实施例中的步骤。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
最后应说明的是:以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (28)

  1. 一种数据传输方法,其特征在于,应用于第一电子设备,所述方法包括:
    获取第一待传输数据;
    确定第一通信通道是否满足所述第一待传输数据的传输业务需求,所述第一通信通道是所述第一电子设备和第二电子设备之间的既有连接通道;
    若所述第一通信通道不满足所述第一待传输数据的传输业务需求,通过所述第一通信通道,建立满足所述第一待传输数据的传输业务需求的第二通信通道;
    通过所述第二通信通道将所述第一待传输数据传输至所述第二电子设备。
  2. 根据权利要求1所述的方法,其特征在于,所述确定第一通信通道是否满足所述第一待传输数据的传输业务需求之前,所述方法还包括:
    确定所述第一待传输数据的传输业务类型,其中,所述传输业务类型包括消息类传输业务、文件传输类业务和多媒体流类传输业务;
    根据所述第一待传输数据的传输业务类型确定所述第一待传输数据的传输业务需求。
  3. 根据权利要求1或2所述的方法,其特征在于,通过所述第一通信通道,建立满足所述第一待传输数据的传输业务需求的第二通信通道,包括:
    根据所述第一待传输数据的传输业务类型,所述第一电子设备的第一通信能力信息,以及所述第二电子设备的第二通信能力信息,确定满足所述第一待传输数据的传输业务需求的目标通信通道类型,其中,所述第二电子设备的第二通信能力信息是在确定第一通信通道不满足所述第一待传输数据的传输业务需求后,由所述第一电子设备向所述第二电子设备获取的,或者是在第一电子设备和第二电子设备在初次建立连接时,由第二电子设备发送给第一电子设备,并存储在第一电子设备中,所述第一通信能力信息包括用于表征所述第一电子设备所支持的通信连接类型的第一通信连接信息,所述第二通信能力信息包括用于表征所述第二电子设备支持的通信连接类型的第二通信连接信息;
    与所述第二电子设备建立所述目标通信通道类型对应的目标通信通道,将所述目标通信通道作为所述第二通信通道。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述第一待传输数据的传输业务类型,所述第一电子设备的第一通信能力信息,以及所述第二电子设备的第二通信能力信息,确定满足所述第一待传输数据的传输业务需求的目标通信通道类型,包括:
    根据所述第一通信连接信息和所述第二通信连接信息,确定第一候选通信通道类型,所述第一候选通信通道类型为满足所述第一待传输数据的传输业务需求的通道类型;
    根据所述第一待传输数据的传输业务类型对应的通信通道优先级,从所述第一候选通信通道类型中确定优先级最高的通信通道类型,将所述优先级最高的通信通道类型作为所述目标通信通道类型。
  5. 根据权利要求3所述的方法,其特征在于,所述根据所述第一待传输数据的传输业务类型,所述第一电子设备的第一通信能力信息,以及所述第二电子设备的第二 通信能力信息,确定满足所述第一待传输数据的传输业务需求的目标通信通道类型,包括:
    将所述第一待传输数据的传输业务类型、所述第一通信能力信息以及所述第二通信能力信息输入至预先训练完成的分类器,将所述分类器输出的通信通道类型作为所述目标通信通道类型。
  6. 根据权利要求3所述的方法,其特征在于,所述第一通信能力信息还包括所述第一电子设备的设备状态信息和信号质量信息中的至少一种,所述第二通信能力信息还包括所述第二电子设备的设备状态信息和信号质量信息中的至少一种。
  7. 根据权利要求1所述的方法,其特征在于,在确定第一通信通道是否满足所述第一待传输数据的传输业务需求之前,所述方法还包括:
    检测所述第一电子设备和所述第二电子设备之间是否存在所述第一通信通道;
    若所述第一电子设备和所述第二电子设备之间不存在所述第一通信通道,与所述第二电子设备之间建立第三通信通道,将所述第三通信通道作为所述第一通信通道。
  8. 根据权利要求1至7任一项所述的方法,其特征在于,在通过所述第二通信通道传输所述第一待传输数据的过程中,所述方法还包括:
    获取第二待传输数据,其中,所述第二待传输数据的数据优先级高于所述第一待传输数据的数据优先级;
    确定所述第二待传输数据的传输业务类型,根据所述第二待传输数据的传输业务类型确定所述第二待传输数据的传输业务需求;
    确定所述第一通信通道和所述第二通信通道是否满足所述第二待传输数据的传输业务需求;
    若所述第一通信通道和所述第二通信通道均不满足所述第一待传输数据的传输业务需求,则根据所述第二待传输数据的传输业务类型、所述第一电子设备的第一通信能力信息以及所述第二电子设备的第二通信能力信息,确定满足所述第二待传输数据的传输业务需求的第四通信通道类型;
    若所述第四通信通道类型与所述第二通信通道的类型相同,通过所述第二通信通道将所述第二待传输数据传输至所述第二电子设备,将所述第一待传输数据切换到所述第一通信通道进行传输,或者建立第五通信通道,通过所述第五通信通道将所述第一待传输数据传输至所述第二电子设备。
  9. 根据权利要求8所述的方法,其特征在于,在所述第二待传输数据传输完成后,所述方法还包括:
    将所述第一待传输数据切换到所述第二通信通道进行传输;
    若存在所述第五通信通道,所述方法还包括:
    确定所述第五通信通道是否有对应的业务;
    若所述第五通信通道没有对应的业务,拆除所述第五通信通道。
  10. 一种数据传输方法,其特征在于,应用于第一电子设备,所述方法包括:
    确定第一待传输数据的传输业务类型;
    获取第二电子设备的第二通信能力信息,所述第二通信能力信息包括用于表征所述第二电子设备支持的通信连接类型的第二通信连接信息;
    根据所述第一待传输数据的传输业务类型,所述第一电子设备的第一通信能力信息,以及所述第二电子设备的第二通信能力信息,确定所述第一待传输数据的目标通信通道类型,其中,所述第一通信能力信息包括用于表征所述第一电子设备所支持的通信连接类型的第一通信连接信息,所述目标通信通道类型是用于传输所述第一待传输数据的最优通信通道的类型;
    若所述目标通信通道类型与第一通信通道的类型相同,通过所述第一通信通道将所述第一待传输数据传输至所述第二电子设备,其中,所述第一通信通道是所述第一电子设备和所述第二电子设备之间的既有连接通道;
    若所述目标通信通道类型与所述第一通信通道的类型不相同,与所述第二电子设备建立所述目标通信通道类型对应的第二通信通道,通过所述第二通信通道将所述第一待传输数据传输至第二电子设备。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述第一待传输数据的传输业务类型,所述第一电子设备的第一通信能力信息,以及所述第二电子设备的第二通信能力信息,确定所述第一待传输数据的目标通信通道类型,包括:
    根据所述第一通信连接信息和所述第二通信连接信息,确定第二候选通信通道类型,所述第二候选通信通道类型是所述第一电子设备和所述第二电子设备均支持的通信通道类型;
    根据所述第一待传输数据的传输业务类型对应的通信通道优先级,从所述第二候选通信通道类型中确定优先级最高的通信通道类型,将所述优先级最高的通信通道类型作为所述目标通信通道类型。
  12. 根据权利要求10所述的方法,其特征在于,所述第一通信能力信息还包括所述第一电子设备的设备状态信息和信号质量信息中的至少一种,所述第二通信能力信息还包括所述第二电子设备的设备状态信息和信号质量信息中的至少一种;
    所述根据所述第一待传输数据的传输业务类型,所述第一电子设备的第一通信能力信息,以及所述第二电子设备的第二通信能力信息,确定所述第一待传输数据的目标通信通道类型,包括:
    根据所述第一通信连接信息和所述第二通信连接信息,确定第二候选通信通道类型,所述第二候选通信通道类型是所述第一电子设备和所述第二电子设备均支持的通信通道类型;
    根据所述第一待传输数据的传输业务类型,所述第一电子设备的设备状态信息和信号质量信息中的至少一种,以及所述第二电子设备的设备状态信息和信号质量信息中的至少一种,从所述第二候选通信通道类型中确定所述第一待传输数据的目标通信通道类型。
  13. 根据权利要求10至12任一项所述的方法,其特征在于,在通过所述第二通信通道传输所述第一待传输数据的过程中,所述方法还包括:
    获取第二待传输数据;
    确定第二待传输数据的传输业务类型,其中所述第二待传输数据的数据优先级高于所述第一待传输数据的数据优先级;
    根据所述第二待传输数据的传输业务类型、所述第一电子设备的第一通信能力信 息以及所述第二电子设备的第二通信能力信息,确定所述第二待传输数据的第四通信通道类型,所述第四通信通道类型是用于传输所述第二待传输数据的最优通信通道的类型;
    若所述第四通信通道类型与所述第二通信通道的类型相同,通过所述第二通信通道将所述第二待传输数据传输至所述第二电子设备,将所述第一待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过所述第五通信通道将所述第一待传输数据传输至所述第二电子设备。
  14. 一种数据传输装置,其特征在于,应用于第一电子设备,所述装置包括:
    第一获取模块,用于获取第一待传输数据;
    第一确定模块,用于确定第一通信通道是否满足所述第一待传输数据的传输业务需求,所述第一通信通道是所述第一电子设备和第二电子设备之间的既有连接通道;
    第一建立模块,用于若所述第一通信通道不满足所述第一待传输数据的传输业务需求,通过所述第一通信通道,建立满足所述第一待传输数据的传输业务需求的第二通信通道;
    第一传输模块,用于通过所述第二通信通道将所述第一待传输数据传输至所述第二电子设备。
  15. 根据权利要求14所述的装置,其特征在于,所述装置还包括:
    第一传输业务类型确定模块,用于确定所述第一待传输数据的传输业务类型,其中,所述传输业务类型包括消息类传输业务、文件传输类业务和多媒体流类传输业务;
    第一传输业务需求确定模块,用于第二根据所述第一待传输数据的传输业务类型确定所述第一待传输数据的传输业务需求。
  16. 根据权利要求14或15所述的装置,其特征在于,所述第一建立模块具体用于:
    根据所述第一待传输数据的传输业务类型,所述第一电子设备的第一通信能力信息,以及所述第二电子设备的第二通信能力信息,确定满足所述第一待传输数据的传输业务需求的目标通信通道类型,其中,所述第二电子设备的第二通信能力信息是在确定第一通信通道不满足所述第一待传输数据的传输业务需求后,由所述第一电子设备向所述第二电子设备获取的,或者是在第一电子设备和第二电子设备在初次建立连接时,由第二电子设备发送给第一电子设备,并存储在第一电子设备中;所述第一通信能力信息包括用于表征所述第一电子设备所支持的通信连接类型的第一通信连接信息,所述第二通信能力信息包括用于表征所述第二电子设备支持的通信连接类型的第二通信连接信息;
    与所述第二电子设备建立所述目标通信通道类型对应的目标通信通道,将所述目标通信通道作为所述第二通信通道。
  17. 根据权利要求16所述的装置,其特征在于,所述第一建立模块具体用于:
    根据所述第一通信连接信息和所述第二通信连接信息,确定第一候选通信通道类型,所述第一候选通信通道类型为满足所述第一待传输数据的传输业务需求的通道类型;
    根据所述第一待传输数据的传输业务类型对应的通信通道优先级,从所述第一候 选通信通道类型中确定优先级最高的通信通道类型,将所述优先级最高的通信通道类型作为所述目标通信通道类型。
  18. 根据权利要求16所述的装置,其特征在于,所述第一建立模块具体用于:
    将所述第一待传输数据的传输业务类型、所述第一通信能力信息以及所述第二通信能力信息输入至预先训练完成的分类器,将所述分类器输出的通信通道类型作为所述目标通信通道类型。
  19. 根据权利要求16所述的装置,其特征在于,所述第一通信能力信息还包括所述第一电子设备的设备状态信息和信号质量信息中的至少一种,所述第二通信能力信息还包括所述第二电子设备的设备状态信息和信号质量信息中的至少一种。
  20. 根据权利要求14所述的装置,其特征在于,所述装置还包括:
    检测模块,用于检测所述第一电子设备和所述第二电子设备之间是否存在所述第一通信通道;
    第二建立模块,用于若所述第一电子设备和所述第二电子设备之间不存在所述第一通信通道,与所述第二电子设备之间建立第三通信通道,将所述第三通信通道作为所述第一通信通道。
  21. 根据权利要求14至20任一项所述的装置,其特征在于,所述装置还包括:
    第二获取模块,用于获取第二待传输数据,其中,所述第二待传输数据的数据优先级高于所述第一待传输数据的数据优先级;
    第二传输业务类型确定模块,用于确定所述第二待传输数据的传输业务类型,根据所述第二待传输数据的传输业务类型确定所述第二待传输数据的传输业务需求;
    第二传输业务需求确定模块,用于确定所述第一通信通道和所述第二通信通道是否满足所述第二待传输数据的传输业务需求;
    通道类型确定模块,用于若所述第一通信通道和所述第二通信通道均不满足所述第一待传输数据的传输业务需求,则根据所述第二待传输数据的传输业务类型、所述第一电子设备的第一通信能力信息以及所述第二电子设备的第二通信能力信息,确定满足所述第二待传输数据的传输业务需求的第四通信通道类型;
    第一切换模块,用于若所述第四通信通道类型与所述第二通信通道的类型相同,通过所述第二通信通道将所述第二待传输数据传输至所述第二电子设备,将所述第一待传输数据切换到所述第一通信通道进行传输,或者建立第五通信通道,通过所述第五通信通道将所述第一待传输数据传输至所述第二电子设备。
  22. 根据权利要求21所述的装置,其特征在于,所述装置还包括:
    切换传输模块,用于将所述第一待传输数据切换到所述第二通信通道进行传输;
    拆除模块,用于确定所述第五通信通道是否有对应的业务;若所述第五通信通道没有对应的业务,拆除所述第五通信通道。
  23. 一种数据传输装置,其特征在于,应用于第一电子设备,所述装置包括:
    第三传输业务类型确定模块,用于确定第一待传输数据的传输业务类型;
    能力信息获取模块,用于获取第二电子设备的第二通信能力信息,所述第二通信能力信息包括用于表征所述第二电子设备支持的通信连接类型的第二通信连接信息;
    最优通道类型确定模块,用于根据所述第一待传输数据的传输业务类型,所述第 一电子设备的第一通信能力信息,以及所述第二电子设备的第二通信能力信息,确定所述第一待传输数据的目标通信通道类型,其中,所述第一通信能力信息包括用于表征所述第一电子设备所支持的通信连接类型的第一通信连接信息,所述目标通信通道类型是用于传输所述第一待传输数据的最优通信通道的类型;
    第二传输模块,用于若所述目标通信通道类型与第一通信通道的类型相同,通过所述第一通信通道将所述第一待传输数据传输至所述第二电子设备,其中,所述第一通信通道是所述第一电子设备和所述第二电子设备之间的既有连接通道;
    第三传输模块,用于若所述目标通信通道类型与所述第一通信通道的类型不相同,与所述第二电子设备建立所述目标通信通道类型对应的第二通信通道,通过所述第二通信通道将所述第一待传输数据传输至第二电子设备。
  24. 根据权利要求23所述的装置,其特征在于,所述最优通道类型确定模块具体用于:
    根据所述第一通信连接信息和所述第二通信连接信息,确定第二候选通信通道类型,所述第二候选通信通道类型是所述第一电子设备和所述第二电子设备均支持的通信通道类型;
    根据所述第一待传输数据的传输业务类型对应的通信通道优先级,从所述第二候选通信通道类型中确定优先级最高的通信通道类型,将所述优先级最高的通信通道类型作为所述目标通信通道类型。
  25. 根据权利要求23所述的装置,其特征在于,所述第一通信能力信息还包括所述第一电子设备的设备状态信息和信号质量信息中的至少一种,所述第二通信能力信息还包括所述第二电子设备的设备状态信息和信号质量信息中的至少一种;
    所述最优通道类型确定模块具体用于:
    根据所述第一通信连接信息和所述第二通信连接信息,确定第二候选通信通道类型,所述第二候选通信通道类型是所述第一电子设备和所述第二电子设备均支持的通信通道类型;
    根据所述第一待传输数据的传输业务类型,所述第一电子设备的设备状态信息和信号质量信息中的至少一种,以及所述第二电子设备的设备状态信息和信号质量信息中的至少一种,从所述第二候选通信通道类型中确定所述第一待传输数据的目标通信通道类型。
  26. 根据权利要求23至25任一项所述的装置,其特征在于,所述装置还包括:
    第三获取模块,用于获取第二待传输数据;
    第四传输业务类型确定模块,用于确定第二待传输数据的传输业务类型,其中所述第二待传输数据的数据优先级高于所述第一待传输数据的数据优先级;
    第四通道类型确定模块,用于根据所述第二待传输数据的传输业务类型、所述第一电子设备的第一通信能力信息以及所述第二电子设备的第二通信能力信息,确定所述第二待传输数据的第四通信通道类型,所述第四通信通道类型是用于传输所述第二待传输数据的最优通信通道的类型;
    第二切换模块,用于若所述第四通信通道类型与所述第二通信通道的类型相同,通过所述第二通信通道将所述第二待传输数据传输至所述第二电子设备,将所述第一 待传输数据切换到第一通信通道进行传输,或者建立第五通信通道,通过所述第五通信通道将所述第一待传输数据传输至所述第二电子设备。
  27. 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至9或者10至13任一项所述的方法。
  28. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9或者10至13任一项所述的方法。
PCT/CN2021/079178 2020-03-06 2021-03-05 数据传输方法、装置、电子设备和可读存储介质 WO2021175300A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010155811.4A CN113438354B (zh) 2020-03-06 2020-03-06 数据传输方法、装置、电子设备和存储介质
CN202010155811.4 2020-03-06

Publications (1)

Publication Number Publication Date
WO2021175300A1 true WO2021175300A1 (zh) 2021-09-10

Family

ID=77612885

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/079178 WO2021175300A1 (zh) 2020-03-06 2021-03-05 数据传输方法、装置、电子设备和可读存储介质

Country Status (2)

Country Link
CN (1) CN113438354B (zh)
WO (1) WO2021175300A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113891130A (zh) * 2021-09-18 2022-01-04 海信视像科技股份有限公司 显示设备及请求处理方法
CN113904860A (zh) * 2021-10-20 2022-01-07 北京天宇威视科技股份有限公司 数据传输方法、装置、设备、系统及存储介质
CN114500511A (zh) * 2022-01-29 2022-05-13 联想(北京)有限公司 一种数据传输方法、装置及电子设备
CN116471351A (zh) * 2022-01-10 2023-07-21 荣耀终端有限公司 通话音频数据的传输方法及装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115695928A (zh) * 2022-09-26 2023-02-03 抖音视界有限公司 一种投屏方法、装置、电子设备及存储介质
CN115632746B (zh) * 2022-12-22 2023-04-18 深圳沛喆微电子有限公司 WiFi6智能路由器系统提升传输信道稳定度的方法
CN117134848A (zh) * 2023-01-20 2023-11-28 荣耀终端有限公司 通道建立方法、设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428672A (zh) * 2013-08-19 2013-12-04 宇龙计算机通信科技(深圳)有限公司 一种传输数据的方法和装置
CN105472772A (zh) * 2014-09-26 2016-04-06 纬创资通股份有限公司 连线方法与电子装置
CN106255230A (zh) * 2016-07-29 2016-12-21 广东美的厨房电器制造有限公司 数据传输方法及数据传输装置
CN106572498A (zh) * 2016-10-27 2017-04-19 东软集团股份有限公司 一种数据传输方法、装置及系统
CN106658372A (zh) * 2016-12-13 2017-05-10 上海斐讯数据通信技术有限公司 低功耗数据传输方法及系统、发送设备及接收设备
CN107318129A (zh) * 2017-06-30 2017-11-03 广东欧珀移动通信有限公司 数据处理方法、装置及终端
CN107343325A (zh) * 2017-06-26 2017-11-10 广东欧珀移动通信有限公司 一种数据传输方法、装置及终端

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092701B (zh) * 2011-10-31 2017-02-08 联想(北京)有限公司 一种通信方法、装置及电子设备
US11088967B2 (en) * 2019-04-26 2021-08-10 Intel Corporation Shared resources for multiple communication traffics
CN111010715A (zh) * 2019-12-11 2020-04-14 惠州Tcl移动通信有限公司 一种数据传输方法、装置、存储介质及终端

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428672A (zh) * 2013-08-19 2013-12-04 宇龙计算机通信科技(深圳)有限公司 一种传输数据的方法和装置
CN105472772A (zh) * 2014-09-26 2016-04-06 纬创资通股份有限公司 连线方法与电子装置
CN106255230A (zh) * 2016-07-29 2016-12-21 广东美的厨房电器制造有限公司 数据传输方法及数据传输装置
CN106572498A (zh) * 2016-10-27 2017-04-19 东软集团股份有限公司 一种数据传输方法、装置及系统
CN106658372A (zh) * 2016-12-13 2017-05-10 上海斐讯数据通信技术有限公司 低功耗数据传输方法及系统、发送设备及接收设备
CN107343325A (zh) * 2017-06-26 2017-11-10 广东欧珀移动通信有限公司 一种数据传输方法、装置及终端
CN107318129A (zh) * 2017-06-30 2017-11-03 广东欧珀移动通信有限公司 数据处理方法、装置及终端

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113891130A (zh) * 2021-09-18 2022-01-04 海信视像科技股份有限公司 显示设备及请求处理方法
CN113904860A (zh) * 2021-10-20 2022-01-07 北京天宇威视科技股份有限公司 数据传输方法、装置、设备、系统及存储介质
CN116471351A (zh) * 2022-01-10 2023-07-21 荣耀终端有限公司 通话音频数据的传输方法及装置
CN116471351B (zh) * 2022-01-10 2024-04-09 荣耀终端有限公司 通话音频数据的传输方法及装置
CN114500511A (zh) * 2022-01-29 2022-05-13 联想(北京)有限公司 一种数据传输方法、装置及电子设备
CN114500511B (zh) * 2022-01-29 2023-12-26 联想(北京)有限公司 一种数据传输方法、装置及电子设备

Also Published As

Publication number Publication date
CN113438354B (zh) 2022-09-02
CN113438354A (zh) 2021-09-24

Similar Documents

Publication Publication Date Title
WO2021175300A1 (zh) 数据传输方法、装置、电子设备和可读存储介质
CN111316598B (zh) 一种多屏互动方法及设备
WO2022257977A1 (zh) 电子设备的投屏方法和电子设备
EP4084486A1 (en) Cross-device content projection method, and electronic device
WO2021185141A1 (zh) Wi-Fi Aware的建链方法、系统、电子设备和存储介质
CN113923230B (zh) 数据同步方法、电子设备和计算机可读存储介质
WO2022033320A1 (zh) 蓝牙通信方法、终端设备及计算机可读存储介质
CN110636554B (zh) 数据传输方法及装置
WO2021031865A1 (zh) 通话方法及装置
WO2021197071A1 (zh) 无线通信系统及方法
KR102491006B1 (ko) 데이터 송신 방법 및 전자 기기
CN113498108A (zh) 基于业务类型调整数据传输策略的芯片、设备以及方法
WO2022042265A1 (zh) 通信方法、终端设备及存储介质
CN113810451A (zh) 点对点链路的建立方法、装置、服务器和终端设备
WO2021218544A1 (zh) 一种提供无线上网的系统、方法及电子设备
WO2021114950A1 (zh) 一种多路http通道复用的方法及终端
CN113453327A (zh) 一种发送功率控制方法、终端、芯片系统与系统
WO2023280160A1 (zh) 一种通道切换方法及装置
WO2022267917A1 (zh) 蓝牙通信方法及系统
CN113271577B (zh) 媒体数据播放系统、方法及相关装置
WO2022206769A1 (zh) 一种拼接内容的方法、电子设备和系统
WO2022206603A1 (zh) 通信资源协作方法及电子设备
WO2024067037A1 (zh) 一种服务调用方法、系统和电子设备
CN117354876A (zh) 一种数据迁移方法、电子设备和组网系统
CN116996900A (zh) 数据传输方法及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21765395

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21765395

Country of ref document: EP

Kind code of ref document: A1