Device pairing methods, apparatus, equipment and storage media
By acquiring identification information and generating an authorization code when the TWS earbuds are placed in the charging case, the problem of low pairing efficiency is solved, enabling fast and convenient pairing of earbuds and charging case, which is suitable for a variety of application scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, the pairing efficiency between TWS earbuds and charging cases is relatively low, especially when the earbuds are lost or swapped, requiring them to be sent back to the factory for re-pairing, which is time-consuming.
When the earphones are detected to be in the charging case, the system obtains the identification information of the current earphones, generates a target authorization code, and controls the earphones to pair with the target earphone case based on the authorization code when the connection status is in the preset state.
It improves the efficiency of headphone pairing, is compatible with different headphone pairing methods, and enhances the user experience.
Smart Images

Figure CN120076069B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart device technology, and in particular to device pairing methods, apparatus, devices and storage media. Background Technology
[0002] With the continuous development of smart wearable technology, the developed smart devices are characterized by multiple functions, exquisite appearance, and small size, which are highly favored by users, especially TWS earphones. TWS earphones cannot be used without the charging case, for example, charging and information synchronization. The premise for completing the above functions is that the TWS earphones have been paired with the charging case. This is set at the factory. However, in actual use, earphones may be lost or swapped. For new or swapped earphones, they need to be sent back to the factory for re-pairing, which takes a lot of time. Therefore, the above method of pairing earphones is inefficient.
[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this application is to provide a device pairing method, apparatus, device, and storage medium, which aims to solve the technical problem of low efficiency in pairing headphones in the prior art.
[0005] To achieve the above objectives, this application proposes a device pairing method, the method comprising:
[0006] When the data indicating that the earphones are in the charging case is detected, the identification information of the current earphones is obtained;
[0007] When the identification information is not the preset stored identification information, a target authorization code is generated based on the identification information and the current headphone device information;
[0008] When the current connection status of the earphone is in the preset state, the current earphone is controlled to pair with the target earphone box according to the target authorization code and the pairing request sent by the current earphone.
[0009] In one embodiment, the step of controlling the current earphone to pair with the target earphone box based on the target authorization code and the pairing request sent by the current earphone when the connection state of the current earphone is a preset state includes:
[0010] When the current connection status of the earphone is in the preset state, the target authorization code is written to the target earphone box;
[0011] The target earphone box is controlled to parse the target authorization code and generate a pairing permission instruction based on the parsed identification information;
[0012] Based on the pairing permission command and the pairing request sent by the current earphone, the system controls the current earphone to pair with the target earphone case.
[0013] In one embodiment, the step of controlling the current earphone to pair with the target earphone box according to the pairing permission command and the pairing request sent by the current earphone includes:
[0014] Based on the physical connection point, the target earphone box sends a pairing permission command to the current earphone.
[0015] Control the current earphone to enter pairing mode according to the pairing permission command;
[0016] The pairing request sent by the current earphone is obtained based on the pairing mode;
[0017] The pairing request is used to control the current earphones to pair with the target earphone case.
[0018] In one embodiment, the step of generating a target authorization code based on the identification information and the current headset device information when the identification information is not the preset stored identification information includes:
[0019] When the identification information is not the preset stored identification information, a security check is performed on the current earphone;
[0020] If no danger information is found in the test results, the type of the current headphones is determined based on the current headphone device information.
[0021] When the type of the current earphone is the same as the type of the historical earphone, a target authorization code is generated based on the identification information and the device information of the current earphone.
[0022] In one embodiment, after the step of generating a target authorization code based on the identification information and the current headset device information when the identification information is not the preset stored identification information, the method further includes:
[0023] When the current connection status of the earphones is not a preset status, query the earphone case corresponding to the current earphones based on the identification information;
[0024] Send an interrupt command to the headphone box;
[0025] Upon receiving disconnection information from the earphone box based on the interruption command, the system continues to control the current earphone to pair with the target earphone box based on the target authorization code and the pairing request sent by the current earphone.
[0026] In one embodiment, after the step of controlling the current earphone to pair with the target earphone box according to the target authorization code and the pairing request sent by the current earphone when the connection state of the current earphone is a preset state, the method further includes:
[0027] Control the light component of the target earphone case to flash the first color of light;
[0028] Get the current remaining battery level of the headphones;
[0029] When the remaining battery power is lower than a preset battery power threshold, the target earphone case is controlled to charge the current earphone.
[0030] During charging, the real-time battery levels of the earbuds and the earbuds themselves are simultaneously displayed on the target earbud case.
[0031] In one embodiment, the step of controlling the current earphone to pair with the target earphone box based on the target authorization code and the pairing request sent by the current earphone when the connection state of the current earphone is a preset state includes:
[0032] If the target earphone box is detected to be idle within a preset time period, control the target earphone box to perform information search;
[0033] When the search results show the identification information of paired headphones, control the light component of the target headphone case to flash a second color of light;
[0034] Control the sound components of the target headphone box to play preset prompt messages.
[0035] Furthermore, to achieve the above objectives, this application also proposes a device pairing apparatus, which includes:
[0036] The acquisition module is used to acquire the current identification information of the earphones when the data of the earphones being put into the case is detected;
[0037] The generation module is used to generate a target authorization code based on the identification information and the current device information of the headset when the identification information is not the preset stored identification information;
[0038] The pairing module is used to control the current earphone to pair with the target earphone box according to the target authorization code and the pairing request sent by the current earphone when the connection status of the current earphone is a preset state.
[0039] In addition, to achieve the above objectives, this application also proposes a device pairing device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the device pairing method as described above.
[0040] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the device pairing method described above.
[0041] One or more technical solutions proposed in this application have at least the following technical effects: When earphone insertion data is detected, the identification information of the current earphone is obtained; when the identification information is not a preset stored identification information, a target authorization code is generated based on the identification information and the device information of the current earphone; when the connection state of the current earphone is a preset state, the current earphone is controlled to pair with the target earphone case based on the target authorization code and the pairing request sent by the current earphone. Through the above method, when it is determined that the identification information of the current earphone is not the preset stored identification information, it indicates that the current earphone and the target earphone case cannot be directly paired. At this time, a target authorization code is generated based on the identification information and the device information of the current earphone, and authorization is completed for the current earphone based on the target authorization code, allowing pairing with the current earphone. Then, the pairing request is used to control the current earphone to pair with the target earphone case, thereby effectively improving the efficiency of earphone pairing, enabling pairing of different earphones, applicable to various application scenarios, and improving the user experience. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart illustrating an embodiment of the device pairing method of this application.
[0045] Figure 2 This is a flowchart illustrating Embodiment 2 of the device pairing method of this application;
[0046] Figure 3 This is a schematic diagram of the module structure of the device pairing device according to an embodiment of this application;
[0047] Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the device pairing method in this application embodiment.
[0048] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0049] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or pairing device capable of performing the above functions. The following description uses a pairing device as an example to illustrate this embodiment and the subsequent embodiments.
[0050] Based on this, the embodiments of this application provide a device pairing method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the device pairing method of this application.
[0051] In this embodiment, the device pairing method includes steps S10 to S30:
[0052] Step S10: When the data of the earphone being put into the case is detected, obtain the identification information of the current earphone.
[0053] It should be noted that when the data of earphones being placed in the case is detected, it indicates that earphones have been placed in the target earphone case. These earphones can be TWS earphones. The identification information refers to the information that identifies different earphones. This identification information can be an ID, which is fixed when the earphones are manufactured. For example, the ID of earphone A is 000001, the ID of earphone B is 000002, etc. The current earphone can be the left earphone and the right earphone, or either one of them.
[0054] Step S20: When the identification information is not the preset stored identification information, generate a target authorization code based on the identification information and the current headphone device information.
[0055] It is understandable that the preset storage identification information refers to the identification information stored in the target charging case. Earphones with the preset storage identification information can be paired with the target charging case. If the identification information is not the preset storage identification information, even earphones of the same brand and type cannot be directly paired with the target charging case.
[0056] It should be understood that the target authorization code refers to the code that authorizes the current earbuds to pair with the target charging case. That is, after the target charging case receives the target authorization code, it knows that in addition to the factory-matched earbuds, it can also pair with the earbuds corresponding to the identification information in the target authorization code. At this point, the target charging case can correctly identify the current earbuds and, upon receiving a pairing request from the current earbuds, pair with them. Furthermore, the current earbuds can be newly purchased earbuds or earbuds exchanged with other users; for example, if the factory-matched earbuds are lost, or if a user wants to experience playing music with other earbuds, it is suitable for various application scenarios.
[0057] It should be noted that only user accounts that purchase the target charging case and previous earphones will have the permission to generate the target authorization code. Other user accounts do not have the permission to generate the target authorization code, and therefore cannot pair the target charging case with the current earphones.
[0058] Further, step S20 includes: when the identification information is not the preset stored identification information, performing a security test on the current earphone; when there is no dangerous information in the test result, determining the type of the current earphone based on the device information of the current earphone; when the type of the current earphone is the same as the type of the historical earphone, generating a target authorization code based on the identification information and the device information of the current earphone.
[0059] It should be understood that, in order to ensure the safety of the target charging case, a safety test needs to be performed on the current earphones before pairing to determine whether there is any dangerous information, such as potential viruses. If no dangerous information is found in the test results, it indicates that the current earphones are safe.
[0060] Understandably, "historical earphones" refers to earphones that could successfully pair with the target charging case at the time of manufacture. When it is determined that the type of the current earphone is the same as that of the historical earphones, it indicates that earphones of the same type need to be paired. Since the current earphones can also be placed in the target charging case, and the appearance of the current earphones is the same as that of the historical earphones, a target authorization code is generated by combining the identification information and the device information of the current earphones. The target authorization code generated will also be different for different earphones.
[0061] Furthermore, after step S20, the method further includes: when the connection status of the current earphone is not a preset status, querying the earphone box corresponding to the current earphone based on the identification information; sending an interrupt operation command to the earphone box; and when receiving disconnection information from the earphone box based on the interrupt operation command, continuing to execute the pairing control between the current earphone and the target earphone box based on the target authorization code and the pairing request sent by the current earphone.
[0062] Understandably, the default state can be an unconnected state. When it is determined that the current earphone's connection state is not the default state, it indicates that the current earphone may be connected to other devices. At this time, pairing with the target charging case cannot be performed. In this case, an interrupt operation command is sent to the earphone case corresponding to the current earphone. After receiving the interrupt operation command, the earphone case controls the current earphone to disconnect from other devices, that is, the connection state of the current earphone returns to the default state. At this time, a disconnection information will be fed back, and then the pairing process with the target earphone case will continue. For example, user B is using the current earphone, but user A wants to borrow the current earphone. At this time, the current earphone is still connected to user B's phone. In this case, the interrupt operation command will disconnect from user B's phone, so that the connection state of the current earphone becomes an unconnected state.
[0063] Step S30: When the connection status of the current earphone is a preset state, control the current earphone to pair with the target earphone box according to the target authorization code and the pairing request sent by the current earphone.
[0064] It should be understood that a pairing request refers to the request initiated by the current earphone when it wants to pair with the target earphone case. The target authorization code is the same as the identification information of the current earphone and is also fixed in the target charging case. When the pairing request sent by the current earphone is received, the target authorization code is used to control the current earphone to pair with the target earphone case.
[0065] Furthermore, after step S30, the method further includes: controlling the light component of the target earphone box to flash a light of a first color; obtaining the remaining battery power of the current earphone; when the remaining battery power is lower than a preset battery power threshold, controlling the target earphone box to charge the current earphone; and during the charging process, synchronously displaying the real-time battery power of the current earphone and its own real-time battery power based on the target earphone box.
[0066] Understandably, after successful pairing, the light component of the target earphone case flashes a first color of light. The color of the light can be adjusted according to the appearance color of the target charging case; for example, it flashes green when the appearance color is white. The target charging case in this embodiment also has a power display function, that is, it directly and synchronously displays the real-time power of the earphones and its own power directly on the target earphone case, without the need for connected peripherals.
[0067] Furthermore, after step S30, the method further includes: if the target earphone box is detected to be idle within a preset time period, controlling the target earphone box to perform information search; if the search results contain the identification information of a paired earphone, controlling the light component of the target earphone box to flash a second color light; and controlling the sound component of the target earphone box to play a preset prompt message.
[0068] It should be understood that if the target earphone case is idle within a preset time period, it indicates that the earphones may have been lost by the user. In this case, to help the user find the earphones, the target earphone case is controlled to perform an information search. If the search results contain the identifier of a paired earphone, it indicates that the earphones are within the search range of the target earphone case. At this time, the light component of the target earphone case is controlled to flash a second color light, and the sound component of the target earphone case is controlled to play a preset prompt message to assist the user in finding the earphones paired with the target earphone case. The second color can be white.
[0069] This embodiment obtains the current earphone's identification information upon detecting earphone insertion into the charging case. If the identification information is not a preset stored identification information, a target authorization code is generated based on the identification information and the current earphone's device information. If the current earphone's connection status is a preset status, the current earphone is controlled to pair with the target charging case based on the target authorization code and the pairing request sent by the current earphone. Through this method, when it is determined that the current earphone's identification information is not a preset stored identification information, it indicates that the current earphone and the target charging case cannot be directly paired. In this case, a target authorization code is generated based on the identification information and the current earphone's device information, and authorization is granted to the current earphone based on the target authorization code, allowing pairing. The pairing request is then used to control the current earphone to pair with the target charging case, thereby effectively improving the efficiency of earphone pairing, enabling pairing of different earphones, applicable to various application scenarios, and improving the user experience.
[0070] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S30 includes steps S301 to S303:
[0071] Step S301: When the current connection status of the earphone is a preset state, write the target authorization code to the target earphone box.
[0072] It should be noted that when the current connection status of the headphones is determined to be the preset status, it means that the headphones are not currently connected to other devices. At this time, the target authorization code can be written to the target headphone box. For the target headphone box, the fixed data includes preset storage identification information and target authorization code.
[0073] Step S302: Control the target earphone box to parse the target authorization code and generate a pairing permission instruction based on the parsed identification information.
[0074] It is understandable that the pairing permission command refers to the command that controls the headphones to enter pairing mode. For example, if the parsed identification information is the current identification information of the headphones, then a pairing permission command is generated to control the current headphones to enter pairing mode.
[0075] Step S303: Control the current earphone to pair with the target earphone box according to the pairing permission instruction and the pairing request sent by the current earphone.
[0076] Further, step S303 includes: controlling the target earphone box to send a pairing permission command to the current earphone based on the physical connection contact point; controlling the current earphone to enter pairing mode according to the pairing permission command; obtaining the pairing request sent by the current earphone based on the pairing mode; and controlling the current earphone to pair with the target earphone box according to the pairing request.
[0077] Understandably, since the pairing permission command is generated based on identification information, the target of the pairing permission command can be identified as the current earphone. After receiving the pairing permission command, the current earphone automatically enters pairing mode, generates and sends a pairing request. At this time, the current earphone is controlled to pair with the target earphone case according to the pairing request. The target earphone case can charge the current earphone and synchronize the remaining battery power of the current earphone to the target earphone case.
[0078] This embodiment writes the target authorization code to the target earphone case when the current earphone's connection state is in a preset state; controls the target earphone case to parse the target authorization code and generate a pairing permission command based on the parsed identification information; and controls the current earphone to pair with the target earphone case based on the pairing permission command and the pairing request sent by the current earphone. Through this method, when the current earphone's connection state is determined to be in a preset state, the target earphone case parses the written target authorization code, generates a pairing permission command based on the parsed identification information, and controls the current earphone to enter pairing mode. In pairing mode, the current earphone sends a pairing request, and then controls the current earphone to pair with the target earphone case based on the pairing request. This enables pairing of different earphones and improves the user experience.
[0079] This application also provides a device pairing device, please refer to... Figure 3 The device pairing device includes:
[0080] The acquisition module 10 is used to acquire the identification information of the current earphone when the earphone is detected to be in the case.
[0081] The generation module 20 is used to generate a target authorization code based on the identification information and the device information of the current headset when the identification information is not the preset stored identification information.
[0082] The pairing module 30 is used to control the current earphone to pair with the target earphone box according to the target authorization code and the pairing request sent by the current earphone when the connection status of the current earphone is a preset state.
[0083] This embodiment obtains the current earphone's identification information upon detecting earphone insertion into the charging case. If the identification information is not a preset stored identification information, a target authorization code is generated based on the identification information and the current earphone's device information. If the current earphone's connection status is a preset status, the current earphone is controlled to pair with the target charging case based on the target authorization code and the pairing request sent by the current earphone. Through this method, when it is determined that the current earphone's identification information is not a preset stored identification information, it indicates that the current earphone and the target charging case cannot be directly paired. In this case, a target authorization code is generated based on the identification information and the current earphone's device information, and authorization is granted to the current earphone based on the target authorization code, allowing pairing. The pairing request is then used to control the current earphone to pair with the target charging case, thereby effectively improving the efficiency of earphone pairing, enabling pairing of different earphones, applicable to various application scenarios, and improving the user experience.
[0084] The device pairing apparatus provided in this application, employing the device pairing method described in the above embodiments, can solve the technical problem of low efficiency in pairing headphones in the prior art. Compared with the prior art, the beneficial effects of the device pairing apparatus provided in this application are the same as those of the device pairing method described in the above embodiments, and other technical features in the device pairing apparatus are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0085] In one embodiment, the generation module 20 is further configured to perform a security test on the current earphone when the identification information is not the preset stored identification information; determine the type of the current earphone based on the device information of the current earphone when there is no dangerous information in the test result; and generate a target authorization code based on the identification information and the device information of the current earphone when the type of the current earphone is the same as the type of the historical earphone.
[0086] In one embodiment, the generation module 20 is further configured to, when the connection status of the current earphone is not a preset status, query the earphone box corresponding to the current earphone based on the identification information; send an interrupt operation command to the earphone box; and when receiving disconnection information fed back by the earphone box according to the interrupt operation command, continue to execute the pairing control of the current earphone and the target earphone box according to the pairing request sent by the current earphone based on the target authorization code and the pairing request sent by the current earphone.
[0087] In one embodiment, the pairing module 30 is further configured to: write the target authorization code to the target earphone box when the connection state of the current earphone is a preset state; control the target earphone box to parse the target authorization code and generate a pairing permission instruction based on the parsed identification information; and control the current earphone to pair with the target earphone box based on the pairing permission instruction and the pairing request sent by the current earphone.
[0088] In one embodiment, the pairing module 30 is further configured to: control the target earphone box to send a pairing permission command to the current earphone based on the physical connection contact point; control the current earphone to enter a pairing mode according to the pairing permission command; obtain a pairing request sent by the current earphone based on the pairing mode; and control the current earphone to pair with the target earphone box according to the pairing request.
[0089] In one embodiment, the pairing module 30 is further configured to control the light component of the target earphone box to flash a first color light; obtain the remaining battery power of the current earphone; when the remaining battery power is lower than a preset battery power threshold, control the target earphone box to charge the current earphone; and during the charging process, synchronously display the real-time battery power of the current earphone and its own real-time battery power based on the target earphone box.
[0090] In one embodiment, the pairing module 30 is further configured to: control the target earphone box to perform information search when it is detected that the target earphone box is idle within a preset time period; control the light component of the target earphone box to flash a second color light when the search results contain the identification information of a paired earphone; and control the sound component of the target earphone box to play preset prompt information.
[0091] This application provides a device pairing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the device pairing method in Embodiment 1 above.
[0092] The following is for reference. Figure 4 The diagram illustrates a structural schematic of a device pairing device suitable for implementing embodiments of this application. The device pairing device in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The device pairing device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0093] like Figure 4 As shown, the device pairing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the device pairing device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows device pairing devices to communicate wirelessly or wiredly with other devices to exchange data. While the figures show device pairing devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0094] Specifically, according to the embodiments disclosed in this application, the process described above with reference to the flowcharts can be implemented as a computer software program. This computer program includes program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0095] The device pairing device provided in this application, employing the device pairing method described in the above embodiments, can solve the technical problem of low efficiency in pairing headphones in the prior art. Compared with the prior art, the beneficial effects of the device pairing device provided in this application are the same as those of the device pairing method described in the above embodiments, and other technical features of this device pairing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0096] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0097] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0098] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the device pairing method described in the above embodiments.
[0099] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0100] The aforementioned computer-readable storage medium may be included in the device pairing device; or it may exist independently and not assembled into the device pairing device.
[0101] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0103] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0104] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described device pairing method, which can solve the technical problem of low efficiency in pairing headphones in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the device pairing method provided in the above embodiments, and will not be repeated here.
[0105] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A device pairing method, characterized by, The method comprises: When earphone-in-box data is detected, obtaining identification information of a current earphone; When the identification information is not preset stored identification information, performing safety detection on the current earphone; when there is no dangerous information in the detection result, determining the type of the current earphone according to device information of the current earphone; when the type of the current earphone is the same as the type of a historical earphone, generating a target authorization code according to the identification information and the device information of the current earphone; When the connection state of the current earphone is not a preset state, querying an earphone case corresponding to the current earphone according to the identification information; sending a running interruption instruction to the earphone case; when disconnection information fed back by the earphone case according to the running interruption instruction is received, continuing to perform pairing of the current earphone and a target earphone case according to a pairing request sent by the current earphone and the target authorization code; When the connection state of the current earphone is the preset state, performing pairing of the current earphone and the target earphone case according to the pairing request sent by the current earphone and the target authorization code; The step of performing pairing of the current earphone and the target earphone case according to the pairing request sent by the current earphone and the target authorization code when the connection state of the current earphone is the preset state comprises: When the connection state of the current earphone is the preset state, writing the target authorization code into the target earphone case; controlling the target earphone case to analyze the target authorization code and generate an allowed pairing instruction according to the analyzed identification information; and controlling the current earphone and the target earphone case to perform pairing according to the allowed pairing instruction and the pairing request sent by the current earphone.
2. The method of claim 1, wherein, The step of controlling the current earphone and the target earphone case to perform pairing according to the allowed pairing instruction and the pairing request sent by the current earphone comprises: Controlling the target earphone case to send the allowed pairing instruction to the current earphone based on a physical connection contact point; Controlling the current earphone to enter a pairing mode according to the allowed pairing instruction; Obtaining the pairing request sent by the current earphone based on the pairing mode; Controlling the current earphone and the target earphone case to perform pairing according to the pairing request.
3. The method of claim 1 or 2, wherein, After the step of controlling the current earphone and the target earphone case to perform pairing according to the pairing request sent by the current earphone and the target authorization code when the connection state of the current earphone is the preset state, the method further comprises: Controlling a light component of the target earphone case to flash light of a first color; Obtaining the remaining power of the current earphone; When the remaining power is lower than a preset power threshold, controlling the target earphone case to charge the current earphone; During the charging process, synchronously displaying the real-time power of the current earphone and the real-time power of the target earphone case based on the target earphone case.
4. The method of claim 1 or 2, wherein, The step of controlling the current earphone and the target earphone case to perform pairing according to the pairing request sent by the current earphone and the target authorization code when the connection state of the current earphone is the preset state comprises: If it is detected that the target earphone case is in an idle state within a preset time period, controlling the target earphone case to search for information; When there is identification information of a paired earphone in the search result, controlling a light component of the target earphone case to flash light of a second color; The control target earphone box sound component plays preset prompt information.
5. An apparatus pairing device, characterized by The device comprises: An acquisition module is configured to acquire identification information of a current earphone when earphone-in-box data is detected. A generation module is configured to perform security detection on the current earphone when the identification information is not preset stored identification information, determine a type of the current earphone according to device information of the current earphone when no dangerous information exists in a detection result, and generate a target authorization code according to the identification information and the device information of the current earphone when the type of the current earphone is the same as a type of a historical earphone. The generation module is further configured to query an earphone box corresponding to the current earphone according to the identification information when a connection state of the current earphone is not a preset state, send a running interruption instruction to the earphone box, continue to perform pairing of the current earphone and a target earphone box according to a pairing request sent by the current earphone and the target authorization code when disconnection information fed back by the earphone box according to the running interruption instruction is received. A pairing module is configured to perform pairing of the current earphone and a target earphone box according to a pairing request sent by the current earphone and the target authorization code when a connection state of the current earphone is a preset state. The pairing module is further configured to write the target authorization code into the target earphone box when the connection state of the current earphone is the preset state, control the target earphone box to analyze the target authorization code and generate an allowed pairing instruction according to analyzed identification information, and perform pairing of the current earphone and the target earphone box according to the allowed pairing instruction and the pairing request sent by the current earphone.
6. A device pairing device, comprising: The device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the device pairing method according to any one of claims 1 to 4.
7. A storage medium, characterized by The storage medium is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the device pairing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Authentication method and device for intelligent headphones
CN109040013A
Method and device for identifying mixed installation of earphones
CN115696129A