A method, device, electronic device and storage medium for estimating power of a Bluetooth headset
By comprehensively considering factors such as the transmission delay, reconnection times, volume, and data transmission rate of the Bluetooth headset, a more accurate power estimate is generated, which solves the problem of inaccurate power estimation in the existing technology and improves the reliability and accuracy of the power estimate. User experience.
Patent Information
- Application Number
- CN202410749972.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-12
AI Technical Summary
The existing Bluetooth headset power estimation method only considers one factor, resulting in inaccurate estimation, which may cause the power to be suddenly exhausted at critical moments, affecting the user's usage plan and experience.
By connecting to the battery management system of the Bluetooth headset, it receives the power value and sends a test packet to determine the transmission delay, counts the number of reconnections and obtains log data, generates an estimation coefficient based on the transmission delay, the number of reconnections, volume and data transmission rate, and adjusts Power estimation ensures more accurate power prediction.
By comprehensively considering multiple factors, the reliability of Bluetooth headset power estimation is improved, helping users to reasonably arrange use time and improve the use experience.
Smart Images

Figure CN118338183B
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, device, electronic device and storage medium for estimating the battery level of a Bluetooth headset. Background Art
[0002] With the rapid development of science and technology, Bluetooth headsets have gradually become an indispensable part of modern life. The advanced wireless technology of Bluetooth headsets frees users from the constraints of cables and enables real freedom of movement and communication. In addition, Bluetooth headsets have excellent sound quality, allowing users to get clear and realistic sound effects when enjoying music, watching movies or making calls, greatly improving the sense of comfort.
[0003] The reliability of Bluetooth headset power estimation is crucial for users, because it can directly affect users' usage plans and experience. If only one factor is considered, the power estimation will be inaccurate, and users may face the situation that the Bluetooth headset suddenly runs out of power at a critical moment, which will cause the interruption of music and calls, which will not only disrupt users' plans, but also bring unnecessary troubles.
[0004] Therefore, how to improve the reliability of Bluetooth headset battery estimation is an urgent problem to be solved. Summary of the invention
[0005] The embodiments of the present application provide a method, device, electronic device and storage medium for estimating the power level of a Bluetooth headset to solve the above-mentioned technical problem of how to improve the reliability of the power level estimation of a Bluetooth headset.
[0006] In a first aspect, an embodiment of the present application provides a method for estimating the power of a Bluetooth headset, which is applied to an electronic device, wherein the electronic device is connected to a Bluetooth headset, and the method for estimating the power of a Bluetooth headset includes:
[0007] Connecting to the battery management system of the Bluetooth headset, receiving a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment;
[0008] Determining whether the first power value is greater than a preset power value;
[0009] If the first power value is greater than the preset power value, a test packet is sent to the Bluetooth headset in a time period between the first moment and the second moment, and a current transmission delay of the Bluetooth headset is determined according to the sending time and the receiving time of the test packet, and the second moment is the next moment of the first moment;
[0010] Within the time period, count the number of times the Bluetooth headset is reconnected to the device to obtain a current number of reconnections;
[0011] Obtain log data of the Bluetooth headset, and in the log data, obtain the current volume and current data transmission rate of the Bluetooth headset;
[0012] Generate a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generation model;
[0013] When the current estimation coefficient is less than the preset coefficient, the second power value sent by the battery management system is obtained, and the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset, and the second power value is the power value of the Bluetooth headset at the second moment.
[0014] Exemplarily, when the current estimation coefficient is less than the preset coefficient, obtaining a second power value sent by the battery management system, multiplying the second power value by the current estimation coefficient, and generating a remaining power value of the Bluetooth headset, the Bluetooth headset power estimation method further includes:
[0015] A storage area corresponding to the remaining power value is created in a preset storage device, the remaining power value is stored in the storage area, and an access interface for the storage area is created.
[0016] Exemplarily, the estimation coefficient generation model includes:
[0017] ;
[0018] in, is the current estimation coefficient, is the ratio of the current transmission delay to the preset transmission delay, is the ratio of the current number of reconnections to the preset number of reconnections, is the ratio of the current volume to the preset volume, is the ratio of the current data transmission rate to the preset data transmission rate, is the preset first weight coefficient, is the preset second weight coefficient.
[0019] In a possible implementation manner of the first aspect, the battery management system connected to the Bluetooth headset receives the first power value sent by the battery management system, including:
[0020] Connecting to the battery management system of the Bluetooth headset, and sending a first acquisition request to the battery management system;
[0021] Receive the first power value sent by the battery management system according to the first acquisition request.
[0022] In a possible implementation manner of the first aspect, determining whether the first power value is greater than a preset power value includes:
[0023] Obtaining a status identifier of the Bluetooth headset, and determining whether the status identifier is a preset working identifier;
[0024] If the state identifier is the working identifier, it is determined whether the first power value is greater than the preset power value.
[0025] In a possible implementation manner of the first aspect, when the current estimation coefficient is less than a preset coefficient, obtaining a second power value sent by the battery management system, multiplying the second power value by the current estimation coefficient, and generating a remaining power value of the Bluetooth headset, including:
[0026] When the current estimation coefficient is less than the preset coefficient, sending a second acquisition request to the battery management system;
[0027] Receive the second power value sent by the battery management system according to the second acquisition request, multiply the second power value by the current estimation coefficient, and generate the remaining power value of the Bluetooth headset.
[0028] In a possible implementation manner of the first aspect, when the current estimation coefficient is less than the preset coefficient, obtaining a second power value sent by the battery management system, multiplying the second power value by the current estimation coefficient, and generating a remaining power value of the Bluetooth headset, the Bluetooth headset power estimation method further includes:
[0029] Determining whether the remaining power value is greater than the preset power value;
[0030] If the remaining power value is not greater than the preset power value, a preset low power reminder message is displayed on the screen.
[0031] In a possible implementation of the first aspect, after displaying a preset low-battery reminder message on the screen if the remaining battery value is not greater than the preset battery value, the Bluetooth headset battery estimation method further includes:
[0032] The low-battery reminder information is sent to the Bluetooth headset.
[0033] In a possible implementation manner of the first aspect, when the current estimation coefficient is less than the preset coefficient, obtaining a second power value sent by the battery management system, multiplying the second power value by the current estimation coefficient, and generating a remaining power value of the Bluetooth headset, the Bluetooth headset power estimation method further includes:
[0034] Read the preset upload time and determine whether the current time is the upload time;
[0035] If the current time is the upload time, the preset server is connected through the preset network to upload the remaining power value to the server, and the preset network includes one of the 4G network, 5G network, and WIFI network or a combination thereof.
[0036] In a second aspect, an embodiment of the present application provides a Bluetooth headset power estimation device, which is applied to an electronic device, wherein the electronic device is connected to a Bluetooth headset, and includes:
[0037] A connection module, used to connect to the battery management system of the Bluetooth headset and receive a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment;
[0038] A judging module, used for judging whether the first power value is greater than a preset power value;
[0039] a sending module, configured to send a test packet to the Bluetooth headset within a time period between the first moment and a second moment if the first power value is greater than the preset power value, and determine a current transmission delay of the Bluetooth headset according to a sending time and a receiving time of the test packet, wherein the second moment is a moment after the first moment;
[0040] A statistics module, used to count the number of times the Bluetooth headset is reconnected to the device within the time period to obtain the current number of reconnections;
[0041] An acquisition module, used to acquire log data of the Bluetooth headset, and in the log data, acquire the current volume and current data transmission rate of the Bluetooth headset;
[0042] A first generating module, configured to generate a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generating model;
[0043] The second generating module is used to obtain the second power value sent by the battery management system when the current estimation coefficient is less than the preset coefficient, multiply the second power value and the current estimation coefficient to generate the remaining power value of the Bluetooth headset, and the second power value is the power value of the Bluetooth headset at the second moment.
[0044] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for estimating the battery level of a Bluetooth headset according to any one of the first aspects described above is implemented.
[0045] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method for estimating the power level of a Bluetooth headset according to any one of the first aspects above is implemented.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the Bluetooth headset power estimation method described in any one of the first aspects above.
[0047] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, when the current estimation coefficient is less than the preset coefficient, the second power value sent by the battery management system is obtained, and the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset. The second power value is the power value of the Bluetooth headset at the second moment. The current transmission delay, the current number of reconnections, the current volume, and the current data transmission rate will affect the power consumption rate to varying degrees. By comprehensively considering these factors, a comprehensive estimation coefficient generation model can be established. The current estimation coefficient is generated based on the preset estimation coefficient generation model. Therefore, the factors considered in the current estimation coefficient are no longer single, which is conducive to improving the reliability of the Bluetooth headset power estimation. On the other hand, the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset. The remaining power value can help users understand the power status of the Bluetooth headset, so that users can reasonably arrange the usage time of the Bluetooth headset, which is conducive to improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0049] Figure 1A diagram of an application scenario of the method for estimating the battery level of a Bluetooth headset provided in an embodiment of the present application;
[0050] Figure 2 It is a flowchart of a method for estimating the power of a Bluetooth headset provided in an embodiment of the present application;
[0051] Figure 3 A flowchart of displaying low battery reminder information provided by an embodiment of the present application;
[0052] Figure 4 A schematic block diagram of a Bluetooth headset power estimation device provided in an embodiment of the present application;
[0053] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0055] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0056] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0057] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0058] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0059] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0060] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0061] In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0062] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0063] The Bluetooth headset power estimation method provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of electronic devices.
[0064] For example, the electronic device may be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a vehicle networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a TV set-top box (STB), a customer premises equipment (CPE) and / or other devices for communicating on a wireless system and a next generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved public land mobile network (PLMN) network, etc.
[0065] See also Figure 1 , Figure 1 The application scenario diagram of the Bluetooth headset power estimation method provided in the embodiment of the present application is described in detail as follows:
[0066] The electronic device is connected to the battery management system of the Bluetooth headset and receives the first power value sent by the battery management system.
[0067] When an electronic device is ready to establish a connection with a Bluetooth headset, it will first start the Bluetooth function and search for nearby Bluetooth electronic devices. Once the Bluetooth headset is found, the electronic device will send a connection request to the Bluetooth headset. After receiving the request, the Bluetooth headset will perform identity authentication and pairing operations to ensure a secure connection between the electronic device and the Bluetooth headset.
[0068] In an embodiment of the present application, the electronic device is connected to the battery management system of the Bluetooth headset and obtains the first power value from the battery management system.
[0069] See also Figure 2 , Figure 2 It is a flow chart of a method for estimating the power level of a Bluetooth headset provided in an embodiment of the present application. The method can be applied to an electronic device connected to a Bluetooth headset.
[0070] like Figure 2 As shown, the Bluetooth headset power estimation method provided in the embodiment of the present application includes the following steps, which are detailed as follows:
[0071] S201, connecting to the battery management system of the Bluetooth headset, receiving a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment;
[0072] The battery management system connected to the Bluetooth headset receives the first power value sent by the battery management system, including:
[0073] Connecting to the battery management system of the Bluetooth headset, and sending a first acquisition request to the battery management system;
[0074] Receive the first power value sent by the battery management system according to the first acquisition request.
[0075] S202, determining whether the first power value is greater than a preset power value;
[0076] The preset power value is set by the user or by the system by default and is not restricted here.
[0077] Wherein, the determining whether the first power value is greater than a preset power value includes:
[0078] Obtaining a status identifier of the Bluetooth headset, and determining whether the status identifier is a preset working identifier;
[0079] If the state identifier is the working identifier, it is determined whether the first power value is greater than the preset power value.
[0080] Among them, the working logo can tell the user that the headset is currently processing audio signals, such as music, phone calls, etc. This audio mode logo allows users to easily switch between different audio modes to adapt to different usage scenarios.
[0081] S203, if the first power value is greater than the preset power value, sending a test packet to the Bluetooth headset during a time period between the first moment and a second moment, and determining a current transmission delay of the Bluetooth headset according to a sending time and a receiving time of the test packet, the second moment being a moment after the first moment;
[0082] Among them, the first moment and the second moment are set by the user or by system default, and are not restricted here.
[0083] For the sake of illustration, an example is given below:
[0084] For example, the first moment is 8:00 in the morning, and the next moment after the first moment is 8:15.
[0085] For example, if the first moment is 8:30 in the morning, the next moment after the first moment is 8:33.
[0086] The electronic device sends a test packet to the Bluetooth headset and records the sending time of the test packet.
[0087] Among them, after receiving the test packet, the Bluetooth headset will record the reception time of the test packet and return a response packet to the sender, and the response packet carries the reception time of the test packet.
[0088] S204, within the time period, counting the number of times the Bluetooth headset is reconnected to the device to obtain a current number of reconnections;
[0089] S205, obtaining log data of the Bluetooth headset, and obtaining the current volume and current data transmission rate of the Bluetooth headset from the log data;
[0090] S206, generating a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generation model;
[0091] Exemplarily, the estimation coefficient generation model includes:
[0092] ;
[0093] in, is the current estimation coefficient, is the ratio of the current transmission delay to the preset transmission delay, is the ratio of the current number of reconnections to the preset number of reconnections, is the ratio of the current volume to the preset volume, is the ratio of the current data transmission rate to the preset data transmission rate, is the preset first weight coefficient, is the preset second weight coefficient.
[0094] in, and It can ensure that the estimation coefficient generation model selects the optimal option, thereby improving the efficiency and performance of the estimation coefficient generation model, which is conducive to ensuring the stability and reliability of the estimation coefficient generation model.
[0095] The first weight coefficient and the second weight coefficient are set by the user or by the system by default, and are not limited here.
[0096] The value range of the first weight coefficient is 0 to 1.
[0097] The value range of the second weight coefficient is 1 to 2. The louder the volume is, the more power is consumed. Therefore, increasing the value range of the second weight coefficient is more in line with the actual power consumption.
[0098] For the sake of illustration, an example is given below:
[0099] for example, is 0.5, is 1.2, and the estimated coefficient generation model is
[0100] ;
[0101] for example, is 0.6, is 1.3, and the estimated coefficient generation model is:
[0102] ;
[0103] S207, when the current estimation coefficient is less than the preset coefficient, obtain the second power value sent by the battery management system, multiply the second power value and the current estimation coefficient to generate the remaining power value of the Bluetooth headset, and the second power value is the power value of the Bluetooth headset at the second moment.
[0104] For the sake of illustration, an example is given below:
[0105] for example, is 0.5, is 1.1, is 1, is 1.1, is 1.2, is 1.1;
[0106] ;
[0107] When the preset coefficient is 1, 0.82 is less than 1, and the second power value is multiplied by 0.82 to generate the remaining power value of the Bluetooth headset.
[0108] For the sake of illustration, an example is given below:
[0109] for example, is 0.5, is 1.3, is 1, is 1.3, is 1.5, is 1.1;
[0110] ;
[0111] When the preset coefficient is 1, 0.61 is less than 1, and the second power value is multiplied by 0.61 to generate the remaining power value of the Bluetooth headset.
[0112] Wherein, when the current estimation coefficient is less than the preset coefficient, obtaining the second power value sent by the battery management system, multiplying the second power value by the current estimation coefficient, and generating the remaining power value of the Bluetooth headset, includes:
[0113] When the current estimation coefficient is less than the preset coefficient, sending a second acquisition request to the battery management system;
[0114] Receive the second power value sent by the battery management system according to the second acquisition request, multiply the second power value by the current estimation coefficient, and generate the remaining power value of the Bluetooth headset.
[0115] Exemplarily, when the current estimation coefficient is less than the preset coefficient, obtaining a second power value sent by the battery management system, multiplying the second power value by the current estimation coefficient, and generating a remaining power value of the Bluetooth headset, the Bluetooth headset power estimation method further includes:
[0116] Step A: creating a storage area corresponding to the remaining power value in a preset storage device, storing the remaining power value in the storage area, and creating an access interface for the storage area.
[0117] Wherein, when the current estimation coefficient is less than the preset coefficient, obtaining the second power value sent by the battery management system, multiplying the second power value and the current estimation coefficient to generate the remaining power value of the Bluetooth headset, the Bluetooth headset power estimation method further includes:
[0118] Step B, reading the preset upload time, and determining whether the current time is the upload time;
[0119] If the current time is the upload time, the preset server is connected through the preset network to upload the remaining power value to the server, and the preset network includes one of the 4G network, 5G network, and WIFI network or a combination thereof.
[0120] Among them, step A can be executed before or after step B, and step A can also be executed simultaneously with step B. The specific execution order is not limited here.
[0121] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, when the current estimation coefficient is less than the preset coefficient, the second power value sent by the battery management system is obtained, and the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset. The second power value is the power value of the Bluetooth headset at the second moment. The current transmission delay, the current number of reconnections, the current volume, and the current data transmission rate will affect the power consumption rate to varying degrees. By comprehensively considering these factors, a comprehensive estimation coefficient generation model can be established. The current estimation coefficient is generated based on the preset estimation coefficient generation model. Therefore, the factors considered in the current estimation coefficient are no longer single, which is conducive to improving the reliability of the Bluetooth headset power estimation. On the other hand, the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset. The remaining power value can help users understand the power status of the Bluetooth headset, so that users can reasonably arrange the usage time of the Bluetooth headset, which is conducive to improving the user experience.
[0122] See also Figure 3 , Figure 3 The flowchart of displaying low battery reminder information provided by the embodiment of the present application is detailed as follows:
[0123] S301, determining whether the remaining power value is greater than the preset power value;
[0124] S302: If the remaining power value is not greater than the preset power value, a preset low power reminder message is displayed on the screen.
[0125] Wherein, after displaying a preset low-battery reminder message on the screen if the remaining battery value is not greater than the preset battery value, the Bluetooth headset battery estimation method further includes:
[0126] The low-battery reminder information is sent to the Bluetooth headset.
[0127] In the embodiment of the present application, the preset low-battery reminder message is displayed on the screen, so that the user can know in advance that the earphone battery is low, so that there is enough time to prepare for charging. At the same time, the low-battery reminder message can also help the user develop good charging habits and further extend the service life of the Bluetooth headset.
[0128] For the Bluetooth headset power estimation method described in the above embodiment, please refer to Figure 4 , Figure 4 A schematic block diagram of a Bluetooth headset power estimation device provided in an embodiment of the present application, Figure 4 The Bluetooth headset power estimation device 400 shown can be applied to Figure 1 The electronic device in the application scenario diagram shown below takes the electronic device as an example. Figure 4 The Bluetooth headset power estimation device 400 shown is described in detail. The Bluetooth headset power estimation device 400 may include a connection module 401, a judgment module 402, a sending module 403, a statistics module 404, an acquisition module 405, a first generation module 406, and a second generation module 407.
[0129] A connection module 401 is used to connect to the battery management system of the Bluetooth headset and receive a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment;
[0130] A determination module 402 is used to determine whether the first power value is greater than a preset power value;
[0131] The sending module 403 is used to send a test packet to the Bluetooth headset within a time period between the first moment and the second moment if the first power value is greater than the preset power value, and determine the current transmission delay of the Bluetooth headset according to the sending time and the receiving time of the test packet, and the second moment is the next moment of the first moment;
[0132] A statistics module 404 is used to count the number of times the Bluetooth headset is reconnected to the device within the time period to obtain a current number of reconnections;
[0133] An acquisition module 405 is used to acquire log data of the Bluetooth headset, and in the log data, a current volume and a current data transmission rate of the Bluetooth headset are acquired;
[0134] A first generating module 406, configured to generate a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generation model;
[0135] The second generating module 407 is used to obtain the second power value sent by the battery management system when the current estimation coefficient is less than the preset coefficient, and multiply the second power value by the current estimation coefficient to generate the remaining power value of the Bluetooth headset, where the second power value is the power value of the Bluetooth headset at the second moment.
[0136] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0137] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, when the current estimation coefficient is less than the preset coefficient, the second power value sent by the battery management system is obtained, and the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset. The second power value is the power value of the Bluetooth headset at the second moment. The current transmission delay, the current number of reconnections, the current volume, and the current data transmission rate will affect the power consumption rate to varying degrees. By comprehensively considering these factors, a comprehensive estimation coefficient generation model can be established. The current estimation coefficient is generated based on the preset estimation coefficient generation model. Therefore, the factors considered in the current estimation coefficient are no longer single, which is conducive to improving the reliability of the Bluetooth headset power estimation. On the other hand, the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset. The remaining power value can help users understand the power status of the Bluetooth headset, so that users can reasonably arrange the usage time of the Bluetooth headset, which is conducive to improving the user experience.
[0138] See also Figure 5 , Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0139] like Figure 5 As shown, Figure 5 The electronic device 2 includes: at least one processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, and when the processor 20 executes the computer program 22, the steps in any of the above-mentioned method embodiments are implemented.
[0140] The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 2 and does not constitute a limitation on the electronic device 2. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0141] The processor 20 is used to run the computer program 22 stored in the memory 21, and implement the following steps when executing the computer program 22:
[0142] Connecting to the battery management system of the Bluetooth headset, receiving a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment;
[0143] Determining whether the first power value is greater than a preset power value;
[0144] If the first power value is greater than the preset power value, a test packet is sent to the Bluetooth headset in a time period between the first moment and a second moment, and a current transmission delay of the Bluetooth headset is determined according to a sending time and a receiving time of the test packet, and the second moment is a moment after the first moment;
[0145] Within the time period, count the number of times the Bluetooth headset is reconnected to the device to obtain a current number of reconnections;
[0146] Obtain log data of the Bluetooth headset, and in the log data, obtain the current volume and current data transmission rate of the Bluetooth headset; generate a current estimation coefficient according to the ratio of the current transmission delay to the preset transmission delay, the ratio of the current reconnection number to the preset reconnection number, the ratio of the current volume to the preset volume, the ratio of the current data transmission rate to the preset data transmission rate, and a preset estimation coefficient generation model; when the current estimation coefficient is less than the preset coefficient, obtain a second power value sent by the battery management system, multiply the second power value and the current estimation coefficient to generate a remaining power value of the Bluetooth headset, the second power value being the power value of the Bluetooth headset at the second moment.
[0147] In some embodiments, the processor 20 is configured to implement: connecting the battery management system of the Bluetooth headset and sending a first acquisition request to the battery management system;
[0148] Receive the first power value sent by the battery management system according to the first acquisition request.
[0149] In some embodiments, the processor 20 is used to implement: obtaining a status identifier of the Bluetooth headset, and determining whether the status identifier is a preset working identifier;
[0150] If the state identifier is the working identifier, it is determined whether the first power value is greater than the preset power value.
[0151] In some embodiments, the processor 20 is configured to implement: when the current estimation coefficient is less than a preset coefficient, sending a second acquisition request to the battery management system;
[0152] Receive the second power value sent by the battery management system according to the second acquisition request, multiply the second power value by the current estimation coefficient, and generate the remaining power value of the Bluetooth headset.
[0153] In some embodiments, the processor 20 is used to implement: determining whether the remaining power value is greater than the preset power value;
[0154] If the remaining power value is not greater than the preset power value, a preset low power reminder message is displayed on the screen.
[0155] In some embodiments, the processor 20 is used to implement: sending the low-battery reminder information to the Bluetooth headset.
[0156] In some embodiments, the processor 20 is used to implement: reading a preset upload time, and determining whether the current time is the upload time;
[0157] If the current time is the upload time, the preset server is connected through the preset network to upload the remaining power value to the server, and the preset network includes one of the 4G network, 5G network, and WIFI network or a combination thereof.
[0158] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0159] In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as a hard disk or memory of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic device 2, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the electronic device 2. The memory 21 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or is to be output.
[0160] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0161] An embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0162] The storage medium stores program codes, which can be called by a processor to execute the Bluetooth headset power estimation method described in the above method embodiment.
[0163] The storage medium has a storage space for the program code.
[0164] The program code includes the code of any step in the method for estimating the battery level of a Bluetooth headset described in the above method embodiment.
[0165] For example, the program code is called by the processor and can execute the following steps:
[0166] Connecting to the battery management system of the Bluetooth headset, receiving a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment;
[0167] Determining whether the first power value is greater than a preset power value;
[0168] If the first power value is greater than the preset power value, a test packet is sent to the Bluetooth headset in a time period between the first moment and a second moment, and a current transmission delay of the Bluetooth headset is determined according to a sending time and a receiving time of the test packet, and the second moment is a moment after the first moment;
[0169] Within the time period, count the number of times the Bluetooth headset is reconnected to the device to obtain a current number of reconnections;
[0170] Obtain log data of the Bluetooth headset, and in the log data, obtain the current volume and current data transmission rate of the Bluetooth headset;
[0171] Generate a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generation model;
[0172] When the current estimation coefficient is less than the preset coefficient, the second power value sent by the battery management system is obtained, and the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset, and the second power value is the power value of the Bluetooth headset at the second moment.
[0173] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0174] Among them, the storage medium can also be an external storage device of the Bluetooth headset power estimation device or the electronic device, for example, a plug-in hard disk equipped on the Bluetooth headset power estimation device or the electronic device, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), a non-volatile computer-readable medium (non-transitory computer-readable storage medium), etc.
[0175] Since the computer program stored in the storage medium can execute any one of the Bluetooth headset power estimation methods provided in the embodiments of the present application, the storage medium can achieve the beneficial effects that can be achieved by any one of the Bluetooth headset power estimation methods provided in the embodiments of the present application. Please refer to the previous embodiments for details and will not be repeated here.
[0176] An embodiment of the present application provides a computer program product. When the computer program product is executed on an electronic device, the electronic device executes the above-mentioned Bluetooth headset power estimation method.
[0177] The computer program product is loaded into the electronic device and can execute the following steps:
[0178] Connecting to the battery management system of the Bluetooth headset, receiving a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment;
[0179] Determining whether the first power value is greater than a preset power value;
[0180] If the first power value is greater than the preset power value, a test packet is sent to the Bluetooth headset in a time period between the first moment and a second moment, and a current transmission delay of the Bluetooth headset is determined according to a sending time and a receiving time of the test packet, and the second moment is a moment after the first moment;
[0181] Within the time period, count the number of times the Bluetooth headset is reconnected to the device to obtain a current number of reconnections;
[0182] Obtain log data of the Bluetooth headset, and in the log data, obtain the current volume and current data transmission rate of the Bluetooth headset;
[0183] Generate a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generation model;
[0184] When the current estimation coefficient is less than the preset coefficient, the second power value sent by the battery management system is obtained, and the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset, and the second power value is the power value of the Bluetooth headset at the second moment.
[0185] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0186] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0187] Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The storage medium may at least include: any entity or device that can carry the computer program code to an electronic device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, the storage medium cannot be an electric carrier signal and a telecommunication signal.
[0188] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0189] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for estimating the battery power of a Bluetooth headset, characterized in that: Applied to an electronic device, the electronic device is connected to a Bluetooth headset, and the Bluetooth headset power estimation method includes: Connecting to the battery management system of the Bluetooth headset, receiving a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment; Determining whether the first power value is greater than a preset power value; If the first power value is greater than the preset power value, a test packet is sent to the Bluetooth headset in a time period between the first moment and the second moment, and a current transmission delay of the Bluetooth headset is determined according to the sending time and the receiving time of the test packet, and the second moment is the next moment of the first moment; Within the time period, count the number of times the Bluetooth headset is reconnected to the device to obtain a current number of reconnections; Obtain log data of the Bluetooth headset, and in the log data, obtain a current volume and a current data transmission rate of the Bluetooth headset; Generate a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generation model; When the current estimation coefficient is less than the preset coefficient, the second power value sent by the battery management system is obtained, and the second power value and the current estimation coefficient are multiplied to generate the remaining power value of the Bluetooth headset, and the second power value is the power value of the Bluetooth headset at the second moment.
2. The method for estimating the power of a Bluetooth headset according to claim 1, characterized in that: The battery management system connected to the Bluetooth headset receives a first power value sent by the battery management system, including: Connecting to the battery management system of the Bluetooth headset, and sending a first acquisition request to the battery management system; Receive the first power value sent by the battery management system according to the first acquisition request.
3. The method for estimating the power of a Bluetooth headset according to claim 1, characterized in that: The determining whether the first power value is greater than a preset power value includes: Obtaining a status identifier of the Bluetooth headset, and determining whether the status identifier is a preset working identifier; If the state identifier is the working identifier, it is determined whether the first power value is greater than the preset power value.
4. The method for estimating the power of a Bluetooth headset according to claim 1, characterized in that: When the current estimation coefficient is less than the preset coefficient, obtaining a second power value sent by the battery management system, and multiplying the second power value by the current estimation coefficient to generate a remaining power value of the Bluetooth headset, including: When the current estimation coefficient is less than the preset coefficient, sending a second acquisition request to the battery management system; Receive the second power value sent by the battery management system according to the second acquisition request, multiply the second power value by the current estimation coefficient, and generate the remaining power value of the Bluetooth headset.
5. The method for estimating the power of a Bluetooth headset according to claim 1, characterized in that: When the current estimation coefficient is less than the preset coefficient, a second power value sent by the battery management system is obtained, and the second power value is multiplied by the current estimation coefficient to generate the remaining power value of the Bluetooth headset, the Bluetooth headset power estimation method further includes: Determining whether the remaining power value is greater than the preset power value; If the remaining power value is not greater than the preset power value, a preset low power reminder message is displayed on the screen.
6. The method for estimating the power of a Bluetooth headset according to claim 5, characterized in that: After the preset low-battery reminder message is displayed on the screen if the remaining battery value is not greater than the preset battery value, the Bluetooth headset battery estimation method further includes: The low-battery reminder information is sent to the Bluetooth headset.
7. The method for estimating the power of a Bluetooth headset according to claim 1, characterized in that: When the current estimation coefficient is less than the preset coefficient, a second power value sent by the battery management system is obtained, and the second power value is multiplied by the current estimation coefficient to generate the remaining power value of the Bluetooth headset, the Bluetooth headset power estimation method further includes: Read the preset upload time and determine whether the current time is the upload time; If the current time is the upload time, the preset server is connected through a preset network to upload the remaining power value to the server. The preset network includes one of the 4G network, 5G network, and WIFI network, or a combination thereof.
8. A Bluetooth headset power estimation device, characterized in that: Applicable to electronic equipment, the electronic equipment is connected to a Bluetooth headset, comprising: A connection module, used to connect to the battery management system of the Bluetooth headset and receive a first power value sent by the battery management system, where the first power value is the power value of the Bluetooth headset at a first moment; A judging module, used for judging whether the first power value is greater than a preset power value; a sending module, configured to send a test packet to the Bluetooth headset within a time period between the first moment and a second moment if the first power value is greater than the preset power value, and determine a current transmission delay of the Bluetooth headset according to a sending time and a receiving time of the test packet, wherein the second moment is a moment after the first moment; A statistics module, used to count the number of times the Bluetooth headset is reconnected to the device within the time period to obtain the current number of reconnections; An acquisition module, used to acquire log data of the Bluetooth headset, and in the log data, acquire the current volume and current data transmission rate of the Bluetooth headset; A first generating module, configured to generate a current estimation coefficient according to a ratio of the current transmission delay to a preset transmission delay, a ratio of the current number of reconnections to a preset number of reconnections, a ratio of the current volume to a preset volume, a ratio of the current data transmission rate to a preset data transmission rate, and a preset estimation coefficient generating model; The second generating module is used to obtain the second power value sent by the battery management system when the current estimation coefficient is less than the preset coefficient, multiply the second power value and the current estimation coefficient to generate the remaining power value of the Bluetooth headset, and the second power value is the power value of the Bluetooth headset at the second moment.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for estimating the battery level of a Bluetooth headset as described in any one of claims 1 to 7 is implemented.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for estimating the battery level of a Bluetooth headset as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Communication method and device for true wireless Bluetooth earphone, earphone and system
CN115767488A
Charging control method of Bluetooth headset
CN117375162A
Portable information terminal
JP2005079889A
Power supply control system, router device, power supply control method and power supply control program
JP2013074784A
Determining pitch cycle energy and scaling an excitation signal
US20120072208A1
