Vehicle charging electric quantity metering method, vehicle and electronic equipment
By introducing a validity verification mechanism during vehicle charging, the problem of incorrect charging power measurement caused by the sleep-wake cycle is solved, ensuring the accuracy and reliability of charging information and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, the charging power measurement is incorrect due to the sleep-wake cycle during vehicle charging, resulting in the APP interface displaying error information after charging is completed, which affects the user experience.
A validity verification mechanism for the charging capacity variable is introduced. The initial capacity value is obtained by detecting changes in the charging state, and multi-level validity checks are performed to ensure the accuracy of the initial capacity value. If the initial capacity value is invalid, the data from the battery management system is used as a backup data source to calculate the charging capacity.
This avoids battery calculation failures caused by variable initialization errors during vehicle sleep-wake cycles, ensuring accurate charging information is provided to users under all circumstances, thus improving user experience and product reliability.
Smart Images

Figure CN121734183A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and more specifically, to a method for measuring the amount of electricity charged in a vehicle, a vehicle, and electronic equipment. Background Technology
[0002] With the increasing prevalence of digital keys and electric vehicles, users are relying more and more on mobile apps to remotely monitor charging status, with accurate real-time charging level display being a key requirement. Currently, power metering mainly relies on the vehicle controller to perform cumulative calculations during the charging process.
[0003] However, to save energy, vehicles periodically hibernate and wake up while charging. During this process, the accumulated charging capacity may be incorrectly initialized to an invalid value during the wake-up cycle. This can lead to the app displaying 0, an error code, or still showing the previous charging amount after charging is complete, severely impacting the user experience. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method for measuring the charging power of a vehicle, a vehicle, and an electronic device, which aims to overcome at least one of the above-mentioned defects.
[0005] In a first aspect, this application provides a method for measuring the charging capacity of a vehicle, the method comprising: When a change in the vehicle's charging status is detected, the initial charge value used to measure the charge amount for this charge is obtained; A first validity check is performed on the initial power value to determine whether the initial power value is invalid data; If the first validity check fails, the cumulative charge amount corresponding to the charge amount signal of the vehicle's battery management system at the end of this charge is determined as the charge amount for this charge.
[0006] In one possible implementation, the change in the vehicle's charging state is detected by: Obtain the charging connection signal of the vehicle; A second validity check is performed on the charging connection signal to determine whether the level of the charging connection signal remains stable for a predetermined duration. When it is determined that the charging connection signal level remains stable for a predetermined duration, it is determined that the charging state of the vehicle has changed.
[0007] In one possible implementation, it also includes: If the first validity check passes, the final charge level of this charging process is obtained at the end of the charging process. The charging power is measured based on the initial power value and the final power value.
[0008] In one possible implementation, the amount of electricity charged is measured in the following way: Obtain the final charge level of this charging session, and perform a third validity check on the final charge level. When the ending power value passes the third validity check, the difference between the ending power value and the starting power value is calculated to obtain the charging power of this charge.
[0009] In one possible implementation, the termination charge value is determined to pass the third validity check by: Determine whether the ending power value is a second predefined invalid value, exceeds the reasonable power range, or is not higher than the starting power value; If the ending power value is not the second predefined invalid value, does not exceed the reasonable power range, and is higher than the starting power value, then the ending power value is determined to have passed the third validity check.
[0010] In one possible implementation, the method further includes: If the ending charge value fails the third validity check, the cumulative charge amount corresponding to the charge amount signal of the battery management system at the end of this charge is determined as the charge amount for this charge.
[0011] In one possible implementation, the method further includes: After the charging power is measured, the charging power is reported to the user terminal for display.
[0012] In one possible implementation, the determination of whether the initial power value is invalid is made in the following way: If the initial power value is a first predefined invalid value or exceeds a reasonable power range, the initial power value is determined to be an invalid value.
[0013] Secondly, this application provides a vehicle, the vehicle comprising: The controller is configured to: when a change in the charging state of the vehicle is detected, acquire a starting charge value for measuring the charge amount for this charge; perform a first validity check on the starting charge value to determine whether the starting charge value is a first predefined invalid value or exceeds a reasonable charge range; if the first validity check fails, determine the cumulative charge amount corresponding to the charge amount signal of the vehicle's battery management system at the end of this charge as the charge amount for this charge.
[0014] Thirdly, this application also provides an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method described above are performed.
[0015] The beneficial effects of the vehicle charging power metering scheme in this application are as follows: This application introduces a validity verification mechanism for charging power variables, which can identify invalid data before updating the charging start power reference point. This avoids the problem of power calculation failure caused by variable initialization errors during the vehicle's sleep-wake cycle, ensuring that accurate and reliable charging power information can be provided to users under any circumstances, thereby improving user experience and product reliability.
[0016] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a method for measuring vehicle charging power provided in an embodiment of this application; Figure 2 A flowchart for measuring the charging power provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] 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, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0020] First, the applicable scenarios for this application will be introduced. This application can be applied to the field of vehicle technology.
[0021] Research has found that with the widespread adoption of digital key technology, more and more car owners are accustomed to using only their mobile phones to unlock and start their vehicles. At the same time, the rapid development of electric vehicles has led to an increasing demand for remote monitoring of charging status, especially the ability to view the amount of charge in real-time and accurately via a mobile app, which has become an important function for enhancing the user experience. Currently, common charging power metering schemes primarily rely on the vehicle controller to perform cumulative calculations during the charging process.
[0022] However, this solution has a significant problem: the vehicle enters a sleep state during charging to conserve energy and is periodically woken up to perform status checks. During one of these wake-up cycles, the variable used to accumulate charging power may be incorrectly initialized to an invalid value (e.g., 0xFFFF). When the charging status changes (e.g., from "Charging" to "Charging Complete"), if the system uses this invalid value as the starting charge level, the calculation condition "ending charge ≥ starting charge" will never be met because the invalid value is much larger than the actual ending charge level. Therefore, the system cannot correctly calculate the effective increment of the current charge, and subsequently reports abnormal data (e.g., 0xFFFFFFFE) to the mobile app, ultimately causing display errors—potentially displaying historical charging amount, 0, or an error code, severely impacting the user experience.
[0023] Based on this, this application provides a method for measuring vehicle charging power, a vehicle, and an electronic device. By introducing a validity verification mechanism for charging power variables, invalid data can be identified before updating the charging start power reference point, thereby fundamentally avoiding the problem of power calculation failure caused by variable initialization errors during the vehicle's sleep-wake cycle. Even if the main cumulative variable is abnormal, the system can automatically recover through a backup data source, ensuring that accurate and reliable charging power information can be provided to users under any circumstances, significantly improving user experience and product reliability.
[0024] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for measuring vehicle charging power according to an embodiment of this application. Figure 1 As shown in the embodiments of this application, the method for measuring vehicle charging power includes: S101. When a change in the vehicle's charging status is detected, the initial charge value used to measure the charge amount for this charging operation is obtained.
[0025] The following methods are used to detect changes in the vehicle's charging status: Acquire the vehicle's charging connection signal; perform a second validity check on the charging connection signal to determine whether the level of the charging connection signal is continuously stable and exceeds a predetermined duration; when it is determined that the level of the charging connection signal is continuously stable and exceeds the predetermined duration, determine that the vehicle's charging status has changed.
[0026] This is the trigger point for the entire process. The metering process is only started when the charging status changes effectively, and a second validity check is performed on the charging signal. This is to filter out instantaneous erroneous signals caused by contact jitter, voltage fluctuations, or electromagnetic interference, and to ensure the reliability of the status judgment.
[0027] For example, when the charging gun is inserted into the vehicle's charging port, the vehicle controller will detect a charging connection signal that jumps from a low level to a high level and continuously monitor the charging connection signal. Only when the charging connection signal remains stably high for more than a predetermined time will it be determined that a valid charging start state change has occurred, and then the currently stored starting power value will be obtained.
[0028] S102. Perform a first validity check on the initial power value to determine whether the initial power value is invalid.
[0029] In this step, the "initial battery value" read directly from the memory may be incorrectly initialized during the vehicle's sleep-wake process. This step aims to proactively identify and intercept these invalid data to prevent them from entering subsequent calculation stages.
[0030] For example, the obtained initial energy value might be represented in memory as a first predefined invalid value (0xFFFF), or the initial energy value might be far beyond the reasonable range of 0-1000 kWh. Therefore, the test result is a failure, and this data is discarded.
[0031] S103. If the first validity test fails, the cumulative charge amount corresponding to the charge amount signal of the vehicle's battery management system at the end of this charge is determined as the charge amount for this charge.
[0032] In this step, if the first validity test fails, the battery status is directly monitored through the battery management system (BMS). The data obtained by the BMS remains continuously valid during the vehicle's sleep period and is not affected by controller reset.
[0033] For example, if the first validity check fails, a query command is sent to the BMS via the vehicle's CAN network. The BMS replies with the total accumulated energy data of the current battery pack, which is the total energy actually absorbed by the battery from the start to the end of charging. This total accumulated energy data is directly determined as the charging amount for this charge and is reported and displayed.
[0034] In this embodiment of the application, if the first validity check passes, the end power value of this charging process is obtained at the end of the charging process; the power of this charging is measured based on the start power value and the end power value.
[0035] The following is through Figure 2 This section describes the specific process of measuring the amount of electricity charged in this session.
[0036] Please see Figure 2 , Figure 2 This is a flowchart illustrating the measurement of the charging power in this embodiment of the application. Figure 2 As shown in the embodiment of this application, the steps for measuring the charging capacity include: S201. Obtain the final charge value of this charging session and perform a third validity check on the final charge value.
[0037] S202. When the end power value passes the third validity test, calculate the difference between the end power value and the starting power value to obtain the charging power of this charge.
[0038] In this embodiment of the application, if the end charge value fails the third validity check, the cumulative charge amount corresponding to the charge amount signal of the battery management system at the end of this charge is determined as the charge amount of this charge.
[0039] Specifically, the termination charge value is determined to pass the third validity check in the following manner: Determine whether the ending power value is a second predefined invalid value, exceeds a reasonable power range, or is not higher than the starting power value; if the ending power value is not a second predefined invalid value, does not exceed a reasonable power range, and is higher than the starting power value, determine that the ending power value passes the third validity check.
[0040] Here, after charging is completed, it is also necessary to strictly verify the power level at the end of charging. This is the last crucial line of defense to ensure that the final result is accurate and reliable.
[0041] First, upon completion of charging, the final charge level recorded by the vehicle controller is acquired, and immediately subjected to a "third validity check" comprising three layers of logic. This check first determines whether the value is a predefined invalid identifier (such as 0xFFFF) to exclude completely unreliable data caused by communication or memory errors; then it determines whether the value is within a reasonable physical range (e.g., 0-1000 kWh) to filter out outrageous values caused by sensor malfunctions; finally, it verifies whether the final charge level is higher than the previously determined initial charge level, because the charge level at the end of a normal charging process must be higher than the initial charge level. If the final value does not meet this condition, it indicates an anomaly in the data acquisition chain or the battery state itself, and the cumulative charge level corresponding to the charged amount signal is used as the charge level for this charging operation.
[0042] Finally, after the charging amount is measured, the charging amount is reported to the user terminal for display.
[0043] Here, after the metering is completed, the charging amount is reported to the user terminal for display. This step enables the system's self-healing and state persistence. It's not only for accurate display this time, but also to save a reliable reference point, providing a correct starting point for the next charging metering, thereby breaking the vicious cycle of continuous errors caused by a single mistake.
[0044] Compared with existing technologies, this application achieves fault isolation and automatic recovery. Occasional errors in the main metering path (caused by waking from hibernation) are identified and isolated by the validity verification mechanism, and the system seamlessly switches to the backup path to ensure continuous service. Ultimately, users can always obtain accurate charging information without any operation (such as unplugging and replugging the charging gun), fundamentally improving the reliability of the function and the user experience.
[0045] Based on the same inventive concept, this application also provides a vehicle corresponding to the method for measuring the charging power of a vehicle. Since the principle of solving the problem in the vehicle in this application is similar to the method for measuring the charging power of a vehicle described above in this application, the implementation of the vehicle can refer to the implementation of the method, and the repeated parts will not be described again.
[0046] This application provides a vehicle, the vehicle comprising: The controller is configured to: when a change in the charging state of the vehicle is detected, acquire a starting charge value for measuring the charge amount for this charge; perform a first validity check on the starting charge value to determine whether the starting charge value is invalid data; if the first validity check fails, determine the cumulative charge amount corresponding to the charge amount signal of the vehicle's battery management system at the end of this charge as the charge amount for this charge.
[0047] In one possible implementation, the controller is further configured to: Acquire the charging connection signal of the vehicle; perform a second validity check on the charging connection signal to determine whether the level state of the charging connection signal is continuously stable and exceeds a predetermined duration; when it is determined that the level state of the charging connection signal is continuously stable and exceeds the predetermined duration, determine that the charging state of the vehicle has changed.
[0048] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.
[0049] The memory 320 stores machine-readable instructions that can be executed by the processor 310. When the electronic device 300 is running, the processor 310 and the memory 320 communicate via the bus 330. When the machine-readable instructions are executed by the processor 310, the steps of the method described above can be performed. For specific implementation details, please refer to the method embodiment, which will not be repeated here.
[0050] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run by a processor, it can execute the steps of the method described above. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0051] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0052] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0053] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0054] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0055] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0056] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for measuring the charging capacity of a vehicle, characterized in that, The method includes: When a change in the vehicle's charging status is detected, the initial charge value used to measure the charge amount for this charge is obtained; A first validity check is performed on the initial power value to determine whether the initial power value is invalid. If the first validity check fails, the cumulative charge amount corresponding to the charge amount signal of the vehicle's battery management system at the end of this charge is determined as the charge amount for this charge.
2. The method according to claim 1, characterized in that, Changes in the charging status of the vehicle are detected by the following methods: Obtain the charging connection signal of the vehicle; A second validity check is performed on the charging connection signal to determine whether the level of the charging connection signal remains stable for a predetermined duration. When it is determined that the charging connection signal level remains stable for a predetermined duration, it is determined that the charging state of the vehicle has changed.
3. The method according to claim 1, characterized in that, Also includes: If the first validity check passes, the final charge level of this charging process is obtained at the end of the charging process. The charging power is measured based on the initial power value and the final power value.
4. The method according to claim 3, characterized in that, The amount of electricity charged this time will be measured in the following ways: Obtain the final charge level of this charging session, and perform a third validity check on the final charge level. When the ending power value passes the third validity check, the difference between the ending power value and the starting power value is calculated to obtain the charging power for this charge.
5. The method according to claim 4, characterized in that, The termination battery value is determined to pass the third validity check in the following manner: Determine whether the ending power value is a second predefined invalid value, exceeds a reasonable power range, or is not higher than the starting power value; If the ending power value is not the second predefined invalid value, does not exceed the reasonable power range, and is higher than the starting power value, then the ending power value is determined to have passed the third validity check.
6. The method according to claim 4, characterized in that, Also includes: If the ending charge value fails the third validity check, the cumulative charge amount corresponding to the charge amount signal of the battery management system at the end of this charge is determined as the charge amount for this charge.
7. The method according to claim 1, characterized in that, The method further includes: After the charging power is measured, the charging power is reported to the user terminal for display.
8. The method according to claim 1, characterized in that, The following method is used to determine whether the initial battery value is invalid: If the initial power value is a first predefined invalid value or exceeds a reasonable power range, the initial power value is determined to be an invalid value.
9. A vehicle, characterized in that, The vehicles include: The controller is configured to: when a change in the charging state of the vehicle is detected, acquire a starting charge value for measuring the charge amount for this charge; perform a first validity check on the starting charge value to determine whether the starting charge value is a first predefined invalid value or exceeds a reasonable charge range; if the first validity check fails, determine the cumulative charge amount corresponding to the charge amount signal of the vehicle's battery management system at the end of this charge as the charge amount for this charge.
10. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1 to 8.