Equipment connection method, electronic equipment 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 connection and high delay in the prior art are solved, and stable connection and low-latency transmission are achieved.

CN119545578APending Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202311134495.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-08-29
Filing Date
2023-08-31
Publication Date
2025-02-28

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 a suitable communication protocol, resulting in unstable connections and high transmission delays.

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 CN119545578A_ABST
    Figure CN119545578A_ABST
Patent Text Reader

Abstract

The invention provides an equipment connection method, electronic equipment and a computer readable storage medium, and relates to the technical field of terminals. In the application, terminal equipment can obtain a target communication protocol for communicating with auxiliary equipment according to an identifier of a communication protocol in a protocol data packet sent by the auxiliary equipment, and after the target communication protocol for communicating with the auxiliary equipment is obtained, a communication protocol confirmation packet is sent to the auxiliary equipment; in this way, according to the connection address, the terminal device can establish a communication connection with the auxiliary device based on the adaptive communication protocol, the stability of the connection can be ensured, and the transmission delay between the terminal device and the auxiliary device is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office of China on August 29, 2023 (the State Intellectual Property Office has not provided an application number as of August 31, 2023. After the State Intellectual Property Office provides the application number, the application number will be supplemented according to the applicant's file number 92047671CN01), with the invention name "A wireless charging automatic identification solution for star flash pen and Bluetooth pen", all of which are incorporated by reference in 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 software and hardware 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 becoming more and more abundant. For example, auxiliary devices such as stylus pens, headphones, and wireless keyboards are also increasingly widely used on terminals.

[0004] At present, terminal devices are generally connected to auxiliary devices based on wireless short-range communication protocols, and data is transmitted through wireless short-range communication technology when users use auxiliary devices. However, there are many types of existing wireless short-range communication protocols, 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 the stability of the connection and reduce the transmission delay between the terminal device and the auxiliary device is an issue that needs to be solved urgently. Summary of the invention

[0005] 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.

[0006] 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 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.

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

[0008] 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 may be field information indicating the use of the target communication protocol.

[0009] 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.

[0010] As a possible implementation, the protocol data packet is an identity data packet generated based on the wireless charging protocol, and the identity data packet carries the identifiers of one or more communication protocols through the identity field. In this way, by carrying the identifier of the communication protocol through the identity data packet, when the terminal device performs wireless charging for the auxiliary device, the auxiliary device does not need to retransmit a new packet to the terminal device, which can reduce the time required to establish the communication connection between the auxiliary device and the terminal device and improve processing efficiency.

[0011] As a possible implementation, before receiving the protocol data packet from the auxiliary device, the method further includes: when receiving the adsorption event, sending a device detection signal, 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. In this way, in the scenario where the terminal device charges the auxiliary device, by sending the device detection signal to the auxiliary device, the accuracy of the detection of the charging object can be guaranteed, and it is avoided that other devices are charged when other devices are adsorbed, resulting in a waste of resources.

[0012] As a possible implementation, after receiving the protocol data packet from the auxiliary device, the method also 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.

[0013] Exemplarily, the charging parameter data packet may include an identity packet. In this way, the identity data packet carries the identifiers of one or more communication protocols supported by the auxiliary device, and the handshake reply message 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 required to establish the communication connection between the auxiliary device and the terminal device and improve processing efficiency.

[0014] As a possible implementation, before receiving the protocol data packet from the auxiliary device, the method further includes: when receiving the adsorption event, sending a device detection signal, the device detection signal is used to detect whether there is an auxiliary device; after receiving the 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 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, sending a handshake reply message to the auxiliary device, the protocol data packet is the data packet sent by the auxiliary device after receiving the handshake reply message. In this way, when the terminal device performs wireless charging for the auxiliary device, the communication protocol compatible with the terminal device and the auxiliary device can be automatically identified, and a communication connection can be automatically established. At the same time, the reliability of data transmission can also be ensured through the handshake mechanism.

[0015] As a possible implementation, a target communication protocol for communicating with an auxiliary device is obtained based on 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 identifiers of one or more communication protocols supported by the auxiliary device, communication protocols supportable by the terminal device, and preset communication rules.

[0016] 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.

[0017] Exemplarily, when the terminal device obtains the target communication protocol for communicating with the auxiliary device according to 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 protocols that the auxiliary device can support according to the identifier, and then obtain the communication protocols that the auxiliary device and the terminal device support at the same time according to 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 the auxiliary device and the terminal device support at the same time based on the preset communication rules. In this way, a target communication protocol with more adaptability, more stable data transmission, and less transmission delay can be obtained.

[0018] As a possible implementation method, the communication protocol is a wireless short-range communication protocol, and the wireless short-range communication protocol 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, so that the terminal device and the auxiliary device can 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.

[0019] As a possible implementation, 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 a 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 an operation by the user to confirm the connection, establishing a communication connection with the auxiliary device according to the connection address.

[0020] Exemplarily, a connection prompt may be issued through a pop-up service, and the pop-up service may provide a connection prompt on a display interface of a terminal device in the form of a dialog box, a function box, a dialog prompt box, or the like.

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

[0022] As a possible implementation, the target communication protocol is at least two 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: sending a connection prompt to the user, the connection prompt includes the connection address of the target communication protocol, and the connection prompt is a prompt to instruct the user to determine the connection address to be connected from multiple connection addresses; 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. In this way, the user can establish a connection based on the required communication protocol through the connection prompt, which is convenient for the user to operate and more in line with the user's needs.

[0023] As a possible implementation, sending a connection prompt to the user includes: 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, sending a connection prompt to the user. In this way, by detecting whether the auxiliary device can be connected through the mode identifier, the problem of mismatch between the terminal device and the auxiliary device can be discovered in time, and subsequent connection operations can be avoided, thereby reducing the workload.

[0024] 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.

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

[0026] 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 may be field information indicating the use of the target communication protocol.

[0027] 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.

[0028] As a possible implementation method, sending a protocol data packet to a terminal device includes: when receiving a device detection signal sent by the terminal device, sending a protocol data packet 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 one or more communication protocol identifiers through an identity identification field. In this way, by carrying the identification 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 required 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 charges 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, thereby avoiding a waste of resources.

[0029] As a possible implementation, 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.

[0030] Exemplarily, the charging parameter data packet may include an identity packet. In this way, the identity data packet carries the identifiers of one or more communication protocols supported by the auxiliary device, and the handshake reply message 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 required to establish the communication connection between the auxiliary device and the terminal device and improve processing efficiency.

[0031] As a possible implementation, sending a protocol data packet to a terminal device includes: sending a charging parameter data packet to the terminal device when receiving a device detection signal sent by the terminal device; sending a handshake message to the terminal device in response to a charging operation of the terminal device based on the charging parameter data packet; and sending a protocol data packet to the terminal device when receiving a handshake reply message sent by the terminal device. In this way, when the terminal device performs wireless charging for the auxiliary device, the communication protocol compatible with the terminal device and the auxiliary device can be automatically identified, and a communication connection can be automatically established. At the same time, the reliability of data transmission can also be ensured through the handshake mechanism.

[0032] As a 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 is used to assist the terminal device in determining the connection detection result of the auxiliary device. In this way, by detecting whether the auxiliary device is connectable through the mode identifier, the problem of mismatch between the terminal device and the auxiliary device can be discovered in time, and subsequent connection operations can be avoided, thereby reducing the workload.

[0033] As a possible implementation method, the communication protocol is a wireless short-range communication protocol, and the wireless short-range communication protocol 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, so that the terminal device and the auxiliary device can 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.

[0034] 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 to implement a method such as any possible implementation method in the first aspect or to implement a method such as any possible implementation method in the second aspect.

[0035] 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.

[0036] 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 in any possible implementation manner in the first aspect or a method as in any possible implementation manner in the second aspect is implemented.

[0037] 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 in any possible implementation method in the first aspect or a method as in any possible implementation method in the second aspect is implemented.

[0038] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed 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.

[0039] 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.

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

[0041] In a 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.

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

[0043] Figure 1 A schematic diagram of a scenario in which a terminal device according to an embodiment of the present application performs wireless charging on an auxiliary device;

[0044] Figure 2 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0045] Figure 3 A software structure block diagram of a terminal device according to an embodiment of the present application;

[0046] Figure 4 A working principle diagram of establishing a communication connection between a terminal device and an auxiliary device during wireless charging provided in an embodiment of the present application;

[0047] Figure 5 One of the flow charts of the device connection method provided in the embodiment of the present application;

[0048] Figure 6 One of the interface diagrams of the terminal device provided in the embodiment of the present application;

[0049] Figure 7 The second interface diagram of the terminal device provided in the embodiment of the present application;

[0050] Figure 8 A second flow chart of the device connection method provided in an embodiment of the present application;

[0051] Fig. 9 One of the interactive schematic diagrams of the device connection method provided in the embodiment of the present application;

[0052] Fig.10 The third flowchart of the device connection method provided in the embodiment of the present application;

[0053] Fig.11 The second interactive schematic diagram of the device connection method provided in the embodiment of the present application;

[0054] Fig.12 A fourth flowchart of the device connection method provided in an embodiment of the present application;

[0055] Fig.13 A schematic diagram of the structure of an identity data packet provided in an embodiment of the present application;

[0056] Fig.14 The third interactive schematic diagram of the device connection method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0057] 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.

[0058] The terms "including" and "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 device including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0059] In the following, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features.

[0060] In the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0061] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more. The "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0062] As the background technology, with the rapid development of terminal software and hardware technology, 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, the auxiliary devices of the terminal are becoming more and more abundant. For example, the use of auxiliary devices such as stylus pens, headphones, and wireless keyboards on the terminal is also becoming more and more extensive.

[0063] At present, terminal devices are generally connected to auxiliary devices based on wireless short-range communication protocols, and data is transmitted through wireless short-range communication technology when users use auxiliary devices. For example, for the connection between a stylus pen and a terminal device, Bluetooth technology can be used for connection. When the tip of the stylus pen is placed above the display screen of the device, the coding module of the stylus pen and the display screen module of the device can interact and transmit the Bluetooth MAC address of the stylus pen to trigger the stylus pen to establish a Bluetooth pairing connection with the electronic device.

[0064] 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 more stability and less latency. However, due to differences in MAC addresses and connection technologies corresponding to different wireless short-range communication protocols, the wireless short-range communication protocols that can be supported by different devices will also be different. 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 a problem that needs to be solved urgently.

[0065] Based on the above problems, an embodiment of the present application provides a device connection method, whereby 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 so that the auxiliary device sends the connection address corresponding to the target communication protocol. In this way, based on the connection address, the terminal device can establish a communication connection with the auxiliary device based on the compatible communication protocol, thereby ensuring the stability of the connection and reducing the transmission delay between the terminal device and the auxiliary device.

[0066] The device connection method provided in the embodiment of the present application can be used for connection between 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. Figure 1 As shown, Figure 1 The diagram shows a scenario in which the terminal device 100 wirelessly charges the auxiliary device 200 .

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

[0068] For ease of understanding, the following is a detailed introduction to the terminal device 100 provided in the embodiment of the present application. Figure 2 , Figure 2 A schematic diagram of the structure of the terminal device 100 provided in the embodiment of the present application. Figure 2As shown, 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.

[0069] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.

[0070] 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.

[0071] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0072] 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 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0073] 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 (such as audio data, etc.) created during the use of the terminal device 100, 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.

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

[0075] In the 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 .

[0076] The wireless communication function of the terminal device 100 can be implemented through the antenna 150, the communication module 160, etc. The 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 the utilization of the antenna. For example, the antenna 150 can be reused as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

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

[0078] 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., which are applied to the terminal device 100. The wireless communication module can be one or more devices integrating at least one communication processing module. The wireless communication module receives electromagnetic waves via the antenna 150, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 150.

[0079] In the embodiment of the present application, the wireless communication module may include a short-range chip, and the 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.

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

[0081] 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 the touch function through the touch sensor.

[0082] In an embodiment of the present application, the processor 110 can determine the specific intention corresponding to the touch operation through touch operations such as clicking (such as single-clicking, double-clicking, etc.), sliding operations, long pressing operations, or dragging operations performed by the user on the interface provided by the display screen through the touch sensor, and then respond to the touch operation.

[0083] It is understood that the structure illustrated in the embodiment 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0084] 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-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device 100.

[0085] Figure 3 1 is a software structure diagram of the terminal device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android Runtime) and the system library, and the kernel layer.

[0086] 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.

[0087] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer may include accessory management services, pop-up services, and short-distance services. Among them, 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-distance service is used to establish a connection with the auxiliary device 200 based on short-distance communication technology.

[0088] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.

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

[0090] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0091] The system library may 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.

[0092] The kernel layer is the layer between hardware and software. The kernel layer includes at least sensor driver, short-distance driver, power management, etc.

[0093] 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.

[0094] 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.

[0095] 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 explanations and will not be elaborated here.

[0096] In order to further facilitate the terminal device to wirelessly charge the auxiliary device, in the 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. At least one magnetic adsorption component is provided in the auxiliary device 200, and the magnetic adsorption component can attract the magnetic component of the terminal device 100 when the auxiliary device 200 approaches or contacts the adsorption area, so as to adsorb and fix the auxiliary device 200 in the adsorption area. After the auxiliary device 200 is adsorbed and fixed in the adsorption area, the terminal device 100 can charge the auxiliary device.

[0097] In the embodiment of the present application, a magnetic field sensor, such as a Hall sensor, may be provided at a position corresponding to the adsorption area inside 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.

[0098] based on Figures 1 to 3Please refer to the structural diagram shown in Figure 4 , Figure 4 A working principle diagram of the terminal device 100 and the auxiliary device 200 establishing a communication connection during wireless charging provided in an embodiment of the present application.

[0099] like Figure 4 As shown, the magnetic field sensor detects the magnetic field strength of the adsorption area and transmits the detection result to the sensor module (sensor driver). When the sensor module determines that the auxiliary device is adsorbed on the adsorption area according to the detection result, the adsorption event can be reported to the power management module. After the power management module receives the adsorption event of the auxiliary device, it can control the battery, boost circuit and wireless charging chip to charge the auxiliary device according to the wireless charging protocol.

[0100] When charging the auxiliary device, the power management module and the auxiliary device can interact with each other using communication protocols and connection addresses, etc. 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, so that the pop-up service can 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 send a signal to the connection address using the antenna, so as to perform a directional connection and establish communication between the terminal device and the auxiliary device.

[0101] To better explain the interaction between the terminal device and the auxiliary device to determine the communication protocol and connection address used for communication, please refer to Figure 5 , Figure 5 A schematic diagram of a flow chart of a device connection method provided in an embodiment of the present application, such as Figure 5 As shown, the device connection method provided in the embodiment of the present application includes:

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

[0103] 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.

[0104] 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.

[0105] Exemplarily, the wireless charging chip can apply a power signal to the wireless charging coil to send out a device detection signal.

[0106] 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.

[0107] 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.

[0108] 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.

[0109] As shown in Table 1, Table 1 shows some data packets generated based on the wireless charging protocol, and different data packets have different headers. The data packet generated by the wireless charging protocol consists of four parts, namely, preamble, header, message and checksum. For details, please refer to conventional technology and will not be repeated here.

[0110] Table 1

[0111] Header Packet Type 0x01 Signal strength Ox38 Private 0x51 Configuration Ox58 Private Ox71 Identification OxF Private 5F Private

[0112] Exemplarily, 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 can 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] Among them, 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 means 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 means 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, so as to charge 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 existence of the auxiliary device and can charge the auxiliary device based on the charging parameter data packet.

[0119] Exemplarily, 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 adsorbed in the adsorption area based on the signal strength in the signal strength data packet. When it is determined that the auxiliary device is correctly adsorbed in the adsorption area, the wireless charging chip can be controlled to charge the auxiliary device according to the power information in the configuration parameter data packet. When it is determined that the auxiliary device is not correctly adsorbed in the adsorption 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 adsorbed to the adsorption area, and when the signal strength is greater than the set strength threshold, it may indicate that the auxiliary device is correctly adsorbed to the adsorption area. The set strength threshold may be set according to actual needs.

[0121] In some embodiments, when it is obtained that the auxiliary device is not correctly attached to the attachment area, the power management module can also send information that the auxiliary device is not correctly attached to the attachment area to the accessory management service. After receiving the information, the accessory management service can send an instruction to the pop-up window service, so that the pop-up window service prompts the display interface of the terminal device that the auxiliary device is not correctly attached. It can be understood that when the user sees the prompt, the auxiliary device can be adjusted so that the auxiliary device is correctly attached to the attachment area of ​​the terminal device.

[0122] It can be understood that for the signal strength data packet, configuration parameter data packet, identity identification data packet and other data packets included in the charging parameter data packet, the auxiliary device can send them in sequence or send them to the terminal device at the same time, without specific restrictions, and can be set according to actual needs. Among them, when the signal strength data packet and the configuration parameter data packet, the identity identification data packet and other data packets are sent in sequence, the sending order can be set according to the needs, without specific restrictions. Exemplarily, the auxiliary device can send the signal strength data packet, the identity identification data packet and the 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 the auxiliary device establishes a communication connection with 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, so as to ensure the reliability and security of data transmission.

[0127] Exemplarily, 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] Exemplarily, the auxiliary device can send a private protocol packet with a header of "0x38" to the terminal device through the wireless charging protocol for handshake, that is, the handshake information can include a private protocol packet with a header of "0x38". The data information of the private protocol packet can be set according to the needs, and only needs to be recognizable by the terminal device and the auxiliary device. Exemplarily, the handshake information can be a private protocol packet of "0x38 0x3b 0x88 0x66", wherein 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 can be understood that the terminal device can also send handshake reply information to the auxiliary device based on the wireless charging protocol. Exemplarily, the auxiliary device can send a private protocol packet with a header of "0x38 0x3b 0x880x66" to the terminal device through the wireless charging protocol for handshake. After receiving the handshake information, the terminal device can send a private protocol packet with a header of "0x3F 0x3b 0x88 0x66" to the auxiliary device through the wireless charging protocol to reply to the handshake. That is, the handshake reply information sent by the terminal device can include a private protocol packet of "0x3F 0x3b 0x88 0x66", 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] Among them, the communication protocol between the terminal device and the auxiliary device can be a wireless short-range communication protocol, such as the Star Alliance protocol, the Bluetooth protocol, etc.

[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, and the terminal device can support the Star Alliance protocol to establish a communication protocol, and the two support different communication protocols. In the case that the terminal device and the auxiliary device can support different communication protocols, if an incompatible communication protocol is selected to establish a communication connection, it may cause the communication connection between the terminal device and the auxiliary device to be unstable and the data transmission to 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 also 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 can be understood 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 an identification field X1 corresponding to communication protocol A. When the auxiliary device supports protocol B, the protocol data packet can include an 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 can be supported by both the terminal device and the auxiliary device. After obtaining the communication protocols that can be supported by both the terminal device and the auxiliary device, the communication protocol that can be supported by both the terminal device and the auxiliary device can be determined as the target communication protocol.

[0146] Considering that there may be multiple communication protocols that the terminal device and the auxiliary device can support at the same time, in order to select a communication protocol that is more adaptable, has more stable data transmission, and has less delay, in the embodiment of the present application, the target communication protocol for communicating with the auxiliary device can also be obtained according to the identifiers of one or more communication protocols supported by the auxiliary device, the communication protocols supported by the terminal device, and the preset communication rules. It can be understood that the target communication protocol is a communication protocol among the one or more communication protocols supported by the accessory device.

[0147] The preset communication rule may also be to use the 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 the embodiment of the present application does not make specific restrictions. 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 highest frequency of terminal device use 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 supportable by the terminal device, and preset communication rules, the terminal device can first obtain the communication protocol supported by the auxiliary device 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 supported by the auxiliary device and the communication protocols supported by the terminal device, 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 top N priorities, where N is 1. If the communication protocols that the auxiliary device can support are the Star Alliance Protocol and the Bluetooth Protocol according to the identification, and the terminal device can also support the Star Alliance Protocol and the Bluetooth Protocol, that is, the auxiliary device and the terminal device can support the Star Alliance Protocol and the Bluetooth Protocol at the same time, and the priority of the Star Alliance Protocol is higher than that of the Bluetooth Protocol, then the target communication protocol obtained according to the preset communication rules is the Star Alliance 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] Exemplarily, if the communication protocols that the auxiliary device can support according to the identification 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 the identifier of the target communication protocol. Exemplarily, taking the Star Alliance Protocol as an example, assuming that the auxiliary device supports the Star Alliance Protocol, the auxiliary device can send a protocol data packet of "0x58 80XXX (Star Alliance)" to the terminal device based on the wireless charging protocol, set the identifier of the terminal device in the protocol data packet, and obtain the target communication protocol for communicating with the auxiliary device as the Star Alliance Protocol. The terminal device can then send a communication protocol confirmation packet of "0x5F 80XXX (Star Alliance)" 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 based on the wireless charging protocol to the auxiliary device.

[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] Among them, after receiving the communication protocol confirmation package, the auxiliary device can determine the target communication protocol for communicating with the terminal device based on the information in the communication protocol confirmation package. For example, when the auxiliary device receives the communication protocol confirmation package of "0x5F 80XXX (Xingshan)", it can be determined that the target communication protocol for communicating with the terminal device is the Xingshan 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 data packet to the terminal device based on the wireless charging protocol, and the address information data packet includes a connection address corresponding to the target communication protocol. For example, the auxiliary device may send an address information data 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 relatively 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, and when the target communication protocol is the Star Flash Alliance protocol, the auxiliary device can send the Star Flash MAC address to the terminal device. It can be understood 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] Among them, after receiving the connection address, the wireless charging chip of the terminal device can send the connection address to the power management module, and the power management module sends the connection address to the accessory management service. When the accessory management service obtains the connection address, it can send a connection operation instruction to the short-distance service to notify the short-distance service to initiate a connection with the auxiliary device. The connection operation instruction includes the connection address, and the short-distance service can initiate a connection with the auxiliary device after receiving the connection operation instruction.

[0167] Exemplarily, the short-range service can be directed by controlling the short-range chip through a short-range driver to send a connection signal to the connection address using an antenna, and after receiving the connection signal, the auxiliary device responds to the connection signal to establish a communication connection with the terminal device, so that 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 can be understood 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 may provide a connection prompt on the display interface of the terminal device in the form of 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] The first connection prompt refers to a prompt indicating whether the user should establish a connection with the auxiliary device based on the target communication protocol. 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 auxiliary device A based on the connection address of target communication protocol a" and "confirm" 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 the "confirm" dialog box, and the pop-up service responds to the user's operation of confirming the connection, and can send 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, initiates the connection operation of the auxiliary device, and controls the short-distance chip through the short-distance drive to send a signal to the connection address using the antenna, so as to make a directional connection and establish 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 the user's connection refusal information to the accessory management service. After receiving the user's connection refusal information, 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 the terminal device establishing a communication connection with 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 a user to determine a connection address to be connected to from a plurality of connection addresses.

[0181] Accordingly, the pop-up service can provide a second connection prompt on the display interface of the terminal device. Figure 7 When the target communication protocols include Bluetooth protocol and Starflash 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 may display dialog boxes of "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 Starflash protocol" and "Reject".

[0182] When the user chooses to connect to auxiliary device A based on the connection address of the Bluetooth protocol, he can click the dialog box of "Connect to auxiliary device A based on the connection address of the Bluetooth protocol". The pop-up service responds to the user's operation and obtains the target connection address specified by the user as the connection address of the Bluetooth protocol. Then, according to the connection address of the Bluetooth protocol, a connection operation instruction can be sent to the short-range service. The connection operation instruction may include the connection address of the Bluetooth protocol. After receiving the connection operation instruction, the short-range service responds to the connection operation instruction and initiates the connection operation of the auxiliary device. The short-range chip is controlled by the short-range driver to send a signal to the connection address of the Bluetooth protocol using the antenna, so as to perform a directional connection and establish 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 Alliance Protocol, he can click on the dialog box of "Connect to auxiliary device A based on the connection address of the Star 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 Alliance Protocol. Then, according to the connection address of the Star 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 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 chip is controlled by the short-distance drive to use the antenna to send a signal to the connection address of the Star Alliance Protocol, so as to make a directional connection and establish communication between the terminal device and the auxiliary device.

[0184] When the user chooses to refuse to connect, he can click on the "Reject" dialog box. The pop-up service responds to the user's operation of refusing the connection and sends the user's connection refusal information to the accessory management service. After receiving the user's connection refusal information, 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 timely discover 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 according to 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 sent 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 data packet to the terminal device based on the wireless charging protocol, and the mode identification data packet includes the mode information of the auxiliary device. For example, the auxiliary device may send a mode identification data packet of "0x5854XXX (mode identification)" to the terminal device based on the wireless charging protocol.

[0190] The terminal device pre-stores a mode identifier of a connectable device. After receiving the mode identifier sent by the auxiliary device, the mode identifier sent by the auxiliary device is matched with the stored mode identifier of the connectable device. When a target mode identifier matching the mode identifier sent by the auxiliary device is obtained in the stored mode identifier of the connectable device, a connection detection result indicating that the auxiliary device can be connected can be obtained. When a target mode identifier matching the mode identifier sent by the auxiliary device is not obtained in the stored mode identifier of the connectable device, a connection detection result indicating that the auxiliary device cannot be connected can be obtained.

[0191] After obtaining the connection detection result that the auxiliary device can be connected, the terminal device can prompt the user to connect. It can be 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, and 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 the workload and improve the connection efficiency. 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, a protocol data packet including an identifier of the priority communication protocol can be directly sent 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 identifier of the protocol data packet, and obtains the priority communication protocol supported by the auxiliary device based on the identifier 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 identifier 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 identifier of the Bluetooth protocol is sent to the terminal.

[0204] S408: If the communication protocol confirmation packet 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 packet 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 communication protocol confirmation packet. If the communication protocol confirmation packet 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 packet includes the identifier of the Bluetooth protocol, the auxiliary device sends the connection address corresponding to the Bluetooth protocol to the terminal device. The specific sending process of the connection address can be referred to step S309, which will not be described in detail here.

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

[0207] Among them, the specific process of step S409 can refer to S310 and will not be repeated here.

[0208] For example, please refer to Fig. 9, taking the priority communication protocol as the Star Alliance Protocol as an example. When the terminal device receives the 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 0x3b0x88 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 for handshake reply. 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 80 XXX(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 80 XXX(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 80 XXX(Bluetooth)". When the auxiliary device receives the communication protocol confirmation packet, if the communication protocol confirmation packet includes the identification of the Star Flash Alliance protocol, it sends the address information data packet of "0X58 52 XXX (Star Flash MAC address)" and the address information data packet of "0X58 53 XXX (Star Flash MAC address)" to the terminal device; if the communication protocol confirmation includes the identification of the Bluetooth protocol, 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 data packet, the terminal device can reply ACK confirmation information to the auxiliary device to indicate to the auxiliary device that the data sent has been confirmed to be received correctly. After that, the auxiliary device can also send a mode identification data packet of "0x58 54XXX (ModeID)" to the terminal device. After receiving the mode identification data packet, the terminal device can also reply ACK confirmation information to the auxiliary device.

[0210] It can be understood 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, which 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, it can directly send the connection address corresponding to the Bluetooth protocol to the terminal device. Based on this, please refer to Fig.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] When the auxiliary device only supports the Bluetooth protocol, it is assumed that the auxiliary device and the terminal device use the Bluetooth protocol to establish a communication connection. Therefore, after receiving the handshake reply information 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 establishes a communication connection according to 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 refer to S310 and will not be repeated here.

[0222] For example, please refer to Fig.11, when the terminal device receives the 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 powering 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 for handshake reply. After receiving the handshake reply, the auxiliary device sends an address information data packet of "0X58 52XXX (Bluetooth MAC address)" and an address information data packet of "0X5853XXX (Bluetooth MAC address)" to the terminal device. After receiving the address information data packet, the terminal device can reply ACK confirmation information to the auxiliary device to indicate to the auxiliary device that the sent data has been confirmed to be received correctly. Afterwards, the auxiliary device may also 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 for the auxiliary device to be attracted to the pop-up window 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 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 Fig.12 The device connection method provided in the embodiment of the present application may 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 data packet carries the identification of one or more communication protocols supported by the auxiliary device through the identity field. Since which communication protocol the auxiliary device supports can be determined by the manufacturer and the seller, in the embodiment of the present application, the identification of one or more communication protocols supported by the auxiliary device can be carried through the identity fields such as the customer code and the manufacturer code.

[0228] For example, Fig.13 As shown, the identity data packet includes the chip version number, customer code, manufacturer code and other identity fields, where the manufacturer code data information is located in the data bits of B1 and B2, the customer code data information is the data bits of B3 and B4, and the chip version number data information is the data bits of 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 0x60 0x7F 0x00, it means that the auxiliary device supports the Star Alliance protocol and can also support the Bluetooth protocol.

[0229] It can be understood that when the communication protocols supported by the auxiliary device are different, 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, which 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 of the identity identification field. After obtaining the data information of the identity identification field in the identity identification data packet, the data information of the identity identification field in the surrounding identification data packet can be compared with the stored data information, and the target data information identical to the data information of the identity identification field in the surrounding identification data packet can be obtained from the stored data information, and the communication protocol corresponding to the target data information can be determined as the communication protocol supported by the auxiliary device. For example, if the data information 0x00 0x60 0x7F 0x00 corresponding to the customer code and the manufacturer code in the identity identification data packet is obtained, 0x00 0x60 0x7F 0x00 can be compared 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 refer 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 of the target communication protocol as a handshake reply information to the auxiliary device.

[0238] Optionally, the information of the target communication protocol in the communication protocol confirmation packet may be field information indicating the use of the target communication protocol. 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 0x880x66" to the terminal device through the wireless charging protocol for handshake, the terminal device may reply to the auxiliary device with a communication protocol confirmation packet of "0x3F 0x3b 0x880x66" through the wireless charging protocol, where 0x3F0x3b 0x88 0x66 is the field information for using the Bluetooth protocol. 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, where 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 the Bluetooth protocol and the Star Alliance protocol, 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, which will not be described in detail here.

[0241] S606: The auxiliary device sends a 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 about 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 of "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 of "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, which will not be described in detail here.

[0248] For example, please refer to Fig.14, taking the priority communication protocol as the Star Alliance Protocol as an example. When the terminal device receives the 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. Among them, the data information corresponding to B1-B4 in the identity data packet is 0x00 0x60 0x7F 0x00. The terminal device charges the auxiliary device based on the signal strength data packet 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 communication protocol confirmation packet of "0x3F 0x3b 0x88 0x88" to the auxiliary device for handshake reply. After receiving the communication protocol confirmation packet, the auxiliary device sends the address information data packet of "0X58 52XXX (Xingshan MAC address)" and the address information data packet of "0X58 53XXX (Xingshan MAC address)" to the terminal device. After receiving the address information data packet, the terminal device can reply ACK confirmation information 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 of "0x58 54XXX (ModeID)" to the terminal device. After receiving the mode identification data packet, the terminal device can also reply ACK confirmation information 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 identifiers 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, which makes user operation more convenient. After the auxiliary device is adsorbed, the terminal device can achieve a one-to-one connection with the accessory by transparently transmitting the MAC address and Mode ID.

[0253] In the embodiments of the present application, for terminal devices that support both Star Flash and Bluetooth, they can connect to Bluetooth accessories, and can also connect to Star Flash accessories. For accessories that support both Star Flash and Bluetooth, they can connect to Bluetooth terminal devices, and can also connect to Star Flash terminal devices. For accessories and terminal devices that support both Star Flash and Bluetooth, they will preferentially connect 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. Among them, the communication interface, the memory, and the processor may be connected via one or more communication buses. Among them, 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 may also provide a chip system, which includes a processing circuit and a storage medium, wherein the storage medium stores computer program instructions, and 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, the embodiments of the present application may also provide a computer program product including 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, and 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 a software instruction. The software instruction can be composed of corresponding software modules, and the software module 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 disk, or any other form of storage medium. An exemplary storage medium is coupled to a 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 a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may 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 may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may 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)), etc.

[0263] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope 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 the 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 of the user-specified connection, a communication connection is established with the auxiliary device according to the target connection address.

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

Cited By

  • Star flash and Bluetooth signal stability detection and improvement method and device

    CN120034886A

  • Method and device for detecting and improving stability of SparkLink and Bluetooth signals

    CN120034886B

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

    EP4686312A1

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

    WO2025044447A1