CN115022853A - Device discovery method and electronic device - Google Patents

Device discovery method and electronic device Download PDF

Info

Publication number
CN115022853A
CN115022853A CN202111551273.1A CN202111551273A CN115022853A CN 115022853 A CN115022853 A CN 115022853A CN 202111551273 A CN202111551273 A CN 202111551273A CN 115022853 A CN115022853 A CN 115022853A
Authority
CN
China
Prior art keywords
electronic device
channel
electronic
information
driver
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111551273.1A
Other languages
Chinese (zh)
Other versions
CN115022853B (en
Inventor
张煜东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202111551273.1A priority Critical patent/CN115022853B/en
Publication of CN115022853A publication Critical patent/CN115022853A/en
Application granted granted Critical
Publication of CN115022853B publication Critical patent/CN115022853B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the application discloses a device discovery method and electronic equipment, relates to the field of electronic equipment, and can reduce the time for discovering other electronic equipment when a screen is projected, so that the time for projecting the screen to other electronic equipment is reduced. The specific scheme is as follows: the method comprises the steps that a first electronic device displays a first interface, wherein the first interface comprises a first control; the first control is used for triggering the first electronic device to transmit a Bluetooth Low Energy (BLE) broadcast, and the transmission interval time of the BLE broadcast is configured to be a first interval time; the method comprises the steps that a first electronic device receives a trigger operation of a user on a first control; in response to the triggering operation, the first electronic device modifies a transmission interval time of the BLE broadcast from a first interval time to a second interval time, and transmits the BLE broadcast for discovery of connectable electronic devices according to the second interval time.

Description

Device discovery method and electronic device
Technical Field
The present application relates to the field of electronic devices, and in particular, to a device discovery method and an electronic device.
Background
With the popularization of smart devices and the development of communication technologies, it is becoming more and more common to project a screen of one electronic device (e.g., a notebook computer) onto a screen of another electronic device (e.g., a smart television) for display in daily life. For example, a user can project a video played on a screen of a notebook computer to a screen of the smart television for display and playing.
Before the notebook computer is projected to the smart television, the notebook computer needs to send Bluetooth Low Energy (BLE) broadcast through an Application Programming Interface (API), namely a native API, of the windows system, so that the notebook computer can discover the smart television and further establish connection with the smart television.
However, the interval for sending BLE broadcast by the notebook computer through the native API of the windows system is usually large, which results in a long time for the notebook computer to find the smart tv, and further results in a long time for the notebook computer to screen the smart tv.
Disclosure of Invention
The embodiment of the application provides a device discovery method and electronic devices, which can reduce the time for discovering other electronic devices during screen projection, and further reduce the time for projecting the screen to other electronic devices.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
in a first aspect, an embodiment of the present application provides a device discovery method, which is applied to a first electronic device, and the device discovery method may include: the method comprises the steps that a first electronic device displays a first interface, and the first interface comprises a first control; the first control is used for triggering the first electronic device to transmit Bluetooth Low Energy (BLE) broadcasting, and the transmission interval time of the BLE broadcasting is configured to be first interval time; the method comprises the steps that a first electronic device receives a trigger operation of a user on a first control; in response to the triggering operation, the first electronic device modifies a transmission interval time of the BLE broadcast from a first interval time to a second interval time, and transmits the BLE broadcast for discovery of connectable electronic devices according to the second interval time.
Based on the method in the first aspect, when the screen-casting electronic device finds the screen-cast electronic device, the first electronic device, that is, the screen-casting electronic device, may modify an interval of BLE broadcasts sent by the screen-casting electronic device. Because the screen-projecting electronic equipment can modify the interval of BLE broadcasting, the screen-projecting electronic equipment can reduce the interval time for sending BLE broadcasting, so that the time for finding the screen-projected electronic equipment by the screen-projecting electronic equipment during screen projection can be shortened, and the time for projecting the screen to the screen-projected electronic equipment by the screen-projecting electronic equipment is further reduced.
With reference to the first aspect, in another possible implementation manner, the modifying, by the first electronic device, the transmission interval time of the BLE broadcast from the first interval time to the second interval time may include: the method comprises the steps that first electronic equipment obtains equipment information of the first electronic equipment; the first electronic equipment determines a first drive according to the equipment information of the first electronic equipment; the first driver is used for modifying the transmission interval time of the BLE broadcast from the first interval time to the second interval time.
Based on the possible implementation mode, the screen projection electronic equipment can determine the corresponding drive through the equipment information, so that the interval of BLE broadcasting sent by the screen projection electronic equipment can be modified through the drive, the interval time for sending the BLE broadcasting can be reduced by the screen projection electronic equipment, and the time for finding the screen projected electronic equipment by the screen projection electronic equipment during screen projection is shortened.
With reference to the first aspect, in another possible implementation manner, the determining, by the first electronic device, the first driver according to the information of the first electronic device may include: the first electronic equipment determines an Application Program Interface (API) corresponding to the first drive according to the equipment information of the first electronic equipment and a preset corresponding relation; and the first electronic equipment determines the first drive according to the API corresponding to the first drive.
Based on the possible implementation mode, the screen projection electronic equipment can determine the application program interface API corresponding to the first drive through the equipment information of the screen projection electronic equipment, and determine the first drive according to the API corresponding to the first drive, so that the first electronic equipment can modify the interval of BLE broadcasting sent by the screen projection electronic equipment through the first drive.
With reference to the first aspect, in another possible implementation manner, the device discovery method may further include: the first electronic device receiving a BLE reply broadcast from the second electronic device; the first electronic equipment displays the identification of the second electronic equipment; the method comprises the steps that a first electronic device receives a trigger operation of a user on an identifier of a second electronic device; responding to the trigger operation of a user on the identifier of the second electronic equipment, and acquiring first channel information and second channel information by the first electronic equipment; the first channel information comprises channel information connected with the first electronic equipment, 2.4GHz channel information supported by the first electronic equipment and 5GHz channel information supported by the first electronic equipment; the second channel information comprises channel information connected with the second electronic equipment, 2.4GHz channel information supported by the second electronic equipment and 5GHz channel information supported by the second electronic equipment; the first electronic equipment determines a first channel according to the first channel information and the second channel information; the first channel is a channel with the data transmission rate between the first electronic equipment and the second electronic equipment larger than a preset threshold value; the first electronic equipment establishes a hotspot, and a channel corresponding to the hotspot is a first channel.
Based on the possible implementation mode, the screen-projecting electronic device can determine a channel with the maximum data transmission rate between the screen-projecting electronic device and the screen-projected electronic device according to the channel information of the screen-projecting electronic device and the channel information of the screen-projected electronic device, and establish a hot spot according to the channel, so that the screen-projecting electronic device and the screen-projected electronic device can establish connection through the hot spot.
With reference to the first aspect, in another possible implementation manner, when the first electronic device is connected to 5ghz wi-Fi, the first channel is a channel to which the first electronic device is connected; under the condition that the first electronic device is not connected with 5GHz wi-Fi and the second electronic device is connected with 5GHz wi-Fi, the first channel is a channel to which the second electronic device is connected; under the condition that the first electronic device and the second electronic device are not connected with 5GHz wi-Fi and have commonly supported 5GHz channels, the first channel is a commonly supported 5GHz channel of the first electronic device and the second electronic device; under the condition that the first electronic device is connected with 2.4GHz wi-Fi, the second electronic device is not connected with 5GHz wi-Fi, and the first electronic device and the second electronic device do not have commonly supported 5GHz channels, the first channel is a channel connected with the first electronic device; under the condition that the first electronic device is not connected with a channel, the first electronic device and the second electronic device are not commonly supported by a 5GHz channel, and the second electronic device is connected with 2.4GHz wi-Fi, the first channel is a channel connected with the second electronic device; under the condition that the first electronic device and the second electronic device are not connected with a channel, the first electronic device and the second electronic device are not provided with a commonly supported 5GHz channel, and the first electronic device and the second electronic device are provided with a commonly supported 2.4GHz channel, the first channel is a commonly supported 2.4GHz channel of the first electronic device and the second electronic device; and under the condition that the first electronic device and the second electronic device are not connected with the channel and the first electronic device and the second electronic device do not have the channel supported by the first electronic device, the first channel is the channel supported by the first electronic device.
Based on the possible implementation manner, the screen-projecting electronic device can determine the channel with the maximum data transmission rate between the screen-projecting electronic device and the screen-projected electronic device according to the channel information of the screen-projecting electronic device and the channel information of the screen-projected electronic device.
With reference to the first aspect, in another possible implementation manner, the BLE reply broadcast may include the second channel information.
Based on the possible implementation mode, the screen-projected electronic device includes the channel information of the screen-projected electronic device in the BLE reply broadcast, so that the screen-projected electronic device can acquire the channel information of the screen-projected electronic device, and a channel with the maximum data transmission rate between the screen-projected electronic device and the screen-projected electronic device can be determined according to the channel information of the screen-projected electronic device and the channel information of the screen-projected electronic device.
With reference to the first aspect, in another possible implementation manner, the first control is a screen projection control, and the screen projection control is configured to trigger the first electronic device to send data corresponding to the first interface to the second electronic device, where the device discovery method may further include: the first electronic equipment sends the information of the hot spot to the second electronic equipment; the information of the hot spot comprises an optimal channel; the first electronic equipment receives a connection establishment message sent by the second electronic equipment, wherein the connection establishment message is used for indicating the second electronic equipment to access the hotspot; and the first electronic equipment sends the data corresponding to the first interface to the second electronic equipment.
Based on the possible implementation manner, the screen projection electronic device can send the data included in the interface displayed by the screen projection electronic device to the screen projected electronic device through the established channel corresponding to the hotspot, and the established channel corresponding to the hotspot is the channel with the maximum data transmission rate between the screen projection electronic device and the screen projected electronic device, so that the screen projection electronic device can quickly send the data included in the interface displayed by the screen projection electronic device to the screen projected electronic device through the channel corresponding to the hotspot.
With reference to the first aspect, in another possible implementation manner, the device information of the first electronic device may include a vendor identification VID of a Wi-Fi chip module included in the first electronic device.
Based on the possible implementation manner, the screen-casting electronic device may determine the application program interface API corresponding to the first driver by using the vendor identification VID of the Wi-Fi chip module included in the screen-casting electronic device, and determine the first driver according to the API corresponding to the first driver, so that the first electronic device may modify the interval of the BLE broadcast sent by the screen-casting electronic device through the first driver.
With reference to the first aspect, in another possible implementation manner, the second interval time is smaller than the first interval time.
Based on the possible implementation mode, the screen-projecting electronic device can reduce the interval time for sending the BLE broadcast, so that the time for the screen-projecting electronic device to find the screen-projected electronic device can be shortened when the screen is projected, and the time for the screen-projecting electronic device to project the screen to the screen-projected electronic device can be further reduced.
In a second aspect, an embodiment of the present application provides a device discovery apparatus, which may be applied to a first electronic device, and is configured to implement the method in the first aspect. The functions of the device discovery apparatus can be realized by hardware, and can also be realized by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, for example, a display module, a reception module, a modification module, a transmission module, and the like.
The display module may be configured to display a first interface, where the first interface includes a first control; the first control is used for triggering the first electronic device to transmit the Bluetooth Low Energy (BLE) broadcast, and the transmission interval time of the BLE broadcast is configured to be the first interval time.
The receiving module may be configured to receive a trigger operation of a user on the first control.
A modification module may be configured to modify a transmission interval time of the BLE broadcast from a first interval time to a second interval time in response to a triggering operation.
And a transmitting module, which may be configured to transmit a BLE broadcast according to the second interval time, for discovering connectable electronic devices.
With reference to the second aspect, in another possible implementation manner, the device discovery apparatus may further include an obtaining module and a determining module. The acquisition module may be configured to acquire device information of the first electronic device. The determining module may be configured to determine the first driver according to device information of the first electronic device; the first driver is configured to modify a transmission interval time of the BLE broadcast from a first interval time to a second interval time.
With reference to the second aspect, in another possible implementation manner, the determining module may be further configured to determine an application program interface API corresponding to the first driver according to the device information of the first electronic device and the preset corresponding relationship. The determining module may be further configured to determine the first driver according to an API corresponding to the first driver.
With reference to the second aspect, in another possible implementation manner, the receiving module may be further configured to receive a BLE reply broadcast sent by the second electronic device.
The display module can also be used for displaying the identification of the second electronic equipment. The receiving module can be further used for receiving a trigger operation of the user on the identification of the second electronic device.
The acquisition module can be further used for responding to the trigger operation of the user on the identifier of the second electronic equipment, and acquiring first channel information of the first electronic equipment and second channel information of the second electronic equipment; the first channel information comprises channel information connected with the first electronic equipment, 2.4GHz channel information supported by the first electronic equipment and 5GHz channel information supported by the first electronic equipment; the second channel information includes channel information connected to the second electronic device, 2.4GHz channel information supported by the second electronic device, and 5GHz channel information supported by the second electronic device.
The determining module may be further configured to determine the first channel according to the first channel information and the second channel information; the first channel is a channel in which the rate of data transmission between the first electronic device and the second electronic device is greater than a preset threshold.
The device discovery apparatus may further include an establishment module. The establishing module may be configured to establish a hot spot, where a channel corresponding to the hot spot is a first channel.
With reference to the second aspect, in another possible implementation manner, in a case that the first electronic device is connected to 5ghz wi-Fi, the first channel is a channel to which the first electronic device is connected; under the condition that the first electronic device is not connected with 5GHz wi-Fi and the second electronic device is connected with 5GHz wi-Fi, the first channel is a channel to which the second electronic device is connected; under the condition that the first electronic device and the second electronic device are not connected with 5GHz wi-Fi and have commonly supported 5GHz channels, the first channel is a commonly supported 5GHz channel of the first electronic device and the second electronic device; under the condition that the first electronic device is connected with 2.4GHz wi-Fi, the second electronic device is not connected with 5GHz wi-Fi, and the first electronic device and the second electronic device do not have commonly supported 5GHz channels, the first channel is a channel connected with the first electronic device; under the condition that the first electronic device is not connected with a channel, the first electronic device and the second electronic device are not commonly supported by a 5GHz channel, and the second electronic device is connected with 2.4GHz wi-Fi, the first channel is a channel connected with the second electronic device; under the condition that the first electronic device and the second electronic device are not connected with a channel, the first electronic device and the second electronic device do not have a commonly supported 5GHz channel, and the first electronic device and the second electronic device have a commonly supported 2.4GHz channel, the first channel is a commonly supported 2.4GHz channel of the first electronic device and the second electronic device; the first channel is a channel supported by the first electronic device when the first electronic device and the second electronic device are not connected with a channel and the first electronic device and the second electronic device do not have a channel supported by both.
With reference to the second aspect, in another possible implementation manner, the BLE reply broadcast may include second channel information.
With reference to the second aspect, in another possible implementation manner, the sending module may be further configured to send information of the hotspot to the second electronic device; the information of the hot spot includes information of the first channel. The receiving module may be further configured to receive a connection establishment message sent by the second electronic device, where the connection establishment message is used to indicate that the second electronic device accesses the hotspot. The sending module may be further configured to send data corresponding to the first interface to the second electronic device.
With reference to the second aspect, in another possible implementation manner, the device information of the first electronic device may include a vendor identification VID of a Wi-Fi chip module included in the first electronic device.
With reference to the second aspect, in another possible implementation manner, the second interval time is smaller than the first interval time.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory for storing instructions executable by the processor. The processor is configured to execute the above instructions to cause the electronic device to implement the device discovery method according to the first aspect or any of its possible implementation manners.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having computer program instructions stored thereon. The computer program instructions, when executed by an electronic device, cause the electronic device to implement a device discovery method as described in the first aspect or any one of its possible implementations.
In a fifth aspect, the present application provides a computer program product, which includes computer readable code, when the computer readable code runs in an electronic device, causes the electronic device to implement the device discovery method according to the first aspect or any one of the possible implementation manners of the first aspect.
It should be understood that the beneficial effects of the second to fifth aspects can be seen from the description of the first aspect, and are not repeated herein.
Drawings
Fig. 1 is a first schematic view of a display interface of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a first screen projection process diagram provided in the embodiment of the present application;
fig. 3 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4 is a schematic view of a screen projection process provided in the embodiment of the present application;
fig. 5A is a first flowchart illustrating a device discovery method according to an embodiment of the present application;
fig. 5B is a schematic flowchart of determining an API corresponding to a driver according to an embodiment of the present application;
fig. 6 is a second schematic display interface diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a flowchart illustrating a device discovery method according to an embodiment of the present application;
fig. 8 is a schematic flowchart of determining an optimal channel according to an embodiment of the present disclosure;
fig. 9 is a third flowchart illustrating a device discovery method according to an embodiment of the present application;
fig. 10 is a flowchart illustrating a device discovery method according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a device discovery apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless otherwise specified.
Currently, a user may project a screen of one electronic device (e.g., a notebook computer, a Personal Computer (PC), etc.) onto a screen of another electronic device (e.g., a smart tv, a tablet PC, etc.) for displaying, for example, a video played on the screen of the notebook computer is projected onto the screen of the smart tv for displaying and playing.
For example, as shown in fig. 1, when a user uses a laptop 01 to perform a video conference, or other scenes requiring multi-screen interaction, the screen of the laptop 01 is small, which is inconvenient for the user to view. At this time, the user can project the screen of the notebook computer 01 to a large screen, such as the smart television 02, so that the notebook computer 01 and the smart television 02 are interconnected, that is, the user can watch a video conference through the smart television 02. Because the screen of the intelligent television 02 is large, the intelligent television can be convenient for users to watch, so that the working efficiency of the users can be improved, and the entertainment and living scenes are enriched.
Before the laptop 01 screens the video played on the screen to the screen of the intelligent television 02, the laptop 01 needs to discover the intelligent television 02 first, and after the intelligent television 02 is discovered, the laptop 01 can establish connection with the intelligent television 02, so that the laptop 01 screens the video played on the screen to the screen of the intelligent television 02.
After the notebook computer 01 finds the smart television 02 first, if the notebook computer 01 and the smart television 02 are not connected to the same wireless network (Wi-Fi), the notebook computer 01 may establish a wireless Access Point (AP) hotspot. The intelligent television 02 can access the AP hotspot established by the notebook computer 01, so that the notebook computer 01 is connected to the intelligent television 02, a socket channel is established, and a video played on the screen of the notebook computer 01 is transmitted by using the socket channel, that is, the video played on the screen of the notebook computer 01 is projected onto the intelligent television 02 by using the socket channel.
The operating system of the notebook computer 01 is usually a windows system, and when the notebook computer 01 finds the intelligent television 02, the notebook computer 01 may send a Bluetooth Low Energy (BLE) broadcast through an API provided by the windows system, that is, a native API of the windows system, so that the notebook computer 01 can find the intelligent television 02 and establish a connection with the intelligent television 02.
For example, as shown in fig. 2, the process of discovering the smart tv 02 by the notebook computer 01 may include the following steps:
when a user uses an application (e.g., a video application) on the laptop 01, the laptop 01 may display an interface corresponding to the application, and the interface may include a screen projection control (e.g., 03 in fig. 1).
When the notebook computer 01 receives a trigger operation, such as a click operation, of a user on a screen-casting control (shown as 03 in fig. 1) included in an application program (such as a video application) on the notebook computer 01, the application program of the notebook computer 01 may send a device discovery message to a soft bus of the notebook computer 01 through a screen-casting protocol as a response.
After the soft bus of the notebook computer 01 receives the device discovery message sent by the application program on the notebook computer 01, the soft bus may send the device discovery message to a native API corresponding to the windows system on the notebook computer 01, for example, send an API corresponding to BLE broadcast.
After receiving the device discovery message sent by the soft bus, the native API allows the laptop 01 to perform device discovery, such as BLE discovery. For example, after receiving the device discovery message sent by the soft bus, the native API may call a corresponding driver, such as a driver corresponding to BLE broadcasting, and may call a Wi-Fi chip module on the notebook computer 01 through the driver, and may send BLE broadcasting through the Wi-Fi chip module. Meanwhile, the Wi-Fi chip module can start BLE scanning, and when the Wi-Fi chip scans BLE broadcasting sent by other equipment (such as the intelligent television 02), the notebook computer 01 can find the equipment.
After the smart television 02 receives the BLE broadcast sent by the notebook computer 01, the smart television 02 may send a BLE reply broadcast. The native API of the laptop 01 may receive BLE reply broadcasts through the Wi-Fi chip module. After the native API of the notebook computer 01 receives the BLE reply broadcast sent by the smart television 02, the native API may send a reporting device message to the soft bus of the notebook computer 01. The soft bus may send a reporting device message to an application on the notebook computer 01.
After the application program on the notebook computer 01 receives the device reporting message sent by the soft bus, the notebook computer 01 can display the found device, such as the smart television 02, so that the user can select the device needing screen projection.
For another example, as shown in fig. 2, after the notebook computer 01 finds the intelligent television 02, a process of establishing a connection between the notebook computer 01 and the intelligent television 02 may include the following steps:
after the notebook computer 01 displays the discovered devices, the user can select the devices, such as the smart tv 02, which need to be projected. After the notebook computer 01 receives a trigger operation, such as a click operation, of a user on a device (such as the smart television 02) needing to screen, in response, an application program of the notebook computer 01 may send a connection request message to the soft bus.
After the soft bus of the notebook computer 01 receives the connection request message sent by the application program on the notebook computer 01, the soft bus may send the connection request message to a native API corresponding to the windows system on the notebook computer 01, such as establishing an API corresponding to an AP hotspot.
After the native API receives the connection request message sent by the soft bus, the notebook computer 01 may establish an AP hotspot through the native API. For example, after the native API receives a connection request message sent by the soft bus, the native API may call a corresponding driver, such as a driver corresponding to the AP hotspot, and may call a Wi-Fi chip module on the notebook computer 01 through the driver, and may establish the AP hotspot through the Wi-Fi chip module.
After the notebook computer 01 establishes the AP hotspot, the notebook computer 01 may send a connection request message to the smart television 02, and after the smart television 02 receives the connection request message sent by the notebook computer 01, the smart television 02 may access the AP hotspot. Namely, the notebook computer 01 is connected with the smart television 02, a socket channel is established, and the video played on the screen of the notebook computer 01 is projected onto the smart television 02 through the socket channel.
After the smart tv 02 accesses the AP hotspot, the smart tv 02 may send a connection setup message to the notebook computer 01. After the native API of the notebook computer 01 receives the connection establishment message sent by the smart television 02, the native API may send the connection establishment message to the soft bus of the notebook computer 01. The softbus may send a connection setup message to the application on the notebook computer 01.
After the application program on the notebook computer 01 receives the connection establishment message sent by the soft bus, the notebook computer 01 can project the video played on the screen of the notebook computer 01 to the smart television 02 through the established AP hotspot.
It can be seen that, when the notebook computer 01 discovers the smart tv 02, it sends BLE broadcasts through the native API of the windows system for device discovery, and the interval for sending BLE broadcasts through the native API of the windows system is usually large and may not be changed. This results in a long time for the laptop 01 to find the smart tv 02, and further results in a long time for the laptop 01 to screen the smart tv 02, and poor user experience.
In addition, the notebook computer 01 has window limitation when scanning the BLE reply broadcast of the smart television 02, and when the BLE broadcast interval sent by the native API of the notebook computer 01 is higher, the probability that the BLE reply broadcast of the smart television 02 falls within the scanning window of the notebook computer 01 is reduced, thereby further resulting in a longer time for the notebook computer 01 to find the smart television 02.
And the channel corresponding to the AP hotspot established by the notebook computer 01 through the native API of the windows system is defaulted to follow the channel corresponding to the Wi-Fi to which the notebook computer 01 has connected, i.e., the channel of the AP hotspot established through the native API cannot be controlled. The channel of the AP hotspot, namely the channel corresponding to the Wi-Fi established by the notebook computer 01, is a frequency band, namely the notebook computer 01 can transmit audio and video data on the notebook computer 01 to the smart television 02 in the frequency band. The Wi-Fi corresponding channels may include 2.4G channels, 5G channels, and the like. 2.4G channels, i.e., 2.4 Gigahertz (GHz) corresponding channels.
For example, when the channel corresponding to the Wi-Fi to which the notebook computer 01 has connected is a 2.4G channel, the channel of the AP hotspot established through the native API is also the 2.4G channel. When the notebook computer 01 supports the 5G channel, the notebook computer 01 cannot establish an AP hotspot of the 5G channel through the native API of the windows system, and only can establish an AP hotspot of the 2.4G channel, which results in a slow transmission rate of audio and video data when the notebook computer 01 is projected to the smart television 02.
In view of the above problem, embodiments of the present application provide a device discovery method, which is applied to an electronic device, and may modify an interval of a BLE broadcast transmitted by a first electronic device (e.g., a notebook computer) when the first electronic device discovers a second electronic device (e.g., a smart television). Because the interval of BLE broadcast can be modified to first electronic equipment, consequently, first electronic equipment can reduce the interval time of sending BLE broadcast to the time that first electronic equipment discovers second electronic equipment when can shorten and throw the screen, and then reduce the time that first electronic equipment throws the screen to second electronic equipment.
In addition, according to the scheme of the application, after the first electronic device discovers the second electronic device, the first electronic device may determine an optimal channel according to the channel supported by the first electronic device and the channel supported by the second electronic device, and establish a hot spot corresponding to the optimal channel, so that the rate of transmitting data from the first electronic device to the second electronic device can be increased through the hot spot corresponding to the optimal channel.
The device discovery method provided by the embodiment of the application can be applied to electronic devices, such as the first electronic device. In some examples, the first electronic device may be a laptop, a tablet, a handheld computer, a PC, a Personal Digital Assistant (PDA), a wearable device, or the like, having a windows system. The embodiment of the present application does not limit the specific form of the electronic device.
The second electronic device may be a mobile phone, a tablet computer, a handheld computer, a personal computer PC, a cellular phone, a Personal Digital Assistant (PDA), a wearable device, a smart television, or other electronic devices.
The following describes a device discovery method provided in an embodiment of the present application.
Exemplarily, a first electronic device is taken as a notebook computer as an example, and fig. 3 illustrates a schematic structural diagram of an electronic device provided in the embodiment of the present application.
As shown in fig. 3, the notebook computer may include: the portable electronic device includes a processor 310, a fan 311, an external memory interface 320, an internal memory 321, a Universal Serial Bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, a display 350, an antenna, a wireless communication module 360, an audio module 370, a speaker (i.e., a loudspeaker) 370A, a microphone 370C, a headset interface 370B, a touch pad 380, a keyboard 390, a camera 391, and the like.
The devices (such as the processor 310, the fan 311, the external memory interface 320, the internal memory 321, the USB interface 330, the charging management module 340, the power management module 341, the battery 342, the antenna, the wireless communication module 360, the audio module 370, the touch pad 380, the speaker 370A, the microphone 370C, the earphone interface 370B, the keyboard 390, the camera 391, and the like) other than the display 350 may be disposed on the base of the notebook computer. The camera 391 may also be disposed on a frame of the display 350 of the notebook computer.
It is to be understood that the illustrated structure of the present embodiment does not constitute a specific limitation to the notebook computer. In other embodiments, a notebook computer may include more or fewer components than shown, or some components may be combined, some components may be separated, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 310 may include one or more processing units, such as: the processor 310 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. Wherein, the different processing units may be independent devices or may be integrated in one or more processors.
In the embodiment of the present application, the processor 310 may further include a Wi-Fi chip module. The Wi-Fi chip module can be used to send BLE broadcasts. The Wi-Fi chip module can also be used for starting BLE scanning so as to receive BLE sent by other electronic equipment. The Wi-Fi chip module can also be used for establishing AP hot spots of different channels.
The controller may be the neural center and command center of a laptop computer. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 310 for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 310. If the processor 310 needs to reuse the instruction or data, it can be called directly from memory. Avoiding repeated accesses reduces the latency of the processor 310, thereby increasing the efficiency of the system.
In some embodiments, processor 310 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the interface connection relationship between the modules in this embodiment is only schematically illustrated, and does not limit the structure of the notebook computer. In other embodiments, the notebook computer may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 340 is used for receiving charging input from a charger (such as a wireless charger or a wired charger) to charge the battery 342. The wireless communication function of the notebook computer can be realized by the antenna and wireless communication module 360, the modem processor, the baseband processor, and the like.
The antenna is used for transmitting and receiving electromagnetic wave signals. Each antenna in a notebook computer may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
In some embodiments, the antenna of the notebook computer is coupled to the wireless communication module 360 so that the notebook computer can communicate with the network and other devices through wireless communication technology. The wireless communication module 360 may provide solutions for wireless communication applied to a notebook computer, including Wireless Local Area Networks (WLANs) (e.g., Wi-Fi networks, Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like.
The notebook computer can implement the display function through the GPU, the display screen 350, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 350 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs that execute program instructions to generate or alter display information. The display screen 350 is used to display images, video, and the like.
The touch pad 380 has a touch sensor integrated therein. The notebook computer can receive a control command of the notebook computer from a user through the touch pad 380 and the keyboard 390.
The notebook computer may implement a shooting function through the ISP, the camera 391, the video codec, the GPU, the display 350, the application processor, and the like. The ISP is used to process the data fed back by the camera 391. In some embodiments, the ISP may be provided in the camera 391. The camera 391 is used to capture still images or video. In some embodiments, the notebook computer may include 1 or N cameras 391, N being a positive integer greater than 1.
The external memory interface 320 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the notebook computer. The internal memory 321 may be used to store computer-executable program code, which includes instructions. The processor 310 executes various functional applications of the notebook computer and data processing by executing instructions stored in the internal memory 321. For example, in the embodiment of the present application, the processor 310 may execute instructions stored in the internal memory 321, and the internal memory 321 may include a program storage area and a data storage area.
The notebook computer can implement an audio function through the audio module 370, the speaker 370A, the microphone 370C, the earphone interface 370B, and the application processor. Such as music playing, recording, etc.
The audio module 370 is used to convert digital audio signals to analog audio signal outputs and also to convert analog audio inputs to digital audio signals. The audio module 370 may also be used to encode and decode audio signals.
The notebook computer of the embodiments of the present application may include one or more speakers 370A and one or more microphones 370C.
The fan 311 is used for heat dissipation of the notebook computer. The processor 310 can control the fan 311 to operate at different rotation speeds to dissipate heat of the notebook computer.
Of course, it should be understood that fig. 3 is only an exemplary illustration of the electronic device in the form of a notebook computer. If the electronic device is in the form of a handheld computer, a PDA, a personal computer, or other devices, the structure of the electronic device may include fewer structures than those shown in fig. 3, or may include more structures than those shown in fig. 3, and the invention is not limited thereto.
The methods in the following embodiments may be implemented in an electronic device having the above hardware structure. In the embodiment of the present application, an electronic device is taken as a notebook computer for illustration.
It will be appreciated that, in general, the implementation of electronic device functions requires the cooperation of software in addition to hardware support.
For example, in some examples of the present application, as shown in fig. 4, when the first electronic device is implemented to be projected to the second electronic device, the first electronic device needs to discover the second electronic device, and the first electronic device needs to establish a connection with the second electronic device. For the first electronic device, at least a processor, such as a Wi-Fi chip module and other hardware support, and an application program (such as a video application) and software cooperation of a driver adaptation layer, a driver and the like are required.
Based on fig. 4, the process of discovering the second electronic device by the first electronic device may include:
when receiving a trigger operation of a user on a screen-projection control included in an application (such as a video application) by an application program of the first electronic device, the application program of the first electronic device may send a device discovery message to a soft bus of the first electronic device through a screen-projection protocol in response.
After the soft bus of the first electronic device receives the device discovery message sent by the application program, the soft bus sends the device discovery message to a driver adaptation layer on the first electronic device. After receiving the device discovery message, the driver adaptation layer may send the device discovery message to a corresponding driver, where the driver may be a driver corresponding to enable the Wi-Fi chip module on the first electronic device to send BLE broadcasts. The driver may modify the BLE broadcast interval, for example, shorten the BLE broadcast interval to 20 milliseconds. After the driver modifies the BLE broadcast interval, the first electronic device may perform BLE fast discovery through the driver, i.e., the first electronic device may transmit BLE broadcast through the driver, thereby discovering the second electronic device. For example, after the drive modifies the BLE broadcast interval, the drive may call the Wi-Fi chip module on the first electronic device, so that the Wi-Fi chip module on the first electronic device sends the BLE broadcast according to the modified BLE broadcast interval, and meanwhile, the Wi-Fi chip module on the first electronic device may start BLE scanning, and when the Wi-Fi chip module scans the BLE reply broadcast sent by the second device, the first electronic device may find the second electronic device.
When the second electronic device receives the BLE broadcast transmitted by the first electronic device, the second electronic device may also transmit a BLE broadcast, such as a BLE reply broadcast. When the Wi-Fi chip module of the first electronic device scans the BLE reply broadcast sent by the second device, that is, the first electronic device discovers the second electronic device, the Wi-Fi chip module of the first electronic device may send a report device message to the corresponding driver. After receiving the report device message, the driver may send the report device message to a driver adaptation layer. The driver adaptation layer can send the report device message to the soft bus after receiving the report device message. After receiving the reporting device message, the soft bus may send the message to the application. After the application program receives the device reporting message sent by the soft bus, the first electronic device can display the discovered device, namely the second electronic device, so that the user can select the device needing screen projection. The first electronic device completes the discovery process of the second electronic device while the first electronic device displays the discovered devices.
For another example, based on fig. 4, the process of establishing a connection between the first electronic device and the second electronic device may include:
after the first electronic device displays the discovered devices, the user may select the devices that need to be projected. That is, after the first electronic device receives a trigger operation of the user on the device (i.e., the second electronic device) requiring screen projection, the application program of the first electronic device may send a connection request message to the soft bus in response. The soft bus may obtain channel information supported by the first electronic device and channel information supported by the second electronic device, and determine an optimal channel according to the channel information supported by the first electronic device and the channel information supported by the second electronic device. After determining the optimal channel, the soft bus may send a connection request message to a driver adaptation layer on the first electronic device, where the connection request message may include the optimal channel.
After the driver adaptation layer receives the connection request message sent by the soft bus, the driver adaptation layer may send the connection request message to a corresponding driver, and the driver may be a driver for enabling the Wi-Fi chip module on the first electronic device to establish correspondence to the AP hotspot. The first electronic device can call the Wi-Fi chip module on the first electronic device through the driver to establish an AP hotspot, wherein a channel corresponding to the AP hotspot is an optimal channel.
After the Wi-Fi chip module on the first electronic device establishes the AP hotspot, a connection request message can be sent to the second electronic device. After the second electronic device receives the connection request message sent by the first electronic device, the second electronic device can access to an AP hotspot established by the Wi-Fi chip module on the first electronic device. After the second electronic device accesses the AP hotspot established by the Wi-Fi chip module on the first electronic device, the second electronic device may send a connection establishment message to the Wi-Fi chip module of the first electronic device. After the Wi-Fi chip module of the first electronic device receives the connection establishment message sent by the second electronic device, the connection establishment message may be sent to the corresponding driver. The driver, after receiving the connection setup message, may send to the driver adaptation layer. The driver adaptation layer may send the connection setup message to the soft bus after receiving it. The connection establishment message may be received by the softbus and may be sent to an application of the first electronic device.
After the application program on the first electronic equipment receives the connection establishment message sent by the soft bus, the first electronic equipment completes the process of establishing connection with the second electronic equipment. The first electronic equipment can project the video played on the screen of the first electronic equipment to the second electronic equipment through an AP hot spot established by a Wi-Fi chip module on the first electronic equipment, wherein a channel corresponding to the AP hot spot is an optimal channel.
The device discovery method provided by the embodiment of the present application is described in detail below with reference to fig. 4. In this embodiment, the method may include: a "device discovery" flow and an "establish connection" flow.
As shown in fig. 5A, taking the first electronic device as a screen projection device and the second electronic device as a screen projected device as an example, the first electronic device may project a screen of the first electronic device onto a screen of the second electronic device. The first electronic device may discover the second electronic device before the first electronic device casts the screen of the first electronic device onto the screen of the second electronic device. The process of the first electronic device discovering the second electronic device, i.e., the "device discovery" flow, may include the following S501-S521.
S501, receiving a screen projection control triggering operation of a user by a first application program of first electronic equipment.
After the user arrives at the home or office, the user may use an application (e.g., referred to as a first application) on a first electronic device (e.g., a laptop) to conduct a video conference or view a video.
For example, as shown in fig. 1, when a user uses a notebook computer 01 to perform a video conference, the user may not be able to watch the video conference conveniently because the screen of the notebook computer 01 is small. At this time, the user may project the screen of the notebook computer 01 to a large screen, such as the smart tv 02, so as to watch the video conference through the smart tv 02. The intelligent television 02 has a large screen, so that the user can watch the television conveniently.
When a user uses a first application program of the first electronic device, an interface corresponding to the first application program can be displayed on a screen of the first electronic device. The interface corresponding to the first application may include a screen projection control. The screen projection control can be used for triggering the first electronic device to project the interface corresponding to the first application program on the first electronic device onto other electronic devices (which may be called second electronic devices, such as a smart television) for display.
When a user needs to screen an interface corresponding to a first application program on first electronic equipment to other electronic equipment, the user can trigger a screen-casting control included in the interface corresponding to the first application program.
S502, responding to the trigger operation, and sending a device discovery message to the soft bus by the first application program of the first electronic device.
When the first electronic device receives a trigger operation, such as a click operation, of the screen-throwing control by the user, in response, the first application program of the first electronic device may send a device discovery message to the soft bus on the first electronic device. The device discovery message may be used to trigger the Wi-Fi chip module on the first electronic device to send a BLE broadcast so that the first electronic device may perform device discovery, i.e., the first electronic device may perform S503-S521 described below.
In some examples, when a first application of a first electronic device sends a device discovery message to a soft bus on the first electronic device, the first application may send the device discovery message to the soft bus via a screen-cast protocol. The screen projection protocol may include Miracast protocol, AirPlay protocol, and Digital Living Network Alliance (DLNA) protocol, etc.
S503, the soft bus of the first electronic device receives the device discovery message sent by the first application program.
A soft bus refers to a virtual set of data transmission lines in a first electronic device that serve multiple, multiple types of components written in multiple computer languages. The virtual data transmission line is software, is a common standard component interface, and is a standard software module. It is also a virtual common channel and interface for data transfer and communication between the computer operating system and various components or component-to-component.
The soft bus of the first electronic device may be configured to connect an application of the first electronic device and a driver adaptation layer of the first electronic device, and may transmit a message between the first application of the first electronic device and the driver adaptation layer of the first electronic device.
After the first electronic device soft bus receives the device discovery message sent by the first application, the first electronic device soft bus may send the received device discovery message to a driver adaptation layer of the first electronic device.
And S504, the soft bus of the first electronic device sends a device discovery message to the drive adaptation layer of the first electronic device.
After the softbus of the first electronic device receives the device discovery message sent by the first application, the softbus of the first electronic device may send the device discovery message to a driver adaptation layer of the electronic device. For example, the softbus of the first electronic device may call a BLE interface or a Wi-Fi interface of a driver adaptation layer of the first electronic device to send a message to the driver adaptation layer of the first electronic device. If the message sent by the soft bus of the first electronic device to the driver adaptation layer of the first electronic device is a device discovery message, the soft bus of the first electronic device may call a BLE interface of the driver adaptation layer of the first electronic device, so as to send the device discovery message to the driver adaptation layer of the first electronic device, and if the message sent by the soft bus of the first electronic device to the driver adaptation layer of the first electronic device is a connection request message, the soft bus of the first electronic device may call a Wi-Fi interface of the driver adaptation layer of the first electronic device, so as to send the connection request message to the driver adaptation layer of the first electronic device.
The driver adaptation layer of the first electronic device may be configured to connect a soft bus of the first electronic device and a driver API of the first electronic device, and may transmit a message between a first application of the first electronic device and the driver adaptation layer of the first electronic device.
The driver adaptation layer of the first electronic device may be further configured to obtain hardware device information of the first electronic device (may also be referred to as device information of the first electronic device), and determine a corresponding driver API according to the hardware device information of the first electronic device, so that the corresponding driver may be called through the corresponding driver API, and the Wi-Fi chip module of the first electronic device may be called through the corresponding driver to send a BLE broadcast. That is to say, the driver adaptation layer of the first electronic device may provide a uniform API for the soft bus, that is, the soft bus may call the corresponding API through the driver adaptation layer, so that the soft bus is not required to call the native API of the windows system.
And S505, the drive adaptation layer of the first electronic device receives the device discovery message sent by the soft bus.
S506, the drive adaptation layer of the first electronic device obtains hardware device information of the first electronic device.
After the driver adaptation layer of the first electronic device receives the device discovery message sent by the soft bus, the driver adaptation layer of the first electronic device may obtain hardware device information of the first electronic device (may also be referred to as device information of the first electronic device). The hardware device information of the first electronic device may include an identification of a Wi-Fi chip module included in the first electronic device, such as a Vendor Identification (VID) of the Wi-Fi chip module. The VID of the Wi-Fi chip module can be used for distinguishing Wi-Fi chip modules of different manufacturers. The corresponding drivers of Wi-Fi chip modules of different manufacturers can be different.
In some examples, the driver adaptation layer of the first electronic device may call a system interface of the first electronic device, such as the interface setupigetdeviceloperty, to obtain hardware device information of the first electronic device.
And S507, determining an API corresponding to the first driver by the driver adaptation layer of the first electronic device according to the hardware device information.
After the driver adaptation layer of the first electronic device obtains the hardware device information of the first electronic device, the driver adaptation layer of the first electronic device may determine, according to the hardware device information, such as the VID of the Wi-Fi chip module, an API corresponding to a driver (referred to as a first driver, for example) corresponding to the transmission BLE broadcast. That is to say, the Wi-Fi chip modules of manufacturers are packaged by the driver adaptation layer, that is, manufacturers of the Wi-Fi chip modules included in the first electronic device can be distinguished by the VID of the Wi-Fi chip modules included in the first electronic device, and the API corresponding to the Wi-Fi chip module of a manufacturer can be determined according to the VID of the Wi-Fi chip module included in the first electronic device.
After the first electronic device determines the API corresponding to the Wi-Fi chip module, the first drive can be called through the API, the interval time for sending BLE broadcasts can be modified through the first drive, the Wi-Fi chip module of the first electronic device can be called through the first drive, the BLE broadcasts can be sent according to the interval time for sending the BLE broadcasts, the interval time is modified through the first drive, and therefore device discovery can be conducted.
In some examples, as shown in fig. 5B, determining, by the driver adaptation layer of the first electronic device, an API corresponding to the first driver according to the hardware device information may include: after receiving the device discovery message sent by the soft bus, the driver adaptation layer of the first electronic device may call a system interface of the first electronic device, such as the interface setupigetdevicepropety, to obtain hardware device information of the first electronic device. After the driver adaptation layer of the first electronic device obtains the hardware device information of the first electronic device, the driver adaptation layer of the first electronic device may determine, according to the hardware device information of the first electronic device, the VID of the Wi-Fi chip module of the first electronic device. After the driver adaptation layer of the first electronic device determines the VID of the Wi-Fi chip module of the first electronic device, the API corresponding to the Wi-Fi chip module of the first electronic device may be determined according to a correspondence between the VID and the API of the Wi-Fi chip module.
For example, when the VID of the Wi-Fi chip module of the first electronic device is determined to be VID1, the API1 corresponding to the Wi-Fi chip module of the first electronic device may be determined according to the correspondence between the VID and the API of the Wi-Fi chip module. When the VID of the Wi-Fi chip module of the first electronic device is determined to be VID2, the corresponding relation between the VID and the API of the Wi-Fi chip module of the first electronic device can be determined to be API 2. When the VID of the Wi-Fi chip module of the first electronic device is determined to be the VID3, the API3 corresponding to the Wi-Fi chip module of the first electronic device can be determined according to the corresponding relationship between the VID and the API of the Wi-Fi chip module.
In some examples, the driver adaptation layer, the APIs corresponding to the Wi-Fi chip modules of the different vendors, and the correspondence between the VIDs and the corresponding APIs of the Wi-Fi chip modules of the different vendors may be stored in a driver manager on the first electronic device.
In some examples, the APIs corresponding to the Wi-Fi chip modules of different vendors and the correspondence between the VIDs and the APIs of the Wi-Fi chip modules of different vendors may also be stored in the cloud, such as in a server. The first electronic device can download the APIs corresponding to the Wi-Fi chip modules of different manufacturers and the corresponding relations between the VIDs and the corresponding APIs of the Wi-Fi chip modules of different manufacturers from the server at preset time intervals.
S508, the drive adaptation layer of the first electronic device calls the first drive through the API corresponding to the first drive.
After the driver adaptation layer of the first electronic device determines the API corresponding to the first driver according to the hardware device information, the driver adaptation layer of the first electronic device may call the first driver through the API corresponding to the first driver.
S509, the first driver of the first electronic device modifies an interval time for transmitting BLE broadcasts.
After the driver adaptation layer of the first electronic device calls the first driver through the API corresponding to the first driver, the first driver may modify an interval time for transmitting the BLE broadcast.
In some examples, the first driver may modify the interval between transmitting BLE broadcasts by modifying a parameter of the interval between transmitting BLE broadcasts included by the first driver, such as modifying the parameter of the interval between transmitting BLE broadcasts included by the first driver to a first value. The first value may be determined according to practical situations, and is not limited in the embodiment of the present application. The first value may be less than an interval between sending BLE broadcasts through a native API of the windows system. For example, the first value may be 20 milliseconds.
S510, the first electronic device calls the Wi-Fi chip module of the first electronic device through the first driver.
After the interval time of the BLE broadcast modified by the first driver of the first electronic device, the first electronic device may call the Wi-Fi chip module of the first electronic device through the first driver, so that the Wi-Fi chip module of the first electronic device may send the BLE broadcast according to the interval time of the BLE broadcast modified by the first driver. The BLE broadcast may be used for discovery by the first electronic device of the second electronic device.
And S511, the Wi-Fi chip module of the first electronic device sends BLE broadcasts according to the interval time for sending the BLE broadcasts, which is modified by the first driver.
After the first driver of the first electronic device calls the Wi-Fi chip module of the first electronic device, the Wi-Fi chip module of the first electronic device may transmit a BLE broadcast according to a BLE broadcast interval modified by the first driver.
In some examples, the Wi-Fi chip module of the first electronic device starts BLE scanning while the Wi-Fi chip module of the first electronic device transmits BLE broadcasts according to the BLE broadcast interval modified by the first driver, that is, after the Wi-Fi chip module of the first electronic device starts BLE scanning, the Wi-Fi chip module of the first electronic device may scan BLE reply broadcasts transmitted by other electronic devices, and when the Wi-Fi chip module of the first electronic device scans BLE reply broadcasts transmitted by other electronic devices, the first electronic device may discover the other electronic devices.
S512, the Wi-Fi chip module of the first electronic device receives BLE reply broadcast sent by the second electronic device.
After the Wi-Fi chip module of the first electronic device transmits the BLE broadcast according to the first drive modified BLE broadcast interval, the second electronic device may receive the BLE broadcast transmitted by the first electronic device. One or more second electronic devices may be provided, which is not limited in this embodiment of the present application, and in this embodiment of the present application, a description is schematically given by taking one second electronic device as an example.
When the second electronic device receives the BLE broadcast transmitted by the first electronic device, the second electronic device may transmit a BLE reply broadcast to the first electronic device. The BLE reply broadcast may be used to instruct the first electronic device to discover the second electronic device. The BLE reply broadcast may include information of the second electronic device, such as a name and a device type of the second electronic device, so that the first electronic device may display the information of the second electronic device, and a user may conveniently select the second electronic device to screen.
After the Wi-Fi chip module of the first electronic device starts BLE scanning, the Wi-Fi chip module of the first electronic device can scan a BLE reply broadcast sent by the second electronic device, and when the Wi-Fi chip module of the first electronic device scans the BLE reply broadcast sent by the second electronic device, the first electronic device can find the second electronic device.
S513, the Wi-Fi chip module of the first electronic device sends a reporting device message to the first driver.
When the Wi-Fi chip module of the first electronic device scans the BLE reply broadcast sent by the second electronic device, the Wi-Fi chip module of the first electronic device can send a reporting device message to the first driver. The reporting device message may be used to cause the first application of the first electronic device to display the discovered second electronic device. The reporting device message may include information of the second electronic device, such as a name and a device type of the second electronic device.
And S514, a first driver of the first electronic equipment receives the reported equipment message sent by the Wi-Fi chip module.
And S515, the first driver of the first electronic device sends a reporting device message to the driver adaptation layer.
After the first driver of the first electronic device receives the reporting device message sent by the Wi-Fi chip module of the first electronic device, the first driver of the first electronic device may send the reporting device message to the driver adaptation layer of the first electronic device.
In some examples, after the first driver of the first electronic device receives the reporting device message sent by the Wi-Fi chip module of the first electronic device, the first driver of the first electronic device may send the reporting device message to an API corresponding to the first driver of the first electronic device. After receiving the reporting device message sent by the first driver of the first electronic device, the API corresponding to the first driver of the first electronic device may send the reporting device message to the driver adaptation layer of the first electronic device.
S516, the driver adaptation layer of the first electronic device receives the reporting device message sent by the first driver.
And S517, the drive adaptation layer of the first electronic device sends a reporting device message to the soft bus.
After the driver adaptation layer of the first electronic device receives the reporting device message sent by the first driver of the first electronic device, the driver adaptation layer of the first electronic device may send the reporting device message to the soft bus of the first electronic device.
S518, the soft bus of the first electronic device receives the reporting device message sent by the driving adaptation layer.
S519, the soft bus of the first electronic device sends a reporting device message to the first application program.
After the soft bus of the first electronic device receives the reporting device message sent by the driver adaptation layer of the first electronic device, the soft bus of the first electronic device may send the reporting device message to the first application program of the first electronic device.
S520, the first application program of the first electronic device receives the reporting device message sent by the soft bus.
S521, the first electronic device displays a selection control corresponding to the second electronic device in an interface corresponding to the first application program.
After a first application program of the first electronic device receives a device reporting message sent by a soft bus of the first electronic device, the first electronic device may display a selection control corresponding to the discovered device in an interface corresponding to the first application program, that is, a selection control corresponding to the second electronic device. The selection control can be used for triggering the first electronic device to send data included in the interface corresponding to the first application program to the second electronic device, so that the second electronic device can display the interface corresponding to the first application program, namely, a screen of the first electronic device is projected to a screen of the second electronic device to be displayed.
For example, as shown in fig. 6, taking the first electronic device as the notebook computer 01 and the second electronic device as the smart television 02 as an example, after the first application program (e.g., the video call application) of the notebook computer 01 receives the reporting device message (e.g., may include the name of the smart television 02) sent by the soft bus of the notebook computer 01, the notebook computer 01 may display the selection control 04 of the smart television 02 in the interface corresponding to the video call application, where the selection control may include the name of the smart television 02, such as the word "smart television". The user can trigger the selection control 04 to trigger the notebook computer 01 to send data included in the interface corresponding to the video call application to the intelligent television 02, so that the intelligent television 02 can display the interface corresponding to the video call application on the notebook computer 01.
The scheme of the embodiment of the application can modify the interval of the BLE broadcast transmitted by the first electronic device (such as a notebook computer) when the first electronic device (such as a notebook computer) discovers the second electronic device (such as an intelligent television). Because the interval of BLE broadcasting can be modified to first electronic equipment, consequently, first electronic equipment can reduce the interval of BLE broadcasting to first electronic equipment discovers the time of second electronic equipment when can shortening to throw, and then reduces first electronic equipment and throws the time of screen to second electronic equipment.
As shown in fig. 7, taking the first electronic device as a screen projection device and the second electronic device as a screen projected device as an example, after the first electronic device discovers the second electronic device, the first electronic device may establish a connection with the second electronic device, so that the first electronic device may project a screen of the first electronic device onto a screen of the second electronic device. The process of establishing a connection of the first electronic device with the second electronic device, i.e., the "establish connection" flow, may include the following S701-S725.
S701, a first application program of the first electronic device receives a trigger operation of a user on a selection control corresponding to the second electronic device.
After the first electronic device discovers the second electronic device, that is, after the first application program of the first electronic device receives the device reporting message sent by the soft bus of the first electronic device, the first electronic device may display a selection control corresponding to the discovered device, that is, a selection control corresponding to the second electronic device, in an interface corresponding to the first application program.
When a user needs to screen-cast an interface corresponding to a first application program on a screen of a second electronic device for display, the user can trigger a selection control corresponding to the second electronic device, which can be displayed in the interface corresponding to the first application program, of the first electronic device.
S702, in response to the triggering operation, the first application program of the first electronic device sends a first connection request message to the soft bus.
When the first electronic device receives a user's trigger operation, such as a click operation, on a selection control corresponding to the second electronic device displayed in an interface corresponding to the first application program of the first electronic device, in response, the first application program of the first electronic device may send a first connection request message to a soft bus of the first electronic device. The first connection request message may be used to trigger the softbus of the first electronic device to establish a BLE connection with the second electronic device.
S703, the soft bus of the first electronic device receives a first connection request message sent by the first application program.
And S704, the soft bus of the first electronic device establishes BLE connection with the second electronic device.
After the first connection request message sent by the first application program of the first electronic device is received by the flexible bus of the first electronic device, the flexible bus of the first electronic device can establish a BLE connection with the second electronic device.
In some examples, establishing a BLE connection with the second electronic device via the soft bus of the first electronic device may include sending a BLE connection request to the second electronic device via the soft bus of the first electronic device, and after receiving the BLE connection request from the first electronic device, the second electronic device may establish a BLE connection with the first electronic device.
S705, the soft bus of the first electronic device receives second channel information sent by the second electronic device.
After the soft bus of the first electronic device establishes a BLE connection with the second electronic device, the second electronic device may transmit the second channel information through the established BLE connection. The second channel information may include information of Wi-Fi to which the second electronic device is connected, 2.4G channels that the second electronic device can support, and 5G channels that the second electronic device can support. 2.4G channels, that is, channels corresponding to 2.4GHz, are referred to as 2.4G channels in this embodiment. The 5G channel, i.e. the channel corresponding to 5GHz, is referred to as the 5G channel in this embodiment.
The 2.4G channel supported by the second electronic device, that is, the second electronic device may transmit data on the frequency band corresponding to the 2.4G channel. The number of the 2.4G channels supported by the second electronic device may be one or more. The 2.4G channels as supported by the second electronic device may comprise 14 channels, e.g. referred to as channel 1 to channel 14. The effective width of each channel is 20MHz, in addition to a 2MHz forced isolation band. For example, for channel 1 with center frequency 2412MHz, the frequency range is 2401-2423 MHz.
The 5G channel supported by the second electronic device, i.e., the second electronic device may transmit data on the frequency band corresponding to the 5GWi-Fi channel. The number of the 5G channels supported by the second electronic device may be one or multiple. The 5G channels as supported by the second electronic device may comprise 6 channels, such as referred to as channel 36, channel 149, channel 153, channel 157, channel 161, channel 165. The effective width of each channel is 20 MHz. For example, for a channel 36 with a center frequency of 5180MHz, the frequency range is 5170-5190 MHz.
The information of Wi-Fi to which the second electronic device is connected may include whether the second electronic device is already connected to Wi-Fi and channel information of Wi-Fi to which the second electronic device is connected. Channel information of Wi-Fi connected to the second electronic device, that is, if the second electronic device is connected to Wi-Fi, whether the Wi-Fi connected to the second electronic device is 2.4GWi-Fi (i.e., 2.4ghz Wi-Fi) or 5GWi-Fi (i.e., 5ghz Wi-Fi), if the Wi-Fi connected to the second electronic device is 2.4GWi-Fi, a 2.4G channel corresponding to 2.4GWi-Fi connected to the second electronic device, and if the Wi-Fi connected to the second electronic device is 5GWi-Fi, a 5G channel corresponding to 5GWi-Fi connected to the second electronic device.
In some examples, establishing a BLE connection with the second electronic device via the soft bus of the first electronic device may include sending a BLE connection request to the second electronic device via the soft bus of the first electronic device, and after receiving the BLE connection request from the first electronic device, the second electronic device may establish a BLE connection with the first electronic device.
S706, the soft bus of the first electronic device obtains first channel information of the first electronic device.
After the soft bus of the first electronic device receives the second channel information sent by the second electronic device, the soft bus of the first electronic device may acquire the first channel information of the first electronic device. The first channel information may include information of Wi-Fi to which the first electronic device is connected, 2.4G channels that the first electronic device may support, and 5G channels that the first electronic device may support.
The 2.4G channel supported by the first electronic device, that is, the first electronic device may transmit data on a frequency band corresponding to the 2.4G channel. The number of the 2.4G channels supported by the first electronic device may be one or more.
The 5G channel supported by the first electronic device, that is, the second electronic device may transmit data on the frequency band corresponding to the 5GWi-Fi channel. The number of the 5G channels supported by the first electronic device may be one or multiple.
The information of Wi-Fi to which the first electronic device is connected may include whether the first electronic device is already connected to Wi-Fi and channel information of Wi-Fi to which the first electronic device is connected. Channel information of Wi-Fi connected by the first electronic device, namely, if the first electronic device is connected with Wi-Fi, whether the Wi-Fi connected by the first electronic device is 2.4GWi-Fi or 5GWi-Fi, and if the Wi-Fi connected by the first electronic device is 2.4GWi-Fi, a 2.4G channel corresponding to the 2.4GWi-Fi connected by the first electronic device, and if the Wi-Fi connected by the first electronic device is 5GWi-Fi, a 5G channel corresponding to the 5GWi-Fi connected by the first electronic device.
In some examples, the obtaining, by the soft bus of the first electronic device, the first channel information of the first electronic device may include the soft bus of the first electronic device obtaining, by a driver adaptation layer of the first electronic device, the first channel information of the first electronic device.
It should be noted that the soft bus of the first electronic device may obtain the first channel information of the first electronic device after receiving the first connection request message sent by the first application program of the first electronic device, and the soft bus of the first electronic device may also obtain the first channel information of the first electronic device after receiving the second channel information sent by the second electronic device. That is, the sequence between S705 and S706 is not limited in this embodiment of the application. In the embodiment of the present application, a soft bus of a first electronic device obtains first channel information of the first electronic device after receiving second channel information sent by a second electronic device, that is, S705 is taken as an example before S706 to schematically describe.
And S707, the soft bus of the first electronic device determines an optimal channel according to the first channel information and the second channel information.
After the soft bus of the first electronic device acquires the first channel information of the first electronic device and the second channel information of the second electronic device, the soft bus of the first electronic device may determine the optimal channel according to the first channel information and the second channel information. The optimal channel is a channel with the highest transmission rate when data is transmitted between the first electronic device and the second electronic device.
For example, when the first electronic device or the second electronic device is connected to 5GWi-Fi, the channel corresponding to the 5GWi-Fi is the optimal channel when data is transmitted between the first electronic device and the second electronic device. Namely, when the first electronic device and the second electronic device transmit data on the channel corresponding to the 5GWi-Fi (i.e., the frequency band corresponding to the channel), the transmission rate is the highest.
For another example, when the first electronic device or the second electronic device is connected to 2.4GWi-Fi, the channel corresponding to the 2.4GWi-Fi is the optimal channel when data is transmitted between the first electronic device and the second electronic device. Namely, when the first electronic device and the second electronic device transmit data on the channel corresponding to the 2.4GWi-Fi, the transmission rate is the highest.
For another example, when neither the first electronic device nor the second electronic device is connected to Wi-Fi, if the channels supported by the first electronic device and the second electronic device include the same channel, the channel is an optimal channel for data transmission between the first electronic device and the second electronic device. That is, when the first electronic device and the second electronic device transmit data on the commonly supported channel, the transmission rate is the highest.
For example, when the channel supported by the first electronic device includes a 5G channel, such as channel 36, and the channel supported by the second electronic device also includes a 5G channel, such as channel 36, the channel 36 is an optimal channel for transmitting data between the first electronic device and the second electronic device. As another example, when the channel supported by the first electronic device includes a 2.4G channel, such as channel 1, and the channel supported by the second electronic device also includes a 2.4G channel, such as channel 1, the channel 1 is an optimal channel for data transmission between the first electronic device and the second electronic device.
For example, as shown in connection with fig. 8, the above S707 may include the following S801 to S813.
S801, determining whether the first electronic equipment is connected with 5Gwi-Fi or not by a soft bus of the first electronic equipment according to the first channel information.
After the soft bus of the first electronic device obtains the first channel information of the first electronic device and the second channel information of the second electronic device, the soft bus of the first electronic device may determine whether the first electronic device is connected to the 5GWi-Fi according to the first channel information.
In the case that the first electronic device is connected to 5GWi-Fi, the soft bus of the first electronic device may determine that the optimal channel is a channel corresponding to the 5GWi-Fi to which the first electronic device is connected, that is, the first electronic device may continue to perform S802. In case the first electronic device is not connected to 5GWi-Fi, the first electronic device may proceed to S803.
S802, the soft bus of the first electronic equipment determines that the optimal channel is a channel corresponding to the 5Gwi-Fi connected with the first electronic equipment.
Under the condition that the first electronic device is connected with 5Gwi-Fi, the soft bus of the first electronic device can determine that the optimal channel is a channel corresponding to the 5Gwi-Fi connected with the first electronic device. For example, when the first electronic device has connected a channel corresponding to 5GWi-Fi as the channel 36, the soft bus of the first electronic device may determine that the optimal channel is the channel 36, that is, when data is transmitted on a frequency band corresponding to the channel 36, the transmission rate is the highest.
And S803, the soft bus of the first electronic equipment determines whether the second electronic equipment is connected with 5Gwi-Fi or not according to the second channel information.
In the case that the soft bus of the first electronic device determines that the first electronic device is not connected with 5GWi-Fi according to the first channel information, the soft bus of the first electronic device may determine whether the second electronic device is connected with 5GWi-Fi according to the second channel information.
In the case that the second electronic device is connected to 5GWi-Fi, the soft bus of the first electronic device may determine that the optimal channel is a channel corresponding to the 5GWi-Fi to which the second electronic device is connected, that is, the first electronic device may continue to perform S804. In case the second electronic device is not connected to 5GWi-Fi, the first electronic device may continue to perform S805.
S804, the soft bus of the first electronic equipment determines that the optimal channel is a channel corresponding to the 5Gwi-Fi connected with the second electronic equipment.
Under the condition that the second electronic device is connected with 5Gwi-Fi, the soft bus of the first electronic device can determine that the optimal channel is a channel corresponding to the 5Gwi-Fi connected with the second electronic device. For example, when the first electronic device is not connected to 5GWi-Fi and the second electronic device is connected to 5GWi-Fi, and a channel corresponding to the 5GWi-Fi connected to the second electronic device is a channel 36, the soft bus of the first electronic device may determine that the optimal channel is the channel 36, that is, when data is transmitted on a frequency band corresponding to the channel 36, the transmission rate is the highest.
And S805, the soft bus of the first electronic device determines whether the first electronic device and the second electronic device have a commonly supported 5G channel according to the first channel information and the second channel information.
Under the condition that the soft bus of the first electronic device determines that the second electronic device is not connected with the 5Gwi-Fi according to the second channel information, the soft bus of the first electronic device can determine whether the first electronic device and the second electronic device have a commonly supported 5G channel according to the first channel information and the second channel information.
In the case that the first electronic device and the second electronic device have the commonly supported 5G channel, the soft bus of the first electronic device may determine that the optimal channel is the commonly supported 5G channel of the first electronic device and the second electronic device, that is, the first electronic device may continue to perform S806. In the case where the first electronic device and the second electronic device do not have a commonly supported 5G channel, the first electronic device may continue to perform S807.
S806, the soft bus of the first electronic device determines that the optimal channel is a 5G channel supported by the first electronic device and the second electronic device.
In the case that the first electronic device and the second electronic device have a commonly supported 5G channel, the soft bus of the first electronic device may determine that the optimal channel is the commonly supported 5G channel of the first electronic device and the second electronic device. When the channels supported by the first electronic device include 5G channels, such as channel 36, and the channels supported by the second electronic device also include 5G channels, such as channel 36, the channel 36 is an optimal channel for transmitting data between the first electronic device and the second electronic device.
It should be noted that, in a case that the first electronic device includes multiple 5G channels supported by the soft bus of the first electronic device and the second electronic device, the soft bus of the first electronic device may randomly determine one 5G channel as the optimal channel in the multiple 5G channels, and the soft bus of the first electronic device may determine the 5G channel with the best channel quality as the optimal channel in the multiple 5G channels.
S807, the soft bus of the first electronic equipment determines whether the first electronic equipment is connected with 2.4Gwi-Fi according to the first channel information.
In the case that the first electronic device and the second electronic device do not have a commonly supported 5G channel, the soft bus of the first electronic device may determine whether the first electronic device is connected to 2.4GWi-Fi according to the first channel information.
In the case that the first electronic device is connected to 2.4GWi-Fi, the soft bus of the first electronic device may determine that the optimal channel is the channel corresponding to the 2.4GWi-Fi to which the first electronic device is connected, that is, the first electronic device may continue to perform S808. In case the first electronic device is not connected to 2.4GWi-Fi, the first electronic device may continue to perform S809.
S808, determining the optimal channel as a channel corresponding to the 2.4Gwi-Fi connected to the first electronic equipment by the soft bus of the first electronic equipment.
Under the condition that the first electronic device is connected with 2.4Gwi-Fi, the soft bus of the first electronic device can determine that the optimal channel is a channel corresponding to the 2.4Gwi-Fi connected with the first electronic device. For example, when the first electronic device has connected a channel corresponding to 2.4GWi-Fi as channel 1, the soft bus of the first electronic device may determine that the optimal channel is channel 1, that is, when data is transmitted on the frequency band corresponding to channel 1, the transmission rate is the highest.
And S809, the soft bus of the first electronic equipment determines whether the second electronic equipment is connected with the 2.4Gwi-Fi according to the second channel information.
In the case where the first electronic device is not connected to the 2.4GWi-Fi, the softbus of the first electronic device may determine whether the second electronic device is connected to the 2.4GWi-Fi according to the second channel information.
In the case that the second electronic device is connected to 2.4GWi-Fi, the soft bus of the first electronic device may determine that the optimal channel is the channel corresponding to the 2.4GWi-Fi to which the second electronic device is connected, that is, the first electronic device may continue to perform S810. In case the second electronic device is not connected to the 2.4GWi-Fi, the first electronic device may continue to perform S811.
And S810, determining the optimal channel as a channel corresponding to the 2.4Gwi-Fi connected with the second electronic equipment by the soft bus of the first electronic equipment.
Under the condition that the second electronic device is connected with the 2.4Gwi-Fi, the soft bus of the first electronic device can determine that the optimal channel is a channel corresponding to the 2.4Gwi-Fi connected with the second electronic device. For example, when the first electronic device and the second electronic device are not connected to 5GWi-Fi, the first electronic device is not connected to 2.4GWi-Fi, and the first electronic device and the second electronic device do not have a commonly supported 5G channel, and when the second electronic device has connected to a channel corresponding to 2.4GWi-Fi as channel 1, the soft bus of the first electronic device may determine that the optimal channel is channel 1, that is, when data is transmitted on a frequency band corresponding to channel 1, the transmission rate is highest.
S811, the soft bus of the first electronic device determines whether the first electronic device and the second electronic device have a commonly supported 2.4G channel according to the first channel information and the second channel information.
In the case that the second electronic device is not connected with the 2.4GWi-Fi, the soft bus of the first electronic device may determine whether the first electronic device and the second electronic device have a commonly supported 2.4G channel according to the first channel information and the second channel information.
In the case that the first electronic device and the second electronic device have a commonly supported 2.4G channel, the soft bus of the first electronic device may determine that the optimal channel is the commonly supported 2.4G channel of the first electronic device and the second electronic device, that is, the first electronic device may continue to perform S812, and in the case that the first electronic device and the second electronic device do not have a commonly supported 2.4G channel, the first electronic device may continue to perform S813.
S812, the soft bus of the first electronic device determines that the optimal channel is a 2.4G channel supported by the first electronic device and the second electronic device.
In the case that the first electronic device and the second electronic device have a commonly supported 2.4G channel, the soft bus of the first electronic device may determine that the optimal channel is the commonly supported 2.4G channel of the first electronic device and the second electronic device. For example, when neither the first electronic device nor the second electronic device is connected to Wi-Fi, and the first electronic device and the second electronic device do not have a commonly supported 5G channel, the channel supported by the first electronic device includes a 2.4G channel, such as channel 1, and the channel supported by the second electronic device also includes a 2.4G channel, such as channel 1, where channel 1 is an optimal channel for data transmission between the first electronic device and the second electronic device.
It should be noted that, in a case that the first electronic device and the second electronic device support a plurality of 2.4G channels, the first electronic device may randomly determine one 5G channel as the optimal channel among the plurality of 2.4G channels, and the first electronic device may determine the 2.4G channel with the best channel quality as the optimal channel among the plurality of 2.4G channels.
And S813, determining an optimal channel by the soft bus of the first electronic device according to the first channel information.
Under the condition that the first electronic device and the second electronic device do not have a commonly supported 2.4G channel, the soft bus of the first electronic device can determine the first channel information and determine the optimal channel.
In some examples, in a case where the first electronic device and the second electronic device do not have a commonly supported 2.4G channel, the soft bus of the first electronic device may use a channel with a minimum center frequency included in the first channel information as an optimal channel, and the soft bus of the first electronic device may also use a channel with a best channel quality among a plurality of channels included in the first channel information as an optimal channel. For example, when the first channel information includes a channel of 2.4G, such as channel 1, channel 2, channel 3, and channel 4, the center frequency of channel 1 is the smallest, and the soft bus of the first electronic device may use channel 1 as the optimal channel.
In other examples, in a case where the first electronic device does not have a commonly supported 2.4G channel with the second electronic device, the soft bus of the first electronic device may randomly include the first channel information as the optimal channel.
S708, the soft bus of the first electronic device sends a second connection request message to the drive adaptation layer.
After the soft bus of the first electronic device determines the optimal channel according to the first channel information and the second channel information, the soft bus of the first electronic device may send a second connection request message to the driver adaptation layer, where the second connection request message may include information of the optimal channel. The second connection request message may be used to trigger the first electronic device to establish an AP hotspot, where a channel corresponding to the AP hotspot is an optimal channel.
For example, the soft bus of the first electronic device may call a Wi-Fi interface of a driver adaptation layer of the first electronic device, thereby sending the second connection request message to the driver adaptation layer of the first electronic device. The driver adaptation layer of the first electronic device may be configured to connect a soft bus of the first electronic device and a driver API of the first electronic device, and may transmit a message between a first application of the first electronic device and the driver adaptation layer of the first electronic device.
The driver adaptation layer of the first electronic device may be further configured to obtain hardware device information of the first electronic device, and determine a corresponding driver API according to the hardware device information of the first electronic device, so that the corresponding driver API may be called, and a Wi-Fi chip module of the first electronic device may be called by the corresponding driver to establish an AP hotspot, where a channel corresponding to the AP hotspot is an optimal channel. That is to say, the driver adaptation layer of the first electronic device may provide a unified API for the soft bus, that is, the soft bus may call a corresponding API through the driver adaptation layer, so that the soft bus is not required to call a native API of the windows system.
S709, the driver adaptation layer of the first electronic device receives the second connection request message sent by the soft bus.
S710, a drive adaptation layer of the first electronic device obtains hardware device information of the first electronic device.
In this embodiment of the present application, the driver adaptation layer of the first electronic device obtains the hardware device information of the first electronic device, and the driver adaptation layer of the first electronic device in the "device discovery" process may be referred to obtain the hardware device information of the first electronic device, that is, S710 may refer to S506 described above, which is not described herein again in this embodiment of the present application.
And S711, determining an API corresponding to the second driver by the driver adaptation layer of the first electronic device according to the hardware device information.
The second driver may be a driver for enabling the Wi-Fi chip module of the first electronic device to establish an AP hotspot. The API corresponding to the second driver may call the API of the second driver.
In this embodiment of the present application, the driver adaptation layer of the first electronic device determines, according to the hardware device information, an API corresponding to the second driver, and may refer to the driver adaptation layer of the first electronic device in the "device discovery" process and determine, according to the hardware device information, an API corresponding to the first driver, that is, S711 may refer to S507 above, which is not described herein again in this embodiment of the present application.
And S712, the driver adaptation layer of the first electronic device calls the second driver through the API corresponding to the second driver.
After the driver adaptation layer of the first electronic device determines the API corresponding to the second driver according to the hardware device information, the driver adaptation layer of the first electronic device may call the second driver through the API corresponding to the second driver.
S713, the first electronic device calls the Wi-Fi chip module of the first electronic device through the second drive.
The first electronic device can call the Wi-Fi chip module of the first electronic device through the second driver, so that the Wi-Fi chip module of the first electronic device can establish an AP hotspot, and a channel corresponding to the AP hotspot is the optimal channel.
And S714, establishing an AP hotspot by the Wi-Fi chip module of the first electronic equipment according to the optimal channel.
S715, the Wi-Fi chip module of the first electronic device sends the AP hotspot information to the second electronic device.
After the Wi-Fi chip module of the first electronic device establishes the AP hotspot corresponding to the optimal channel, the Wi-Fi chip module of the first electronic device may send information of the AP hotspot to the second electronic device. The information of the AP hotspot may include a name and a password of the AP hotspot and a channel corresponding to the AP hotspot.
In some examples, the Wi-Fi chip module of the first electronic device may send the information of the AP hotspot to the second electronic device through the BLE connection established between the first electronic device and the second electronic device.
S716, the Wi-Fi chip module of the first electronic equipment receives the connection establishment message sent by the second electronic equipment.
After the second electronic device receives the information of the AP hotspot sent by the Wi-Fi chip module of the first electronic device, the second electronic device can access the AP hotspot according to the information of the AP hotspot.
After the second electronic device accesses the AP hotspot according to the information of the AP hotspot, the second electronic device may send a connection establishment message to the Wi-Fi chip module of the first electronic device. The connection establishment message may be used to indicate that the access of the second electronic device to the AP hotspot established by the first electronic device is successful.
And S717, the Wi-Fi chip module of the first electronic equipment sends a connection establishment message to the second driver.
After the Wi-Fi chip module of the first electronic device receives the connection establishment message sent by the second electronic device, the Wi-Fi chip module of the first electronic device may send the connection establishment message to the second driver of the second electronic device.
S718, the second driver of the first electronic device receives the connection establishment message sent by the Wi-Fi chip module.
And step S719, the second driver of the first electronic device sends a connection establishment message to the driver adaptation layer.
After the second driver of the first electronic device receives the connection establishment message sent by the Wi-Fi chip module of the first electronic device, the second driver of the first electronic device may send the connection establishment message to the driver adaptation layer of the first electronic device.
In some examples, after the second driver of the first electronic device receives the connection establishment message sent by the Wi-Fi chip module of the first electronic device, the second driver of the first electronic device may send the connection establishment message to an API corresponding to the second driver of the first electronic device. After receiving the connection establishment message sent by the second driver of the first electronic device, the API corresponding to the second driver of the first electronic device may send the connection establishment message to the driver adaptation layer of the first electronic device.
S720, the driver adaptation layer of the first electronic device receives the connection establishment message sent by the second driver.
And S721, the driving adaptation layer of the first electronic device sends a connection establishment message to the soft bus.
After the driver adaptation layer of the first electronic device receives the connection establishment message sent by the second driver of the first electronic device, the driver adaptation layer of the first electronic device may send the connection establishment message to the soft bus of the first electronic device.
And S722, the soft bus of the first electronic device receives the connection establishment message sent by the driving adaptation layer.
S723, the soft bus of the first electronic device sends a connection setup message to the first application.
After the soft bus of the first electronic device receives the connection establishment message sent by the driver adaptation layer of the first electronic device, the soft bus of the first electronic device may send the connection establishment message to the first application of the first electronic device.
S724, the first application program of the first electronic equipment receives the connection establishment message sent by the soft bus.
And S725, the first electronic device sends data included in the interface corresponding to the first application program to the second electronic device.
After the first application program of the first electronic device receives the connection establishment message sent by the driver adaptation layer of the first electronic device, the first electronic device sends data included in the interface corresponding to the first application program to the second electronic device, so that the second electronic device can display the interface corresponding to the first application program of the first electronic device.
According to the scheme of the application, after the first electronic device discovers the second electronic device, the first electronic device can select the optimal channel according to the channel supported by the first electronic device and the channel supported by the second electronic device, and establish the hotspot corresponding to the optimal channel, so that the rate of data transmission from the first electronic device to the second electronic device can be increased through the hotspot corresponding to the optimal channel.
In some examples, channel information supported by the second electronic device may be included in the BLE reply broadcast transmitted by the second electronic device, so that the first electronic device may establish the corresponding AP hotspot according to the channel information supported by the second electronic device. Because the channel corresponding to the AP hotspot established by the first electronic device is a channel supported by the second electronic device, when data is transmitted between the first electronic device and the second electronic device, the data is transmitted by using the channel corresponding to the AP hotspot, so that the data transmission rate can be increased.
For example, the channel information supported by the second electronic device may be included in the BLE reply broadcast transmitted by the second electronic device. With reference to fig. 5A, as shown in fig. 9, after the Wi-Fi chip module of the first electronic device sends a BLE broadcast according to the first drive modified BLE broadcast interval, the first electronic device receives a BLE reply broadcast sent by the second electronic device, where the BLE reply broadcast includes channel information supported by the second electronic device, that is, after S511, a process of the first electronic device establishing an AP hotspot according to the channel information supported by the second electronic device may include the following S901 to S922.
S901, the Wi-Fi chip module of the first electronic device receives a BLE reply broadcast sent by the second electronic device, wherein the BLE reply broadcast comprises second channel information.
After the Wi-Fi chip module of the first electronic device transmits the BLE broadcast, the second electronic device may receive the BLE broadcast transmitted by the first electronic device.
When the second electronic device receives the BLE broadcast transmitted by the first electronic device, the second electronic device may transmit a BLE reply broadcast to the first electronic device. The BLE reply broadcast may be used to instruct the first electronic device to discover the second electronic device. The BLE reply broadcast may include information of the second electronic device, such as a name and a device type of the second electronic device, so that the first electronic device may display the information of the second electronic device, and a user may conveniently select the second electronic device for screen projection.
The BLE reply broadcast may also include second channel information for the second electronic device, such as including the second channel information for the second electronic device in a reserved field of the BLE reply broadcast. The second channel information may include Wi-Fi information connected to the second electronic device, a 2.4G channel that the second electronic device may support, and a 5G channel that the second electronic device may support, so that the first electronic device may establish a corresponding AP hotspot according to the second channel information, thereby improving a rate at which the first electronic device and the second electronic device transmit data.
S902, the Wi-Fi chip module of the first electronic device sends a reporting device message to the first driver, wherein the reporting device message comprises second channel information.
When the Wi-Fi chip module of the first electronic device scans the BLE reply broadcast sent by the second electronic device, the Wi-Fi chip module of the first electronic device may send a reporting device message to the first driver of the first electronic device. The reporting device message may be used to cause the first application of the first electronic device to display the discovered second electronic device. The reporting device message may include information of the second electronic device, such as a name and a device type of the second electronic device.
The reporting device message may further include second channel information, so that the first electronic device may establish a corresponding AP hotspot according to the second channel information.
S903, a first driver of the first electronic device receives a reported device message sent by the Wi-Fi chip module.
S904, the first driver of the first electronic device sends a reporting device message to the driver adaptation layer.
After the first driver of the first electronic device receives the reporting device message sent by the Wi-Fi chip module of the first electronic device, the first driver of the first electronic device may send the reporting device message to the driver adaptation layer of the first electronic device.
In some examples, after the first driver of the first electronic device receives the reporting device message sent by the Wi-Fi chip module of the first electronic device, the first driver of the first electronic device may send the reporting device message to an API corresponding to the first driver of the first electronic device. After receiving the reporting device message sent by the first driver of the first electronic device, the API corresponding to the first driver of the first electronic device may send the reporting device message to the driver adaptation layer of the first electronic device.
And S905, the driver adaptation layer of the first electronic device receives the reporting device message sent by the first driver.
S906, the drive adaptation layer of the first electronic device sends a reporting device message to the soft bus.
After the driver adaptation layer of the first electronic device receives the reporting device message sent by the first driver of the first electronic device, the driver adaptation layer of the first electronic device may send the reporting device message to the soft bus of the first electronic device.
And S907, the soft bus of the first electronic device receives the reporting device message sent by the driving adaptation layer.
And S908, the soft bus of the first electronic equipment sends a reporting equipment message to the first application program.
After the flexible bus of the first electronic device receives the reporting device message sent by the driver adaptation layer of the first electronic device, the flexible bus of the first electronic device may send the reporting device message to the first application program of the first electronic device.
And S909, the first application program of the first electronic device receives the reporting device message sent by the soft bus.
S910, the first electronic device displays a selection control corresponding to the second electronic device in an interface corresponding to the first application program.
After the first application program of the first electronic device receives the device reporting message sent by the soft bus of the first electronic device, the first electronic device may display the selection control corresponding to the discovered device, that is, the selection control corresponding to the second electronic device, in the interface corresponding to the first application program.
And S911, the first electronic equipment receives the trigger operation of the user on the selection control corresponding to the second electronic equipment.
When the user needs to screen the interface corresponding to the first application program onto the screen of the second electronic device for display, the user can trigger a selection control corresponding to the second electronic device, which can be displayed in the interface corresponding to the first application program by the first electronic device.
S912, in response to the triggering operation, the first application program of the first electronic device sends a third connection request message to the soft bus.
When the first electronic device receives a user's trigger operation, such as a click operation, on a selection control corresponding to the second electronic device displayed in an interface corresponding to the first application program of the first electronic device, in response, the first application program of the first electronic device may send a third connection request message to the soft bus of the first electronic device. The third connection request message may be used to trigger the soft bus of the first electronic device to determine the optimal channel according to the channel information supported by the second electronic device. The third connection request message may include second channel information of the second electronic device.
S913, the soft bus of the first electronic device receives the third connection request message sent by the first application program.
And S914, the soft bus of the first electronic equipment determines the optimal channel according to the second channel information.
After the soft bus of the first electronic device receives the third connection request message sent by the first application program, the soft bus of the first electronic device may determine the optimal channel according to the second channel information. Because the optimal channel is determined according to the second channel information of the second electronic device, that is, the optimal channel is a channel supported by the second electronic device, when the channel corresponding to the AP hotspot established by the first electronic device is the optimal channel, the rates of the first electronic device and the second electronic device when transmitting data on the optimal channel are higher.
For example, when the soft bus of the first electronic device determines that the second electronic device is connected to 5GWi-Fi according to the second channel information, the soft bus of the first electronic device may determine that the optimal channel is a channel corresponding to the second electronic device connected to 5 GWi-Fi. Because the optimal channel is a channel corresponding to the connection of the second electronic device to the 5GWi-Fi, when the channel corresponding to the AP hotspot established by the first electronic device is the optimal channel, the rate of data transmission between the first electronic device and the second electronic device on the optimal channel is high.
When the soft bus of the first electronic device determines that the second electronic device is not connected with the 5Gwi-Fi according to the second channel information, but the second electronic device has a supported 5G channel, the soft bus of the first electronic device may determine that the optimal channel is the supported 5G channel of the second electronic device. Because the optimal channel is a 5G channel supported by the second electronic device, when the channel corresponding to the AP hotspot established by the first electronic device is the optimal channel, the rates of the first electronic device and the second electronic device when transmitting data on the optimal channel are higher.
When the soft bus of the first electronic device determines that the second electronic device is not connected with 5Gwi-Fi and the second electronic device is not connected with a 5G channel supported by the second electronic device according to the second channel information, and the second electronic device is connected with 2.4Gwi-Fi, the soft bus of the first electronic device may determine that the optimal channel is a channel corresponding to the 2.4Gwi-Fi connected with the second electronic device. Because the optimal channel is a channel corresponding to the 2.4GWi-Fi connected to the second electronic device, when the channel corresponding to the AP hotspot established by the first electronic device is the optimal channel, the rate at which the first electronic device and the second electronic device transmit data on the optimal channel is higher.
When the soft bus of the first electronic device determines that the second electronic device is not connected with Wi-Fi, the second electronic device does not have a supported 5G channel, and the second electronic device has a supported 2.4G channel according to the second channel information, the soft bus of the first electronic device may determine that the optimal channel is the 2.4G channel supported by the second electronic device. Because the optimal channel is a 2.4G channel supported by the second electronic device, when the channel corresponding to the AP hotspot established by the first electronic device is the optimal channel, the rates of the first electronic device and the second electronic device when transmitting data on the optimal channel are higher.
And when the soft bus of the first electronic device determines that the second electronic device is not connected with Wi-Fi, the second electronic device does not have a supported 5G channel, and the second electronic device does not have a supported 2.4G channel according to the second channel information, the soft bus of the first electronic device determines an optimal channel according to the channel supported by the first electronic device.
S915, the soft bus of the first electronic device sends a fourth connection request message to the drive adaptation layer
The fourth connection request message may include the optimal channel.
After the soft bus of the first electronic device determines the optimal channel according to the second channel information, the soft bus of the first electronic device may send a fourth connection request message to the driver adaptation layer, where the fourth connection request message includes information of the optimal channel. The second connection request message may be used to trigger the first electronic device to establish an AP hotspot, where a channel corresponding to the AP hotspot is an optimal channel.
In this embodiment of the application, reference may be made to a process in which the soft bus of the first electronic device sends the fourth connection request message to the driver adaptation layer in the "connection establishment" process, that is, reference may be made to S708 in S915, where details of this embodiment of the application are not repeated here.
S916, the driver adaptation layer of the first electronic device receives the fourth connection request message sent by the soft bus.
S917, the driver adaptation layer of the first electronic device obtains hardware device information of the first electronic device.
After the driver adaptation layer of the first electronic device receives the fourth connection request message sent by the soft bus of the first electronic device, the driver adaptation layer of the first electronic device may obtain the hardware device information of the first electronic device.
In this embodiment of the present application, the driver adaptation layer of the first electronic device obtains the hardware device information of the electronic device, which may refer to S506 or 710 described above, and this embodiment of the present application is not described herein again.
S918, the drive adaptation layer of the first electronic device determines the API corresponding to the second drive according to the hardware device information.
After the driver adaptation layer of the first electronic device obtains the hardware device information of the first electronic device, the driver adaptation layer of the first electronic device may determine, according to the hardware device information of the first electronic device, an API corresponding to the second driver. The second driver may be a driver for enabling the Wi-Fi chip module of the first electronic device to establish an AP hotspot. The API corresponding to the second driver may call the API of the second driver.
In this embodiment of the application, the driver adaptation layer of the first electronic device determines, according to the hardware device information, an API corresponding to the second driver, where reference is made to 711.
S919, the driver adaptation layer of the first electronic device calls the second driver through the API corresponding to the second driver.
After the driver adaptation layer of the first electronic device determines the API corresponding to the second driver according to the hardware device information, the driver adaptation layer of the first electronic device may call the second driver through the API corresponding to the second driver.
In this embodiment of the application, reference may be made to 712, where the process of the driver adaptation layer of the first electronic device calling the second driver through the API corresponding to the second driver is not described herein again.
S920, the first electronic device calls the Wi-Fi chip module of the first electronic device through the second driver.
The first electronic device can call the Wi-Fi chip module of the first electronic device through the second driver, so that the Wi-Fi chip module of the first electronic device can establish an AP hotspot, and a channel corresponding to the AP hotspot can be the optimal channel.
In this embodiment of the application, reference may be made to the process in which the driver adaptation layer of the first electronic device invokes the second driver through the API corresponding to the second driver, where reference is made to the foregoing 713, and this embodiment of the application is not described herein again.
And S921, the Wi-Fi chip module of the first electronic device establishes the AP hotspot according to the optimal channel.
In this embodiment of the application, reference may be made to the process in which the driver adaptation layer of the first electronic device invokes the second driver through the API corresponding to the second driver by reference to the foregoing 714, which is not described herein again in this embodiment of the application.
S922, the Wi-Fi chip module of the first electronic device sends the AP hotspot information to the second electronic device.
After the second electronic device receives the information of the AP hotspot sent by the Wi-Fi chip module of the first electronic device, the second electronic device can access the AP hotspot, so that the first electronic device can send data included in an interface corresponding to the first application program to the second electronic device, and the second electronic device can display the interface corresponding to the first application program of the first electronic device. I.e. the first electronic device may be projected to the second electronic device.
It should be noted that, for the process of the first electronic device projecting the screen to the second electronic device, reference may be made to the above S716-S725, and details of the embodiment of the present application are not described herein again.
According to the scheme of the application, after the first electronic device discovers the second electronic device, the first electronic device can select the optimal channel according to the channel supported by the second electronic device, and establish the hotspot corresponding to the optimal channel, so that the rate of data transmission from the first electronic device to the second electronic device can be improved through the hotspot corresponding to the optimal channel.
For ease of understanding, the device discovery method provided in the embodiment of the present application is described below with reference to fig. 10. As shown in fig. 10, the device discovery method may include the following S1001-S1015.
S1001, displaying a first interface by the first electronic device, wherein the first interface comprises a first control.
The first interface may be an interface corresponding to a first application included in the first electronic device. The first application program may be a video application or a video call application included in the first electronic device.
The first interface may include a first control. The first control is used for triggering the first electronic device to transmit the Bluetooth Low Energy (BLE) broadcast, and the transmission interval time of the BLE broadcast is configured to be the first interval time. That is, the first interval may be an interval in which the first electronic device transmits the BLE broadcast through a native API of the windows system.
The first control may be a screen projection control. The screen projection control can be used for triggering the first electronic device to project the interface (namely the first interface) corresponding to the first application program on the first electronic device onto other electronic devices (which can be called as second electronic devices) for display.
S1002, the first electronic device receives a trigger operation of a user on the first control.
When a user needs to screen-cast an interface corresponding to a first application program on a first electronic device to another electronic device, the user may trigger a screen-cast control (i.e., a first control) included in the interface corresponding to the first application program.
The process of the first electronic device receiving the user trigger operation on the screen projection control may refer to the step of S501, and is not described herein again in this embodiment of the application.
When the first electronic device receives a triggering operation of the first control, such as a clicking operation, from a user, in response, the first electronic device may modify a transmission interval time of the BLE broadcast from a first interval time to a second interval time, and transmit the BLE broadcast according to the second interval time for discovering connectable electronic devices (e.g., referred to as second electronic devices). Specifically, the first electronic device may perform the following S1003 to S1015.
S1003, responding to the trigger operation, and acquiring the equipment information of the first electronic equipment by the first electronic equipment.
When the first electronic device receives a trigger operation, such as a click operation, of the screen-throwing control by the user, the first electronic device may obtain device information of the first electronic device in response. The device information of the first electronic device may be hardware device information of the first electronic device.
The device information of the first electronic device may include an identification of a Wi-Fi chip module included in the first electronic device, such as a VID of the Wi-Fi chip module. The VID of the Wi-Fi chip module can be used for distinguishing Wi-Fi chip modules of different manufacturers. The corresponding drivers of Wi-Fi chip modules of different manufacturers can be different.
In this embodiment of the application, the process of acquiring the hardware device information of the first electronic device by the first electronic device may refer to the process of acquiring the hardware device information of the first electronic device by the first electronic device in the "device discovery" procedure, that is, S1003 may refer to S502-S506 described above, or may refer to the process of acquiring the hardware device information of the first electronic device by the first electronic device in the "connection establishment" procedure, that is, S1003 may refer to S709-S710 described above.
And S1004, the first electronic device determines an API corresponding to the first driver according to the device information.
The first electronic device may determine the API corresponding to the first driver according to the hardware device information and the preset corresponding relationship. The preset correspondence may be a correspondence between the hardware device information and the API.
The first driver may be to cause the first electronic device to transmit a BLE broadcast driver. The API corresponding to the first driver may call the API of the first driver. After the first electronic device determines the API corresponding to the first drive, the first drive can be called through the API, the interval time for sending BLE broadcasts can be modified through the first drive, the Wi-Fi chip module of the first electronic device can be called through the first drive, the BLE broadcasts are sent according to the interval time for sending the BLE broadcasts, modified through the first drive, and therefore device discovery can be conducted.
In this embodiment of the application, the first electronic device determines, according to the hardware device information, a process of the API corresponding to the first driver, where reference may be made to the process of the first electronic device determining, according to the hardware device information, an API corresponding to the first driver in the "device discovery" process, that is, reference may be made to S507 in S1004.
S1005, the first electronic device calls the first driver according to the API corresponding to the first driver.
After the first electronic device determines the API corresponding to the first driver, the first electronic device calls the first driver through the API corresponding to the first driver, that is, the first electronic device determines the first driver according to the application program interface API corresponding to the first driver.
In this embodiment of the application, the first electronic device invokes the process of the first drive according to the API corresponding to the first drive, and refer to the API corresponding to the first drive in the "device discovery" process, that is, refer to S508 in S1005.
And S1006, the first electronic device modifies the interval time for sending BLE broadcast through the first driver.
After the first electronic device calls the first driver through the API corresponding to the first driver, the first electronic device may modify the interval time for transmitting the BLE broadcast through the first driver. That is, the first electronic device may modify the transmission interval time of the BLE broadcast from the first interval time to the second interval time by the first driver. The second interval time may be less than the first interval time.
In this embodiment of the application, the process that the first electronic device modifies the interval time for transmitting the BLE broadcast through the first driver may refer to the process that the first electronic device modifies the interval time for transmitting the BLE broadcast through the first driver in the "device discovery" process, that is, S1006 may refer to S509 described above, which is not described herein again in this embodiment of the application.
And S1007, the first electronic device transmits the BLE broadcast according to the modified interval time for transmitting the BLE broadcast.
After the first electronic device modifies the interval time for transmitting BLE broadcasts through the first driver, the first electronic device may transmit BLE broadcasts according to the modified interval time for transmitting BLE broadcasts.
In some examples, the interval time of the first driven modified BLE broadcast may be less than or equal to an interval time threshold. The interval time threshold may be set according to actual conditions, and is not limited in this embodiment of the present application. The interval time threshold may be less than an interval time for transmitting BLE broadcasts through a native API of the windows system. For example, the interval time for the first drive modified BLE broadcast may be 20 milliseconds.
In this embodiment of the application, the process of sending BLE broadcasts by the first electronic device according to the modified interval time for sending BLE broadcasts may refer to the process of sending BLE broadcasts by the first electronic device according to the modified interval time for sending BLE broadcasts in the "device discovery" procedure, that is, S1007 may refer to S510 to S511 described above, which is not described herein again in this embodiment of the application.
And S1008, the first electronic device receives a BLE reply broadcast sent by the second electronic device.
After the first electronic device transmits the BLE broadcast according to the modified interval time for transmitting the BLE broadcast, the first electronic device may turn on BLE scanning, that is, the first electronic device may receive a BLE reply broadcast transmitted by the second electronic device. After the second electronic device receives the BLE broadcast transmitted by the first electronic device, the second electronic device may transmit a BLE reply broadcast to the first electronic device, and when the first electronic device receives the BLE reply broadcast transmitted by the second electronic device, the first electronic device may discover the second electronic device.
In this embodiment of the application, a process of the first electronic device receiving the BLE reply broadcast sent by the second electronic device may refer to a process of the first electronic device receiving the BLE reply broadcast sent by the second electronic device in the above "device discovery" procedure, that is, S1008 may refer to S512, or a process of the first electronic device receiving the BLE reply broadcast sent by the second electronic device may also refer to S901, which is not described herein again in this embodiment of the application.
And S1009, the first electronic device displays the identifier of the second electronic device on the first interface.
After the first electronic device transmits the BLE broadcast, the second electronic device may receive the BLE broadcast. After the second electronic device receives the BLE broadcast transmitted by the first electronic device, the second electronic device may transmit a BLE reply broadcast to the first electronic device so that the first electronic device may discover the second electronic device.
After the first electronic device receives the BLE reply broadcast sent by the second electronic device, the first electronic device may display, on the first interface, an identifier corresponding to the second electronic device. The identifier corresponding to the second electronic device may be a selection control. The selection control can be used for triggering the first electronic device to send data included in the first interface to the second electronic device, so that the second electronic device can display the first interface, namely, a screen of the first electronic device is projected to a screen of the second electronic device to be displayed.
In this embodiment of the application, reference may be made to the process, in the "device discovery" process, of the first electronic device displaying the selection control corresponding to the second electronic device on the first interface by the first electronic device, that is, reference may be made to S513 to S521 by S1009, where details of this embodiment of the application are not repeated here.
S1010, the first electronic device receives a trigger operation of a user on the identifier of the second electronic device.
When a user needs to screen an interface corresponding to a first application program on a screen of a second electronic device for displaying, the user can trigger a selection control corresponding to the second electronic device, which can be displayed in the interface corresponding to the first application program by the first electronic device.
In this embodiment of the application, reference may be made to a process, in the "connection establishment" process, in which the first electronic device receives a trigger operation of a selection control corresponding to the second electronic device, of the user, where the process is performed by the first electronic device to receive the trigger operation of the selection control corresponding to the second electronic device, that is, reference may be made to S701 in S1010, and details of this embodiment of the application are not repeated here.
S1011, in response to the triggering operation, the first electronic device obtains first channel information of the first electronic device and second channel information of the second electronic device.
The first channel information may include channel information that the first electronic device is connected to (i.e., information of Wi-Fi connected), 2.4G channels that the first electronic device may support, and 5G channels that the first electronic device may support. The channel information of the first electronic device connection (i.e., the information of the connected Wi-Fi) may include whether the first electronic device is connected to Wi-Fi, where the first electronic device is connected to Wi-Fi, 2.4G-WiFi or 5GWi-Fi, and where the first electronic device is connected to 2.4G-WiFi, a channel corresponding to 2.4G-WiFi connected to the first electronic device, and where the first electronic device is connected to 5G-WiFi, a channel corresponding to 5G-WiFi connected to the first electronic device.
The second channel information may include channel information to which the second electronic device is connected (i.e., information of Wi-Fi connected), 2.4G channels that the second electronic device can support, and 5G channels that the second electronic device can support. The channel information (i.e., information of connected Wi-Fi) to which the second electronic device is connected may include whether the second electronic device is connected to Wi-Fi, in which case the second electronic device is connected to Wi-Fi, 2.4G-WiFi or 5GWi-Fi, and in which case the second electronic device is connected to 2.4G-WiFi, a channel corresponding to 2.4G-WiFi to which the second electronic device is connected, and in which case the second electronic device is connected to 5G-WiFi, a channel corresponding to 5G-WiFi to which the second electronic device is connected.
In this embodiment of the present application, for a process in which the first electronic device acquires the first channel information of the first electronic device and the second channel information of the second electronic device, reference may be made to a process in which the first electronic device acquires the first channel information of the first electronic device and the second channel information of the second electronic device in the "connection establishment" process, that is, reference may be made to S702 to S706 in S1011, which is not described herein again in this embodiment of the present application.
S1012, the first electronic device determines a first channel according to the first channel information and the second channel information.
After the soft bus of the first electronic device obtains the first channel information of the first electronic device and the second channel information of the second electronic device, the soft bus of the first electronic device may determine the first channel according to the first channel information and the second channel information. The first channel is a channel with the highest transmission rate when data is transmitted between the first electronic device and the second electronic device. That is, the first channel is an optimal channel for data transmission between the first electronic device and the second electronic device.
In some examples, the first channel may be a channel in which a transmission rate is greater than a preset threshold when data is transmitted between the first electronic device and the second electronic device. The preset threshold may be set according to an actual situation, which is not limited in the embodiment of the present application.
For example, when the first electronic device or the second electronic device is connected to 5GWi-Fi, the channel corresponding to the 5GWi-Fi is the optimal channel when data is transmitted between the first electronic device and the second electronic device. That is, when the first electronic device and the second electronic device transmit data on a channel corresponding to 5GWi-Fi (i.e., a frequency band corresponding to the channel), the transmission rate is the highest.
For another example, when the first electronic device or the second electronic device is connected to 2.4GWi-Fi, the channel corresponding to the 2.4GWi-Fi is the optimal channel when data is transmitted between the first electronic device and the second electronic device. Namely, when the first electronic device and the second electronic device transmit data on the channel corresponding to the 2.4GWi-Fi, the transmission rate is the highest.
For another example, when neither the first electronic device nor the second electronic device is connected to Wi-Fi, if the channels supported by the first electronic device and the second electronic device include the same channel, the channel is an optimal channel for data transmission between the first electronic device and the second electronic device. That is, when the first electronic device and the second electronic device transmit data on the commonly supported channel, the transmission rate is the highest.
In this embodiment of the application, the process of determining the optimal channel by the first electronic device according to the first channel information and the second channel information may refer to the process of determining the optimal channel by the first electronic device according to the first channel information and the second channel information in the "connection establishment" procedure, that is, S1012 may refer to S707 described above, which is not described herein again in this embodiment of the application.
And S1013, the first electronic device establishes the AP hotspot according to the first channel.
After determining the first channel, the first electronic device may establish a hotspot, such as an AP hotspot. The channel corresponding to the hot spot is a first channel.
In this embodiment of the present application, the process of the first electronic device establishing the AP hotspot according to the first channel may refer to the process of the first electronic device establishing the AP hotspot according to the optimal channel in the "connection establishment" procedure, that is, the S1013 may refer to the above S708 to S714, which is not described herein again.
And S1014, the first electronic device sends the AP hotspot information to the second electronic device.
The information of the AP hotspot may include a name and a password of the AP hotspot and channel information (i.e., information of the first channel) corresponding to the AP hotspot.
In this embodiment of the application, reference may be made to the process in which the first electronic device sends the AP hotspot information to the second electronic device in the "connection establishment" process, that is, reference may be made to S715 for S1015, which is not described herein again in this embodiment of the application.
After the second electronic device receives the information of the AP hotspot sent by the first electronic device, the second electronic device may access the AP hotspot.
In this embodiment of the application, reference may be made to the process of accessing the AP hotspot by the second electronic device in the "connection establishment" process, that is, reference may be made to S716-S724 in S1014, and details of this embodiment of the application are not described herein again.
And S1015, after the second electronic device accesses the AP hotspot, the first electronic device sends the data included in the first interface to the second electronic device through the first channel.
After the second electronic device accesses the information of the AP hotspot sent by the first electronic device, the first electronic device may send the data included in the first interface to the second electronic device through the AP hotspot (i.e., the first channel), that is, the first electronic device may project a screen to the second electronic device.
In this embodiment of the application, reference may be made to a process in which the first electronic device sends the data included in the first interface to the second electronic device through the AP hot spot in the "connection establishment" process, that is, reference may be made to S716-S725 by S1015, where this embodiment is not described herein again.
According to the device discovery method provided by the embodiment of the application, when a first electronic device (such as a notebook computer) discovers a second electronic device (such as a smart television), an interval of a BLE broadcast transmitted by the first electronic device can be modified. Because the interval of BLE broadcasting can be modified to first electronic equipment, consequently, first electronic equipment can reduce the interval of BLE broadcasting to first electronic equipment discovers the time of second electronic equipment when can shortening to throw, and then reduces first electronic equipment and throws the time of screen to second electronic equipment.
In addition, according to the scheme of the application, after the first electronic device discovers the second electronic device, the first electronic device can select an optimal channel according to the channel supported by the first electronic device and the channel supported by the second electronic device, and establish a hot spot corresponding to the optimal channel, so that the rate of transmitting data from the first electronic device to the second electronic device can be increased through the hot spot corresponding to the optimal channel.
Corresponding to the method in the foregoing embodiment, the embodiment of the present application further provides a screen projection apparatus. The screen projection device can be applied to first electronic equipment, and the first electronic equipment can be screen projection electronic equipment and is used for realizing the method in the embodiment. The function of the screen projection device can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
For example, fig. 11 shows a schematic structural diagram of a device discovery apparatus 11, and as shown in fig. 11, the device discovery apparatus 11 may include: a display module 1101, a receiving module 1102, a modification module 1103, a sending module 1104, and the like.
The display module 1101 may be configured to display a first interface, where the first interface includes a first control; the first control is used for triggering the first electronic device to transmit the Bluetooth Low Energy (BLE) broadcast, and the transmission interval time of the BLE broadcast is configured to be the first interval time.
The receiving module 1102 may be configured to receive a trigger operation of a user on a first control.
A modifying module 1103 may be configured to modify the transmission interval time of the BLE broadcast from the first interval time to the second interval time in response to the triggering operation.
A transmitting module 1104 may be configured to transmit BLE broadcast according to the second interval time for discovering connectable electronic devices.
In another possible implementation manner, the apparatus discovery device 11 may further include an obtaining module 1105 and a determining module 1106. The obtaining module 1105 may be configured to obtain device information of a first electronic device. A determining module 1106, which may be configured to determine a first driver according to device information of a first electronic device; the first driver is used for modifying the transmission interval time of the BLE broadcast from the first interval time to the second interval time.
In another possible implementation manner, the determining module 1106 may be further configured to determine, according to the device information of the first electronic device and a preset corresponding relationship, an application program interface API corresponding to the first driver. The determining module 1106 may be further configured to determine the first driver according to the API corresponding to the first driver.
In another possible implementation manner, the receiving module 1102 may be further configured to receive a BLE reply broadcast transmitted by the second electronic device.
The display module 1101 may be further configured to display an identifier of the second electronic device. The receiving module 1102 may further be configured to receive a trigger operation of the user on the identifier of the second electronic device.
The obtaining module 1105 may be further configured to, in response to a trigger operation of a user on an identifier of a second electronic device, obtain first channel information of a first electronic device and second channel information of the second electronic device; the first channel information comprises channel information connected with the first electronic equipment, 2.4GHz channel information supported by the first electronic equipment and 5GHz channel information supported by the first electronic equipment; the second channel information includes channel information to which the second electronic device is connected, 2.4GHz channel information supported by the second electronic device, and 5GHz channel information supported by the second electronic device.
A determining module 1106, further configured to determine a first channel according to the first channel information and the second channel information; the first channel is a channel in which the rate of data transmission between the first electronic device and the second electronic device is greater than a preset threshold.
The device discovery apparatus 11 may further include an establishing module 1107. The establishing module 1107 may be configured to establish a hot spot, where a channel corresponding to the hot spot is a first channel.
In another possible implementation, in a case that the first electronic device is connected to 5ghz wi-Fi, the first channel is a channel to which the first electronic device is connected; under the condition that the first electronic device is not connected with 5GHz wi-Fi and the second electronic device is connected with 5GHz wi-Fi, the first channel is a channel to which the second electronic device is connected; under the condition that the first electronic device and the second electronic device are not connected with the 5GHz wi-Fi and the first electronic device and the second electronic device have commonly supported 5GHz channels, the first channel is the commonly supported 5GHz channel of the first electronic device and the second electronic device; under the condition that the first electronic device is connected with 2.4GHz wi-Fi, the second electronic device is not connected with 5GHz wi-Fi, and the first electronic device and the second electronic device do not have commonly supported 5GHz channels, the first channel is a channel connected with the first electronic device; under the condition that the first electronic device is not connected with a channel, the first electronic device and the second electronic device are not commonly supported by a 5GHz channel, and the second electronic device is connected with 2.4GHz wi-Fi, the first channel is a channel connected with the second electronic device; under the condition that the first electronic device and the second electronic device are not connected with a channel, the first electronic device and the second electronic device are not provided with a commonly supported 5GHz channel, and the first electronic device and the second electronic device are provided with a commonly supported 2.4GHz channel, the first channel is a commonly supported 2.4GHz channel of the first electronic device and the second electronic device; and under the condition that the first electronic device and the second electronic device are not connected with the channel and the first electronic device and the second electronic device do not have the channel supported by the first electronic device, the first channel is the channel supported by the first electronic device.
In another possible implementation, the BLE reply broadcast may include the second channel information.
In another possible implementation manner, the sending module 1104 may be further configured to send information of the hotspot to the second electronic device; the information of the hot spot includes information of the first channel. The receiving module 1102 may be further configured to receive a connection establishment message sent by the second electronic device, where the connection establishment message is used to indicate that the second electronic device accesses the hotspot. The sending module can also be used for sending the data corresponding to the first interface to the second electronic device.
In another possible implementation manner, the device information of the first electronic device may include a vendor identification VID of a Wi-Fi chip module included in the first electronic device.
In another possible implementation, the second interval time is less than the first interval time.
It should be understood that the division of units or modules (hereinafter referred to as units) in the above apparatus is only a division of logical functions, and may be wholly or partially integrated into one physical entity or physically separated in actual implementation. And the units in the device can be realized in the form of software called by the processing element; or may be implemented entirely in hardware; part of the units can also be realized in the form of software called by a processing element, and part of the units can be realized in the form of hardware.
For example, each unit may be a processing element separately set up, or may be implemented by being integrated into a chip of the apparatus, or may be stored in a memory in the form of a program, and a function of the unit may be called and executed by a processing element of the apparatus. In addition, all or part of the units can be integrated together or can be independently realized. The processing element described herein may also be referred to as a processor and may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each unit above may be implemented by an integrated logic circuit of hardware in a processor element or in a form called by software through the processor element.
In one example, the units in the above apparatus may be one or more integrated circuits configured to implement the above method, such as: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.
As another example, when a unit in an apparatus may be implemented in the form of a processing element scheduler, the processing element may be a general-purpose processor, such as a CPU or other processor that may invoke a program. As another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
In one implementation, the means for implementing the respective corresponding steps of the above method by the above apparatus may be implemented in the form of a processing element scheduler. For example, the apparatus may include a processing element and a memory element, the processing element calling a program stored by the memory element to perform the method described in the above method embodiments. The memory elements may be memory elements on the same chip as the processing elements, i.e. on-chip memory elements.
In another implementation, the program for performing the above method may be in a memory element on a different chip than the processing element, i.e. an off-chip memory element. At this time, the processing element calls or loads a program from the off-chip storage element onto the on-chip storage element to call and execute the method described in the above method embodiment.
For example, the embodiments of the present application may also provide an apparatus, such as: an electronic device may include: a processor, a memory for storing instructions executable by the processor. The processor is configured to execute the above instructions, so that the electronic device implements the device discovery method according to the foregoing embodiment. The memory may be located within the electronic device or external to the electronic device. And the processor includes one or more.
In yet another implementation, the unit of the apparatus for implementing the steps of the method may be configured as one or more processing elements, and these processing elements may be disposed on the electronic device corresponding to the foregoing, where the processing elements may be integrated circuits, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these types of integrated circuits. These integrated circuits may be integrated together to form a chip.
For example, the embodiment of the present application also provides a chip, and the chip can be applied to the electronic device. The chip includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuitry to implement the methods described in the method embodiments above.
Embodiments of the present application further provide a computer program product, which includes computer instructions executed by the electronic device as described above.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in the form of software products, such as: and (5) programming. The software product is stored in a program product, such as a computer readable storage medium, and includes several instructions for causing a device (which may be a single chip, a chip, or the like) or a processor (processor) to perform all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various media capable of storing program codes.
For example, embodiments of the present application may also provide a computer-readable storage medium having stored thereon computer program instructions. The computer program instructions, when executed by the electronic device, cause the electronic device to implement a device discovery method as described in the aforementioned method embodiments.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A device discovery method, applied to a first electronic device, the method comprising:
the first electronic equipment displays a first interface, and the first interface comprises a first control; the first control is used for triggering the first electronic device to transmit a Bluetooth Low Energy (BLE) broadcast, and the transmission interval time of the BLE broadcast is configured as a first interval time;
the first electronic equipment receives a trigger operation of a user on the first control;
in response to the triggering operation, the first electronic device modifies the transmission interval time of the BLE broadcast from the first interval time to a second interval time, and transmits the BLE broadcast according to the second interval time for discovering connectable electronic devices.
2. The method according to claim 1, wherein the first electronic device modifies the transmission interval time of the BLE broadcast from the first interval time to a second interval time, comprising:
the first electronic equipment acquires equipment information of the first electronic equipment;
the first electronic equipment determines a first drive according to the equipment information of the first electronic equipment; the first driver is used for modifying the transmission interval time of the BLE broadcast from the first interval time to a second interval time.
3. The method of claim 1 or 2, wherein the first electronic device determining the first driver according to the device information of the first electronic device comprises:
the first electronic equipment determines an Application Program Interface (API) corresponding to the first drive according to the equipment information of the first electronic equipment and a preset corresponding relation;
and the first electronic equipment determines the first drive according to the API corresponding to the first drive.
4. The method according to any one of claims 1-3, further comprising:
the first electronic device receiving a BLE reply broadcast from a second electronic device;
the first electronic equipment displays the identification of the second electronic equipment;
the first electronic equipment receives a trigger operation of a user on the identifier of the second electronic equipment;
responding to the trigger operation of a user on the identifier of the second electronic equipment, and acquiring first channel information and second channel information by the first electronic equipment; the first channel information comprises channel information connected by the first electronic device, 2.4GHz channel information supported by the first electronic device and 5GHz channel information supported by the first electronic device; the second channel information comprises channel information connected with the second electronic device, 2.4GHz channel information supported by the second electronic device and 5GHz channel information supported by the second electronic device;
the first electronic equipment determines a first channel according to the first channel information and the second channel information; the first channel is a channel with a data transmission rate between the first electronic device and the second electronic device being greater than a preset threshold;
the first electronic device establishes a hotspot, and a channel corresponding to the hotspot is the first channel.
5. The method of claim 4, wherein in a case that the first electronic device is connected to 5ghz wi-Fi, the first channel is a channel to which the first electronic device is connected;
the first channel is a channel to which the second electronic device is connected when the first electronic device is not connected with 5GHz wi-Fi and the second electronic device is connected with 5GHz wi-Fi;
when the first electronic device and the second electronic device are not connected with 5GHz wi-Fi and the first electronic device and the second electronic device have commonly supported 5GHz channels, the first channel is a commonly supported 5GHz channel of the first electronic device and the second electronic device;
under the condition that the first electronic device is connected with 2.4GHz wi-Fi, the second electronic device is not connected with 5GHz wi-Fi, and the first electronic device and the second electronic device do not have commonly supported 5GHz channels, the first channel is a channel connected with the first electronic device;
under the condition that the first electronic device is not connected with a channel, the first electronic device and the second electronic device are not provided with a commonly supported 5GHz channel, and the second electronic device is connected with 2.4GHz wi-Fi, the first channel is a channel connected with the second electronic device;
when the first electronic device and the second electronic device are not connected with a channel, the first electronic device and the second electronic device do not have a commonly supported 5GHz channel, and the first electronic device and the second electronic device have a commonly supported 2.4GHz channel, the first channel is a commonly supported 2.4GHz channel of the first electronic device and the second electronic device;
and under the condition that the first electronic device and the second electronic device are not connected with a channel and the first electronic device and the second electronic device do not have a channel supported by the first electronic device, the first channel is a channel supported by the first electronic device.
6. The method according to claim 4 or 5, wherein the BLE reply broadcast comprises the second channel information.
7. The method according to any one of claims 4-6, wherein the first control is a screen-casting control, and the screen-casting control is configured to trigger the first electronic device to send data corresponding to the first interface to the second electronic device, and the method further includes:
the first electronic equipment sends the information of the hot spot to the second electronic equipment; the information of the hotspot comprises information of the first channel;
the first electronic device receives a connection establishment message from the second electronic device, wherein the connection establishment message is used for indicating the second electronic device to access the hotspot;
and the first electronic equipment sends the data corresponding to the first interface to the second electronic equipment.
8. The method of claim 3, wherein the device information of the first electronic device comprises a Vendor Identification (VID) of a Wi-Fi chip module included in the first electronic device.
9. The method of any of claims 1-8, wherein the second interval time is less than the first interval time.
10. An electronic device, comprising a processor, a memory for storing processor-executable instructions; the processor is configured to, when executing the instructions, cause the electronic device to carry out the method of any one of claims 1 to 9.
11. A computer readable storage medium having stored thereon computer program instructions; it is characterized in that the preparation method is characterized in that,
the computer program instructions, when executed by an electronic device, cause the electronic device to implement the method of any of claims 1 to 9.
CN202111551273.1A 2021-12-17 2021-12-17 Device discovery method and electronic device Active CN115022853B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111551273.1A CN115022853B (en) 2021-12-17 2021-12-17 Device discovery method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111551273.1A CN115022853B (en) 2021-12-17 2021-12-17 Device discovery method and electronic device

Publications (2)

Publication Number Publication Date
CN115022853A true CN115022853A (en) 2022-09-06
CN115022853B CN115022853B (en) 2023-04-18

Family

ID=83064826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111551273.1A Active CN115022853B (en) 2021-12-17 2021-12-17 Device discovery method and electronic device

Country Status (1)

Country Link
CN (1) CN115022853B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104812094A (en) * 2015-04-21 2015-07-29 广东欧珀移动通信有限公司 Method and apparatus for establishing connection between devices
CN106792448A (en) * 2016-12-14 2017-05-31 北京小米移动软件有限公司 Bluetooth connecting method and device, system
CN108476533A (en) * 2015-11-19 2018-08-31 三星电子株式会社 Wireless communications method and the electronic equipment that the wireless communications method is provided
CN108769971A (en) * 2018-07-03 2018-11-06 森美嘉(深圳)医疗健康科技发展有限公司 A kind of bluetooth equipment control method and bluetooth equipment
CN112823554A (en) * 2018-10-12 2021-05-18 三星电子株式会社 Electronic device for determining P2P operation channel and method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104812094A (en) * 2015-04-21 2015-07-29 广东欧珀移动通信有限公司 Method and apparatus for establishing connection between devices
CN108476533A (en) * 2015-11-19 2018-08-31 三星电子株式会社 Wireless communications method and the electronic equipment that the wireless communications method is provided
CN106792448A (en) * 2016-12-14 2017-05-31 北京小米移动软件有限公司 Bluetooth connecting method and device, system
CN108769971A (en) * 2018-07-03 2018-11-06 森美嘉(深圳)医疗健康科技发展有限公司 A kind of bluetooth equipment control method and bluetooth equipment
CN112823554A (en) * 2018-10-12 2021-05-18 三星电子株式会社 Electronic device for determining P2P operation channel and method thereof

Also Published As

Publication number Publication date
CN115022853B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN111372325B (en) Method and device for establishing Wi-Fi point-to-point connection
JP6784306B2 (en) Communication device and communication method
CN110320811B (en) Access method of intelligent household equipment and electronic equipment
EP3893109B1 (en) Method and device for connecting bluetooth devices
WO2021037250A1 (en) Network access method and apparatus for wireless local area network (wlan)
WO2021051986A1 (en) Method for establishing connection between apparatuses, and electronic device
WO2021077830A1 (en) Bluetooth communication method, and apparatus and device with bluetooth communication function
CN111010693B (en) Method for providing wireless fidelity network access service and electronic equipment
CN114390501B (en) Data transmission method and electronic equipment
EP4247031A1 (en) Access method and system and electronic device
US20240073978A1 (en) Method for monitoring link and terminal device
CN115022853B (en) Device discovery method and electronic device
WO2023071993A1 (en) Bluetooth pairing method, device, system, and storage medium
CN116054870B (en) Wireless communication circuit, bluetooth communication switching method and electronic equipment
CN112448964A (en) Device discovery method and P2P device
CN112469014A (en) Method and electronic equipment for configuring Bluetooth connection parameters
JP2013150282A (en) Wireless base station device, wireless terminal and wireless transmission system
CN115022872B (en) Data transmission method, electronic equipment and readable storage medium
CN116405631A (en) Screen sharing method, terminal and storage medium
WO2022057521A1 (en) Method and devices for configuring device
WO2023051204A1 (en) Cross-device connection method, electronic device and storage medium
WO2022052760A1 (en) Combined loudspeaker box configuration method, loudspeaker box, and electronic device
WO2024093597A1 (en) Method for configuring a plurality of devices, device, and system
WO2022194220A1 (en) Iot device configuration method and iot device
WO2024001443A1 (en) Transmission power limiting method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant