A communication system, device connection method and electronic device
By detecting changes in device screen capacitance parameters and preset actions, the system automatically identifies when a device is close and initiates request and response messages, solving the problem of cumbersome connection operations between devices and achieving efficient connection without manual selection, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI DEVICE CO LTD
- Filing Date
- 2024-11-30
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the connection between devices requires manual selection by the user, which is cumbersome and results in a poor user experience.
By detecting changes in the capacitance parameters of the device screen and preset actions, the system automatically identifies when a device is close and initiates request and response messages, enabling connections between devices without the need for manual selection.
It improved the efficiency of device connectivity, enhanced the user experience, and simplified the operation process.
Smart Images

Figure CN122138286A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a communication system, a device connection method, and an electronic device. Background Technology
[0002] To facilitate cross-system and cross-device operations and multi-device collaboration, such as multi-screen collaboration or screen casting, are becoming increasingly popular. Currently, both multi-screen collaboration and screen casting require users to manually select the target device for collaboration or casting. For example, if a user wants to cast a video from their phone to a TV, they need to tap the "cast" button on their phone. The phone then responds by displaying a list of available devices, from which the user can select the TV. The phone then sends a connection request to the selected TV and establishes a connection. This method is cumbersome and provides a poor user experience. Summary of the Invention
[0003] This application provides a communication system, a device connection method, and an electronic device to improve the efficiency of establishing connections between different devices.
[0004] In a first aspect, this application provides a communication system comprising a first electronic device and a second electronic device. Specifically, the second electronic device is configured to issue a first request message when a first condition is met, the first condition including detecting that a device is approaching the screen of the second electronic device; the first electronic device is configured to receive the request message and, when a second condition is met, reply to the electronic device with a first response message, the second condition including determining that the first electronic device is approaching the second electronic device; the second electronic device is further configured to establish a communication link with the first electronic device based on the first response message.
[0005] With the above technical solution, the first electronic device and the second electronic device can establish a connection without the user having to manually select the device. The second electronic device can send a request when it determines that a device is close to its screen, and the first electronic device can reply with a response message when it determines that it is close to the second electronic device. Thus, the two devices complete the device selection by the screen of the device that is close to it, and then establish a communication connection. This can improve the efficiency of establishing a communication connection between devices, and it can improve the user experience by eliminating the need for manual selection by the user.
[0006] In one possible design, the first electronic device is a mobile phone, and the second electronic device is a personal computer (PC), an in-vehicle terminal, or a tablet.
[0007] In one possible design, the first electronic device is a mobile terminal, such as a mobile phone or tablet.
[0008] In one possible design, the first condition may further include: a first preset application running in the foreground of the second electronic device. The first preset application may be a file management application, a gallery application, or a document application.
[0009] In one possible design, the second condition may further include: the account logged in on the first electronic device and the account logged in on the second electronic device are the same account. Confirming that the same account is logged in on different devices can improve the security of subsequent content transmission and protect user privacy.
[0010] In one possible design, the second condition may further include: a second preset application running in the foreground of the first electronic device. This second preset application may be a file management application, a gallery application, a document application, a navigation application, a music application, or a video application.
[0011] In one possible design, the second electronic device detects that a device is approaching the screen of the second electronic device, including:
[0012] The second electronic device determines that a device is approaching the screen of the second electronic device based on the change in the capacitance parameter of the screen.
[0013] The above technical solution can determine whether a device is approaching by observing changes in the screen's capacitance parameters, thereby identifying the proximity of the device.
[0014] In one possible design, determining that the first electronic device is near the second electronic device includes:
[0015] The first electronic device determines that the first electronic device has performed a preset action, and the distance between the first electronic device and the second electronic device is less than a set threshold. The preset action is an action that indicates that the first electronic device moves in front of the screen of the first electronic device and then stops. The first electronic device is used to capture images through a camera and determine that the screen of the second electronic device is in the image captured by the camera.
[0016] Through the above technical solution, the first electronic device can determine whether it is close to other devices by preset actions and the distance to the second electronic device or the image captured by the camera, and then complete the selection of the device after determining that the device is close.
[0017] In one possible design, the second electronic device establishes a communication link with the first electronic device based on the first response message:
[0018] After receiving the first response message, the second electronic device sends a link establishment request message to the first electronic device, which is used to request the establishment of a communication link with the first electronic device.
[0019] In one possible design, the second electronic device detects that a device is approaching the screen of the second electronic device, including:
[0020] The second electronic device detects that a device is approaching an area on the screen of the second electronic device where content can be shared.
[0021] Through the above technical solution, the second electronic device can determine that a device is close to its screen when it detects that another device is close to an area on its screen where content can be shared. This allows the device to be selected and connected when the user's intention to share content is strong in a content sharing scenario.
[0022] In one possible design, the second electronic device sends a connection establishment request message to the first electronic device, including:
[0023] When the second electronic device meets the first set condition, it sends a connection establishment request message to the first electronic device. The first set condition includes at least one of the following: the first response message carries a first flag bit, which is used to indicate that the first electronic device has content that can be shared with the second electronic device; or the second electronic device has content that can be shared with the first electronic device.
[0024] The above technical solution allows for initiating a connection request when an electronic device has content to share with other electronic devices, thus improving the success rate of device connection establishment.
[0025] In one possible design, the first response message is a chain establishment request message.
[0026] The second electronic device establishes a communication link with the first electronic device according to the first response message, including:
[0027] The second electronic device establishes a communication link with the first electronic device based on the link establishment request message.
[0028] In this application, the first electronic device can initiate a chain establishment request to the second electronic device, and the second electronic device can also initiate a chain establishment request to the first electronic device.
[0029] In one possible design, the second electronic device establishes a communication link with the first electronic device based on the link establishment request message:
[0030] When the second electronic device meets the second set condition, it establishes a communication link with the first electronic device according to the link establishment request message. The second set condition includes at least one of the following: the first request message carries a second flag bit, which is used to indicate that the second electronic device has content that can be shared with the first electronic device; or the first electronic device has content that can be shared with the second electronic device.
[0031] Secondly, this application also provides a communication system, which includes a first electronic device and a second electronic device. Specifically, the first electronic device is configured to send a second request message when a third condition is met, the third condition including the first electronic device determining that the first electronic device is near the second electronic device; the second electronic device is configured to receive the second request message and, when a fourth condition is met, reply to the first electronic device with a second response message, the fourth condition including detecting that a device is near the screen of the second electronic device; the first electronic device is configured to establish a communication link with the second electronic device according to the second response message.
[0032] Using the above technical solution, the first electronic device can send a request when it determines that it is close to the screen of another device. After receiving the request, the second electronic device can establish a communication link with the first electronic device if it determines that a device is close to its screen. This method eliminates the need for the user to manually select a device; device selection and connection are completed simply by determining the proximity of the device.
[0033] In one possible design, the first electronic device determines that it is near the second electronic device, including:
[0034] The first electronic device determines that it has performed a preset action, and the distance between the first electronic device and the second electronic device is less than a set threshold. The preset action is an action that indicates that the first electronic device moves forward and then stops.
[0035] In one possible design, the second electronic device detects that a device is approaching the screen of the second electronic device, including:
[0036] The second electronic device determines that a device is approaching the screen of the second electronic device based on the change in the capacitance parameter of the screen.
[0037] In one possible design, the second electronic device detects that a device is approaching the screen of the second electronic device, including:
[0038] The second electronic device detects that a device is approaching an area on the screen of the second electronic device where content can be shared.
[0039] In one possible design, the first electronic device establishes a communication link with the second electronic device based on the second response message, including:
[0040] After receiving the second response message, the first electronic device sends a link establishment request message to the second electronic device, which is used to request the establishment of a communication link with the second electronic device.
[0041] In one possible design, the first electronic device sends a connection establishment request message to the second electronic device, including:
[0042] When the first electronic device meets a third preset condition, it sends a connection establishment request message to the second electronic device. The third preset condition includes at least one of the following:
[0043] The first electronic device has content that can be shared with the second electronic device; or the second response message carries a second flag bit, which is used to indicate that the second electronic device has content that can be shared with the first electronic device.
[0044] In one possible design, the second response message is a chain establishment request message;
[0045] The first electronic device establishes a communication link with the second electronic device according to the second response message, including:
[0046] The first electronic device establishes a communication link with the second electronic device based on the link establishment request message.
[0047] In one possible design, the first electronic device establishes a communication link with the second electronic device based on the link establishment request message, including:
[0048] When the fourth preset condition is met, the first electronic device establishes a communication link with the second electronic device according to the link establishment request message, wherein the fourth preset condition includes at least one of the following:
[0049] The second request message carries a first flag bit, which is used to indicate that the first electronic device has content that can be shared with the second electronic device; or the second electronic device has content that can be shared with the first electronic device.
[0050] Thirdly, this application provides a device connection method applied to a first electronic device. Specifically, the method may include: the first electronic device receiving a first request message, and, upon meeting a second condition, replying to a second electronic device with a first response message, the second condition including determining that the first electronic device is near the second electronic device, the first request message being sent by the second electronic device upon meeting the first condition, the first condition including detecting that a device is near the screen of the second electronic device; and the first electronic device establishing a communication link with the second electronic device.
[0051] In one possible design, the second condition further includes: the account logged in on the first electronic device and the account logged in on the second electronic device are the same account.
[0052] In one possible design, the first electronic device determines that it is near the second electronic device, including:
[0053] The first electronic device determines that it has performed a preset action, and the distance between the first electronic device and the second electronic device is less than a set threshold. The preset action is an action that indicates that the first electronic device moves forward and then stops.
[0054] Fourthly, this application also provides a device connection method, which is applied to a second electronic device. Specifically, the method may include: when the second electronic device meets a first condition, it sends a first request message, the first condition including detecting that a device is approaching the screen of the second electronic device; the second electronic device receives a first response message sent by a first electronic device, the first response message being sent by the first electronic device after receiving the first request message and meeting a second condition, the second condition including determining that the first electronic device is approaching the second electronic device; and the second electronic device establishes a communication link with the first electronic device based on the first response message.
[0055] In one possible design, the first condition further includes: the first application is running in the foreground of the second electronic device.
[0056] In one possible design, the second electronic device establishes a communication link with the first electronic device based on the first response message, including:
[0057] After receiving the first response message, the second electronic device sends a link establishment request message to the first electronic device, which is used to request the establishment of a communication link with the first electronic device.
[0058] In one possible design, the second electronic device detects that a device is approaching the second electronic device, including:
[0059] The second electronic device detects that a device is approaching an area on the screen of the second electronic device where content can be shared.
[0060] In one possible design, the second electronic device sends a connection establishment request message to the first electronic device, including:
[0061] When the second electronic device meets the first set condition, it sends a connection establishment request message to the first electronic device. The first set condition includes at least one of the following: the first response message carries a first flag bit, which is used to indicate that the first electronic device has content that can be shared with the second electronic device; or the second electronic device has content that can be shared with the first electronic device.
[0062] In one possible design, the first response message is a chain establishment request message;
[0063] The second electronic device establishes a communication link with the first electronic device according to the first response message, including:
[0064] The second electronic device establishes a communication link with the first electronic device based on the link establishment request message.
[0065] In one possible design, the second electronic device establishes a communication link with the first electronic device based on the link establishment request message, including:
[0066] When the second electronic device meets the second set condition, it establishes a communication link with the first electronic device according to the link establishment request message. The second set condition includes at least one of the following: the first request message carries a second flag bit, which is used to indicate that the second electronic device has content that can be shared with the first electronic device; or the first electronic device has content that can be shared with the second electronic device.
[0067] Fifthly, this application also provides a device connection method applied to a first electronic device. Specifically, the method may include: the first electronic device sending a second request message when a third condition is met, the third condition including the first electronic device determining that the first electronic device is near a second electronic device; the first electronic device receiving a second response message sent by the second electronic device, the second response message being a reply from the second electronic device after receiving the second request message and when a fourth condition is met, the fourth condition including detecting that a device is near the screen of the second electronic device; and then, the first electronic device establishing a communication link with the second electronic device based on the second response message.
[0068] In one possible design, the first electronic device establishes a communication link with the second electronic device based on the second response message, including:
[0069] After receiving the second response message, the first electronic device sends a link establishment request message to the second electronic device, which is used to request the establishment of a communication link with the second electronic device.
[0070] In one possible design, the first electronic device sends a connection establishment request message to the second electronic device, including:
[0071] When the first electronic device meets a third preset condition, it sends a connection establishment request message to the second electronic device. The third preset condition includes at least one of the following:
[0072] The first electronic device has content that can be shared with the second electronic device; or the second response message carries a second flag bit, which is used to indicate that the second electronic device has content that can be shared with the first electronic device.
[0073] In one possible design, the second response message is a chain establishment request message;
[0074] The first electronic device is specifically used to establish a communication link with the second electronic device according to the second response message in the following manner:
[0075] The first electronic device establishes a communication link with the second electronic device based on the link establishment request message.
[0076] In one possible design, the first electronic device establishes a communication link with the second electronic device based on the link establishment request message, including:
[0077] When the fourth set condition is met, the first electronic device establishes a communication link with the second electronic device according to the link establishment request message. The fourth set condition includes at least one of the following: the second request message carries a first flag bit, which is used to indicate that the first electronic device has content that can be shared with the second electronic device; or the second electronic device has content that can be shared with the first electronic device.
[0078] Sixthly, this application also provides a device connection method applied to a second electronic device. Specifically, the method may include: the second electronic device receiving a second request message, and, upon satisfying a fourth condition, replying to a first electronic device with a second response message, the fourth condition including detecting that a device is approaching the screen of the second electronic device; the second request message being sent by the first electronic device upon satisfying a third condition, the third condition including the first electronic device determining that it is approaching the second electronic device; and the second electronic device establishing a communication link with the first electronic device.
[0079] In one possible design, the second electronic device detects that a device is approaching the screen of the second electronic device, including:
[0080] The second electronic device determines that a device is approaching the screen of the second electronic device based on the change in the capacitance parameter of the screen.
[0081] In one possible design, the second electronic device detects that a device is approaching the screen of the second electronic device, including:
[0082] The second electronic device detects that a device is approaching an area on the screen of the second electronic device where content can be shared.
[0083] In a seventh aspect, this application provides an electronic device, the electronic device including a processor; a memory and one or more computer programs; wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the methods described in the third aspect and any possible design of the third aspect.
[0084] Eighthly, this application provides an electronic device, the electronic device including a processor; a memory and one or more computer programs; wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the methods described in the fourth aspect and any possible design of the fourth aspect.
[0085] Ninthly, this application provides an electronic device, the electronic device including a processor; a memory and one or more computer programs; wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the methods described in the fifth aspect and any possible design of the fifth aspect.
[0086] In a tenth aspect, this application provides an electronic device, the electronic device including a processor; a memory and one or more computer programs; wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the methods described in the sixth aspect and any possible design of the sixth aspect.
[0087] Eleventhly, this application also provides a computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the methods of the third to sixth aspects and any possible design of the third to sixth aspects.
[0088] In a twelfth aspect, this application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the methods of the third to sixth aspects and any possible design of the first to sixth aspects.
[0089] For the various aspects of the above-mentioned third to twelfth aspects and the technical effects that each aspect may achieve, please refer to the above description of the technical effects that various possible solutions for the first and second aspects may achieve, which will not be repeated here. Attached Figure Description
[0090] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0091] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0092] Figure 3 A schematic diagram illustrating capacitance changes on a screen, provided as an embodiment of this application;
[0093] Figure 4 A user interface diagram provided for an embodiment of this application;
[0094] Figure 5 A flowchart illustrating a device connection method provided in this application embodiment;
[0095] Figure 6 A user interface diagram provided for an embodiment of this application;
[0096] Figure 7 A user interface diagram provided for an embodiment of this application;
[0097] Figure 8 A flowchart illustrating a device connection method provided in this application embodiment;
[0098] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0099] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0100] For example, such as Figure 1 The diagram shown is an application scenario illustration provided by an embodiment of this application. (See attached image.) Figure 1 As shown, this application scenario may include a first electronic device 10 and a second electronic device 20. The first electronic device 10 or the second electronic device 20 may be, but is not limited to, mobile phones, tablets, desktop computers, laptops, handheld computers, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, and other electronic devices with displays. Furthermore, the operating system installed on the first electronic device 10 or the second electronic device 20 may include, but is not limited to, […]. Or other operating systems.
[0101] It should be understood that Figure 1 The first electronic device 10 is illustrated using a mobile phone as an example, and the second electronic device 20 is illustrated using a PC as an example. In practical applications, it can also be other electronic devices.
[0102] In some embodiments, the first electronic device 10 can act as the initiator of multi-device collaboration, initiating a connection request to the second electronic device 20; the second electronic device 20 can act as the receiver of multi-device collaboration, receiving the connection request initiated by the first electronic device 10. Alternatively, the second electronic device 20 can also act as the initiator of multi-device collaboration, initiating a connection request to the first electronic device 10; and the first electronic device 10 can act as the receiver of multi-device collaboration, receiving the connection request initiated by the second electronic device 20. That is, in the embodiments of this application, either the first electronic device 10 or the second electronic device 20 can act as either the initiator or the receiver of multi-device collaboration. For example, if the first electronic device 10 is a mobile phone and the second electronic device 20 is a laptop computer, the mobile phone can act as the initiator, initiating a connection request to the laptop computer; the mobile phone can also act as the receiver, with the laptop computer initiating a connection request to the mobile phone.
[0103] In some embodiments, a user can move the first electronic device 10 closer to the display screen of the second electronic device 20. When the second electronic device 20 determines that a device is near its display screen, it can send a request message. Correspondingly, the first electronic device 10 can receive the request message from the second electronic device 20. When the first electronic device 10 determines that the device near it is the second electronic device 20, it can reply with a response message to the second electronic device 20. After receiving the response message from the first electronic device 10, the second electronic device 20 can send a connection request message to the first electronic device 10. Then, the first electronic device 10 can establish a communication connection with the second electronic device 20. Of course, when the first electronic device 10 determines that the device near it is the second electronic device 20, it may not reply with a response message to the second electronic device 20 and may directly initiate a connection request message to the second electronic device 20; this application does not limit this approach.
[0104] It should be understood that the request message in this application embodiment can be sent in the form of broadcast, such as Bluetooth broadcast. Similarly, the response message can also be sent in the form of broadcast. Of course, the response message can also be in other forms, such as WiFi action frame (WiFi behavior frame) message, which is not limited in this application.
[0105] In other embodiments, a user can move the first electronic device 10 closer to the display screen of the second electronic device 20. Once the first electronic device 10 determines that it is close to the display screen of the second electronic device 20, it can send a request message. Correspondingly, the second electronic device 20 can receive the request message from the first electronic device 10. Once the second electronic device 20 determines that the first electronic device 10 is close to its own display screen, it can initiate a connection request message to the first electronic device 10. Alternatively, after the second electronic device 10 determines that the first electronic device 10 is close to its own display screen, the second electronic device 20 can also reply with a response message to the first electronic device 10. Then, after receiving the response message, the first electronic device 10 can then initiate a connection request message to the second electronic device 20. This application does not limit this approach.
[0106] Optionally, the first electronic device 10 and the second electronic device 20 can establish a connection via wired or wireless communication technology. For example, wireless communication technologies may include, but are not limited to, Bluetooth (BT), Starlink, near field communication (NFC), wireless local area networks (WLANs) (such as Wireless Fidelity (Wi-Fi) networks), Zigbee, frequency modulation (FM), and infrared (IR).
[0107] For example, Figure 2 A schematic diagram of an electronic device according to an embodiment of this application is shown. This electronic device can be as described above. Figure 1 The first electronic device 10 in the application scenario shown can also be the one described above. Figure 1 The second electronic device 20 in the application scenario shown. For example... Figure 2 As shown, the electronic device 100 may include a processor 110, a memory 120, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a camera 191, a display screen 192, etc.
[0108] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has recently used or is repeatedly used. If processor 110 needs to reuse an instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.
[0109] The memory 120 can be used to store computer executable program code, which includes instructions. The memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc. The data storage area may store data created during the use of the electronic device 400, etc. Furthermore, the memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 400 by running instructions stored in the memory 120 and / or instructions stored in memory disposed in the processor.
[0110] USB interface 130 is a USB standard compliant interface, specifically a Mini USB interface, Micro USB interface, USB Type-C interface, etc. USB interface 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. Charging management module 140 receives charging input from the charger. Power management module 141 connects battery 142, charging management module 140, and processor 110. Power management module 141 receives input from battery 142 and / or charging management module 140, providing power to processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.
[0111] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0112] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0113] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including WLAN (such as Wi-Fi networks), BT, Starflash technology, Global Navigation Satellite System (GNSS), FM, NFC, IR, etc. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0114] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), the fifth generation (5G) mobile communication system, future communication systems such as the sixth generation (6G) system, BT, GNSS, WLAN, NFC, FM and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0115] Electronic device 100 can implement audio functions through audio module 170, such as speakers, receivers, microphones, headphone jacks, and application processors. Examples include music playback and recording.
[0116] The sensor module 180 may include one or more sensors that can be used by the electronic device 100 to determine whether a display screen of another electronic device is nearby, or to determine whether another electronic device is nearby. For example, these one or more sensors may include one or more of a pressure sensor 180A, a gyroscope sensor 180B, an accelerometer sensor 180C, etc.
[0117] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A may be disposed on display screen 192; in other embodiments, pressure sensor 180A may also be disposed in other locations, such as the frame of electronic device 400. In some embodiments of this application, pressure sensor 180A can be used to detect whether pressure is applied to electronic device 100 to determine whether a scenario of handheld electronic device 100 is occurring.
[0118] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of the electronic device 400 about three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor 180B.
[0119] Accelerometer 180C can detect the magnitude of acceleration of electronic device 100 in various directions (generally three axes). In some embodiments of this application, gyroscope sensor 180B and accelerometer 180C can be used to detect whether electronic device 100 is in motion, and thus to determine whether electronic device 100 is near a display screen with other electronic devices.
[0120] It should be understood that Figure 2 The sensors shown are for illustrative purposes only. In actual applications, electronic device 100 may include more or fewer sensors or different types of sensors to sense whether electronic device 100 is near a display screen with other electronic devices, or whether other electronic devices are near a display screen with electronic device 100.
[0121] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 400 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0122] Camera 191 is used to capture still images or videos. Camera 191 may include a front-facing camera and a rear-facing camera. In this embodiment, camera 191 can acquire images to determine whether the device near the first electronic device 10 is a device with a screen.
[0123] The display screen 192 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a minimized LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 192, where N is a positive integer greater than 1. In this embodiment, the display screen 192 can be used to display application interfaces, etc.
[0124] Optionally, the display screen 192 can be various types of touch screens, such as capacitive touch screens, infrared touch screens, and acoustic wave touch screens. In some embodiments of this application, the display screen 192 can be used to determine whether other electronic devices are near the electronic device 100. As one possible implementation, when other electronic devices approach the display screen 192 of the electronic device 100, the detection parameters corresponding to the display screen 192 can change, thereby determining that other electronic devices are near the display screen 192 of the electronic device 100. For example, assuming that the display screen 192 of the electronic device 100 is a capacitive touch screen, the detection parameters corresponding to the display screen 192 can include capacitance, voltage, current, etc. When other electronic devices approach the display screen 192 of the electronic device 100, the capacitance corresponding to the display screen 192 will change.
[0125] Understandable Figure 2 The illustrated structure does not constitute a specific limitation on the first electronic device 10 or the second electronic device 20. The first electronic device 10 or the second electronic device 20 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0126] The technical solution of the embodiments of this application will be described below using a first electronic device 10 as the first electronic device and a second electronic device 20 as the second electronic device as an example. In the embodiments of this application, the request message can be initiated by the first electronic device 10 (for example, the request message can be a proximity broadcast), or the request message can be initiated by the second electronic device 20. The device connection method of this application will be described below using two different devices initiating request messages.
[0127] Scenario 1: The second electronic device 20 initiates a request message
[0128] Based on the request message issued by the second electronic device 20, scenario 1 can be further subdivided according to the different devices that initiate the chain establishment request. Specifically, it can be divided into the following situations:
[0129] Scenario 1: The second electronic device 20 initiates a connection establishment request.
[0130] Option A: In some embodiments, a user moves the first electronic device 10 closer to the display screen of the second electronic device 20. The display screen of the second electronic device 20 can detect a change in screen parameters (e.g., capacitance parameters) and determine that a device is approaching its display screen. At this time, it can send a request message. Correspondingly, the first electronic device 10 can receive the request message sent by the second electronic device 20 and determine whether it is itself approaching the second electronic device 20. If it determines that it is approaching the second electronic device 20, it replies with a response message to the second electronic device 20 (this response message can be a wireless broadcast). After receiving the response message, the second electronic device 20 can initiate a connection establishment request to the first electronic device 10. It should be understood that after the second electronic device 20 initiates a connection establishment request to the first electronic device 10, the first electronic device 10 can reply with a response message agreeing to establish a connection, thus enabling the second electronic device 20 to establish a connection with the first electronic device 10.
[0131] Optionally, the request message may carry the change value of screen parameters (e.g., the change value of capacitance parameters), the time when the screen parameters changed, and the time difference between the time the screen parameters changed and the time the request message was sent (e.g., the time difference between the time the capacitance changed and the time the request message was sent is 100ms). Optionally, the request message may also carry specific area information of the display screen of the first electronic device 10 near the second electronic device 20, account information, etc.
[0132] Optionally, the response message can be in the form of a broadcast, such as a Bluetooth broadcast or a star broadcast.
[0133] Optionally, the display screen of the second electronic device 20 detects a change in screen parameters (e.g., capacitance parameters), determines that a device is approaching its display screen, and can also determine the shape of the object approaching its display screen. For example, the object shape can be determined based on the capacitance value distribution map of a specific location on the display screen of the first electronic device 10 approaching the second electronic device 20. For example, the detected capacitance data of the display screen can be input into a preset model, and the recognition result can be output through the preset model. Of course, the object shape can also be determined in other ways, and this application does not limit this.
[0134] It should be understood that "the first electronic device 10 is close to the display screen of the second electronic device 20" means that the distance between the first electronic device 10 and the display screen of the second electronic device 20 is less than or equal to a certain threshold. In this application, "close" may include the first electronic device 10 contacting the screen of the second electronic device 20 or the first electronic device 10 and the screen of the second electronic device 20 being x (x is greater than 0) centimeters apart.
[0135] As one possible implementation, the first electronic device 10 can determine whether it is approaching the second electronic device 20 based on its own state and parameters such as its distance from the second electronic device 20. Specifically, if the first electronic device 10 is in a handheld hovering state and the distance between the first electronic device 10 and the second electronic device 20 is less than a set threshold, then it can be determined that the first electronic device 10 is approaching the display screen of the second electronic device 20. It should be understood that the handheld hovering state refers to a state in which a preset action occurs. This preset action can be the action of the first electronic device 10 moving in front of the screen of the first electronic device 10 and then stopping, such as the action of a mobile phone moving in front of the screen of a mobile phone and then stopping.
[0136] The handheld hovering state includes the state within a preset time period before and after the first electronic device 10 receives the request message (i.e., whether a preset action occurs within the preset time period before and after the first electronic device 10 receives the request message). For example, assuming the time when the first electronic device 10 receives the request message is t1, it can be determined whether a preset action occurs within the preset time period before t1 (e.g., 3 seconds), i.e., the time period (t1-3), or it can be determined whether a preset action occurs within the preset time period after t1 (e.g., 3 seconds), i.e., the time period (t1+3).
[0137] Alternatively, the handheld hovering state can also include the state during the time period between when the screen parameters of the second electronic device 20 change and when the first electronic device 10 receives the request message. For example, the state of the first electronic device 10 during this time difference can be determined by subtracting the capacitance change time (the time when the screen parameters change) carried in the request message from the current time.
[0138] Whether the distance between the first electronic device 10 and the second electronic device 20 is less than a set threshold can be determined by ranging. For example, after receiving a request message, the first electronic device 10 can determine the distance between itself and the second electronic device 20 based on the difference between the received signal strength indicator (RSSI) of the received request message and the RSSI of the second electronic device 20 when it sent the request message. Then, the distance between the first electronic device 10 and the second electronic device 20 is compared with a set threshold to determine if it is less than the set threshold. Alternatively, after receiving a request message, the first electronic device 10 can initiate an ultrasonic ranging request message to the second electronic device 20. Upon receiving the ultrasonic ranging request message, the second electronic device 20 can emit an ultrasonic ranging signal, and then the first electronic device 10 performs ranging based on the ultrasonic ranging signal. Alternatively, after receiving a request message, the first electronic device 10 can initiate a satellite stroboscopic ranging request message to the second electronic device 20. Upon receiving the satellite stroboscopic ranging request message, the second electronic device 20 can emit a satellite stroboscopic ranging signal, and then the first electronic device 10 performs ranging based on the satellite stroboscopic ranging signal. Of course, the distance between the first electronic device 10 and the second electronic device 20 can also be measured in other ways, and this application does not specifically limit this.
[0139] The above process will be described using a mobile phone as the first electronic device 10 and a PC as the second electronic device 20 as an example. For example, as shown... Figure 3 As shown, suppose a user holds a mobile phone and moves it closer to the PC screen. The PC screen's capacitance will change (capacitance data can be found in [reference needed]). Figure 3 The diagram shows different patterns representing different capacitance values (area 1 in the diagram represents the area of capacitance change). When the PC senses a capacitance change, it can determine that a device is approaching its screen and then send a request message. The mobile phone receives the request message from the PC, determines the distance between itself and the PC based on the request message, and checks whether its state is hovering. If the mobile phone determines that the distance between itself and the PC screen is less than a threshold and the mobile phone is in a hovering state, it can determine that it is approaching the PC and then reply with a response message to the PC. After receiving the response message, the PC can initiate a connection request to the mobile phone.
[0140] Option B: In some embodiments, the user moves the first electronic device 10 closer to the display screen of the second electronic device 20. The display screen of the second electronic device 20 can detect a change in screen parameters (e.g., capacitance parameters) and determine that a device is approaching its display screen. At this time, it can send a request message. Correspondingly, the first electronic device 10 can receive the request message from the second electronic device 20, then turn on its own camera (e.g., a rear camera), capture an image through the camera, and then determine whether the image captured by the camera contains a screen. If the image captured by the camera contains a screen, it replies with a response message to the second electronic device 20. After receiving the response message, the second electronic device 20 can initiate a connection establishment request to the first electronic device 10. It should be understood that after the second electronic device 20 initiates a connection establishment request to the first electronic device 10, the first electronic device 10 can reply with a response message agreeing to establish a connection, thus enabling the second electronic device 20 to establish a connection with the first electronic device 10.
[0141] Continuing with the example of a mobile phone as the first electronic device 10 and a PC as the second electronic device 20. For example... Figure 4 As shown, the user holds the phone and moves it close to the PC screen. The PC screen senses the change in capacitance, confirming the presence of a device, and then sends a request message. The phone receives the request message from the PC, activates its camera to capture an image, for example... Figure 4 The image capture screen shown in the diagram indicates that if the camera captures an image of the PC's screen, it can send a response message to the PC. Upon receiving the response message, the PC can then initiate a connection request to the mobile phone.
[0142] In other words, in scenario 1, the first electronic device 10 can determine whether to reply to the second electronic device 20 using two different methods, Scheme A and Scheme B; the second electronic device 20 determines whether a device is approaching by detecting changes in screen parameters, and then sends a request message. For the specific implementation of the same steps in Scheme A and Scheme B, please refer to the detailed description in Scheme A, which will not be repeated here.
[0143] Scenario 2: The first electronic device 10 initiates a chain establishment request.
[0144] Option A: In some embodiments, a user moves the first electronic device 10 closer to the display screen of the second electronic device 20. The display screen of the second electronic device 20 can detect a change in screen parameters (e.g., capacitance parameters) and determine that a device is approaching its display screen. At this time, it can send a request message. Correspondingly, the first electronic device 10 can receive the request message from the second electronic device 20 and determine whether it is itself approaching the display screen of the second electronic device 20. If it determines that it is approaching the display screen of the second electronic device 20, it directly initiates a connection establishment request to the second electronic device 20. It should be understood that after the first electronic device 10 initiates a connection establishment request to the second electronic device 20, the second electronic device 20 can reply with a response message agreeing to establish a connection, thus enabling the first electronic device 10 to establish a connection with the second electronic device 20.
[0145] Taking a mobile phone as the first electronic device 10 and a PC as the second electronic device 20 as an example, the user holds the mobile phone and moves it closer to the PC screen. After the PC screen senses the change in capacitance, it determines that a device is approaching its screen and can then send a request message. The mobile phone receives the request message from the PC, determines the distance between itself and the PC based on the request message, and determines whether its state is hovering. If the mobile phone determines that the distance between itself and the PC screen is less than a threshold and the mobile phone is in a hovering state, it can determine that it is approaching the PC screen and can then directly initiate a connection request to the PC.
[0146] Option B: In some embodiments, the user moves the first electronic device 10 closer to the display screen of the second electronic device 20. The display screen of the second electronic device 20 can detect a change in screen parameters (e.g., capacitance parameters) and determine that a device is approaching its display screen. At this time, it can send a request message. Correspondingly, the first electronic device 10 can receive the request message sent by the second electronic device 20, then turn on its own camera (e.g., a rear camera), capture an image through the camera, and then determine whether the image captured by the camera contains a screen. If the image captured by the camera contains a screen, it can directly initiate a connection request to the second electronic device 20.
[0147] Continuing with the example of a mobile phone as the first electronic device 10 and a PC as the second electronic device 20, the user holds the mobile phone and moves it closer to the PC screen. After the PC screen senses the change in capacitance, it confirms that a device is near its screen and can then send a request message. The mobile phone receives the request message from the PC, turns on its camera, and if it confirms that the screen is in the image captured by the camera, it can directly initiate a connection request to the PC.
[0148] It should be understood that the difference between scenario 1 and scenario 2 in scenario 1 lies in the different initiators of the chain. For the specific implementation of scenario 2, please refer to the detailed introduction in scenario 1, which will not be repeated here.
[0149] Scenario 2: The first electronic device 10 initiates a request message
[0150] Based on the request message issued by the first electronic device 10, scenario 2 can be further subdivided according to the different devices that initiate the chain establishment request. Specifically, it can be divided into the following situations:
[0151] Scenario 1: The first electronic device 10 initiates a chain establishment request.
[0152] Option A: In some embodiments, the user moves the first electronic device 10 closer to the display screen of the second electronic device 20. The first electronic device 10 can determine whether it is itself that is close to the display screen of the second electronic device 20. If the first electronic device 10 determines that it is itself that is close to the display screen of the second electronic device 20, it sends a request message. Correspondingly, the second electronic device 20 can receive the request message sent by the first electronic device 10, detect whether the screen parameters (e.g., capacitance parameters) have changed, and if it is determined that the screen parameters have changed, it can determine that a device is close to its own display screen. Then, the second electronic device 20 can reply with a response message to the first electronic device 10. After receiving the response message, the first electronic device 10 can initiate a connection establishment request to the second electronic device 20. It should be understood that after the first electronic device 10 initiates a connection establishment request to the second electronic device 20, the second electronic device 20 can reply with a response message agreeing to establish a connection, thus enabling the second electronic device 20 to establish a connection with the first electronic device 10.
[0153] Taking a mobile phone as the first electronic device 10 and a PC as the second electronic device 20 as an example, when a user moves the mobile phone closer to the PC screen, the mobile phone detects its own status and parameters such as the distance from the PC to determine whether it is close to the PC screen. When the mobile phone determines that it is close to the PC screen, it can send a request message. Correspondingly, the PC can receive the request message sent by the mobile phone, detect changes in the screen's capacitance, and if it determines that a device is close to its screen, it can reply with a response message to the mobile phone. After receiving the response message, the mobile phone can initiate a connection request to the PC.
[0154] Option B: In some embodiments, the first electronic device 10 activates its camera to capture images. If the captured image contains a screen, it can send a request message. Correspondingly, the second electronic device 20 receives the request message from the first electronic device 10, detects whether screen parameters (e.g., capacitance parameters) have changed, and if a change is detected, it determines that a device is near its display screen. Then, the second electronic device 20 can reply with a response message to the first electronic device 10. After receiving the response message, the first electronic device 10 can initiate a connection request to the second electronic device 20.
[0155] Continuing with the example of a mobile phone as the first electronic device 10 and a PC as the second electronic device 20, the user opens the phone's camera, captures an image, and determines whether a screen is present in the captured image. If a screen is present in the captured image, a request message can be sent. Correspondingly, the PC receives the request message from the phone, detects changes in the screen's capacitance, and if it determines that a device is near its screen, it can reply with a response message to the phone. After receiving the response message, the phone can initiate a connection request to the PC.
[0156] Scenario 2: The second electronic device 20 initiates a connection establishment request.
[0157] Option A: In some embodiments, the user moves the first electronic device 10 closer to the display screen of the second electronic device 20. The first electronic device 10 can determine whether it is itself that is approaching the display screen of the second electronic device 20. If the first electronic device 10 determines that it is itself that is approaching the display screen of the second electronic device 20, it sends a request message. Correspondingly, the second electronic device 20 can receive the request message sent by the first electronic device 10, detect whether the screen parameters (e.g., capacitance parameters) have changed, and if it is determined that the screen parameters have changed, it can determine that a device is approaching its own display screen. Then, the second electronic device 20 can initiate a connection establishment request to the first electronic device 10. It should be understood that after the second electronic device 20 initiates a connection establishment request to the first electronic device 10, the first electronic device 10 can reply with a response message agreeing to establish a connection, thus enabling the second electronic device 20 to establish a connection with the first electronic device 10.
[0158] Taking a mobile phone as the first electronic device 10 and a PC as the second electronic device 20 as an example, when a user moves the mobile phone closer to the PC screen, the mobile phone detects its own status and parameters such as the distance from the PC to determine whether it is close to the PC screen. When the mobile phone determines that it is close to the PC screen, it can send a request message. Correspondingly, the PC can receive the request message sent by the mobile phone, detect the change in the screen's capacitance, and if it determines that a device is close to its screen, it can directly initiate a connection request to the mobile phone.
[0159] It should be understood that the execution steps for the second electronic device 20 to determine that a device is approaching its display screen and the first electronic device 10 to determine that it is approaching the display screen of another device are not limited in this embodiment. For example, if a user moves the first electronic device 10 so that it is close to the display screen of the second electronic device 20, the display screen of the second electronic device 20 can detect a change in screen parameters (e.g., capacitance parameters) and determine that a device is approaching its display screen. Then, the first electronic device 10 determines whether it is close to the display screen of the second electronic device 20. If it determines that it is close to the display screen of the second electronic device 20, it sends a request message. The second electronic device 20 can then receive the request message sent by the first electronic device 10 and initiate a connection request to the first electronic device 10.
[0160] Option B: In some embodiments, when the first electronic device 10 approaches the screen of the second electronic device 20, the first electronic device 10 can activate its camera to capture an image. If the image captured by the camera contains a screen, a request message can be sent. Correspondingly, the second electronic device 20 can receive the request message from the first electronic device 10, detect whether screen parameters (e.g., capacitance parameters) have changed, and if it is determined that the screen parameters have changed, it can determine that a device is approaching its display screen. Then, the second electronic device 20 can initiate a connection request to the first electronic device 10.
[0161] Continuing with the example of a mobile phone as the first electronic device 10 and a PC as the second electronic device 20, the user opens the mobile phone's camera, captures an image, and determines whether the captured image contains a screen. If the image captured by the camera contains a screen, a request message can be sent. Correspondingly, the PC can receive the request message sent by the mobile phone, detect changes in the screen's capacitance, and if it determines that a device is close to its own screen, it can directly initiate a connection request to the mobile phone.
[0162] Similarly, for Scheme B, when the first electronic device 10 approaches the screen of the second electronic device 20, the display of the second electronic device 20 can detect a change in screen parameters (e.g., capacitance parameters) and determine that a device is approaching its display. Then, the first electronic device 10 can determine from the image captured by its camera that it has approached the screen of another device, and at this point, it can send a request message. Accordingly, after receiving the request message, the second electronic device 20 can initiate a connection request to the first electronic device 10.
[0163] It should be understood that the difference between Scenario 1 and Scenario 2 lies in the device that initiates the request message. Within each scenario, the difference lies in the party initiating the connection establishment request.
[0164] Through the above embodiments, the first electronic device 10 and the second electronic device 20 can complete device selection and connection by bringing them close to the screen, avoiding the tedious operation of manually selecting devices when establishing a connection, realizing seamless interconnection and communication between devices, and improving the user experience.
[0165] The following example illustrates the implementation of scenario 1 above, using the data transmission process between a mobile phone and a PC as an example. For instance, as shown... Figure 5 The diagram shown is a flowchart of a device connection method provided in an embodiment of this application. (See attached diagram.) Figure 5 As shown, the method may include the following steps:
[0166] Step 501, PC determines that the first condition is met.
[0167] The first condition may include detecting that a device is near its screen.
[0168] Optionally, the first condition may also include the PC running a first preset application in the foreground. The first preset application may be a file management application, a gallery application, or a document application.
[0169] In some embodiments, when a device approaches the PC's display, the PC can detect a change in the display's screen parameters, such as a change in capacitance parameters, and then determine that a device is approaching its display based on the change in capacitance parameters. For example, a device can be determined to be approaching the PC screen when the change in capacitance parameters on the PC screen exceeds a set threshold.
[0170] In other embodiments, the PC can detect when a device is near an area of its screen where content can be shared. For example, such as... Figure 6 The diagram shown is a user interface illustration provided in an embodiment of this application. Figure 6 The diagram illustrates different areas on a PC screen. For example, the first area can be a region with content that can be shared (or transferred), while the second area can be a blank area.
[0171] One possible approach is to determine whether the phone is near a blank area or an area with shareable content on the PC screen by using the coordinates of a point on the PC screen where the phone is positioned. (Reference) Figure 3The diagram illustrates that when a mobile phone is brought close to a PC screen, the capacitance of region 1 on the PC screen changes. The coordinates of the center point of region 1, such as point A, can then be determined. It can be then determined whether point A's coordinates fall within an area with shareable content or a blank area. If point A's coordinates fall within an area with shareable content, the area where other devices are near the PC screen is designated as the first region (area with shareable content). If point A's coordinates fall within a blank area, the area where other devices are near the PC screen is designated as the second region (blank area). It should be understood that using the center point of region 1 is merely illustrative; in this embodiment, coordinates of other points within region 1 can also be used, such as the center point of the top edge of the rectangle containing region 1. No specific limitation is made in this regard.
[0172] Step 502: The PC sends the first request message.
[0173] In some embodiments, the PC may send a first request message via broadcast. For example, the first request message may be a Bluetooth broadcast message.
[0174] As one possible implementation, the first request message may carry a first flag bit, which indicates that there is content on the PC screen that can be shared with other electronic devices (such as mobile phones). Optionally, the first request message may also carry a second flag bit, which indicates that there is space on the PC screen that can receive content shared by other electronic devices. It should be understood that in this embodiment, the first request message may not carry a flag bit. Whether or not to carry a flag bit depends on the actual scenario. For example, when the PC has content that can be shared with the mobile phone and the PC initiates a connection establishment request to the mobile phone, the first request message may not carry a flag bit; when the PC has content that can be shared with the mobile phone and the mobile phone initiates a connection establishment request to the PC, the first request message may carry the first flag bit.
[0175] As one possible implementation, the first request message can also carry the business type of the request, such as file transfer, screen mirroring, etc.
[0176] It should be understood that Figure 5 The illustrated embodiment uses the example of receiving content transmitted from other devices in a blank area of the PC's currently displayed interface. In other embodiments, this could mean that any interface of the PC can receive content transmitted from other devices, and this application does not impose any specific limitations on this. That is to say, in the embodiments of this application, when the first request message carries the second flag bit, it can be understood that the device can receive content transmitted from other devices, and there are no specific limitations on which interface or area can receive it.
[0177] Optionally, the first request message may also carry account information logged in on the PC, PC power information, etc. It should be understood that when the first request message carries account information, after the mobile phone receives the first request message from the PC, it can compare the account information logged in on its own device with the account information in the first request message, and filter out request messages that do not match the account information logged in on its own device. This ensures that the account logged in on the device corresponding to the received request message is the same account logged in on the mobile phone's own device.
[0178] Step 503: The mobile phone receives the first request message and sends the first response message to the PC when the second condition is met.
[0179] The second condition may include the mobile phone determining that it is close to the PC screen.
[0180] Optionally, the second condition may also include: the account information logged in on the mobile phone is the same as the account information carried in the first request message, that is, the account logged in on the mobile phone and the PC is the same account.
[0181] Optionally, the second condition may also include: a second preset application running in the foreground of the phone. This second preset application can be a file management application, a gallery application, a document application, a navigation application, a music application, or a video application. In other words, when the phone opens the second preset application, it can be assumed that the phone has content that can be shared with the PC, and thus the phone can reply with the first response message to the PC.
[0182] In some embodiments, after the PC sends a first request message, the mobile phone can receive the first request message from the PC, then detect whether its own state is a hovering state, and detect whether the distance between itself and the device that sent the first request message is less than a set threshold. If it is determined that its own state is a hovering state, and the distance between its own position and the PC display screen is less than the set threshold, then it can be determined that the mobile phone is close to the PC screen.
[0183] It should be understood that, in this embodiment, the hovering state (also referred to as the moving hovering state) refers to the state after executing a preset action, which indicates that the phone has moved forward and then stopped. The front of the phone screen can be directly in front, or to the side, such as the left front, right front, top front, or bottom front. Specifically, the movement can be within a preset angle range, which can be 0 degrees to 180 degrees. Furthermore, the direction of movement of the phone is based on the direction of movement from the top of the phone.
[0184] Optionally, the mobile phone can acquire detection data (such as the phone's tilt angle data, acceleration data, etc.) through an inertial measurement unit (IMU), and then determine the phone's state based on the detection data, such as determining that the phone enters a stopped state after moving.
[0185] As one possible implementation, the first response message may carry a third flag, which indicates that the mobile phone has content that can be shared with the PC. Optionally, the first response message may also carry a fourth flag, which indicates that the mobile phone has a location available to receive content transmitted from other devices. It should be understood that, in this embodiment, the first response message may also not carry a flag. Whether or not to carry a flag depends on the actual scenario. For example, when the PC has content that can be shared with the mobile phone and the PC initiates a connection request to the mobile phone, the first response message may carry a third flag; when the PC has content that can be shared with the mobile phone and the mobile phone initiates a connection request to the PC, the first response message may not carry a third flag.
[0186] For example, such as Figure 7 The diagram shown is a user interface illustration provided in an embodiment of this application. (See attached image.) Figure 7 As shown in diagram (a), assuming the current screen of the phone is the gallery interface 1, the first response message can carry a third flag bit; assuming the current screen of the phone is the gallery interface 2, for example... Figure 7 In the interface shown in (b), the fourth flag bit can be carried in the first response message. It should be understood that in... Figure 7 In the interface shown in (a), the user has already selected some images, indicating that the user may intend to share the selected images; while... Figure 7 In the interface shown in (b), the user's intention to share images is weak; therefore, when the interface is... Figure 7 When the interface shown in (b) is used, the third flag bit may not be carried in the first response message.
[0187] It should be understood that, similar to the PC side, the mobile phone side has the right to receive content transmitted from other devices. In this application embodiment, there is no limitation on which interface or area the mobile phone can receive content transmitted from other devices.
[0188] As one possible implementation, in the embodiments of this application, the second condition may not include opening the second preset application. If the preset application is opened, a flag bit can be carried in the response message to indicate that there is content that can be shared with the peer device. This application does not limit this.
[0189] Step 504: When the first set condition is met, the PC sends a connection establishment request message to the mobile phone.
[0190] The first setting condition may include at least one of the following:
[0191] 1. Content on the PC can be transferred to the mobile phone.
[0192] 2. The mobile phone has content that can be transmitted to the PC (i.e., the third flag is carried in the first response message).
[0193] In other words, a PC can trigger a connection request message to be sent to the mobile phone when it determines that at least one of the above two conditions is met. If neither the mobile phone nor the PC has content to transmit to the other, then there is no need to send a connection request message.
[0194] This can also be understood as follows: when a PC determines that a mobile phone has content that can be shared with it, it can initiate a connection request to the mobile phone; or, when a PC determines that it has content that can be shared with the mobile phone, it can initiate a connection request to the mobile phone; or, when a PC determines that it has content that can be shared with the mobile phone, and the mobile phone has content that can be shared with the PC, it can initiate a connection request to the mobile phone.
[0195] Step 505: The mobile phone replies to the PC with a message indicating agreement to establish the blockchain.
[0196] Step 506: The connection between the PC and the mobile phone has been successfully established.
[0197] It should be understood that, regarding Figure 5 For details on how the PC determines that a device is approaching its display screen and how the mobile phone determines that it is approaching the PC display screen in the illustrated embodiments, please refer to the detailed description in the embodiments described above, which will not be repeated here.
[0198] It should be understood that Figure 5 In the illustrated embodiment, step 503 takes the example of the mobile phone determining that it is close to the PC display screen. According to the implementation of scheme B described above, step 503 could also be: the mobile phone receives a first request message, opens the camera to capture an image, and determines that the image captured by the camera contains a screen. That is, the triggering condition for step 504 could also be: the mobile phone receives the first request message and determines that the image captured by the camera contains a screen.
[0199] in addition, Figure 5 This description only uses the example of a PC sending a first request message and initiating a connection establishment request. In practical applications, the PC can also send a first request message and the mobile phone can initiate a connection establishment request. That is to say, after step 503 is executed, the mobile phone does not need to reply to the PC with a response message and can directly send a connection establishment request message to the PC. This application does not make specific limitations on this.
[0200] In other embodiments, if the PC sends the first request message and the mobile phone initiates a connection establishment request, the first response message can be a connection establishment request message. Then, the PC can establish a communication link with the mobile phone based on the connection establishment request message. Specifically, the PC can establish a communication link with the mobile phone based on the connection establishment request message when a second set condition is met.
[0201] The second setting condition includes at least one of the following: the first request message carries a second flag bit, which is used to indicate that the PC has content that can be shared with the mobile phone; or the mobile phone has content that can be shared with the PC.
[0202] As one possible implementation, when the PC senses a change in capacitance and determines that a device is approaching its display, it can send a request message. Upon receiving the request message, the mobile phone confirms that it is indeed near the PC's screen and can then reply with a response message. At this point, the mobile phone can display a prompt (e.g., a playing animation or text prompt) prompting the user to move the phone even closer to the PC's display. When the user moves the phone again, the PC can detect a stronger capacitance signal and can send another request message. The mobile phone, upon receiving this request message, will again reply with a response message to confirm. Finally, after receiving the response message from the mobile phone, the PC sends a connection establishment request message to the mobile phone.
[0203] Continuing with the example of data transmission between a mobile phone and a PC, we will introduce the specific implementation of scenario 2 above. For example, as shown... Figure 8 The diagram shown is a device connection flowchart provided in an embodiment of this application. (See attached diagram.) Figure 8 As shown, the method may include the following steps:
[0204] Step 801: When the third condition is met, the mobile phone sends a second request message.
[0205] The third condition may include the mobile phone determining that it is close to the PC screen.
[0206] In some embodiments, the mobile phone can determine its proximity to other devices by determining its hovering state, its distance from the PC, etc., and then trigger the sending of a second request message. It should be understood that the method of triggering the mobile phone to send the second request message in step 801 can also be other methods, such as the user clicking the screen projection operation, shaking the phone, etc., and this application does not limit this.
[0207] In other embodiments, the user can open the phone's camera and capture images while the user moves the phone. When the phone determines that the captured image contains a screen, it can send a second request message. As one possible implementation, the user can perform a user action, such as shaking the phone or triggering screen mirroring, before moving the phone close to the PC screen. It should be understood that the specific implementation of how the phone determines its proximity to the PC screen can be found in the detailed descriptions of the embodiments described above, and will not be repeated here.
[0208] Step 802: The PC receives the second request message and sends a second response message to the mobile phone when the fourth condition is met.
[0209] The fourth condition may include detecting that a device is near the PC screen.
[0210] It should be understood that the solution for how a PC determines that a device is near its screen can be found in the detailed description in the embodiments described above, and will not be repeated here.
[0211] Step 803: When the third set condition is met, the mobile phone sends a connection establishment request message to the PC.
[0212] The third condition may include at least one of the following:
[0213] 1. The PC has content that can be transferred to the mobile phone (i.e., the second response message from the PC contains a flag indicating that the content can be shared with the mobile phone).
[0214] 2. Data on the mobile phone can be transferred to the PC.
[0215] In other words, a mobile phone can send a connection request message to the PC when it determines that at least one of the above conditions is met. If neither the mobile phone nor the PC has content to transmit to the other, then there is no need to send a connection request message.
[0216] Step 804: The PC sends a response message to the mobile phone agreeing to establish the blockchain.
[0217] Step 805: PC and mobile phone connection established successfully.
[0218] It should be understood that Figure 8 The illustrated embodiments and Figure 5 The difference between the illustrated embodiments lies in the device sending the request message and the device initiating the connection request. Secondly, the triggering conditions for message interaction differ. For the similarities between the two embodiments, such as the PC determining that a device is near its display screen, please refer to the detailed descriptions in the preceding embodiments; they will not be repeated here.
[0219] It should be understood that in practical applications, Figure 8 The illustrated embodiment could also involve the mobile phone sending a second request message, and the PC initiating a connection establishment request. That is, after step 804 is executed, the PC does not need to reply to the mobile phone with a response message; it can directly send a connection establishment request message to the mobile phone. This application does not specifically limit this approach.
[0220] When the mobile phone sends the second request message and the PC initiates a connection establishment request, the second response message can be a connection establishment request message. Then, the mobile phone can establish a communication link with the PC based on the connection establishment request message initiated by the PC. Specifically, the mobile phone can establish a communication link with the PC based on the connection establishment request message when the fourth predefined condition is met.
[0221] The fourth setting condition includes at least one of the following: the second request message carries a first flag bit, which is used to indicate that the mobile phone has content that can be shared with the PC; or the PC has content that can be shared with the mobile phone.
[0222] The above embodiments enable rapid selection and connection between multiple devices without requiring users to manually select devices, thus improving the efficiency of establishing connections between devices.
[0223] It should be noted that all or part of the embodiments provided in this application can be freely and arbitrarily combined with each other. The combined technical solutions are also within the protection scope of this application.
[0224] The methods provided in the embodiments of this application above are described from the perspective of an electronic device as the executing entity. To implement the functions of the methods provided in the embodiments of this application above, the electronic device may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.
[0225] like Figure 9 As shown, other embodiments of this application disclose an electronic device. See also... Figure 9 As shown, the electronic device 900 includes: a processor 901; a memory 902; a display screen 903; and one or more computer programs 904 (not shown in the figure). The above devices can be connected through one or more communication buses 905.
[0226] The memory 902 stores one or more computer programs, which, when called and executed by the processor 901, cause the electronic device 900 to perform the method steps described in the above embodiments.
[0227] In this embodiment, the processor 901 can be a general-purpose processor, digital signal processor, application-specific integrated circuit, field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in this embodiment. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in this embodiment can be directly implemented by the hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can be located in the memory 902. The processor 901 reads the program instructions from the memory 902 and, in conjunction with its hardware, completes the steps of the aforementioned methods.
[0228] In this embodiment, the memory 902 can be non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), or it can be volatile memory, such as RAM. The memory can also be any other medium capable of carrying or storing desired program code in the form of instructions or data structures, and accessible by a computer, but is not limited thereto. The memory in this embodiment can also be a circuit or any other device capable of implementing storage functions, used to store instructions and / or data.
[0229] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0230] Based on the above embodiments, this application also provides a computer storage medium storing a computer program, which, when executed by a computer, causes the computer to perform the method provided in the above embodiments.
[0231] This application also provides a computer program product, including instructions that, when run on a computer, cause the computer to execute the methods provided in the above embodiments.
[0232] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0233] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0234] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
Claims
1. A communication system, the communication system comprising a first electronic device and a second electronic device, characterized in that, The second electronic device is configured to send a first request message when a first condition is met, the first condition including detecting that a device is near the screen of the second electronic device; The first electronic device is configured to receive the first request message and, when a second condition is met, reply to the second electronic device with a first response message, wherein the second condition includes determining that the first electronic device is close to the second electronic device; The second electronic device is also configured to establish a communication link with the first electronic device based on the first response message.
2. The system as described in claim 1, characterized in that, The first condition also includes: the second electronic device is running a first preset application in the foreground.
3. The system as described in claim 2, characterized in that, The first preset application is a file management application, a gallery application, or a document application.
4. The system as described in claim 1, characterized in that, The first request message includes the account logged in on the second electronic device; The second condition also includes: the account logged in on the first electronic device and the account logged in on the second electronic device are the same account.
5. The system as described in claim 1, characterized in that, The second electronic device detects that a device is approaching the screen of the second electronic device, including: The second electronic device determines that a device is approaching the screen of the second electronic device based on the change in the capacitance parameter of the screen.
6. The system according to any one of claims 1-5, characterized in that, The first electronic device determines that it is near the second electronic device, including: The first electronic device determines that it has performed a preset action, and the distance between the first electronic device and the second electronic device is less than a set threshold. The preset action is an action that indicates that the first electronic device moves forward and then stops.
7. The system according to any one of claims 1-6, characterized in that, The second electronic device establishes a communication link with the first electronic device according to the first response message, including: After receiving the first response message, the second electronic device sends a link establishment request message to the first electronic device, which is used to request the establishment of a communication link with the first electronic device.
8. The system according to any one of claims 1-6, characterized in that, The second electronic device detects that a device is approaching the screen of the second electronic device, including: The second electronic device detects that a device is approaching an area on the screen of the second electronic device where content can be shared.
9. The system as described in claim 7, characterized in that, The second electronic device sends a connection establishment request message to the first electronic device, including: When the second electronic device meets the first preset condition, it sends a connection establishment request message to the first electronic device. The first preset condition includes at least one of the following: The first response message carries a first flag bit, which is used to indicate that the first electronic device has content that can be shared with the second electronic device; or the second electronic device has content that can be shared with the first electronic device.
10. The system as claimed in claim 1, characterized in that, The first response message is a link establishment request message, which is used to request the establishment of a communication link with the second electronic device; The second electronic device establishes a communication link with the first electronic device based on the first response message: The second electronic device establishes a communication link with the first electronic device based on the link establishment request message.
11. The system as claimed in claim 10, characterized in that, The second electronic device establishes a communication link with the first electronic device according to the link establishment request message: When the second electronic device meets the second set condition, it establishes a communication link with the first electronic device according to the link establishment request message. The second set condition includes at least one of the following: The first request message carries a second flag, which indicates that the second electronic device has content that can be shared with the first electronic device; or The first electronic device has content that can be shared with the second electronic device.
12. The system according to any one of claims 1-11, characterized in that, The first electronic device is a mobile phone, and the second electronic device is a personal computer, a vehicle terminal, or a tablet.
13. A communication system, the communication system comprising a first electronic device and a second electronic device, characterized in that, The first electronic device is configured to send a second request message when a third condition is met, the third condition including the first electronic device determining that the first electronic device is close to the second electronic device; The second electronic device is configured to receive the second request message and, when a fourth condition is met, reply to the first electronic device with a second response message, the fourth condition including detecting that a device is near the screen of the second electronic device; The first electronic device is further configured to establish a communication link with the second electronic device based on the second response message.
14. The system as described in claim 13, characterized in that, The first electronic device determines that it is near the second electronic device, including: The first electronic device determines that it has performed a preset action, and the distance between the first electronic device and the second electronic device is less than a set threshold. The preset action is an action that indicates that the first electronic device moves forward and then stops.
15. The system as described in claim 13, characterized in that, The second electronic device detects that a device is approaching the screen of the second electronic device, including: The second electronic device determines that a device is approaching the screen of the second electronic device based on the change in the capacitance parameter of the screen.
16. The system as described in claim 13, characterized in that, The second electronic device detects that a device is approaching the screen of the second electronic device, including: The second electronic device detects that a device is approaching an area on the screen of the second electronic device where content can be shared.
17. The system according to any one of claims 13-16, characterized in that, The first electronic device is specifically used to establish a communication link with the second electronic device according to the second response message in the following manner: The first electronic device is configured to send a link establishment request message to the second electronic device after receiving the second response message, the link establishment request message being used to request the establishment of a communication link with the second electronic device.
18. The system as claimed in claim 17, characterized in that, The first electronic device sends a connection establishment request message to the second electronic device: When the first electronic device meets a third preset condition, it sends a connection establishment request message to the second electronic device. The third preset condition includes at least one of the following: The first electronic device has content that can be shared with the second electronic device; or The second response message carries a second flag bit, which is used to indicate that the second electronic device has content that can be shared with the first electronic device.
19. The system as claimed in claim 13, characterized in that, The second response message is a chain establishment request message; The first electronic device establishes a communication link with the second electronic device based on the second response message: The first electronic device establishes a communication link with the second electronic device based on the link establishment request message.
20. The system as described in claim 19, characterized in that, The first electronic device establishes a communication link with the second electronic device according to the link establishment request message, including: When the fourth preset condition is met, the first electronic device establishes a communication link with the second electronic device according to the link establishment request message, wherein the fourth preset condition includes at least one of the following: The second request message carries a first flag, which indicates that the first electronic device has content that can be shared with the second electronic device; or The second electronic device has content that can be shared with the first electronic device.
21. A device connection method, characterized in that, Applied to a first electronic device, the method includes: The first electronic device receives a first request message and, when a second condition is met, replies to the second electronic device with a first response message. The second condition includes determining that the first electronic device is close to the second electronic device. The first request message is sent by the second electronic device when the first condition is met. The first condition includes detecting that a device is close to the screen of the second electronic device. The first electronic device establishes a communication link with the second electronic device.
22. The method as described in claim 21, characterized in that, The second condition also includes: the account logged in on the first electronic device and the account logged in on the second electronic device are the same account.
23. The method as described in claim 21 or 22, characterized in that, The first electronic device determines that it is near the second electronic device, including: The first electronic device determines that it has performed a preset action, and the distance between the first electronic device and the second electronic device is less than a set threshold. The preset action is an action that indicates that the first electronic device moves forward and then stops.
24. A device connection method, characterized in that, Applied to a second electronic device, the method includes: When the second electronic device meets the first condition, it sends a first request message, the first condition including detecting that a device is near the screen of the second electronic device; The second electronic device receives a first response message sent by the first electronic device. The first response message is sent by the first electronic device when it receives the first request message and meets a second condition, the second condition including determining that the first electronic device is close to the second electronic device. The second electronic device establishes a communication link with the first electronic device based on the first response message.
25. The method as described in claim 24, characterized in that, The first condition also includes: the second electronic device is running a first preset application in the foreground.
26. The method as described in claim 24, characterized in that, The second electronic device detects that a device is approaching the screen of the second electronic device, including: The second electronic device determines that a device is approaching the screen of the second electronic device based on the change in the capacitance parameter of the screen.
27. The method according to any one of claims 24-26, characterized in that, The second electronic device establishes a communication link with the first electronic device according to the first response message, including: After receiving the first response message, the second electronic device sends a link establishment request message to the first electronic device, which is used to request the establishment of a communication link with the first electronic device.
28. The method according to any one of claims 24-26, characterized in that, The second electronic device detects that a device is approaching the screen of the second electronic device, including: The second electronic device detects that a device is approaching an area on the screen of the second electronic device where content can be shared.
29. The method as described in claim 27, characterized in that, The second electronic device sends a connection establishment request message to the first electronic device, including: When the second electronic device meets the first preset condition, it sends a connection establishment request message to the first electronic device. The first preset condition includes at least one of the following: The first response message carries a first flag bit, which is used to indicate that the first electronic device has content that can be shared with the second electronic device; or the second electronic device has content that can be shared with the first electronic device.
30. The method as described in claim 24, characterized in that, The first response message is a chain establishment request message; The second electronic device establishes a communication link with the first electronic device according to the first response message, including: The second electronic device establishes a communication link with the first electronic device based on the link establishment request message.
31. The method as described in claim 30, characterized in that, The second electronic device establishes a communication link with the first electronic device according to the link establishment request message, including: When the second electronic device meets the second set condition, it establishes a communication link with the first electronic device according to the link establishment request message. The second set condition includes at least one of the following: The first request message carries a second flag bit, which is used to indicate that the second electronic device has content that can be shared with the first electronic device; or the first electronic device has content that can be shared with the second electronic device.
32. An electronic device, characterized in that, The electronic device includes a transceiver; a processor; a memory; and one or more computer programs; The one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when invoked and executed by the one or more processors, cause the electronic device to perform the method as described in any one of 21 to 23 or the method as described in any one of 24 to 31.