Headphones upgrade method, device, electronic device and readable storage medium
By acquiring information about the primary and secondary earphones during the Bluetooth earphone upgrade process, establishing a connection, and determining the upgrade status, the problem of lost upgrade packages for the secondary earphones has been resolved, improving upgrade efficiency and synchronization.
Patent Information
- Application Number
- CN202310092730.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-16
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-01-16
AI Technical Summary
During the Bluetooth headset upgrade process, the upgrade package for the secondary earphone may be lost, resulting in an unsuccessful upgrade. Current technology cannot effectively improve the efficiency of headset upgrades.
By acquiring the current information of the main and secondary earpieces, a connection is established and an upgrade data packet is sent. After a preset interval, it is determined whether the upgrade information of the secondary earpiece is successful. If it fails, the data packet is resent to ensure that the secondary earpiece is successfully upgraded.
It improves the efficiency of headphone upgrades, promptly identifies and resolves upgrade failures of the secondary headphone, and ensures that the primary and secondary headphones remain synchronized.
Smart Images

Figure CN115955630B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of headphone technology, and in particular to a method, apparatus, electronic device, and readable storage medium for upgrading headphones. Background Technology
[0002] Bluetooth headsets are divided into left and right ears. When upgrading Bluetooth headsets, the main unit communicates with the main earphone to send the upgrade package to the main earphone to upgrade it. Then, the main earphone communicates with the secondary earphone, and the main earphone sends the upgrade package to the secondary earphone to upgrade it.
[0003] When upgrading the secondary earphone, the upgrade package may be lost, causing the upgrade to fail. Users need to confirm whether the secondary earphone has been upgraded successfully. If the upgrade fails, the secondary earphone needs to be upgraded again. Therefore, improving the efficiency of earphone upgrades is becoming increasingly important. Summary of the Invention
[0004] To improve the efficiency of headphone upgrades, this application provides a method, apparatus, electronic device, and readable storage medium for headphone upgrades.
[0005] The above-mentioned inventive objective of this application is achieved through the following technical solutions:
[0006] Firstly, a method for upgrading headphones is provided, the method comprising:
[0007] Get the current information of the main earphone and the secondary earphone;
[0008] Based on the current information of the main earphone, a first connection is established;
[0009] Based on the first connection and the current information of the main earphone, send a first upgrade data packet and a second upgrade data packet to the main earphone;
[0010] After a preset time interval, the upgrade information of the secondary earphone is obtained, and it is determined whether the upgrade information of the secondary earphone is the current information of the secondary earphone, so as to obtain a first determination result;
[0011] If the first determination result is yes, then a second upgrade data packet is sent to the main earphone.
[0012] By adopting the above technical solution, the current information of the main earphone and the current information of the secondary earphone are obtained. Based on the current information of the main earphone, a first connection is established, which is used to transmit data to the main earphone. Based on the first connection and the current information of the main earphone, a first upgrade data packet and a second upgrade data packet are sent to the main earphone. The first upgrade data packet is used to upgrade the main earphone, and the second upgrade data packet is used to upgrade the secondary earphone. After a preset time interval, the upgrade information of the secondary earphone is obtained, and it is determined whether the upgrade information of the secondary earphone is the same as the current information of the secondary earphone. A first judgment result is obtained. If the first judgment result is yes, the upgrade of the secondary earphone fails. The failure of the upgrade of the secondary earphone is promptly determined, and a second upgrade data packet is sent to the main earphone. This allows the main earphone to send a second upgrade data packet to the secondary earphone again when the upgrade of the secondary earphone fails, thereby improving the efficiency of the earphone upgrade.
[0013] In one possible implementation, if the first determination result is negative, the process further includes:
[0014] Get main headset upgrade information;
[0015] Determine whether the main earphone upgrade information is the preset main earphone upgrade information to obtain a second determination result;
[0016] If the second determination result is yes, then the main earphone upgrade information is restored to the current information of the main earphone.
[0017] In another possible implementation, the current information of the main earphone includes: the location information of the main earphone, and the current information of the secondary earphone further includes: the location information of the secondary earphone;
[0018] The process of establishing a first connection based on the current information of the main earphone includes, prior to:
[0019] Based on the location information of the main earphone and the secondary earphone, the distance between the main earphone and the secondary earphone is determined;
[0020] If the distance is greater than the preset distance, a location warning message will be output;
[0021] The location information that the secondary earphone can transmit is determined based on the location information of the primary earphone and the preset distance.
[0022] In another possible implementation, the method further includes:
[0023] Obtain the size of the second upgrade data packet;
[0024] Based on the size of the second upgrade data packet and the distance, the second upgrade data packet is divided into at least two second upgrade sub-packets.
[0025] In another possible implementation, dividing the second upgrade data packet into at least two second upgrade sub-packets based on the length of the second upgrade data packet and the distance includes:
[0026] Obtain the correspondence between the preset distance range and the preset data packet size;
[0027] Based on the distance, a matching distance range is determined from the preset distance;
[0028] Based on the correspondence and the preset data packet size, determine the matching data packet size corresponding to the matching distance range;
[0029] Based on the size of the matching data packet, the second upgrade data packet is divided into at least two second upgrade sub-packets.
[0030] In another possible implementation, the process of establishing a first connection based on the current information of the main earphone further includes:
[0031] Get the current status of the main headset upgrade;
[0032] Based on the current upgrade time and the preset start time of the main earphone, the first upgrade duration corresponding to the main earphone is determined;
[0033] If the first upgrade duration exceeds the first preset duration, then the first warning message will be output.
[0034] In another possible implementation, the method further includes:
[0035] Get the moment the main headset upgrade is complete;
[0036] The duration of the main earphone upgrade is determined based on the main earphone upgrade completion time and the preset start time.
[0037] If the upgrade completion time of the main earphone is less than or equal to the preset completion time, then obtain the current upgrade time of the secondary earphone.
[0038] Based on the current upgrade time and the preset start time of the secondary earphone, the second upgrade duration corresponding to the secondary earphone is determined;
[0039] If the second upgrade duration exceeds the second preset duration, then a second warning message will be output.
[0040] Secondly, a headphone upgrade device is provided, the device comprising:
[0041] The first acquisition module is used to acquire the current information of the main earphone and the current information of the secondary earphone.
[0042] A connection establishment module is used to establish a first connection based on the current information of the main earphone;
[0043] The first sending module is configured to send a first upgrade data packet and a second upgrade data packet to the main earphone based on the first connection and the current information of the main earphone;
[0044] The second acquisition module is used to acquire the secondary earphone upgrade information after a preset time interval, and determine whether the secondary earphone upgrade information is the current information of the secondary earphone, and obtain a first judgment result;
[0045] The second sending module is used to send a second upgrade data packet to the main earphone when the first judgment result is negative.
[0046] In one possible implementation, the device further includes: a third acquisition module, a judgment module, and a restoration module, wherein,
[0047] The third acquisition module is used to acquire the main earphone upgrade information;
[0048] The judgment module is used to determine whether the main earphone upgrade information is the preset main earphone upgrade information, and obtain a second judgment result;
[0049] The restoration module is used to restore the main earphone upgrade information to the current information of the main earphone when the second judgment result is yes.
[0050] In another possible implementation, the current information of the main earphone includes: the location information of the main earphone, and the current information of the secondary earphone further includes: the location information of the secondary earphone;
[0051] The device further includes: a first determining module, a first output module, and a second determining module, wherein...
[0052] The first determining module is used to determine the distance between the main earphone and the secondary earphone based on the main earphone position information and the secondary earphone position information;
[0053] The first output module is used to output a position warning message when the distance is greater than a preset distance;
[0054] The second determining module is used to determine the transmittable location information of the secondary earphone based on the location information of the primary earphone and the preset distance.
[0055] In another possible implementation, the apparatus further includes: a fourth acquisition module and a partitioning module, wherein the fourth acquisition module is used to acquire the size of the second upgrade data packet;
[0056] The partitioning module is used to partition the second upgrade data packet into at least two second upgrade sub-packets based on the size of the second upgrade data packet and the distance.
[0057] In another possible implementation, when the partitioning module divides the second upgrade data packet into at least two second upgrade sub-packets based on the length of the second upgrade data packet and the distance, it is specifically used for:
[0058] Obtain the correspondence between the preset distance range and the preset data packet size;
[0059] Based on the distance, a matching distance range is determined from the preset distance;
[0060] Based on the correspondence and the preset data packet size, determine the matching data packet size corresponding to the matching distance range;
[0061] Based on the size of the matching data packet, the second upgrade data packet is divided into at least two second upgrade sub-packets.
[0062] In another possible implementation, the device further includes: a fifth acquisition module, a third determination module, and a second output module, wherein,
[0063] The fifth acquisition module is used to acquire the current time of the main earphone upgrade;
[0064] The third determining module is used to determine the first upgrade duration corresponding to the main earphone based on the current upgrade time and the preset start time of the main earphone;
[0065] The second output module is used to output a first warning message when the first upgrade duration exceeds the first preset duration.
[0066] In another possible implementation, the device further includes: a sixth acquisition module, a fourth determination module, a seventh acquisition module, a fifth determination module, and a third output module, wherein,
[0067] The sixth acquisition module is used to acquire the time when the main earphone upgrade is completed;
[0068] The fourth determining module is used to determine the duration of the main earphone upgrade based on the main earphone upgrade completion time and the preset start time.
[0069] The seventh acquisition module is used to acquire the current upgrade time of the secondary earphone when the upgrade completion time of the main earphone is less than or equal to the preset completion time;
[0070] The fifth determining module is used to determine the second upgrade duration corresponding to the secondary earphone based on the current upgrade time and the preset start time of the secondary earphone;
[0071] The third output module is used to output a second warning message when the second upgrade duration exceeds the second preset duration.
[0072] Thirdly, an electronic device is provided, the electronic device comprising:
[0073] One or more processors;
[0074] Memory;
[0075] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform operations corresponding to the headphone upgrade method shown in any possible implementation of the first aspect.
[0076] Fourthly, a computer-readable storage medium is provided, the storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement a method for upgrading headphones as shown in any possible implementation of the first aspect.
[0077] In summary, this application includes at least one of the following beneficial technical effects:
[0078] This application provides a method, apparatus, electronic device, and readable storage medium for upgrading headphones. Compared with related technologies, in this application, current information of the main headphone and the secondary headphone is obtained, and a first connection is established based on the current information of the main headphone. The first connection is used to transmit data to the main headphone. Based on the first connection and the current information of the main headphone, a first upgrade data packet and a second upgrade data packet are sent to the main headphone. The first upgrade data packet is used to upgrade the main headphone, and the second upgrade data packet is used to upgrade the secondary headphone. After a preset time interval, the upgrade information of the secondary headphone is obtained, and it is determined whether the upgrade information of the secondary headphone is the current information of the secondary headphone. A first determination result is obtained. If the first determination result is yes, the upgrade of the secondary headphone fails. The failure of the upgrade of the secondary headphone is promptly determined, and a second upgrade data packet is sent to the main headphone. This allows the main headphone to send the second upgrade data packet to the secondary headphone again when the upgrade of the secondary headphone fails, thereby improving the efficiency of headphone upgrade. Attached Figure Description
[0079] Figure 1 This is a schematic flowchart of a headphone upgrade method provided in an embodiment of this application.
[0080] Figure 2 This is a schematic diagram of a headphone upgrade device provided in an embodiment of this application.
[0081] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0082] The following is in conjunction with the appendix Figure 1 -Appendix Figure 3 This application will be described in further detail.
[0083] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.
[0084] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0085] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0086] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0087] This application provides a method for upgrading headphones, executed by an electronic device. This electronic device can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. The terminal device and the server can be directly or indirectly connected via wired or wireless communication. This application does not impose any limitations on this. Figure 1 As shown, the method may include:
[0088] Step S101: Obtain the current information of the main earphone and the current information of the secondary earphone.
[0089] In this embodiment of the application, the current information of the main earphone may include the version number of the main earphone, and the current information of the secondary earphone may include the version number of the secondary earphone. The electronic device can obtain the current information of the main earphone and the secondary earphone in real time, or at preset intervals. It can also obtain the model of the main earphone and the model of the secondary earphone when a user's trigger command is detected. In this embodiment of the application, no limitation is made.
[0090] In the embodiments of this application, after obtaining the current information of the main earphone, the current information of the main earphone and the current information of the secondary earphone can be stored locally, or the current information of the main earphone and the current information of the secondary earphone can be sent to other devices for storage, such as a USB flash drive.
[0091] Step S102: Establish the first connection based on the current information of the main earphone.
[0092] In this embodiment of the application, a first connection is established between the main earphone and the electronic device based on the current information of the main earphone, so that the electronic device sends an upgrade data packet to the main earphone.
[0093] Step S103: Based on the first connection and the current information of the main earphone, send the first upgrade data packet and the second upgrade data packet to the main earphone.
[0094] In this embodiment of the application, after establishing the first connection, based on the first connection and the current information of the main earphone, a first upgrade data packet and a second upgrade data packet are sent to the main earphone. The first upgrade data packet is used to upgrade the current information of the main earphone corresponding to the main earphone, and the second upgrade data packet is used to upgrade the current information of the secondary earphone corresponding to the secondary earphone.
[0095] Step S104: After a preset time interval, obtain the secondary earphone upgrade information, and determine whether the secondary earphone upgrade information is the same as the current information of the secondary earphone, and obtain the first judgment result.
[0096] In this embodiment of the application, after a preset time interval, the secondary earphone upgrade information is obtained. After the primary earphone sends the first upgrade data packet and the second upgrade data packet to the primary earphone, the primary earphone sends the second upgrade data packet to the secondary earphone. After a preset time interval, the secondary earphone upgrade information is obtained. By comparing the secondary earphone upgrade information with the current information of the secondary earphone, it is determined whether the secondary earphone upgrade information is the same as the current information of the secondary earphone.
[0097] Step S105: If the first judgment result is yes, then send the second upgrade data packet to the main earphone.
[0098] In the embodiments of this application, when the upgrade information of the secondary earphone is the same as the current information of the secondary earphone, that is, when the first judgment result is negative, the upgrade of the secondary earphone fails, and the second upgrade data packet is sent to the primary earphone again, so that the primary earphone sends the second upgrade data packet to the secondary earphone again.
[0099] This application provides a method for upgrading headphones. Compared with related technologies, in this application, the current information of the main headphone and the current information of the secondary headphone are obtained, and a first connection is established based on the current information of the main headphone. The first connection is used to transmit data to the main headphone. Based on the first connection and the current information of the main headphone, a first upgrade data packet and a second upgrade data packet are sent to the main headphone. The first upgrade data packet is used to upgrade the main headphone, and the second upgrade data packet is used to upgrade the secondary headphone. After a preset time interval, the upgrade information of the secondary headphone is obtained, and it is determined whether the upgrade information of the secondary headphone is the current information of the secondary headphone. A first determination result is obtained. If the first determination result is yes, the upgrade of the secondary headphone fails. The failure of the upgrade of the secondary headphone is determined in a timely manner, and a second upgrade data packet is sent to the main headphone. This allows the main headphone to send the second upgrade data packet to the secondary headphone again when the upgrade of the secondary headphone fails, thereby improving the efficiency of headphone upgrade.
[0100] Another possible implementation of this application embodiment, if the judgment result is negative, may further include: obtaining the main earphone upgrade information; determining whether the main earphone upgrade information is the preset main earphone upgrade information to obtain a second judgment result; if the second judgment result is positive, then restoring the main earphone upgrade information to the current information of the main earphone. In this application embodiment, when the information of the main earphone and the secondary earphone are not upgraded simultaneously, the main earphone and the secondary earphone will not be able to establish a connection, and the main earphone and the secondary earphone will not be able to communicate. Obtain the main earphone upgrade information corresponding to the main earphone, and determine whether the main earphone has been upgraded by comparing the main earphone upgrade information with the preset main earphone upgrade information. If the main earphone upgrade information and the preset main earphone upgrade information are the information corresponding to the main earphone after it has been upgraded, then the main earphone upgrade is successful. When the secondary earphone upgrade fails, in order to ensure normal communication between the main earphone and the secondary earphone, when the main earphone upgrade information is the same as the second upgrade information, the main earphone upgrade information is restored to the current information of the main earphone. For example, if the primary earpiece's current information is A1 and its upgrade information is A2, and the default upgrade information is A2, then the primary earpiece upgrade is successful. If the secondary earpiece's current information is B1, its upgrade information is B1, and its current information is B2, then the secondary earpiece upgrade fails. In this case, the primary earpiece upgrade information A2 is reverted to A1. In the event of a secondary earpiece upgrade failure, the primary earpiece's upgrade information is reverted to its current information to ensure that both the primary and secondary earpieces are on the same version and can communicate normally.
[0101] In another possible implementation of this application embodiment, the current information of the main earphone includes: the location information of the main earphone, and the current information of the secondary earphone further includes: the location information of the secondary earphone;
[0102] Based on the current information of the main earphone, a first connection is established. Prior to this, the process includes: determining the distance between the main and secondary earphones based on their location information; outputting a location warning message if the distance is greater than a preset distance; and determining the transmittable location information of the secondary earphone based on its location information and the preset distance. In this embodiment, the step of outputting a location warning message if the distance is greater than the preset distance can be performed before, after, or simultaneously with the step of determining the transmittable location information of the secondary earphone based on its location information and the preset distance.
[0103] In this embodiment of the application, the location information of the main earphone and the location information of the secondary earphone can be represented by coordinates. When the distance between the main earphone and the secondary earphone is far, packet loss is likely to occur when the main earphone transmits the second data upgrade packet to the secondary earphone. Based on the location information of the main earphone and the secondary earphone, the distance between the main earphone and the secondary earphone is determined, and the distance between the main earphone and the secondary earphone is compared with a preset distance. When the distance between the main earphone and the secondary earphone is greater than the preset distance, a location warning message is output to remind the user that the distance between the main earphone and the secondary earphone is too far. Based on the location information of the main earphone and the preset distance, the transmittable location information of the secondary earphone is determined. The transmittable location information of the secondary earphone is the movable range of the secondary earphone within the preset distance.
[0104] In another possible implementation of this application embodiment, the method may further include: obtaining the size of the second upgrade data packet; and dividing the second upgrade packet into at least two second upgrade sub-packets based on the size of the second upgrade data packet and the distance. In this application embodiment, the electronic device may obtain the size of the second upgrade data packet in real time, or at preset time intervals, or when a user-triggered acquisition command is detected; no limitation is imposed in this application embodiment.
[0105] In this embodiment of the application, the Bluetooth headset does not support large data transmissions. When the distance between the primary and secondary headsets changes, the smaller the second upgrade data packet, the faster the transmission speed between the primary and secondary headsets. Based on the size of the second upgrade data packet and the distance between the primary and secondary headsets, the second upgrade data packet is divided into at least two second upgrade sub-packets. For example, the second upgrade data packet A is divided into a second upgrade sub-packet A1 and a second upgrade sub-packet A2.
[0106] Specifically, based on the length and distance of the second upgrade data packet, the second upgrade data packet is divided into at least two second upgrade sub-packets. This may include: obtaining the correspondence between a preset distance range and a preset data packet size; determining a matching distance range from the preset distance based on the distance; determining the matching data packet size corresponding to the matching distance range based on the correspondence and the preset data packet size; and dividing the second upgrade data packet into at least two second upgrade sub-packets based on the matching data packet size. In this embodiment, the correspondence between the preset distance range and the preset data packet size can be obtained from local storage, from other devices, or from a user-inputted preset distance range and preset data packet size; no limitation is imposed in this embodiment.
[0107] In this embodiment, when the second upgrade data packet is divided into too many sub-packets, it wastes the upgrade time of the secondary earpiece, thereby reducing the upgrade efficiency of the secondary earpiece. Based on the distance between the primary and secondary earpieces, a matching distance range is determined from a preset distance range. Based on the correspondence, the matching data packet size corresponding to the matching distance range is determined from a preset data packet size. Based on the matching data packet size, the second upgrade data packet is divided into at least two sub-packets, wherein the size of the sub-packet is less than or equal to the matching data packet size. For example, if the distance between the primary and secondary earpieces is 8m, the corresponding matching distance range is 8m to 10m, the data packet size corresponding to the matching distance range is 10M, and the second upgrade data packet size is 30M, then the second upgrade packet is divided into three 10M sub-packets.
[0108] Another possible implementation of this application embodiment establishes a transmission connection based on the current information of the main earphone, and then further includes: obtaining the current time of the main earphone upgrade; determining the first upgrade duration corresponding to the main earphone based on the current time of the main earphone upgrade and a preset start time; if the first upgrade duration is longer than the first preset duration, then outputting a first warning message. In this application embodiment, the electronic device can obtain the current time of the main earphone upgrade in real time, or at preset intervals, or when a user-triggered acquisition command is detected, and is not limited in this application embodiment.
[0109] In this embodiment, when the upgrade duration corresponding to the main earphone exceeds the first preset duration, packet loss may occur during the upgrade process. The current upgrade time of the main earphone can be any moment during the upgrade process, and the preset start time is the moment when the upgrade begins. The difference between the current upgrade time and the preset start time is calculated and used as the first upgrade duration for the main earphone. When the first upgrade duration exceeds the first preset duration, a first warning message is output, which may include the first upgrade duration to remind the user. For example, if the current upgrade time of the main earphone is 9:20, the preset start time is 8:10, and the first preset duration is 30 minutes, then the first upgrade duration of the main earphone is 70 minutes, and the first warning message is output. By timely obtaining the current upgrade time of the main earphone, determining whether the upgrade has timed out, and promptly outputting the first warning message, users can easily detect upgrade timeouts.
[0110] Another possible implementation of this application embodiment, the method may further include: obtaining the upgrade completion time of the main earphone; determining the upgrade completion duration of the main earphone based on the upgrade completion time of the main earphone and a preset start time; if the upgrade completion duration of the main earphone is less than or equal to the preset completion duration, obtaining the upgrade current time corresponding to the secondary earphone; determining the second upgrade duration corresponding to the secondary earphone based on the upgrade current time of the secondary earphone and the preset start time; if the second upgrade duration is greater than the second preset duration, outputting a second warning message. In this embodiment, when the main earphone completes the upgrade within a preset completion time, it is determined whether packet loss occurred in the secondary earphone during the upgrade process. The upgrade completion time of the main earphone is the moment when the upgrade is successful. The difference between the upgrade completion time of the main earphone and the preset start time is determined as the upgrade completion time of the main earphone. When the upgrade completion time of the main earphone is less than or equal to the preset completion time, the upgrade of the main earphone is complete. After the upgrade of the main earphone is completed, the current upgrade time of the secondary earphone is obtained, and the difference between the current upgrade time of the secondary earphone and the preset start time is determined as the second upgrade time corresponding to the secondary earphone. The second upgrade time is compared with the second preset time. When the second upgrade time is greater than the second preset time, packet loss may occur in the secondary earphone, and a second warning message is output. The second warning message may include the second upgrade time corresponding to the secondary earphone. When the upgrade of the main earphone is completed, the upgrade time of the secondary earphone is judged in a timely manner to determine whether packet loss occurred in the upgrade process of the secondary earphone, so that the user can be informed of the upgrade status of the secondary earphone in a timely manner.
[0111] The above embodiments describe a method for upgrading headphones from the perspective of process flow. The following embodiments describe a device for upgrading headphones from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.
[0112] This application provides a device for upgrading headphones, such as... Figure 2As shown, the headphone upgrade device 20 may specifically include: a first acquisition module 21, an establishment module 22, a first transmission module 23, a second acquisition module 24, and a second transmission module 25, wherein,
[0113] Secondly, an apparatus is provided, the apparatus comprising:
[0114] The first acquisition module 21 is used to acquire the current information of the main earphone and the current information of the secondary earphone;
[0115] Establish module 22, used to establish a transmission connection based on the current information of the main earphone;
[0116] The first sending module 23 is used to send a first upgrade data packet and a second upgrade data packet to the main earphone based on the transmission connection and the current information of the main earphone.
[0117] The second acquisition module 24 is used to acquire the secondary earphone upgrade information after a preset time interval, and determine whether the secondary earphone upgrade information is the current information of the secondary earphone, and obtain the first judgment result;
[0118] The second sending module 25 is used to send a second upgrade data packet to the main earphone when the first judgment result is negative.
[0119] In one possible implementation of this application embodiment, the apparatus 20 further includes: a third acquisition module, a judgment module, and a restoration module, wherein...
[0120] The third acquisition module is used to acquire the main earphone upgrade information;
[0121] The judgment module is used to determine whether the main earphone upgrade information is the preset main earphone upgrade information, and obtain a second judgment result;
[0122] The restore module is used to restore the main earphone upgrade information to the current information of the main earphone when the second judgment result is yes.
[0123] In another possible implementation of this application embodiment, the current information of the main earphone includes: the location information of the main earphone, and the current information of the secondary earphone further includes: the location information of the secondary earphone;
[0124] Device 20 further includes: a first determining module, a first output module, and a second determining module, wherein,
[0125] The first determining module is used to determine the distance between the main earphone and the secondary earphone based on the position information of the main earphone and the secondary earphone.
[0126] The first output module is used to output a position warning message when the distance is greater than the preset distance;
[0127] The second determining module is used to determine the transmittable location information of the secondary earphone based on the location information of the primary earphone and a preset distance.
[0128] In another possible implementation of this application embodiment, the apparatus 20 further includes: a fourth acquisition module and a division module, wherein the fourth acquisition module is used to acquire the size of the second upgrade data packet;
[0129] The partitioning module is used to divide the second upgrade data packet into at least two second upgrade sub-packets based on the size and distance of the second upgrade data packet.
[0130] In another possible implementation of this application embodiment, when the partitioning module divides the second upgrade data packet into at least two second upgrade sub-packets based on the length and distance of the second upgrade data packet, it is specifically used for:
[0131] Obtain the correspondence between the preset distance range and the preset data packet size;
[0132] Based on distance, a matching distance range is determined from a preset distance;
[0133] Based on the correspondence and the preset data packet size, determine the matching data packet size corresponding to the matching distance range;
[0134] Based on the matching data packet size, the second upgrade data packet is divided into at least two second upgrade sub-packets.
[0135] In another possible implementation of this application embodiment, the apparatus 20 further includes: a fifth acquisition module, a third determination module, and a second output module, wherein...
[0136] The fifth acquisition module is used to obtain the current time of the main earphone upgrade;
[0137] The third determining module is used to determine the first upgrade duration corresponding to the main earphone based on the current upgrade time of the main earphone and the preset start time.
[0138] The second output module is used to output a first warning message when the first upgrade duration exceeds the first preset duration.
[0139] In another possible implementation of this application embodiment, the apparatus 20 further includes: a sixth acquisition module, a fourth determination module, a seventh acquisition module, a fifth determination module, and a third output module, wherein,
[0140] The sixth acquisition module is used to acquire the time when the main earphone upgrade is completed;
[0141] The fourth determining module is used to determine the duration of the main earphone upgrade based on the main earphone upgrade completion time and the preset start time.
[0142] The seventh acquisition module is used to acquire the current upgrade time of the secondary earphone when the upgrade completion time of the primary earphone is less than or equal to the preset completion time.
[0143] The fifth determining module is used to determine the second upgrade duration corresponding to the secondary earphone based on the current upgrade time and the preset start time of the secondary earphone;
[0144] The third output module is used to output a second warning message when the second upgrade duration exceeds the second preset duration.
[0145] This application provides an earphone upgrade device. Compared with related technologies, in this application embodiment, by acquiring the current information of the main earphone and the current information of the secondary earphone, and establishing a transmission connection based on the current information of the main earphone, the transmission connection is used to transmit data to the main earphone. Based on the transmission connection and the current information of the main earphone, a first upgrade data packet and a second upgrade data packet are sent to the main earphone. The first upgrade data packet is used to upgrade the main earphone, and the second upgrade data packet is used to upgrade the secondary earphone. After a preset time interval, the upgrade information of the secondary earphone is acquired, and it is determined whether the upgrade information of the secondary earphone is the current information of the secondary earphone. A first determination result is obtained. If the first determination result is yes, the upgrade of the secondary earphone fails. The failure of the upgrade of the secondary earphone is promptly determined, and the second upgrade data packet is sent to the main earphone so that when the upgrade of the secondary earphone fails, the main earphone sends the second upgrade data packet to the secondary earphone again, thereby improving the efficiency of the earphone upgrade.
[0146] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the headphone upgrade device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0147] This application provides an electronic device, such as... Figure 3 As shown, Figure 3 The illustrated electronic device 30 includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302. Optionally, the electronic device 30 may also include a transceiver 304. It should be noted that in practical applications, the transceiver 304 is not limited to one type, and the structure of this electronic device 30 does not constitute a limitation on the embodiments of this application.
[0148] Processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0149] Bus 302 may include a pathway for transmitting information between the aforementioned components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 302 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0150] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0151] The memory 303 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the foregoing method embodiments.
[0152] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers can also be included. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0153] This application provides a computer-readable storage medium storing a computer program. When the program is run on a computer, it enables the computer to execute the corresponding content in the aforementioned method embodiments. Compared with related technologies, in this application embodiment, by obtaining the current information of the main earphone and the current information of the secondary earphone, and establishing a transmission connection based on the current information of the main earphone, the transmission connection is used to transmit data to the main earphone. Based on the transmission connection and the current information of the main earphone, a first upgrade data packet and a second upgrade data packet are sent to the main earphone. The first upgrade data packet is used to upgrade the main earphone, and the second upgrade data packet is used to upgrade the secondary earphone. After a preset time interval, the upgrade information of the secondary earphone is obtained, and it is determined whether the upgrade information of the secondary earphone is the current information of the secondary earphone. A first determination result is obtained. If the first determination result is yes, the upgrade of the secondary earphone fails. The failure of the upgrade of the secondary earphone is promptly determined, and the second upgrade data packet is sent to the main earphone. This allows the main earphone to send the second upgrade data packet to the secondary earphone again when the upgrade of the secondary earphone fails, thereby improving the efficiency of earphone upgrades.
[0154] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0155] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for upgrading headphones, characterized in that, include: Get the current information of the main earphone and the secondary earphone; Based on the current information of the main earphone, a first connection is established; Based on the first connection and the current information of the main earphone, send a first upgrade data packet and a second upgrade data packet to the main earphone; After a preset time interval, the upgrade information of the secondary earphone is obtained, and it is determined whether the upgrade information of the secondary earphone is the current information of the secondary earphone, so as to obtain a first determination result; If the first determination result is yes, then send the second upgrade data packet to the main earphone; If the first determination result is negative, the following steps are also included: Get main headset upgrade information; Determine whether the main earphone upgrade information is the preset main earphone upgrade information to obtain a second determination result; If the second determination result is yes, then the main earphone upgrade information is restored to the current information of the main earphone.
2. The method according to claim 1, characterized in that, The current information of the main earphone includes: the location information of the main earphone; the current information of the secondary earphone also includes: the location information of the secondary earphone. The process of establishing a first connection based on the current information of the main earphone includes, prior to: Based on the location information of the main earphone and the secondary earphone, the distance between the main earphone and the secondary earphone is determined; If the distance is greater than the preset distance, a location warning message will be output; The location information that the secondary earphone can transmit is determined based on the location information of the primary earphone and the preset distance.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the size of the second upgrade data packet; Based on the size of the second upgrade data packet and the distance, the second upgrade data packet is divided into at least two second upgrade sub-packets.
4. The method according to claim 3, characterized in that, The step of dividing the second upgrade data packet into at least two second upgrade sub-packets based on the length of the second upgrade data packet and the distance includes: Obtain the correspondence between the preset distance range and the preset data packet size; Based on the distance, a matching distance range is determined from the preset distance; Based on the correspondence and the preset data packet size, determine the matching data packet size corresponding to the matching distance range; Based on the size of the matching data packet, the second upgrade data packet is divided into at least two second upgrade sub-packets.
5. The method according to claim 1, characterized in that, The process of establishing a first connection based on the current information of the main earphone further includes: Get the current status of the main headset upgrade; Based on the current upgrade time and the preset start time of the main earphone, the first upgrade duration corresponding to the main earphone is determined; If the first upgrade duration exceeds the first preset duration, then the first warning message will be output.
6. The method according to claim 1, characterized in that, The method further includes: Get the moment the main headset upgrade is complete; The duration of the main earphone upgrade is determined based on the main earphone upgrade completion time and the preset start time. If the upgrade completion time of the main earphone is less than or equal to the preset completion time, then obtain the current upgrade time of the secondary earphone. Based on the current upgrade time and the preset start time of the secondary earphone, the second upgrade duration corresponding to the secondary earphone is determined; If the second upgrade duration exceeds the second preset duration, then a second warning message will be output.
7. A device for upgrading headphones, characterized in that, include: The first acquisition module is used to acquire the current information of the main earphone and the current information of the secondary earphone. A connection establishment module is used to establish a first connection based on the current information of the main earphone; The first sending module is configured to send a first upgrade data packet and a second upgrade data packet to the main earphone based on the first connection and the current information of the main earphone; The second acquisition module is used to acquire the secondary earphone upgrade information after a preset time interval, and determine whether the secondary earphone upgrade information is the current information of the secondary earphone, and obtain a first judgment result; The second sending module is used to send a second upgrade data packet to the main earphone when the first judgment result is yes; It also includes: a third acquisition module, a judgment module, and a restoration module, among which, The third acquisition module is used to acquire the main earphone upgrade information; The judgment module is used to determine whether the main earphone upgrade information is the preset main earphone upgrade information, and obtain a second judgment result; The restoration module is used to restore the main earphone upgrade information to the current information of the main earphone when the second judgment result is yes.
8. An electronic device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to: perform a method for upgrading headphones according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements a headphone upgrade method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Upgrading method for TWS earphones and TWS earphones
CN108833542A
Upgrading method of TWS wireless earphone and wireless audio equipment
CN111031576A