Method for detecting electric quantity and positioning device
By configuring a sub-process flag in the positioning device to determine the timing of power detection, and using a simple voltage averaging method, the problem of inaccurate power detection in the positioning device is solved, achieving high-precision and low-power power detection.
Patent Information
- Application Number
- CN202111190114.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2041-10-11
AI Technical Summary
Existing positioning devices suffer from inaccurate power detection due to voltage fluctuations under high power consumption conditions, and existing methods are either costly or complex.
By configuring flags for the positioning sub-process and the power detection sub-process, the system determines whether to perform power detection based on the sub-process status, avoiding power detection during periods of high power consumption and unstable voltage, and using a simple voltage averaging algorithm to calculate the power consumption.
It improves the accuracy of power detection, simplifies operation procedures, reduces equipment power consumption, and avoids the impact of voltage fluctuations.
Smart Images

Figure CN113848485B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power detection technology, specifically to a power detection method and positioning device. Background Technology
[0002] Positioning devices using GPS or BeiDou navigation systems are typically battery-powered. During daily operation, besides periodically executing positioning sub-processes (which include locating the current coordinates and uploading positioning data), it's also necessary to monitor the remaining battery power so users know the device's battery life and can charge it promptly. Common methods for power detection include coulomb counter measurement, battery modeling, and voltage measurement.
[0003] Coulomb counting and battery modeling methods offer more accurate results, but are also relatively expensive and complex to implement. Voltage detection, on the other hand, is less expensive and easier to implement. However, when the positioning device is locating and uploading data, its power consumption increases instantaneously, causing voltage fluctuations, which leads to inaccurate readings of remaining battery power. Summary of the Invention
[0004] This invention provides a power detection method and positioning device, aiming to improve the accuracy of power detection using a simpler control method. The objective of this invention is achieved through the following technical solutions:
[0005] A method for detecting battery power, characterized in that it includes:
[0006] (1) Configure the positioning sub-process and the triggering conditions for the positioning sub-process, and configure the power detection sub-process and the triggering conditions for the power detection sub-process;
[0007] (2) According to the location subprocess triggering condition or the power detection subprocess triggering condition, when one of the location subprocess or the power detection subprocess is about to be triggered, determine whether the other one is being executed. If yes, execute step (3a); otherwise, execute step (3b).
[0008] (3a) Execute the sub-process described in step (2) and return to step (2);
[0009] (3b) Trigger and execute the subprocess to be triggered as described in step (2).
[0010] Specifically, the positioning subprocess is configured with a positioning subprocess flag bit that records the start and end states of the positioning subprocess; in step (2), if it is determined that the subprocess to be triggered is the power detection subprocess, the positioning subprocess flag bit is read. If the positioning subprocess flag bit is in the start state, step (3a) is executed; if the positioning subprocess flag bit is in the end state, step (3b) is executed.
[0011] Specifically, the power detection subprocess is configured with a power detection subprocess flag bit that records the start and end states of the power detection subprocess; in step (2), if it is determined that the subprocess to be triggered is the positioning subprocess, the power detection subprocess flag bit is read. If the power detection subprocess flag bit is in the start state, step (3a) is executed; if the power detection subprocess flag bit is in the end state, step (3b) is executed.
[0012] Specifically, the positioning subprocess is configured with a positioning subprocess flag bit to record the start and end states of the positioning subprocess, and the power detection subprocess is configured with a power detection subprocess flag bit to record the start and end states of the power detection subprocess; in step (2), if it is determined that the subprocess to be triggered is either the positioning subprocess or the power detection subprocess, the flag bit of the other one is read. If the flag bit is in the start state, step (3a) is executed; if the flag bit is in the end state, step (3b) is executed.
[0013] Specifically, the location subprocess triggering conditions include at least one of a preset location detection period and a received location detection trigger signal.
[0014] Specifically, the triggering conditions for the power detection sub-process include at least one of a preset power detection period and a received power detection trigger signal.
[0015] Specifically, the power detection sub-process is triggered by a preset power detection cycle; the detection method further includes the step of adjusting the power detection cycle based on the power detection value obtained by the power detection sub-process.
[0016] Specifically, the trigger condition for the power detection sub-process is configured to a preset power detection cycle, and the power detection sub-process specifically includes:
[0017] A1. Determine whether there is a charging operation within the power detection cycle. If not, continuously collect n voltages that satisfy Vn≤V0, where n is an integer greater than 3, and V0 is the currently recorded detection voltage. In step A1, V0 is the detection voltage obtained in the previous power detection cycle. Put all Vn into the current voltage set V={V1,V2,...,Vn}. If there is a charging operation, collect n voltages that satisfy Vn≥V0, and put all Vn into the current voltage set V={V1,V2,...,Vn}.
[0018] A2. Select one, or partially select and average the n voltages in the current set V to obtain the detection voltage of the current power detection cycle, and update V0 to the detection voltage of the current power detection cycle.
[0019] A3. Finally, based on the correspondence between the latest V0 and the remaining power, the remaining power corresponding to V0 is calculated.
[0020] Specifically, in step A2, the n voltages in the current voltage set V are sorted from smallest to largest, and the average value of at least two voltage values in the latter half of the sorted set is calculated. This average value is used as the detection voltage in the current power detection step.
[0021] A positioning device is characterized by comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is used to invoke the program instructions to execute the detection method described above.
[0022] The beneficial effects of this invention are as follows: by determining whether the electrical device is currently locating and transmitting data, it can be determined whether to detect the device's remaining power; conversely, it can also be determined whether to perform location and data transmission by determining whether the location device is currently detecting the device's remaining power. This invention ensures that power detection is performed under stable voltage conditions, avoiding operating states with high device power consumption and unstable voltage using a simpler method. This not only improves the accuracy of remaining power detection but also simplifies the operation steps, eliminating the need for complex algorithms. Attached Figure Description
[0023] Figure 1 The main flowchart of the power detection method provided by the present invention.
[0024] Figure 2 In the power detection method for the positioning device provided in Example 1, there are steps for triggering the positioning sub-process and executing the positioning sub-process.
[0025] Figure 3 In the power detection method for the positioning device provided in Embodiment 1, the power detection sub-process is triggered and the execution steps of the power detection sub-process are controlled. Detailed Implementation
[0026] Combination Figure 1 As shown, the power detection method provided by the present invention includes:
[0027] (1) Configure the positioning sub-process and the triggering conditions of the positioning sub-process, and configure the power detection sub-process and the triggering conditions of the power detection sub-process.
[0028] (2) Based on the location subprocess triggering condition or the power detection subprocess triggering condition, if one of the location subprocess or the power detection subprocess is about to be triggered, determine whether the other one is being executed. If yes, execute step (3a); otherwise, execute step (3b).
[0029] (3a) Execute the sub-process described in step (2) and return to step (2).
[0030] (3b) Trigger and execute the subprocess to be triggered as described in step (2).
[0031] The positioning sub-process includes locating the current coordinates and uploading positioning data, while the battery detection sub-process includes battery detection and battery information update. The triggering conditions for the positioning sub-process include a preset positioning detection period and / or a received positioning detection trigger signal; similarly, the triggering conditions for the battery detection sub-process include a preset battery detection period and / or a received battery detection trigger signal. The phrase "when to be triggered" in this document refers to the existence of corresponding triggering conditions, but the corresponding sub-process has not yet been formally triggered.
[0032] The above-mentioned power detection method can have three operating modes: 1. The power detection sub-process actively avoids the positioning sub-process: It determines whether to detect the remaining power of the positioning device by judging whether the positioning device is currently locating and transmitting data; 2. Alternatively, the positioning sub-process can actively avoid the power detection sub-process: It determines whether to perform positioning and transmit data by judging whether the positioning device is currently detecting the remaining power of the positioning device; 3. No distinction between primary and secondary processes: The later-triggered sub-process avoids the earlier-triggered sub-process. Specific embodiments are described below:
[0033] Example 1
[0034] Example 1 is an implementation method for the power detection subprocess to actively avoid the positioning subprocess. The power detection method it provides specifically includes:
[0035] (1) As Figure 2 As shown, the triggering condition for the positioning sub-process is configured to be a preset periodic trigger. When the periodic trigger node is reached, the positioning sub-process is triggered and the following operations are performed:
[0036] S111. Record the positioning sub-process flag as the start state;
[0037] S112, Locate the current coordinates;
[0038] S113. Upload location data;
[0039] S114. Record the location subprocess flag as the end state.
[0040] Since device positioning and uploading positioning data are performed sequentially, only one positioning sub-process flag needs to be set to represent the execution status of the positioning sub-process, that is, whether the positioning device is currently positioning and sending data.
[0041] like Figure 3As shown, the triggering condition for the power detection sub-process is configured to be a preset periodic trigger. Simultaneously, the power detection sub-process is configured to include:
[0042] S121, Battery level detection;
[0043] S122, Battery Information Update.
[0044] Considering that battery level changes slowly and real-time monitoring is unnecessary, as it would consume resources and generate unnecessary power, the battery level monitoring cycle is set based on historical battery level monitoring results and power outages during operation. Alternatively, the battery level monitoring sub-process can be triggered by an externally received battery level detection signal.
[0045] (2) Combination Figure 3 As shown, if the sub-process to be triggered is the power detection sub-process, the positioning sub-process flag is read. If the positioning sub-process flag is in the start state, step (3a) is executed; if the positioning sub-process flag is in the end state, step (3b) is executed.
[0046] (3a) Execute the currently executing location subprocess and return to step (2).
[0047] (3b) Trigger and execute the power detection subprocess to be triggered as described in step (2).
[0048] In the above embodiment, when the power detection trigger node is reached, the power detection sub-process is not executed directly. Instead, the value of the positioning sub-process flag is first determined. If it is an end flag (it's either start or end, only two states, so determining whether it's start or end is sufficient), power detection is performed directly. If it is a start flag, power detection is paused, and the positioning sub-process flag value is re-evaluated. Power detection is only performed after the positioning sub-process flag value becomes an end flag. This method effectively avoids detecting the remaining battery power when the device voltage is unstable, improving the accuracy of power detection.
[0049] The power detection sub-process specifically includes:
[0050] A1. Determine if there was a charging operation during the power detection cycle. If not, continuously collect the current voltage Vn, where n > 2 and n is an integer greater than 3. In this embodiment, n = 10, meaning collect 10 voltages that satisfy Vn ≤ V0 (V0 is the currently recorded detection voltage; in step A1, V0 is the detection voltage obtained in the previous power detection cycle). Place all Vn values into the current voltage set V, V = {V1, V2, ..., V10}. If there was a charging operation, collect 10 voltages that satisfy Vn ≥ V0 and place them into the current voltage set V, V = {V1, V2, ..., V10}. The advantage of this is that it can filter out some abnormal voltage values, improving the accuracy of the final result.
[0051] A2. Sort the ten voltages in the current set V from smallest to largest, take the eighth and ninth voltage values after sorting, calculate the average of these two voltages, use this average as the final voltage of the current power detection step, and assign this average to V0.
[0052] A3. Finally, based on the correspondence between the latest V0 and the remaining power, the remaining battery power corresponding to V0 is calculated.
[0053] Furthermore, the detection method in this embodiment also includes a step of adjusting the power detection cycle based on the power detection value obtained from the power detection sub-process. For example, when the power is low, the detection cycle is shortened to obtain power information more promptly.
[0054] Example 2
[0055] The difference between Example 2 and Example 1 is that Example 2 is configured with a power detection subprocess flag to record the start and end states of the power detection subprocess. Under normal circumstances, the power detection subprocess is triggered and executed periodically. When the positioning subprocess is triggered, the power detection subprocess flag is read to determine whether to execute it; that is, the positioning subprocess actively avoids the power detection subprocess. Specifically, when it is determined that the subprocess to be triggered is the positioning subprocess, the power detection subprocess flag is read. If the flag is in the start state, the currently executing power detection subprocess is executed; if the flag is in the end state (not the start state), the positioning subprocess to be triggered is triggered and executed.
[0056] In the second embodiment described above, when the positioning trigger node is reached, the positioning sub-process is not executed directly. Instead, the value of the power detection sub-process flag is first determined. If it is an end flag (there are only two states, either start or end, so only the start flag needs to be determined), the positioning sub-process is executed directly. If it is a start flag, the positioning process is paused, and the power detection sub-process flag is re-evaluated. The positioning sub-process is only executed again after the power detection flag changes to an end flag. This method prevents interference from the high power consumption of the positioning sub-process during power detection, thus improving the accuracy of power detection.
[0057] Example 3
[0058] The difference between Embodiment 3 and Embodiments 1 or 2 is that: the positioning sub-process is configured with a positioning sub-process flag bit to record the start and end states of the positioning sub-process, and the power detection sub-process is configured with a power detection sub-process flag bit to record the start and end states of the power detection sub-process; the corresponding step (2) specifically includes: according to the triggering condition, if it is determined that the sub-process to be triggered is either the positioning sub-process or the power detection sub-process, the flag bit of the other one is read. If the flag bit is in the start state, step (3a) is executed; if the flag bit is in the end state, step (3b) is executed. As can be seen from the above, Embodiment 3 does not distinguish between primary and secondary processes, and the sub-process triggered later avoids the sub-process triggered earlier.
[0059] The present invention also provides a positioning device, including a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is used to call the program instructions to execute the detection method described above.
[0060] The above specific embodiments are merely a full disclosure and not a limitation of the present invention. Any substitution of equivalent technical features that are based on the creative intent of the present invention and can be obtained without creative effort should be considered as within the scope of this application.
Claims
1. A method of detecting an amount of electricity, characterized by, The method comprises: (1) configuring a positioning sub-process and a positioning sub-process trigger condition, configuring an electric quantity detection sub-process and an electric quantity detection sub-process trigger condition; (2) when one of the positioning sub-process or the electric quantity detection sub-process is to be triggered according to the positioning sub-process trigger condition or the electric quantity detection sub-process trigger condition, judging whether the other one of the two is being executed, if yes, executing step (3a), otherwise executing step (3b); (3a) executing the sub-process being executed in step (2) and returning to step (2); (3b) triggering and executing the sub-process to be triggered in step (2); wherein the electric quantity detection sub-process trigger condition is configured as a preset electric quantity detection period, and the electric quantity detection sub-process specifically comprises: A1, judging whether there is a charging operation in the electric quantity detection period, if not, continuously collecting n voltages satisfying Vn≤V0, n being an integer greater than 3, V0 at this time being a detection voltage obtained in the last electric quantity detection period, and putting all Vn into a current voltage set V={V1, V2,..., Vn}; if there is a charging operation, collecting n voltages satisfying Vn≥V0, and putting all Vn into the current voltage set V={V1, V2,..., Vn}; A2, performing alternative selection, average operation after partial selection, or average operation of all, on the n voltages in the current set V to obtain a detection voltage of the current electric quantity detection period, and updating V0 to the detection voltage of the current electric quantity detection period; A3, finally, calculating the remaining electric quantity corresponding to V0 according to the latest V0 and the corresponding relationship of the remaining electric quantity.
2. The electric quantity detection method according to claim 1, characterized by, The positioning sub-process is configured with a positioning sub-process flag bit recording a starting state and an ending state of the positioning sub-process; in step (2), if it is judged that the sub-process to be triggered is the electric quantity detection sub-process, the positioning sub-process flag bit is read, and if the positioning sub-process flag bit is in the starting state, step (3a) is executed, and if the positioning sub-process flag bit is in the ending state, step (3b) is executed.
3. The electric quantity detection method according to claim 1, wherein The electric quantity detection sub-process is configured with an electric quantity detection sub-process flag bit recording a starting state and an ending state of the electric quantity detection sub-process; in step (2), if it is judged that the sub-process to be triggered is the positioning sub-process, the electric quantity detection sub-process flag bit is read, and if the electric quantity detection sub-process flag bit is in the starting state, step (3a) is executed, and if the electric quantity detection sub-process flag bit is in the ending state, step (3b) is executed.
4. The electric quantity detection method according to claim 1, wherein The positioning sub-process is configured with a positioning sub-process flag bit recording a starting state and an ending state of the positioning sub-process, and the electric quantity detection sub-process is configured with an electric quantity detection sub-process flag bit recording a starting state and an ending state of the electric quantity detection sub-process; in step (2), if it is judged that the sub-process to be triggered is one of the positioning sub-process or the electric quantity detection sub-process, the flag bit of the other one of the two is read, and if the flag bit is in the starting state, step (3a) is executed, and if the flag bit is in the ending state, step (3b) is executed.
5. The charge amount detection method according to any one of claims 1 to 4, characterized by, The positioning sub-process triggering condition comprises at least one of a preset positioning detection period and a received positioning detection triggering signal.
6. The electric quantity detection method according to claim 1, wherein The power detection sub-process triggering condition is a preset power detection period; the detection method further comprises a step of adjusting the power detection period according to a power detection value obtained by the power detection sub-process.
7. The electric quantity detection method according to claim 1, wherein In the step A2, n voltages in the current voltage set V are sorted from small to large, at least two voltage values located in the latter half of the sorted voltages are averaged, and the average value is taken as the detection voltage of the current power detection step.
8. A positioning device, characterized by A device comprising a processor and a memory, wherein the memory is configured to store a computer program comprising program instructions, and the processor is configured to invoke the program instructions to execute the detection method of any one of claims 1-7.
Citation Information
Patent Citations
System and method for judging battery electric quantity and wireless network equipment management system
CN101556309A
Battery capacity detection method and device of equipment
CN109270467A
Anti-fluctuation battery electric quantity detection method and device
CN111948556A
Online determination method and system for state of health of power battery pack of electric vehicle
WO2021185308A1
A method for enhancing the accuracy of electric quantity measurement
CN109143095A