Device connection method, electronic device, and computer readable storage medium

By transmitting protocol packets between the terminal device and the auxiliary device, determining the target communication protocol, and establishing an adaptive communication connection, the problems of unstable connections and high transmission delays between the terminal device and the auxiliary device are solved, and stable connections and low-latency transmission are achieved.

WO2025044447A1PCT designated stage expired Publication Date: 2025-03-06HUAWEI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/101435
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-31
Filing Date
2024-06-25
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

The prior art is difficult to establish a stable connection between the terminal device and the auxiliary device based on an appropriate communication protocol, resulting in high transmission delay.

Method used

By transmitting protocol data packets between the terminal device and the auxiliary device, the target communication protocol is determined, and an appropriate communication connection is established through the communication protocol confirmation packet and connection address.

Benefits of technology

The stable connection between the terminal device and the auxiliary device is achieved, which reduces transmission delay and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024101435_06032025_PF_FP_ABST
    Figure CN2024101435_06032025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of terminals, and provides a device connection method, an electronic device, and a computer readable storage medium. According to the present application, on the basis of an identifier of a communication protocol in a protocol data packet sent by an auxiliary device, a terminal device may obtain a target communication protocol for communicating with the auxiliary device; and after obtaining the target communication protocol for communicating with the auxiliary device, sends a communication protocol confirmation packet to the auxiliary device, enabling the auxiliary device to send a connection address corresponding to the target communication protocol. In this way, on the basis of the connection address, the terminal device may establish a communication connection with the auxiliary device according to a matched communication protocol, ensuring the stability of connection and reducing transmission delay between the terminal device and the auxiliary device.
Need to check novelty before this filing date? Find Prior Art

Description

Device connection method, electronic device, and computer-readable storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 29, 2023, with application number 202311101834.7 and application name “Device connection method, electronic device and computer-readable storage medium”, and claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 31, 2023, with application number 202311134495.2 and application name “Device connection method, electronic device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a device connection method, an electronic device, and a computer-readable storage medium. Background Art

[0003] With the rapid development of terminal hardware and software technologies, terminal products have been applied to all aspects of life, greatly enriching users' daily activities such as social interaction, entertainment, and office work. At the same time, terminal auxiliary devices are also becoming more and more diverse. For example, auxiliary devices such as styluses, headphones, and wireless keyboards are becoming more and more widely used on terminals.

[0004] Currently, terminal devices typically connect to auxiliary devices based on wireless short-range communication protocols, and data is transmitted through wireless short-range communication technology when the user uses the auxiliary device. However, there are many different wireless short-range communication protocols available, and different devices may support different wireless short-range communication protocols. Therefore, how to ensure that the connection between the terminal device and the auxiliary device is established based on the compatible communication protocol to ensure connection stability and reduce transmission delay between the terminal device and the auxiliary device is currently a problem that needs to be solved.

[0005] Summary of the Invention

[0006] The present application provides a device connection method, an electronic device, and a computer-readable storage medium, which can select a suitable communication protocol to establish a connection between a terminal device and an auxiliary device, thereby ensuring the stability of the connection and reducing the transmission delay between the terminal device and the auxiliary device.

[0007] In a first aspect, a device connection method is provided, which is applied to a terminal device, and the method includes: receiving a protocol data packet from an auxiliary device, the protocol data packet including an identifier of one or more communication protocols supported by the auxiliary device; obtaining a target communication protocol for communicating with the auxiliary device based on the identifier of the one or more communication protocols supported by the auxiliary device; sending a communication protocol confirmation packet to the auxiliary device, the communication protocol confirmation packet including information of the target communication protocol; receiving a connection address corresponding to the target communication protocol from the auxiliary device; and establishing a communication connection with the auxiliary device based on the connection address.

[0008] Exemplarily, the protocol data packet is generated based on the wireless charging protocol.

[0009] Exemplarily, the communication protocol confirmation packet is generated based on the wireless charging protocol, and the information of the target communication protocol in the communication protocol confirmation packet may be an identifier of the target communication protocol or field information indicating the use of the target communication protocol.

[0010] According to the solution provided by the first aspect above, the terminal device can obtain the target communication protocol for communicating with the auxiliary device based on the identifier of the communication protocol in the protocol data packet sent by the auxiliary device. After obtaining the target communication protocol for communicating with the auxiliary device, the terminal device sends a communication protocol confirmation packet to the auxiliary device to enable the auxiliary device to send the connection address corresponding to the target communication protocol. In this way, according to the connection address, the terminal device can establish a communication connection with the auxiliary device based on the compatible communication protocol, which can ensure the stability of the connection and reduce the transmission delay between the terminal device and the auxiliary device.

[0011] As one possible implementation, the protocol data packet is an identification data packet generated based on the wireless charging protocol. The identification data packet carries the identifiers of one or more communication protocols via an identification field. By using the identification data packet to carry the identification of the communication protocol, when the terminal device wirelessly charges the auxiliary device, the auxiliary device does not need to retransmit a new packet to the terminal device. This can reduce the time it takes to establish a communication connection between the auxiliary device and the terminal device and improve processing efficiency.

[0012] As a possible implementation, before receiving the protocol data packet from the auxiliary device, the method further includes: upon receiving an attachment event, issuing a device detection signal. The device detection signal is used to detect the presence of the auxiliary device, and the protocol data packet is sent by the auxiliary device after receiving the device detection signal. In this way, in a scenario where the terminal device is charging the auxiliary device, sending the device detection signal to the auxiliary device can ensure the accuracy of charging target detection, avoiding charging other devices when other devices are attached, which would result in wasted resources.

[0013] As a possible implementation, after receiving the protocol data packet from the auxiliary device, the method further includes: charging the auxiliary device based on the charging parameter data packet sent by the auxiliary device; the charging parameter data packet is generated by the auxiliary device based on the wireless charging protocol after receiving the device detection signal; sending a communication protocol confirmation packet to the auxiliary device, including: after receiving the handshake information sent by the auxiliary device, sending a communication protocol confirmation packet to the auxiliary device, the communication protocol confirmation packet is a data packet in reply to the handshake information, and the handshake information is sent by the auxiliary device to the terminal device after starting charging.

[0014] Exemplarily, the charging parameter data packet may include an identity identification packet. In this way, the identity identification data packet carries the identification of one or more communication protocols supported by the auxiliary device, and the handshake reply information carries information of the target communication protocol. On the one hand, the handshake mechanism can ensure the reliability of data transmission. On the other hand, when the terminal device wirelessly charges the auxiliary device, the auxiliary device does not need to retransmit a new packet to the terminal device, which can reduce the time it takes to establish a communication connection between the auxiliary device and the terminal device and improve processing efficiency.

[0015] As a possible implementation, before receiving a protocol data packet from the auxiliary device, the method further includes: upon receiving an adsorption event, issuing a device detection signal, the device detection signal being used to detect the presence of an auxiliary device; upon receiving a charging parameter data packet sent by the auxiliary device, charging the auxiliary device based on the charging parameter data packet, the charging parameter data packet being generated by the auxiliary device based on the wireless charging protocol after receiving the device detection signal; and upon receiving a handshake message sent by the auxiliary device, sending a handshake reply message to the auxiliary device, the protocol data packet being the data packet sent by the auxiliary device after receiving the handshake reply message. In this way, when the terminal device wirelessly charges the auxiliary device, it can automatically identify the communication protocol compatible with the terminal device and the auxiliary device, automatically establish a communication connection, and ensure the reliability of data transmission through the handshake mechanism.

[0016] As a possible implementation method, a target communication protocol for communicating with the auxiliary device is obtained based on the identifiers of one or more communication protocols supported by the auxiliary device, including: obtaining the target communication protocol for communicating with the auxiliary device based on the identifiers of one or more communication protocols supported by the auxiliary device, the communication protocols supportable by the terminal device, and preset communication rules.

[0017] Exemplarily, the preset communication rule may also be to use the communication protocols ranked in the top N priorities as the target communication protocols, where N is a positive integer greater than or equal to 1.

[0018] For example, when the terminal device obtains the target communication protocol for communicating with the auxiliary device based on the identifiers of one or more communication protocols supported by the auxiliary device, the communication protocols that the terminal device can support, and preset communication rules, it can first obtain the communication protocols that the auxiliary device can support based on the identifiers, then obtain the communication protocols that both the auxiliary device and the terminal device support based on the communication protocols that the auxiliary device can support and the communication protocols that the terminal device can support, and then determine the target communication protocol from the communication protocols that both the auxiliary device and the terminal device support based on the preset communication rules. In this way, a target communication protocol with better adaptability, more stable data transmission, and less transmission delay can be obtained.

[0019] As a possible implementation method, the communication protocol is a wireless short-range communication protocol, which includes the Star Alliance protocol and the Bluetooth protocol. In this way, a connection between the terminal device and the auxiliary device can be established through the wireless short-range communication protocol, allowing the terminal device and the auxiliary device to communicate or operate with each other within a short range. Furthermore, if the connection between the terminal device and the auxiliary device is established through the Star Alliance protocol, the stability of the connection between the terminal device and the auxiliary device can be further improved, and the transmission delay can be reduced.

[0020] As a possible implementation method, the target communication protocol is one of the one or more communication protocols supported by the auxiliary device, and a communication connection is established with the auxiliary device according to the connection address, including: issuing a connection prompt to the user; the connection prompt is a prompt indicating whether the user establishes a connection with the auxiliary device based on the target communication protocol; after receiving the user's operation to confirm the connection, establishing a communication connection with the auxiliary device according to the connection address.

[0021] For example, a connection prompt may be issued through a pop-up service, which may provide a connection prompt on a display interface of a terminal device in the form of a dialog box, a function box, a dialogue prompt box, or the like.

[0022] In this way, by sending a connection prompt to the user, it is possible to avoid the terminal device and the auxiliary device from being mistakenly connected when the user does not need to connect the terminal device and the auxiliary device.

[0023] In one possible implementation, the target communication protocol is at least two of one or more communication protocols supported by the auxiliary device. Establishing a communication connection with the auxiliary device based on the connection address includes: issuing a connection prompt to the user, the connection prompt including the connection address of the target communication protocol, the connection prompt instructing the user to determine the connection address to be established from multiple connection addresses; and upon receiving the target connection address specified by the user, establishing a communication connection with the auxiliary device based on the target connection address. In this way, the connection prompt allows the user to establish a connection based on the desired communication protocol, facilitating user operation and better meeting user needs.

[0024] As a possible implementation, issuing a connection prompt to the user includes: obtaining a connection detection result of the auxiliary device based on a mode identifier sent by the auxiliary device; and issuing a connection prompt to the user if the connection detection result of the auxiliary device indicates that the auxiliary device is connectable. In this way, by detecting whether the auxiliary device is connectable based on the mode identifier, mismatches between the terminal device and the auxiliary device can be promptly detected, avoiding subsequent connection operations and reducing workload.

[0025] In a second aspect, a device connection method is provided, which is applied to an auxiliary device, and the method includes: sending a protocol data packet to a terminal device, the protocol data packet including an identifier of one or more communication protocols supported by the auxiliary device; receiving a communication protocol confirmation packet sent by the terminal device; obtaining a target communication protocol for communicating with the terminal device based on the information in the communication protocol confirmation packet; and sending a connection address corresponding to the target communication protocol to the terminal device, the connection address being used to instruct the terminal device to establish a communication connection based on the connection address.

[0026] Exemplarily, the protocol data packet is generated based on the wireless charging protocol.

[0027] Exemplarily, the communication protocol confirmation packet is generated based on the wireless charging protocol, and the information of the target communication protocol in the communication protocol confirmation packet may be an identifier of the target communication protocol or field information indicating the use of the target communication protocol.

[0028] According to the solution provided by the second aspect above, the terminal device can obtain the target communication protocol for communicating with the auxiliary device based on the identifier of the communication protocol in the protocol data packet sent by the auxiliary device. After obtaining the target communication protocol for communicating with the auxiliary device, the terminal device sends a communication protocol confirmation packet to the auxiliary device to enable the auxiliary device to send the connection address corresponding to the target communication protocol. In this way, according to the connection address, the terminal device can establish a communication connection with the auxiliary device based on the compatible communication protocol, which can ensure the stability of the connection and reduce the transmission delay between the terminal device and the auxiliary device.

[0029] As a possible implementation method, sending a protocol data packet to a terminal device includes: upon receiving a device detection signal sent by the terminal device, sending a protocol data packet to the terminal device, wherein the protocol data packet is an identity identification data packet generated based on the wireless charging protocol, and the identity identification data packet carries the identifiers of one or more communication protocols through the identity identification field. In this way, by carrying the identifier of the communication protocol through the identity identification data packet, when the terminal device wirelessly charges the auxiliary device, the auxiliary device does not need to retransmit a new packet to the terminal device, which can reduce the time it takes to establish a communication connection between the auxiliary device and the terminal device and improve processing efficiency. At the same time, in the scenario where the terminal device is charging the auxiliary device, by sending a device detection signal to the auxiliary device, the accuracy of the detection of the charging object can be guaranteed, avoiding charging other devices when other devices are adsorbed, resulting in a waste of resources.

[0030] As a possible implementation method, before receiving the communication protocol confirmation packet sent by the terminal device, the method also includes: sending handshake information to the terminal device in response to the charging operation of the terminal device based on the charging parameter data packet, the communication protocol confirmation packet is sent by the terminal device after receiving the handshake information, and the charging parameter data packet is generated by the auxiliary device based on the wireless charging protocol after receiving the device detection signal, and sent to the terminal device.

[0031] Exemplarily, the charging parameter data packet may include an identity identification packet. In this way, the identity identification data packet carries the identification of one or more communication protocols supported by the auxiliary device, and the handshake reply information carries information of the target communication protocol. On the one hand, the handshake mechanism can ensure the reliability of data transmission. On the other hand, when the terminal device wirelessly charges the auxiliary device, the auxiliary device does not need to retransmit a new packet to the terminal device, which can reduce the time it takes to establish a communication connection between the auxiliary device and the terminal device and improve processing efficiency.

[0032] As a possible implementation, sending a protocol data packet to a terminal device includes: sending a charging parameter data packet to the terminal device upon receiving a device detection signal from the terminal device; sending a handshake message to the terminal device in response to a charging operation performed by the terminal device based on the charging parameter data packet; and sending a protocol data packet to the terminal device upon receiving a handshake reply message from the terminal device. In this way, when the terminal device wirelessly charges an auxiliary device, it can automatically identify the communication protocol compatible with the auxiliary device and automatically establish a communication connection. Furthermore, the handshake mechanism ensures the reliability of data transmission.

[0033] As one possible implementation, after sending the connection address corresponding to the target communication protocol to the terminal device, the method further includes: sending a mode identifier to the terminal device, the mode identifier being used to assist the terminal device in determining the connection detection result of the auxiliary device. In this way, by using the mode identifier to detect whether the auxiliary device is connectable, mismatches between the terminal device and the auxiliary device can be promptly identified, avoiding subsequent connection operations and reducing workload.

[0034] As a possible implementation method, the communication protocol is a wireless short-range communication protocol, which includes the Star Alliance protocol and the Bluetooth protocol. In this way, a connection between the terminal device and the auxiliary device can be established through the wireless short-range communication protocol, allowing the terminal device and the auxiliary device to communicate or operate with each other within a short range. Furthermore, if the connection between the terminal device and the auxiliary device is established through the Star Alliance protocol, the stability of the connection between the terminal device and the auxiliary device can be further improved, and the transmission delay can be reduced.

[0035] In a third aspect, an electronic device is provided, comprising: a memory for storing computer program instructions; and a processor for executing the computer program instructions to support the electronic device in implementing a method as any possible implementation method in the first aspect or implementing a method as any possible implementation method in the second aspect.

[0036] Exemplarily, when the electronic device is a terminal device, the method described in any possible implementation manner in the first aspect is implemented; when the electronic device is an auxiliary device, the method described in any possible implementation manner in the second aspect is implemented.

[0037] In a fourth aspect, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processing circuit, a method as described in any possible implementation method in the first aspect or a method as described in any possible implementation method in the second aspect is implemented.

[0038] In a fifth aspect, a chip system is provided, which includes a processing circuit and a storage medium, in which computer program instructions are stored; when the computer program instructions are executed by the processing circuit, a method as described in any possible implementation method in the first aspect or a method as described in any possible implementation method in the second aspect is implemented.

[0039] In a sixth aspect, a computer program product comprising instructions is provided, which, when the computer program product is run on a computer, enables the computer to execute a method as in any possible implementation manner in the first aspect or implement a method as in any possible implementation manner in the second aspect.

[0040] In a seventh aspect, a terminal device is provided, comprising a device for executing a method as described in any possible implementation manner in the first aspect.

[0041] In an eighth aspect, an auxiliary device is provided, comprising a device for executing the method described in any possible implementation manner of the second aspect.

[0042] In the ninth aspect, a communication system is provided, comprising an auxiliary device and a terminal device, wherein the terminal device is used to implement the method described in any possible implementation manner in the first aspect, and the auxiliary device is used to implement the method described in any possible implementation manner in the second aspect.

[0043] In a tenth aspect, an operating system is provided, which, when running on a computer, enables the computer to execute a method as described in any possible implementation of the first aspect or implement a method as described in any possible implementation of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] FIG1 is a schematic diagram of a scenario in which a terminal device according to an embodiment of the present application wirelessly charges an auxiliary device;

[0045] FIG2 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0046] FIG3 is a block diagram of a software structure of a terminal device provided in an embodiment of the present application;

[0047] FIG4 is a working principle diagram of establishing a communication connection between a terminal device and an auxiliary device during wireless charging according to an embodiment of the present application;

[0048] FIG5 is a flow chart of a device connection method according to an embodiment of the present application;

[0049] FIG6 is one of the interface diagrams of the terminal device provided in an embodiment of the present application;

[0050] FIG7 is a second schematic diagram of an interface of a terminal device provided in an embodiment of the present application;

[0051] FIG8 is a second flow chart of the device connection method provided in an embodiment of the present application;

[0052] FIG9 is one of the interactive schematic diagrams of the device connection method provided in an embodiment of the present application;

[0053] FIG10 is a third flow chart of the device connection method provided in an embodiment of the present application;

[0054] FIG11 is a second interactive diagram of the device connection method provided in an embodiment of the present application;

[0055] FIG12 is a fourth flow chart of the device connection method provided in an embodiment of the present application;

[0056] FIG13 is a schematic diagram of a structure of an identity identification data packet provided in an embodiment of the present application;

[0057] FIG14 is a third interactive schematic diagram of the device connection method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0059] The terms "including," "having," and any variations thereof mentioned in the description of the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.

[0060] In the following, the terms "first," "second," etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the quantity of the technical features indicated. Therefore, a feature specified as "first," "second," etc. may explicitly or implicitly include one or more of the features.

[0061] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0062] In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more. "And / or" in this document is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.

[0063] As mentioned in the background, with the rapid development of terminal hardware and software technologies, terminal products have been applied to all aspects of life, greatly enriching users' daily activities such as social interaction, entertainment, and office work. At the same time, terminal auxiliary devices are also becoming more and more diverse. For example, auxiliary devices such as styluses, headphones, and wireless keyboards are also increasingly widely used on terminals.

[0064] Currently, terminal devices generally connect to auxiliary devices based on wireless short-range communication protocols, and wireless short-range communication technology is used to transmit data when the user uses the auxiliary device. For example, the connection between a stylus pen and a terminal device can be achieved using Bluetooth technology. When the tip of the stylus pen is placed above the device's display, the stylus's coding module and the device's display module can interact, transmitting the stylus's Bluetooth MAC address to trigger a Bluetooth pairing connection between the stylus pen and the electronic device.

[0065] However, with the continuous development of wireless short-range communication technology, more and more wireless short-range communication protocols have emerged, such as the Star Flash Alliance Protocol. Star Flash technology is a new generation of wireless short-range communication technology developed in recent years. Star Flash connection has the advantages of greater stability and lower latency. However, due to differences in the MAC addresses and connection technologies corresponding to different wireless short-range communication protocols, different devices can also support different wireless short-range communication protocols. Based on this, how to ensure that the connection between the terminal device and the auxiliary device is established based on the compatible communication protocol to ensure the stability of the connection and reduce the transmission delay between the terminal device and the auxiliary device is currently a problem that needs to be solved.

[0066] Based on the above problems, an embodiment of the present application provides a device connection method, in which the terminal device can obtain the target communication protocol for communicating with the auxiliary device based on the identifier of the communication protocol in the protocol data packet sent by the auxiliary device. After obtaining the target communication protocol for communicating with the auxiliary device, the terminal device sends a communication protocol confirmation packet to the auxiliary device to enable the auxiliary device to send the connection address corresponding to the target communication protocol. In this way, according to the connection address, the terminal device can establish a communication connection with the auxiliary device based on the corresponding communication protocol, which can ensure the stability of the connection and reduce the transmission delay between the terminal device and the auxiliary device.

[0067] The device connection method provided in the embodiments of the present application can be used to connect a terminal device and an auxiliary device. Specifically, it can be applied to establish a connection between the terminal device and the auxiliary device in a scenario where the terminal device and the auxiliary device are wirelessly charged. As shown in Figure 1, Figure 1 shows a scenario where a terminal device 100 is wirelessly charging an auxiliary device 200.

[0068] The terminal device 100 can be any electronic device capable of wirelessly charging other devices, such as a smartphone, tablet computer, laptop computer, e-book reader, multimedia player, wearable device, PC (Personal Computer), or smart home appliance. The auxiliary device 200 can be a device capable of wirelessly charging the terminal device 100. For example, the auxiliary device 200 can be a stylus, headset, wireless keyboard, or wristband.

[0069] For ease of understanding, the following is a detailed introduction to the terminal device 100 provided in an embodiment of the present application. Please refer to Figure 2, which is a schematic diagram of the structure of the terminal device 100 provided in an embodiment of the present application. As shown in Figure 2, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a charging module 130, a battery 141, a boost circuit 142, a wireless charging coil 143, an antenna 150, a communication module 160, a sensor module 170, a display screen 180, etc.

[0070] The processor 110 may include one or more processing units, for example, an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, 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.

[0071] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0072] Processor 110 may also include a 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 have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0073] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0074] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0075] The charging module 130 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wireless charging embodiments, the charging module 130 can receive wireless charging input via the wireless charging coil 143 of the terminal device 100 to charge the battery 141. While charging the battery 141, the charging module 130 can also be used to power the terminal device 100.

[0076] In an embodiment of the present application, the charging module 130 may include a wireless charging chip, and the terminal device 100 may supply power to the auxiliary device 200 through the battery 141 , the boost circuit 142 , and the wireless charging coil 143 .

[0077] The wireless communication functionality of the terminal device 100 can be implemented via antenna 150, communication module 160, and the like. Antenna 150 is used to transmit and receive electromagnetic wave signals. Each antenna 150 in the terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 150 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antenna can be used in conjunction with a tuning switch.

[0078] The communication module 160 includes a mobile communication module and a wireless communication module. The mobile communication module can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module can include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), etc. The mobile communication module can receive electromagnetic waves from the antenna 150, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 150.

[0079] The wireless communication module can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied to the terminal device 100. The wireless communication module can be one or more devices that integrate at least one communication processing module. The wireless communication module receives electromagnetic waves via the antenna 150, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 150.

[0080] In the embodiment of the present application, the wireless communication module may include a short-range chip, and wireless short-range communication technology is implemented based on the short-range chip. Among them, the short-range chip may include a Star Flash chip, a Bluetooth chip, etc.

[0081] The display screen 180 is used to display images, videos, etc.

[0082] The sensor module 170 may include a magnetic field sensor, a touch sensor, etc. The terminal device 100 may detect the magnetic field strength of the terminal device 100 through the magnetic field sensor and implement a touch function through the touch sensor.

[0083] In an embodiment of the present application, the processor 110 can detect touch operations such as clicks (such as single clicks, double clicks, etc.), sliding operations, long press operations, or drag operations performed by the user on the interface provided by the display screen through the touch sensor, thereby determining the specific intention corresponding to the touch operation and then responding to the touch operation.

[0084] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0085] In the embodiment of the present application, the software system of the terminal device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the terminal device 100.

[0086] Figure 3 is a block diagram of the software structure of the terminal device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime (Android Runtime) and system libraries, and the kernel layer.

[0087] The application layer can include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0088] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer can include accessory management services, pop-up services, and short-range services. The accessory management service is used to manage the auxiliary device 200, the pop-up service is used to display notification information and interact with the user, and the short-range service is used to establish a connection with the auxiliary device 200 using short-range communication technology.

[0089] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for scheduling and management of the Android system.

[0090] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0091] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0092] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0093] The kernel layer is the layer between hardware and software. The kernel layer includes at least sensor drivers, short-range drivers, power management, etc.

[0094] It can be understood that in the embodiment of the present application, the auxiliary device 200 and the terminal device 100 can have the same or similar structure, which will not be described in detail here.

[0095] In some embodiments, the auxiliary device 200 includes at least a processor, an internal memory, a wireless charging coil, a charging module, a communication module, an antenna and other devices. The specific functions can be referred to the introduction of the terminal device 100 and will not be repeated here.

[0096] It can be understood that the wireless charging coil in the terminal device and the wireless charging coil in the auxiliary device can form electromagnetic induction, thereby performing wireless charging through electromagnetic induction. For details, please refer to the existing explanation and will not be elaborated here.

[0097] To further facilitate wireless charging of the auxiliary device by the terminal device, in an embodiment of the present application, an adsorption area for adsorbing the auxiliary device 200 is provided on the terminal device 100, and a magnetic component, such as a magnetic metal strip, is provided inside or on the surface of the terminal device 100 at a position corresponding to the adsorption area. The auxiliary device 200 is provided with at least one magnetic adsorption component, which can attract the magnetic component of the terminal device 100 when the auxiliary device 200 approaches or contacts the adsorption area, thereby adsorbing and fixing the auxiliary device 200 in the adsorption area. Once the auxiliary device 200 is adsorbed and fixed in the adsorption area, the terminal device 100 can charge the auxiliary device.

[0098] In the embodiment of the present application, a magnetic field sensor, such as a Hall sensor, may be provided at a location corresponding to the adsorption area within the terminal device 100. The terminal device 100 may detect the magnetic field strength of the adsorption area through the magnetic field sensor to determine whether the auxiliary device 200 is fixed in the adsorption area.

[0099] Based on the structural schematic diagrams shown in Figures 1 to 3, please refer to Figure 4 in combination. Figure 4 is a working principle diagram of the terminal device 100 and the auxiliary device 200 provided in an embodiment of the present application establishing a communication connection during wireless charging.

[0100] As shown in Figure 4, the magnetic field sensor detects the magnetic field strength in the attachment area and transmits the detection results to the sensor module (sensor driver). When the sensor module determines that the auxiliary device is attached to the attachment area based on the detection results, it can report the attachment event to the power management module. After receiving the attachment event of the auxiliary device, the power management module controls the battery, boost circuit, and wireless charging chip according to the wireless charging protocol to charge the auxiliary device.

[0101] When charging the auxiliary device, the power management module and the auxiliary device can interact with each other using communication protocols and connection addresses. After obtaining the connection address, the power management module transmits the connection address to the accessory management service. After receiving the connection address, the accessory management service sends an instruction to the pop-up service to enable the pop-up service to display a pop-up prompt on the display interface of the terminal device. After receiving the connection operation issued by the user based on the pop-up prompt, the pop-up service can send a connection operation instruction to the short-range service. After receiving the connection operation instruction, the short-range service responds to the connection operation instruction and initiates a connection operation on the auxiliary device. The short-range chip is controlled by the short-range drive to use the antenna to send a signal to the connection address, thereby performing a directional connection and establishing communication between the terminal device and the auxiliary device.

[0102] To better illustrate the interactive process between the terminal device and the auxiliary device to determine the communication protocol and connection address for communication, please refer to FIG5 , which is a flow chart of a device connection method provided in an embodiment of the present application. As shown in FIG5 , the device connection method provided in an embodiment of the present application includes:

[0103] S301: When receiving an adsorption event, the terminal device sends a device detection signal.

[0104] Among them, the magnetic field sensor of the terminal device detects the magnetic field strength of the adsorption area and transmits the detection result to the sensor module. When the sensor module determines that a device is adsorbed on the adsorption area based on the detection result, it can report the adsorption event to the power management module.

[0105] When the power management module receives an adsorption event, it can control the boost circuit switch to open, so that the battery can supply power to the wireless charging chip. When the power management module detects that the voltage of the wireless charging chip is within the normal range, it controls the wireless charging chip to send a device detection signal.

[0106] For example, the wireless charging chip may apply a power signal to the wireless charging coil to thereby send a device detection signal.

[0107] In an embodiment of the present application, the device detection signal may be a ping signal. By sending the ping signal, it is possible to confirm whether an auxiliary device exists, thereby avoiding charging other devices when other devices are adsorbed, thereby wasting resources.

[0108] S302: After receiving the device detection signal sent by the terminal device, the auxiliary device sends a charging parameter data packet to the terminal device based on the wireless charging protocol.

[0109] In an embodiment of the present application, the terminal device can wirelessly charge the auxiliary device based on the wireless charging protocol. During the wireless charging process, at different charging stages, the terminal device and the auxiliary device can interact based on different data packets to obtain information from both parties.

[0110] Table 1 shows some data packets generated based on the wireless charging protocol. Different data packets have different headers. Data packets generated by the wireless charging protocol consist of four parts: a preamble, a header, a message, and a checksum. For details, refer to conventional techniques and are not detailed here.

[0111] Table 1

[0112] For example, in an embodiment of the present application, when the auxiliary device receives a device detection signal sent by the terminal device, it can respond to the device detection signal and send a charging parameter data packet to the terminal device based on the wireless charging protocol to prompt the terminal device that the device detection signal has been received and wireless charging can be performed based on the wireless charging protocol.

[0113] The charging parameter data packet includes a signal strength data packet and a configuration parameter data packet.

[0114] The signal strength data packet includes the signal strength of the device detection signal received by the auxiliary device. The signal strength data packet can be used to detect the degree of coupling between the wireless charging coil of the auxiliary device and the wireless charging coil of the terminal device to indicate whether the auxiliary device is correctly adsorbed in the adsorption area. When the signal strength is high, it indicates that the degree of coupling between the wireless charging coil of the auxiliary device and the wireless charging coil of the terminal device is high, thereby determining that the auxiliary device is correctly adsorbed in the adsorption area. When the signal strength is low, it indicates that the degree of coupling between the wireless charging coil of the auxiliary device and the wireless charging coil of the terminal device is low, thereby determining that the auxiliary device is not correctly adsorbed in the adsorption area.

[0115] The configuration parameter data packet includes the power information required by the auxiliary device when charging. The configuration parameter data is used to instruct the terminal device to output power according to the required power, thereby charging the auxiliary device.

[0116] In some embodiments, the charging parameter data packet may further include an identity data packet, which includes attribute information of the auxiliary device, such as the version number of the chip used, the customer code, the manufacturer code, etc. The identity data packet is used to identify the identity of the auxiliary device.

[0117] S303: The terminal device charges the auxiliary device based on the charging parameter data packet.

[0118] Among them, after receiving the charging parameter data packet, the wireless charging chip of the terminal device can send the charging parameter data packet to the power management module. After receiving the charging parameter data packet, the power management module can determine the presence of an auxiliary device and charge the auxiliary device based on the charging parameter data packet.

[0119] For example, the power management module can identify and store the identity of the auxiliary device based on the surrounding identification data packet, and then confirm whether the auxiliary device is correctly attached to the attachment area based on the signal strength in the signal strength data packet. If it is determined that the auxiliary device is correctly attached to the attachment area, the wireless charging chip can be controlled to charge the auxiliary device according to the power information in the configuration parameter data packet. If it is determined that the auxiliary device is not correctly attached to the attachment area, the wireless charging chip can be controlled not to charge the auxiliary device.

[0120] Optionally, when the signal strength is less than a set strength threshold, it may indicate that the auxiliary device is not correctly attached to the attachment area, and when the signal strength is greater than the set strength threshold, it may indicate that the auxiliary device is correctly attached to the attachment area. The set strength threshold can be set according to actual needs.

[0121] In some embodiments, when the power management module detects that the auxiliary device is not properly attached to the attachment area, the power management module may also send information indicating that the auxiliary device is not properly attached to the attachment area to the accessory management service. Upon receiving this information, the accessory management service may send an instruction to the pop-up window service, causing the pop-up window service to display a prompt on the display interface of the terminal device indicating that the auxiliary device is not properly attached. It is understood that when the user sees this prompt, they can adjust the auxiliary device to ensure that the auxiliary device is properly attached to the attachment area of ​​the terminal device.

[0122] It is understandable that the auxiliary device can send the signal strength data packet, configuration parameter data packet, identity data packet and other data packets included in the charging parameter data packet in sequence or simultaneously to the terminal device. There is no specific limitation and it can be set according to actual needs. Among them, when the signal strength data packet, configuration parameter data packet, identity data packet and other data packets are sent in sequence, their sending order can be set according to needs and there is no specific limitation. For example, the auxiliary device can send the signal strength data packet, identity data packet and configuration parameter data packet to the terminal device in sequence.

[0123] It can be understood that when the wireless charging chip is controlled to charge the auxiliary device according to the power information in the configuration parameter data packet, the auxiliary device can be powered. After the auxiliary device is powered, the auxiliary device and the terminal device can establish a communication connection to exchange information.

[0124] In order to improve the reliability of data transmission, in the embodiment of the present application, before the auxiliary device establishes a communication connection with the terminal device, the device connection method may further include S304 to S305.

[0125] S304: The auxiliary device sends a handshake message to the terminal device.

[0126] Before establishing a communication connection between the auxiliary device and the terminal device, a handshake signal can be used to confirm the identities of the communication auxiliary device and the terminal device and to conduct data negotiation, thereby ensuring the reliability and security of data transmission.

[0127] For example, after the terminal device charges the auxiliary device, the auxiliary device is powered on, and the auxiliary device can send a handshake data packet to the terminal device.

[0128] In an embodiment of the present application, the auxiliary device and the terminal device can perform handshake interaction based on the wireless charging protocol by sending private data packets.

[0129] For example, the auxiliary device can send a private protocol packet with a header of "0x38" to the terminal device via the wireless charging protocol for handshake. That is, the handshake information can include the private protocol packet with a header of "0x38". The data information in the private protocol packet can be configured as needed, as long as it is recognizable by the terminal device and the auxiliary device. For example, the handshake information can be a private protocol packet of "0x38 0x3b 0x88 0x66", where 0x3b 0x88 0x66 is the data information in the private protocol packet.

[0130] In some embodiments, the auxiliary device and the terminal device may also perform handshake interaction via other communication protocols, which are not limited here.

[0131] S305: The terminal device sends a handshake reply message to the auxiliary device.

[0132] Among them, after receiving the handshake information sent by the auxiliary device, the wireless charging chip of the terminal device can send the handshake information to the power management module. The battery management module responds to the handshake information and sends a handshake reply message to the auxiliary device through the wireless charging chip to indicate that the auxiliary device can send data.

[0133] It is understandable that the terminal device may also send a handshake reply message to the auxiliary device based on the wireless charging protocol. For example, the auxiliary device may send a private protocol packet with a header of "0x38 0x3b 0x88 0x66" to the terminal device through the wireless charging protocol for handshake. After receiving the handshake message, the terminal device may send a private protocol packet with a header of "0x3F 0x3b 0x88 0x66" to the auxiliary device through the wireless charging protocol for handshake reply. That is, the handshake reply message sent by the terminal device may include a private protocol packet of "0x3F 0x3b 0x88 0x66", where 0x3F is the header of the private protocol packet and 0x3b 0x88 0x66 is the data information in the private protocol packet.

[0134] S306: The auxiliary device sends a protocol data packet to the terminal device.

[0135] After receiving the handshake reply information sent by the terminal device, the auxiliary device indicates that the handshake with the terminal device has been completed, and a communication connection can be established.

[0136] In an embodiment of the present application, the auxiliary device and the terminal device can establish a communication connection based on a communication protocol.

[0137] The communication protocol between the terminal device and the auxiliary device may be a wireless short-range communication protocol, such as the Star Alliance protocol, the Bluetooth protocol, and the like.

[0138] Considering that the terminal device and the auxiliary device can support different communication protocols, for example, the auxiliary device can support the Bluetooth communication protocol to establish a communication connection, while the terminal device can support the Star Alliance protocol to establish a communication protocol. The two support different communication protocols. If the terminal device and the auxiliary device support different communication protocols, if an incompatible communication protocol is selected to establish a communication connection, the communication connection between the terminal device and the auxiliary device may be unstable and data transmission may have a large delay. In order to select an adaptive and correct communication protocol to establish a communication connection between the terminal device and the auxiliary device, the auxiliary device can send a protocol data packet to the terminal device.

[0139] In the embodiment of the present application, a protocol data packet may be sent to the terminal device based on the wireless charging protocol. For example, a data packet with a header of "0x58" may be sent to the terminal device based on the wireless charging protocol.

[0140] In the embodiment of the present application, the protocol data packet includes the identifiers of one or more communication protocols supported by the auxiliary device. It is understandable that different communication protocols have different identifiers.

[0141] In an embodiment of the present application, in a protocol data packet, the identifier of the communication protocol can be represented by a field. Different identifiers use different fields. For example, when the auxiliary device supports communication protocol A, the protocol data packet can include the identification field X1 corresponding to communication protocol A. When the auxiliary device supports protocol B, the protocol data packet can include the identification field X2 corresponding to communication protocol B.

[0142] S307: Obtain a target communication protocol for communicating with the auxiliary device according to the identifiers of one or more communication protocols supported by the auxiliary device.

[0143] Among them, after receiving the protocol data packet, the wireless charging chip of the terminal device sends the protocol data packet to the power management module. The power management module parses the protocol data packet and can obtain the identifier in the protocol data packet.

[0144] Optionally, the terminal device stores an identifier of the communication protocol. After obtaining the identifier in the protocol data packet, the identifier in the protocol data packet is compared with the stored identifier to obtain the communication protocol supported by the auxiliary device.

[0145] After obtaining the communication protocols supported by the auxiliary device, it is possible to determine from the communication protocols supported by the auxiliary device whether there is a communication protocol that the auxiliary device itself also supports, that is, from the communication protocols supported by the auxiliary device, obtain the communication protocols that the terminal device and the auxiliary device can support at the same time. After obtaining the communication protocols that the terminal device and the auxiliary device can support at the same time, the communication protocol that the terminal device and the auxiliary device can support at the same time can be determined as the target communication protocol.

[0146] Considering that the terminal device and the auxiliary device may support multiple communication protocols simultaneously, in order to select a communication protocol that is more adaptable, has more stable data transmission, and reduces latency, in embodiments of the present application, a target communication protocol for communicating with the auxiliary device can be obtained based on the identifiers of one or more communication protocols supported by the auxiliary device, the communication protocols supported by the terminal device, and preset communication rules. It is understood that the target communication protocol is a communication protocol from the one or more communication protocols supported by the accessory device.

[0147] The preset communication rule may also be a communication protocol with the top N priorities as the target communication protocol, where N is a positive integer greater than or equal to 1. The priority of the communication protocol can be set according to actual needs and is not specifically limited in the embodiments of the present application. For example, the priority of the Star Alliance protocol is higher than the priority of the Bluetooth protocol.

[0148] In some embodiments, the preset communication rule may also be the terminal device with the highest usage frequency or the fastest transmission speed, etc., which can be set according to actual needs.

[0149] When the terminal device obtains the target communication protocol for communicating with the auxiliary device based on the identifiers of one or more communication protocols supported by the auxiliary device, the communication protocols that the terminal device can support, and the preset communication rules, it can first obtain the communication protocol that the auxiliary device can support based on the identifier, and then obtain the communication protocol supported by both the auxiliary device and the terminal device based on the communication protocols that the auxiliary device can support and the communication protocols that the terminal device can support, and then determine the target communication protocol from the communication protocols supported by both the auxiliary device and the terminal device based on the preset communication rules.

[0150] The preset communication rules can also be used as the target communication protocol with the communication protocol ranked in the top N in priority, with N being 1 as an example. If the communication protocols that the auxiliary device can support according to the identification are the Star Flash Alliance Protocol and the Bluetooth Protocol, and the terminal device can also support the Star Flash Alliance Protocol and the Bluetooth Protocol, that is, the auxiliary device and the terminal device can both support the Star Flash Alliance Protocol and the Bluetooth Protocol, and the priority of the Star Flash Alliance Protocol is higher than the priority of the Bluetooth Protocol, then the target communication protocol obtained according to the preset communication rules is the Star Flash Protocol.

[0151] It can be understood that when it is found that the terminal device and the auxiliary device can only support one communication protocol at the same time, the communication protocol can be directly used as the target communication protocol.

[0152] For example, if the communication protocol that the auxiliary device can support according to the identifier is the Bluetooth protocol, and the terminal device can support the Star Alliance protocol and the Bluetooth protocol, that is, the auxiliary device and the terminal device can support the Bluetooth protocol at the same time, then the target communication protocol that can be directly obtained is the Bluetooth protocol.

[0153] For example, if the communication protocols that the auxiliary device can support according to the identifier are Bluetooth protocol and Star Alliance protocol, and the terminal device can support Bluetooth protocol, that is, the auxiliary device and the terminal device can support Bluetooth protocol at the same time, then the target communication protocol that can be directly obtained is Bluetooth protocol.

[0154] S308: The terminal device sends a communication protocol confirmation packet to the auxiliary device.

[0155] Among them, after obtaining the target communication protocol, a communication protocol confirmation packet can be sent to the auxiliary device through the wireless charging chip. The communication protocol confirmation packet refers to a data packet sent to confirm the use of the target communication protocol, and the communication protocol confirmation packet includes information about the target communication protocol.

[0156] Optionally, the information of the target communication protocol in the communication protocol confirmation packet may be an identifier of the target communication protocol. For example, taking the Star Flash Alliance Protocol as an example, assuming that the auxiliary device supports the Star Flash Alliance Protocol, the auxiliary device can send a protocol data packet of "0x58 80XXX (Star Flash)" to the terminal device based on the wireless charging protocol, set the identifier of the terminal device in the protocol data packet, and obtain that the target communication protocol for communicating with the auxiliary device is also the Star Flash Alliance Protocol. The terminal device can then send a communication protocol confirmation packet of "0x5F 80XXX (Star Flash)" to the auxiliary device.

[0157] It can be understood that in the embodiment of the present application, the terminal device can also send a communication protocol confirmation packet to the auxiliary device based on the wireless charging protocol.

[0158] It can be understood that since the communication protocol confirmation packet includes information of the target communication protocol, by sending the communication protocol packet to the auxiliary device, the auxiliary device can be instructed to transmit the connection address corresponding to the target communication protocol.

[0159] S309: The auxiliary device sends the connection address corresponding to the target communication protocol to the terminal device.

[0160] After receiving the communication protocol confirmation packet, the auxiliary device can determine the target communication protocol for communicating with the terminal device based on the information in the communication protocol confirmation packet. For example, if the auxiliary device receives the communication protocol confirmation packet "0x5F 80XXX (Star Flash)", it can determine that the target communication protocol for communicating with the terminal device is the Star Flash Alliance Protocol.

[0161] After the auxiliary device obtains the target communication protocol for communicating with the terminal device, it can send the connection address corresponding to the target communication protocol to the terminal device.

[0162] In an embodiment of the present application, the auxiliary device may also send an address information packet to the terminal device based on the wireless charging protocol. The address information packet includes a connection address corresponding to the target communication protocol. For example, the auxiliary device may send an address information packet of "0x58 52XXX (connection address)" to the terminal device based on the wireless charging protocol.

[0163] In some embodiments, considering that the connection address is long, the connection address may be divided into multiple address information data packets and sent to the terminal device.

[0164] It should be noted that in the embodiments of the present application, the connection address refers to the MAC address. For example, when the target communication protocol is the Bluetooth protocol, the auxiliary device can send the Bluetooth MAC address to the terminal device. When the target communication protocol is the Star Alliance protocol, the auxiliary device can send the Star MAC address to the terminal device. It is understandable that if the target communication protocol includes multiple communication protocols, the auxiliary device can send all the communication protocols included in the target communication protocol to the terminal device.

[0165] S310: The terminal device establishes a communication connection with the auxiliary device according to the connection address.

[0166] After receiving the connection address, the wireless charging chip of the terminal device can send the connection address to the power management module. The power management module sends the connection address to the accessory management service. Once the accessory management service receives the connection address, it can send a connection operation instruction to the short-range service to notify the short-range service to initiate a connection with the auxiliary device. The connection operation instruction includes the connection address. Upon receiving the connection operation instruction, the short-range service can initiate a connection with the auxiliary device.

[0167] For example, the short-range service can achieve a directional connection by controlling the short-range chip through a short-range driver to send a connection signal to the connection address using an antenna. After receiving the connection signal, the auxiliary device responds to the connection signal and establishes a communication connection with the terminal device. In this way, the terminal device and the auxiliary device can transmit data.

[0168] Considering that in actual application, the user may only wirelessly charge the auxiliary device through the terminal device, and there is no need to establish a communication connection for data transmission. Based on this, in order to improve the user experience and avoid misoperation (misconnection), in the embodiment of the present application, the step of establishing a communication connection between the terminal device and the auxiliary device according to the connection address may also include:

[0169] (1) When the target communication protocol is one of the one or more communication protocols supported by the auxiliary device, a first connection prompt is issued to the user.

[0170] (2) After receiving the user's operation to confirm the connection, a communication connection is established with the auxiliary device according to the connection address.

[0171] Among them, when the accessory management service of the terminal device obtains the connection address corresponding to the target communication protocol, it can send an instruction to the pop-up service to instruct the pop-up service to initiate a connection prompt.

[0172] It is understandable that the instruction sent to the pop-up service may include a connection address corresponding to the target communication protocol. After receiving the instruction, the pop-up service may provide a connection prompt on the display interface of the terminal device.

[0173] Optionally, in an embodiment of the present application, the pop-up service can provide a connection prompt on the display interface of the terminal device through a dialog box, a function box, a dialogue prompt box, etc.

[0174] In an embodiment of the present application, when the target communication protocol is one of the one or more communication protocols supported by the auxiliary device, the pop-up service can provide a first connection prompt on the display interface of the terminal device.

[0175] Among them, the first connection prompt refers to a prompt instructing the user whether to establish a connection with the auxiliary device based on the target communication protocol. For example, please refer to Figure 6. When the pop-up service makes the first connection prompt on the display interface of the terminal device, the display interface of the terminal device may display a dialog box of "whether to connect to the auxiliary device A based on the connection address of the target communication protocol a" and "OK" or "Reject". It can be understood that after the first connection prompt is made, the user can choose whether to connect to the auxiliary device based on the target communication protocol according to the first connection prompt. When the user chooses to connect to the auxiliary device based on the target communication protocol, he can click on the "OK" dialog box. The pop-up service responds to the user's operation of confirming the connection and sends a connection operation instruction to the short-distance service. After receiving the connection operation instruction, the short-distance service responds to the connection operation instruction and initiates the connection operation on the auxiliary device. The short-distance driver controls the short-distance chip to use the antenna to send a signal to the connection address, thereby performing a directional connection and establishing communication between the terminal device and the auxiliary device.

[0176] When the user chooses to refuse to connect to the auxiliary device based on the target communication protocol, he can click the "Reject" dialog box. The pop-up service responds to the user's operation of refusing the connection and sends a message of user refusal to the accessory management service. After receiving the message of user refusal to connect, the accessory management service does not need to initiate the connection.

[0177] Considering that there may be multiple communication protocols for the target communication protocol to be connected, in order to facilitate the establishment of a communication connection between the auxiliary device and the terminal device. In an embodiment of the present application, the step of establishing a communication connection between the terminal device and the auxiliary device according to the connection address may also include:

[0178] (a) When the target communication protocol is at least two of the one or more communication protocols supported by the auxiliary device, a second connection prompt is issued to the user.

[0179] (b) After receiving the target connection address specified by the user, a communication connection is established with the auxiliary device according to the target connection address.

[0180] The second connection prompt includes a connection address of a target communication protocol, and the second connection prompt refers to a prompt instructing the user to determine a connection address to be connected to from a plurality of connection addresses.

[0181] Accordingly, the pop-up service can make a second connection prompt on the display interface of the terminal device. For example, please refer to Figure 7. When the target communication protocol includes the Bluetooth protocol and the Star Flash protocol, when the pop-up service makes a second connection prompt on the display interface of the terminal device, the display interface of the terminal device can display dialog boxes such as "Connecting to auxiliary device A based on the connection address of the Bluetooth protocol", "Connecting to auxiliary device A based on the connection address of the Star Flash protocol", and "Reject".

[0182] When the user chooses to connect to auxiliary device A using a connection address based on the Bluetooth protocol, they can click on the "Connect to auxiliary device A using a connection address based on the Bluetooth protocol" dialog box. The pop-up service responds to the user's operation and obtains the target connection address specified by the user as the Bluetooth protocol connection address. Then, based on the Bluetooth protocol connection address, a connection operation instruction can be sent to the short-range service. The connection operation instruction may include the Bluetooth protocol connection address. After receiving the connection operation instruction, the short-range service responds to the connection operation instruction and initiates a connection operation on the auxiliary device. By controlling the short-range chip through the short-range driver, the short-range chip uses the antenna to send a signal to the Bluetooth protocol connection address, thereby establishing a directional connection and establishing communication between the terminal device and the auxiliary device.

[0183] When the user chooses to connect to auxiliary device A based on the connection address of the Star Flash Alliance Protocol, he can click on the dialog box of "Connect to auxiliary device A based on the connection address of the Star Flash Alliance Protocol". The pop-up service responds to the user operation and obtains the target connection address of the user-specified connection as the connection address of the Star Flash Alliance Protocol. Then, according to the connection address of the Star Flash Alliance Protocol, a connection operation instruction can be sent to the short-distance service. The connection operation instruction may include the connection address of the Star Flash Alliance Protocol. After receiving the connection operation instruction, the short-distance service responds to the connection operation instruction and initiates a connection operation on the auxiliary device. The short-distance driver controls the short-distance chip to use the antenna to send a signal to the connection address of the Star Flash Alliance Protocol, thereby performing a directional connection and establishing communication between the terminal device and the auxiliary device.

[0184] When the user chooses to refuse the connection, he can click on the "Reject" dialog box. The pop-up service responds to the user's operation of refusing the connection and sends a message of user's refusal to the accessory management service. After receiving the message of user's refusal to connect, the accessory management service does not need to initiate the connection.

[0185] Considering that in actual applications, the modes of the auxiliary device and the terminal device do not match, for example, when the models of the auxiliary device and the terminal device do not match, the connection between the auxiliary device and the terminal device may fail. In order to reduce the workload and promptly detect the problem of connection mismatch, in an embodiment of the present application, the auxiliary device can also send a mode identifier to the terminal device, and the terminal device can detect whether the auxiliary device matches itself based on the mode identifier. Therefore, in an embodiment of the present application, it can also include:

[0186] (A) Obtaining a connection detection result of the auxiliary device according to the mode identifier sent by the auxiliary device.

[0187] (B) If the connection detection result of the auxiliary device indicates that the auxiliary device can be connected, a connection prompt is issued to the user.

[0188] After sending the connection address to the terminal device, the auxiliary device may send a mode identifier (Mode ID) to the terminal device.

[0189] In an embodiment of the present application, the auxiliary device may also send a mode identification packet to the terminal device based on the wireless charging protocol, where the mode identification packet includes mode information of the auxiliary device. For example, the auxiliary device may send a mode identification packet of "0x58 54XXX (mode identification)" to the terminal device based on the wireless charging protocol.

[0190] The terminal device pre-stores mode identifiers of connectable devices. Upon receiving a mode identifier sent by an auxiliary device, the terminal device matches the mode identifier sent by the auxiliary device with the stored mode identifiers of the connectable device. If a target mode identifier matching the mode identifier sent by the auxiliary device is found among the stored mode identifiers of the connectable device, a connection detection result indicating that the auxiliary device is connectable is obtained. If a target mode identifier matching the mode identifier sent by the auxiliary device is not found among the stored mode identifiers of the connectable device, a connection detection result indicating that the auxiliary device is not connectable is obtained.

[0191] After obtaining a connection detection result indicating that the auxiliary device can connect, the terminal device can prompt the user to connect. It is understood that when the target communication protocol is one of the one or more communication protocols supported by the auxiliary device, a first connection prompt is issued to the user. When the target communication protocol is at least two of the one or more communication protocols supported by the auxiliary device, a second connection prompt is issued to the user. For details, please refer to the above description and will not be repeated here. In the embodiment of the present application, for auxiliary devices of the same type, their mode identifiers can be the same.

[0192] Considering that in actual applications, most terminal devices and auxiliary devices are equipped with Bluetooth modules, that is, most terminal devices and auxiliary devices can be connected based on the Bluetooth protocol, in order to reduce workload and improve connection efficiency, referring to Figure 8, the device connection method provided in the embodiment of the present application may also include steps S401 to S409.

[0193] S401: When receiving an adsorption event, the terminal device sends a device detection signal.

[0194] S402: After receiving the device detection signal sent by the terminal device, the auxiliary device sends a charging parameter data packet to the terminal device based on the wireless charging protocol.

[0195] S403: The terminal device charges the auxiliary device based on the charging parameter data packet.

[0196] S404: The auxiliary device sends a handshake message to the terminal device.

[0197] S405: The terminal device sends a handshake reply message to the auxiliary device.

[0198] Among them, the specific process of steps S401 to S405 can refer to steps S301 to S305 and will not be repeated here.

[0199] S406: The auxiliary device sends a protocol data packet to the terminal device, where the protocol data packet includes an identifier of a priority communication protocol supported by the auxiliary device.

[0200] The priority communication protocol refers to the communication protocol with the highest priority among one or more communication protocols supported by the auxiliary device, that is, the communication protocol with which the connection is established first.

[0201] In an embodiment of the present application, when the auxiliary device can support multiple communication protocols, after receiving the handshake reply information, it can directly send a protocol data packet including the identifier of the preferred communication protocol to the terminal device.

[0202] S407: If the terminal device supports the priority communication protocol, a communication protocol confirmation packet including the identifier of the priority communication protocol is sent to the auxiliary device; if the terminal device does not support the priority communication protocol, a communication protocol confirmation packet including the identifier of the Bluetooth protocol is sent to the auxiliary device.

[0203] Among them, after obtaining the protocol data packet, the terminal device parses the protocol data packet to obtain the identification of the protocol data packet, and obtains the priority communication protocol supported by the auxiliary device based on the identification of the protocol data packet. After obtaining the priority communication protocol supported by the auxiliary device, if the terminal device can also support the priority communication protocol, the priority communication protocol can be used as the target communication protocol, and a communication protocol confirmation packet including the identification of the priority communication protocol is sent to the auxiliary device. If the terminal device does not support the priority communication protocol, the Bluetooth protocol can be used as the target communication protocol, and a communication protocol confirmation packet including the identification of the Bluetooth protocol is sent to the terminal.

[0204] S408: If the communication protocol confirmation package includes the identifier of the priority communication protocol, the auxiliary device sends the connection address corresponding to the priority communication protocol to the terminal device; if the communication protocol confirmation package includes the identifier of the Bluetooth protocol, the auxiliary device sends the connection address corresponding to the Bluetooth protocol to the terminal device.

[0205] After receiving the communication protocol confirmation packet, the auxiliary device parses the packet. If the packet contains an identifier for the preferred communication protocol, the auxiliary device sends the connection address corresponding to the preferred communication protocol to the terminal device. If the packet contains an identifier for the Bluetooth protocol, the auxiliary device sends the connection address corresponding to the Bluetooth protocol to the terminal device. The specific process of sending the connection address can be found in step S309 and is not detailed here.

[0206] S409: The terminal device establishes a communication connection with the auxiliary device according to the connection address.

[0207] The specific process of step S409 can refer to S310 and will not be repeated here.

[0208] For example, please refer to Figure 9 and take the Star Alliance Protocol as the priority communication protocol for explanation. When the terminal device receives an adsorption event, it sends a ping signal. After receiving the device detection signal sent by the terminal device, the auxiliary device sends a signal strength data packet (SS data packet), an identity data packet (ID data packet), and a configuration parameter data packet (CFG data packet) to the terminal device based on the wireless charging protocol. The terminal device charges the auxiliary device based on the signal strength data packet, the identity data packet, and the configuration parameter data packet. After power-on, the auxiliary device sends a private protocol packet of "0x38 0x3b 0x88 0x66" to the terminal device for handshake, and the terminal device sends a private protocol packet of "0x3F 0x3b 0x88 0x66" to the auxiliary device in response to the handshake. After receiving the handshake reply, the auxiliary device sends a protocol data packet of "0x58 80XXX (Star Flash)" to the terminal device, that is, a protocol data packet including the identifier of the Star Flash Alliance Protocol. After receiving the protocol data packet of "0x58 80XXX (Star Flash)", if the terminal device supports the Star Flash Alliance Protocol, it can reply to the auxiliary device with a communication protocol confirmation packet of "0x5F 80XXX (Star Flash)". If the terminal device does not support the Star Flash Alliance Protocol, it can reply to the auxiliary device with a communication protocol confirmation packet of "0x5F 80XXX (Bluetooth)". When the auxiliary device receives the communication protocol confirmation packet, if the communication protocol confirmation packet includes the Star Flash Alliance protocol identifier, it sends the address information data packet of "0X58 52XXX (Star Flash MAC address)" and the address information data packet of "0X58 53XXX (Star Flash MAC address)" to the terminal device; if the communication protocol confirmation includes the Bluetooth protocol identifier, it sends the address information data packet of "0X58 52XXX (Bluetooth MAC address)" and the address information data packet of "0X58 53XXX (Bluetooth MAC address)" to the terminal device.

[0209] After receiving the address information packet, the terminal device can reply with an ACK confirmation message to the auxiliary device to indicate that the data has been received correctly. After that, the auxiliary device can also send a mode identification packet with "0x58 54XXX (ModeID)" to the terminal device. After receiving the mode identification packet, the terminal device can also reply with an ACK confirmation message to the auxiliary device.

[0210] It is understandable that after receiving the mode identifier and the connection address, the terminal device can perform subsequent operations of establishing a communication connection with the auxiliary device. For details, please refer to the above description of S310 and will not be repeated here.

[0211] It should be noted that when the auxiliary device only supports the Bluetooth protocol, after receiving the handshake reply message sent by the terminal device, the connection address corresponding to the Bluetooth protocol can be directly sent to the terminal device. Based on this, please refer to Figure 10, the device connection method of the embodiment of the present application may also include:

[0212] S501: When receiving an adsorption event, the terminal device sends a device detection signal.

[0213] S502: After receiving the device detection signal sent by the terminal device, the auxiliary device sends a charging parameter data packet to the terminal device based on the wireless charging protocol.

[0214] S503: The terminal device charges the auxiliary device based on the charging parameter data packet.

[0215] S504: The auxiliary device sends a handshake message to the terminal device.

[0216] S505: The terminal device sends a handshake reply message to the auxiliary device.

[0217] Among them, the specific process of steps S501 to S505 can refer to steps S301 to S305 and will not be repeated here.

[0218] S506: The auxiliary device sends a connection address corresponding to the Bluetooth protocol to the terminal device.

[0219] If the auxiliary device only supports the Bluetooth protocol, it is assumed that the auxiliary device and the terminal device establish a communication connection using the Bluetooth protocol. Therefore, after receiving the handshake reply message sent by the terminal device, the auxiliary device can directly send the connection address corresponding to the Bluetooth protocol to the terminal device, so that the terminal device can establish a communication connection based on the connection address corresponding to the Bluetooth protocol.

[0220] S507: The terminal device establishes a communication connection with the auxiliary device according to the connection address.

[0221] Among them, after receiving the connection address, the terminal device can establish a communication connection with the auxiliary device according to the connection address. The specific process can be referred to S310 and will not be repeated here.

[0222] For example, referring to Figure 11, upon receiving a pickup event, the terminal device sends a ping signal. After receiving the device detection signal from the terminal device, the auxiliary device sends a signal strength packet (SS packet), an identity packet (ID packet), and a configuration parameter packet (CFG packet) to the terminal device based on the wireless charging protocol. The terminal device charges the auxiliary device based on the signal strength packet, identity packet, and configuration parameter packet. After powering on, the auxiliary device sends a private protocol packet "0x38 0x3b 0x88 0x66" to the terminal device for a handshake. The terminal device responds with a private protocol packet "0x3F 0x3b 0x88 0x66" to the auxiliary device for a handshake. After receiving the handshake response, the auxiliary device sends an address information packet "0X58 52XXX (Bluetooth MAC address)" and an address information packet "0X58 53XXX (Bluetooth MAC address)" to the terminal device. Upon receiving the address information packet, the terminal device can respond with an ACK message to the auxiliary device, indicating that the data has been received correctly. Afterwards, the auxiliary device may further send a mode identification data packet of “0x58 54XXX (ModeID)” to the terminal device. After receiving the mode identification data packet, the terminal device may also reply ACK confirmation information to the auxiliary device.

[0223] Considering that the protocol data packet transmitted separately will increase the communication connection time between the auxiliary device and the terminal device, for example, it will prolong the time it takes for the auxiliary device to be adsorbed to the pop-up prompt. In order to improve efficiency and reduce the communication connection time between the auxiliary device and the terminal device, in the embodiment of the present application, the protocol data packet can be an identity identification data packet generated based on the wireless charging protocol, and the communication protocol confirmation packet can also be a handshake reply message generated based on the wireless charging protocol. Based on this, please refer to Figure 12, the device connection method provided in the embodiment of the present application can also include:

[0224] S601: When receiving an adsorption event, the terminal device sends a device detection signal.

[0225] S602: After receiving the device detection signal sent by the terminal device, the auxiliary device sends a charging parameter data packet to the terminal device based on the wireless charging protocol.

[0226] The charging parameter data includes a signal strength data packet, a configuration parameter data packet, and an identity identification data packet.

[0227] The identity packet carries the identifiers of one or more communication protocols supported by the auxiliary device via the identity field. Since the communication protocols supported by the auxiliary device may be determined by the manufacturer and seller, in this embodiment of the present application, the identifiers of one or more communication protocols supported by the auxiliary device may be carried via an identity field such as a customer code or a manufacturer code.

[0228] For example, as shown in Figure 13, the identity identification data packet includes the chip version number, customer code, manufacturer code and other identification fields, where the manufacturer code data information is located in the data bits B1 and B2, the customer code data information is the data bits B3 and B4, and the chip version number data information is the data bits B5 and B6. The data information corresponding to B1-B4 can carry the identification of the communication protocol, that is, the data information corresponding to B1-B4 can be used to represent the identification of the communication protocol. For example, when the data information corresponding to B1-B4 is 0x00 0x600x7F 0x00, it means that the auxiliary device supports the Star Alliance protocol and can also support the Bluetooth protocol.

[0229] It is understandable that when the auxiliary device supports different communication protocols, the data information corresponding to B1-B4 is also different.

[0230] S603: The terminal device charges the auxiliary device based on the charging parameter data packet.

[0231] Among them, after receiving the charging parameter data packet, the terminal device can perform a charging operation on the auxiliary device based on the signal strength data packet and the configuration parameter data in the charging parameter data packet. For details, please refer to S303 and will not be repeated here.

[0232] It can be understood that after receiving the charging parameter data packet, the terminal device parses and identifies the identity data packet in the charging parameter data packet to obtain one or more communication protocols supported by the auxiliary device.

[0233] Exemplarily, the terminal device stores communication protocols corresponding to different data information in the identity field. After obtaining the data information of the identity field in the identity data packet, the terminal device can compare the data information of the identity field in the local identification data packet with the stored data information, obtain target data information from the stored data information that is identical to the data information of the identity field in the local identification data packet, and determine the communication protocol corresponding to the target data information as the communication protocol supported by the auxiliary device. For example, if the data information corresponding to the customer code and manufacturer code in the identity data packet is 0x00 0x60 0x7F 0x00, the terminal device can compare 0x00 0x60 0x7F 0x00 with the stored data information to obtain the communication protocol supported by the auxiliary device.

[0234] S604: The auxiliary device sends a handshake message to the terminal device.

[0235] Among them, after the terminal device charges the auxiliary device, the auxiliary device is powered on, and the auxiliary device can send a handshake data packet to the terminal device. The specific process can be referred to S304 and will not be repeated here.

[0236] S605: The terminal device sends a communication protocol confirmation packet to the auxiliary device.

[0237] Among them, after obtaining the communication protocol supported by the auxiliary device, the terminal device can determine the target communication protocol from the communication protocols supported by the auxiliary device, and then after receiving the handshake information sent by the auxiliary device, it can send a communication protocol confirmation package containing information about the target communication protocol as a handshake reply information to the auxiliary device.

[0238] Optionally, the target communication protocol information in the communication protocol confirmation packet may be field information indicating the target communication protocol to be used. For example, when the target communication protocol is the Bluetooth protocol, after the auxiliary device sends a private protocol packet with a header of "0x38 0x3b 0x88 0x66" to the terminal device via the wireless charging protocol for handshake, the terminal device may reply to the auxiliary device with a communication protocol confirmation packet of "0x3F 0x3b 0x88 0x66" via the wireless charging protocol, where 0x3F 0x3b 0x88 0x66 is the field information indicating the Bluetooth protocol to be used. When the target communication protocol is the Star Alliance protocol, after the auxiliary device sends a private protocol packet with a header of "0x38 0x3b 0x88 0x66" to the terminal device through the wireless charging protocol for handshake, the terminal device can reply to the auxiliary device with a communication protocol confirmation packet of "0x3F 0x3b 0x88 0x88" through the wireless charging protocol. Among them, 0x3F 0x3b 0x88 0x88 is the field information of using the Star Alliance protocol.

[0239] In some embodiments, when there are multiple target communication protocols, the terminal device may send communication protocol confirmation packets corresponding to the multiple target communication protocols to the auxiliary device. For example, when the multiple target communication protocols include Bluetooth and Star Alliance protocols, the terminal device may send a communication protocol confirmation packet corresponding to the Bluetooth protocol and a communication protocol confirmation packet corresponding to the Star Alliance protocol to the auxiliary device.

[0240] It can be understood that the specific process of determining the target communication protocol from the communication protocols supported by the auxiliary device can refer to S307 and will not be described in detail here.

[0241] S606: The auxiliary device sends the connection address corresponding to the target communication protocol to the terminal device.

[0242] After receiving the communication protocol confirmation packet, the auxiliary device can obtain the target communication protocol for communicating with the terminal device according to the information in the communication protocol packet.

[0243] The auxiliary device pre-stores information on supported communication protocols. After obtaining the information in the communication protocol confirmation package, the information in the communication protocol confirmation package can be matched with the pre-stored information to determine the target communication protocol for communicating with the terminal device.

[0244] After the auxiliary device obtains the target communication protocol for communicating with the terminal device, it can send the connection address corresponding to the target communication protocol to the terminal device.

[0245] Exemplarily, after the auxiliary device receives the communication protocol confirmation packet "0x3F 0x3b 0x88 0x66", it matches the information "0x3F 0x3b 0x88 0x66" in the communication protocol confirmation packet, and obtains that the target communication protocol for communicating with the terminal device is the Bluetooth protocol, and then the connection address corresponding to the Bluetooth protocol can be sent to the terminal device. After the auxiliary device receives the communication protocol confirmation packet "0x3F 0x3b 0x88 0x88", it matches the information "0x3F 0x3b 0x88 0x88" in the communication protocol confirmation packet, and obtains that the target communication protocol for communicating with the terminal device is the Star Alliance Protocol, and then the connection address corresponding to the Star Alliance Protocol can be sent to the terminal device.

[0246] S607: The terminal device establishes a communication connection with the auxiliary device according to the connection address.

[0247] The specific process of the terminal device establishing a communication connection with the auxiliary device according to the connection address can be referred to S310 and will not be described in detail here.

[0248] For example, please refer to Figure 14, using the Star Alliance protocol as the preferred communication protocol for illustration. Upon receiving an adsorption event, the terminal device sends a ping signal. After receiving the device detection signal from the terminal device, the auxiliary device sends a signal strength packet (SS packet), an identity packet (ID packet), and a configuration parameter packet (CFG packet) to the terminal device based on the wireless charging protocol. The data corresponding to B1-B4 in the identity packet is 0x00 0x60 0x7F 0x00. The terminal device charges the auxiliary device based on the signal strength packet and the configuration parameter packet. After powering on, the auxiliary device sends a private protocol packet "0x38 0x3b 0x88 0x66" to the terminal device for a handshake. The terminal device responds with a communication protocol confirmation packet "0x3F 0x3b 0x88 0x88" to the auxiliary device. After receiving the communication protocol confirmation packet, the auxiliary device sends an address information data packet with the address information of "0X58 52 XXX (Xingshan MAC address)" and an address information data packet with the address information of "0X58 53 XXX (Xingshan MAC address)" to the terminal device. After receiving the address information data packet, the terminal device can reply with an ACK confirmation message to the auxiliary device to indicate to the auxiliary device that the data sent has been confirmed to be received correctly. Afterwards, the auxiliary device can also send a mode identification data packet with the address information of "0x58 54 XXX (ModeID)" to the terminal device. After receiving the mode identification data packet, the terminal device can also reply with an ACK confirmation message to the auxiliary device.

[0249] It can be understood that after receiving the mode identifier and the connection address, the terminal device can perform subsequent operations to establish a communication connection with the auxiliary device. For details, please refer to the above description and will not be repeated here.

[0250] The embodiment of the present application carries the identification of one or more communication protocols supported by the auxiliary device through an identity identification data packet and carries information of the target communication protocol through a handshake reply message, which can reduce the communication connection time between the auxiliary device and the terminal device and improve processing efficiency.

[0251] The embodiment of the present application carries the identifiers and connection addresses of different communication protocols through the wireless charging protocol, which can automatically determine the target communication protocol adapted between the terminal device and the auxiliary device and connect them, thereby ensuring the stability of the connection and reducing the transmission delay between the terminal device and the auxiliary device.

[0252] In the embodiment of the present application, the terminal device can actively pop up a connection prompt box after the auxiliary device is adsorbed for about 2 seconds, making user operation more convenient. After the auxiliary device is adsorbed, a one-to-one connection between the terminal device and the accessory can be achieved by transparently transmitting the MAC address and Mode ID.

[0253] In the embodiments of the present application, terminal devices that support both Star Flash and Bluetooth can connect to Bluetooth accessories, and can also connect to Star Flash accessories. Accessories that support both Star Flash and Bluetooth can connect to Bluetooth terminal devices, and can also connect to Star Flash terminal devices. Accessories and terminal devices that support both Star Flash and Bluetooth will be connected preferentially through Star Flash.

[0254] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which may be a terminal device or an auxiliary device in the above embodiment. The electronic device may specifically include a communication interface, a memory, a processor, and one or more computer programs. The communication interface, the memory, and the processor may be connected via one or more communication buses. The one or more computer programs are stored in the above memory and configured to be executed by the processor, and when the one or more computer programs are executed by the processor, the functions or steps in the above device connection method are implemented.

[0255] An embodiment of the present application also provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by the processing circuit, the functions or steps in the above-mentioned device connection method are implemented.

[0256] In addition, an embodiment of the present application can also provide a chip system, which includes a processing circuit and a storage medium, wherein the storage medium stores computer program instructions. When the computer program instructions are executed by the processing circuit, the functions or steps in the above-mentioned device connection method are implemented.

[0257] In addition, an embodiment of the present application may also provide a computer program product containing instructions, which, when executed on a computer, enables the computer to execute the functions or steps in the above-mentioned device connection method.

[0258] In addition, an embodiment of the present application may also provide a communication system, which includes an auxiliary device and a terminal device. The terminal device and the auxiliary device can be used to perform the functions or steps in the above-mentioned device connection method.

[0259] In addition, an embodiment of the present application may also provide an operating system, which, when running on a computer, enables the computer to execute the functions or steps in the above-mentioned device connection method.

[0260] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working processes of the chip system, electronic device, computer-readable storage medium, computer program product containing instructions, communication system, and operating system described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0261] It is understandable that the steps of the method or algorithm described in conjunction with the embodiments of the present application can be implemented in a hardware manner, or can be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory, a flash memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a register, a hard disk, a mobile hard disk, a read-only optical disc, or any other form of storage medium. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). In addition, the ASIC can be located in an electronic device. Of course, the processor and the storage medium can also be present in an electronic device as discrete components.

[0262] In an optional manner, when software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is implemented in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disk (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)).

[0263] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A device connection method, characterized in that: Applied to a terminal device, the method comprises: receiving a protocol data packet from an auxiliary device, the protocol data packet including identification of one or more communication protocols supported by the auxiliary device; Obtaining a target communication protocol for communicating with the auxiliary device according to the identifiers of one or more communication protocols supported by the auxiliary device; Sending a communication protocol confirmation packet to the auxiliary device, wherein the communication protocol confirmation packet includes information of the target communication protocol; receiving a connection address corresponding to the target communication protocol from the auxiliary device; A communication connection is established with the auxiliary device according to the connection address.

2. The device connection method according to claim 1, characterized in that: The protocol data packet is an identity identification data packet generated based on the wireless charging protocol, and the identity identification data packet carries the identification of the one or more communication protocols through an identity identification field.

3. The device connection method according to claim 2, characterized in that: Prior to receiving the protocol data packet from the auxiliary device, the method further includes: When receiving an adsorption event, a device detection signal is sent out, wherein the device detection signal is used to detect whether the auxiliary device exists, and the protocol data packet is sent by the auxiliary device after receiving the device detection signal.

4. The device connection method according to claim 3, characterized in that: After receiving the protocol data packet from the auxiliary device, the method further includes: charging the auxiliary device based on the charging parameter data packet sent by the auxiliary device; the charging parameter data packet is generated by the auxiliary device based on the wireless charging protocol after receiving the device detection signal; The sending of a communication protocol confirmation packet to the auxiliary device comprises: After receiving the handshake information sent by the auxiliary device, the communication protocol confirmation packet is sent to the auxiliary device, where the communication protocol confirmation packet is a data packet replying to the handshake information, and the handshake information is sent by the auxiliary device to the terminal device after starting charging.

5. The device connection method according to claim 1, characterized in that: Before receiving the protocol data packet from the auxiliary device, the method further includes: When receiving an adsorption event, sending a device detection signal, wherein the device detection signal is used to detect whether the auxiliary device exists; After receiving the charging parameter data packet sent by the auxiliary device, charging the auxiliary device based on the charging parameter data packet, wherein the charging parameter data packet is generated by the auxiliary device based on the wireless charging protocol after receiving the device detection signal; After receiving the handshake information sent by the auxiliary device, a handshake reply information is sent to the auxiliary device, and the protocol data packet is a data packet sent by the auxiliary device after receiving the handshake reply information.

6. The device connection method according to any one of claims 1 to 5, characterized in that: The obtaining, according to the identifiers of one or more communication protocols supported by the auxiliary device, a target communication protocol for communicating with the auxiliary device, comprises: A target communication protocol for communicating with the auxiliary device is obtained according to the identifiers of one or more communication protocols supported by the auxiliary device, the communication protocols supportable by the terminal device, and preset communication rules.

7. The device connection method according to any one of claims 1 to 6, characterized in that: The target communication protocol is one of the one or more communication protocols supported by the auxiliary device, and establishing a communication connection with the auxiliary device according to the connection address includes: Sending a connection prompt to the user; the connection prompt is a prompt indicating whether the user establishes a connection with the auxiliary device based on the target communication protocol; After receiving the user's operation of confirming the connection, a communication connection is established with the auxiliary device according to the connection address.

8. The device connection method according to any one of claims 1 to 6, characterized in that: The target communication protocol is at least two of the one or more communication protocols supported by the auxiliary device, and establishing a communication connection with the auxiliary device according to the connection address includes: Sending a connection prompt to the user, the connection prompt including the connection address of the target communication protocol, the connection prompt being a prompt instructing the user to determine a connection address to be connected to from a plurality of the connection addresses; After receiving the target connection address specified by the user, establish communication with the auxiliary device according to the target connection address connect.

9. The device connection method according to claim 7 or 8, characterized in that: The sending of a connection prompt to the user comprises: Obtaining a connection detection result of the auxiliary device according to the mode identifier sent by the auxiliary device; If the connection detection result of the auxiliary device indicates that the auxiliary device can be connected, the connection prompt is sent to the user.

10. The device connection method according to any one of claims 1 to 9, characterized in that: The communication protocol is a wireless short-range communication protocol, and the wireless short-range communication protocol includes the Star Flash Alliance protocol and the Bluetooth protocol.

11. A device connection method, characterized in that: Applied to auxiliary equipment, the method comprises: Sending a protocol data packet to a terminal device, the protocol data packet including identifications of one or more communication protocols supported by the auxiliary device; Receiving a communication protocol confirmation packet sent by the terminal device; Obtaining a target communication protocol for communicating with the terminal device according to information in the communication protocol confirmation packet; A connection address corresponding to the target communication protocol is sent to the terminal device, where the connection address is used to instruct the terminal device to establish a communication connection according to the connection address.

12. The device connection method according to claim 11, characterized in that: The sending of a protocol data packet to the terminal device includes: When receiving the device detection signal sent by the terminal device, the protocol data packet is sent to the terminal device, the protocol data packet is an identity identification data packet generated based on the wireless charging protocol, and the identity identification data packet carries the identification of the one or more communication protocols through the identity identification field.

13. The device connection method according to claim 12, characterized in that: Before receiving the communication protocol confirmation packet sent by the terminal device, the method further includes: In response to the charging operation of the terminal device based on the charging parameter data packet, a handshake message is sent to the terminal device, the communication protocol confirmation packet is sent by the terminal device after receiving the handshake message, and the charging parameter data packet is generated by the auxiliary device based on the wireless charging protocol after receiving the device detection signal, and sent to the terminal device.

14. The device connection method according to claim 11, characterized in that: The sending of a protocol data packet to the terminal device includes: When receiving a device detection signal sent by the terminal device, sending a charging parameter data packet to the terminal device; In response to a charging operation of the terminal device based on the charging parameter data packet, sending a handshake message to the terminal device; After receiving the handshake reply information sent by the terminal device, the protocol data packet is sent to the terminal device.

15. The device connection method according to any one of claims 11 to 14, characterized in that: After sending the connection address corresponding to the target communication protocol to the terminal device, the method further includes: A mode identifier is sent to the terminal device, where the mode identifier is used to assist the terminal device in determining a connection detection result of the auxiliary device.

16. The device connection method according to any one of claims 11 to 15, characterized in that: The communication protocol is a wireless short-range communication protocol, and the wireless short-range communication protocol includes the Star Flash Alliance protocol and the Bluetooth protocol.

17. An electronic device, characterized in that: include: a memory for storing computer program instructions; A processor is used to execute the computer program instructions to support the electronic device to implement the method as described in any one of claims 1-10 or to implement the method as described in any one of claims 11-16.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processing circuit, the method according to any one of claims 1 to 10 or the method according to any one of claims 11 to 16 is implemented.

19. A chip system, characterized in that: The chip system includes a processing circuit and a storage medium, wherein the storage medium stores computer program instructions; when the computer program instructions are executed by the processing circuit, the method described in any one of claims 1 to 10 or the method described in any one of claims 11 to 16 are implemented.

20. An operating system, characterized in that: When the operating system runs on a computer, the computer is enabled to execute the method according to any one of claims 1 to 10 or the method according to any one of claims 11 to 16.

21. A computer program product comprising instructions, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 10 or the method according to any one of claims 11 to 16.

Citation Information

Patent Citations

  • Equipment connection method, electronic equipment and computer readable storage medium

    CN119545578A

  • Device connection method and apparatus, electronic device and computer readable medium

    CN109450851A

  • Control method, electronic equipment and writing interaction device

    CN114204630A

  • Method for establishing SLB connection, electronic equipment and communication system

    CN116017377A

  • Method for deciding communication protocol between wireless power transmitter and wireless power receiver

    US20170018954A1