Voltage sampling method and device, computer equipment and readable storage medium

The voltage sampling method and device address the challenge of inconsistent battery performance by detecting and managing circuit faults to ensure accurate data collection, thereby improving battery performance assessment.

CN119087249APending Publication Date: 2024-12-06CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411090967.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Existing power batteries in vehicles lack a method to efficiently collect performance parameters such as voltage, capacity, and other information due to varying performance characteristics, leading to inconsistent vehicle performance.

Method used

A voltage sampling method and device that determines the state of the analog front-end circuit before sampling, initializing tasks, managing error counters, and reporting faults to ensure valid data collection.

Benefits of technology

Ensures accurate and reliable collection of battery performance parameters by detecting and addressing circuit faults, enhancing the understanding of battery performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119087249A_ABST
    Figure CN119087249A_ABST
Patent Text Reader

Abstract

The invention provides a voltage sampling method and device, computer equipment and a readable storage medium, and the method comprises the steps: judging whether an analog front-end circuit executing a current voltage sampling task is in a fault diagnosis state or not before battery voltage sampling; and if the analog front-end circuit is not in the fault diagnosis state, executing the current voltage sampling task through the analog front-end circuit. By adopting the method, the performance parameters of the battery are obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of circuit control, and in particular to a voltage sampling method, device, computer equipment and readable storage medium. Background Art

[0002] With the development of new energy technology, the development of power batteries is also becoming more and more rapid. Existing power batteries are mainly used in hybrid vehicles and pure electric vehicles. Due to their low-carbon and environmentally friendly advantages, they have been favored by major automobile manufacturers. Therefore, power batteries composed of lithium battery packs or iron-lithium battery packs are now being studied in depth, and are increasingly being used in automobiles to meet social needs. In the prior art, manufacturers usually directly install the purchased batteries on vehicles and put them on the market or use them. However, it was found in the study that due to the different performance parameters of different batteries, the performance of vehicles with different batteries installed will also be different. If the purchased batteries are directly installed on the vehicle and put into use, it will lead to the inability to obtain the performance parameters of the battery, such as voltage, capacity and other information, and thus it will be impossible to have a deeper understanding of the performance of the vehicle. Therefore, how to collect the performance parameters of the battery has become an urgent problem to be solved. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a voltage sampling method, device, computer equipment and readable storage medium to obtain performance parameters of a battery.

[0004] In a first aspect, an embodiment of the present application provides a voltage sampling method, the method comprising:

[0005] Before sampling the battery voltage, determine whether the analog front-end circuit that performs the voltage sampling task is in a fault diagnosis state;

[0006] If the analog front-end circuit is not in a fault diagnosis state, the voltage sampling task is performed by the analog front-end circuit.

[0007] Optionally, before performing voltage sampling, the method further includes:

[0008] Initialize the current voltage sampling task and clear the reading of the error counter, wherein the reading of the error counter is the number of times the analog front-end circuit that performs the voltage sampling task is in a fault diagnosis state before performing each voltage sampling task;

[0009] If the analog front-end circuit is in a fault diagnosis state, determining whether the initialization of the voltage sampling task is the first initialization;

[0010] If the initialization of this voltage sampling task is not the first initialization, a diagnosis timeout fault is reported to a third-party system.

[0011] Optionally, the method further comprises:

[0012] If the analog front-end circuit is in a fault diagnosis state, updating the reading of the error counter;

[0013] Determining whether the updated reading of the error counter exceeds a preset value;

[0014] If the updated reading of the error counter does not exceed the preset value, the fault diagnosis state is exited through the analog front-end circuit.

[0015] Optionally, the method further comprises:

[0016] If the updated reading of the error counter exceeds the preset value, the next voltage sampling task is initialized and the reading of the error counter is cleared.

[0017] Optionally, after completing the voltage sampling task, the method further includes:

[0018] The sampling result obtained by executing this voltage sampling task is set to be valid, and the sampling result is reported to a third-party system.

[0019] Optionally, after completing the voltage sampling task, the method further includes:

[0020] Reset the reading of the error counter to zero and reset the diagnostic timeout fault to zero;

[0021] Sampling fault diagnosis is performed by the analog front end circuit.

[0022] Optionally, when initializing the current voltage sampling task, the method further includes:

[0023] Reporting invalid sampling values ​​to the third-party system.

[0024] In a second aspect, an embodiment of the present application provides a voltage sampling device, the device comprising:

[0025] The first judgment module is used to judge whether the analog front-end circuit performing the voltage sampling task is in a fault diagnosis state before sampling the battery voltage;

[0026] The voltage sampling module is used to execute the voltage sampling task through the analog front-end circuit if the analog front-end circuit is not in a fault diagnosis state.

[0027] Optionally, the device further comprises a first diagnostic module, wherein the first diagnostic module is configured to:

[0028] Before performing voltage sampling, the current voltage sampling task is initialized and the reading of the error counter is cleared to zero, wherein the reading of the error counter is the number of times the analog front-end circuit performing the voltage sampling task is in a fault diagnosis state before performing each voltage sampling task;

[0029] If the analog front-end circuit is in a fault diagnosis state, determining whether the initialization of the voltage sampling task is the first initialization;

[0030] If the initialization of this voltage sampling task is not the first initialization, a diagnosis timeout fault is reported to a third-party system.

[0031] Optionally, the first diagnostic module is further used for:

[0032] If the analog front-end circuit is in a fault diagnosis state, updating the reading of the error counter;

[0033] Determining whether the updated reading of the error counter exceeds a preset value;

[0034] If the updated reading of the error counter does not exceed the preset value, the fault diagnosis state is exited through the analog front-end circuit.

[0035] Optionally, the first diagnostic module is further used for:

[0036] If the updated reading of the error counter exceeds the preset value, the next voltage sampling task is initialized and the reading of the error counter is cleared.

[0037] Optionally, the device further comprises a second diagnostic module, wherein the second diagnostic module is configured to:

[0038] After completing this voltage sampling task, the sampling result obtained by executing this voltage sampling task is set as valid, and the sampling result is reported to the third-party system.

[0039] Optionally, the second diagnostic module is further used for:

[0040] Reset the reading of the error counter to zero and reset the diagnostic timeout fault to zero;

[0041] Sampling fault diagnosis is performed by the analog front end circuit.

[0042] Optionally, the device further includes a third diagnostic module, and the third diagnostic module is used to:

[0043] When initializing this voltage sampling task, the reported sampling value is invalid to the third-party system.

[0044] In a third aspect, an embodiment of the present application provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps of the voltage sampling method described in any one of the optional implementations of the first aspect are performed.

[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the voltage sampling method described in any optional implementation manner in the first aspect are executed.

[0046] The technical solution provided by this application includes but is not limited to the following beneficial effects:

[0047] Before the battery voltage sampling is performed, the present application determines whether the analog front-end circuit that performs the voltage sampling task is in a fault diagnosis state, and can detect the state of the analog front-end circuit that collects the voltage before the voltage sampling is performed to ensure the validity of the voltage sampling result. If the analog front-end circuit is not in a fault diagnosis state, the voltage sampling task is performed through the analog front-end circuit, and the battery voltage sampling task can be performed when the analog front-end circuit is in a state capable of performing voltage sampling, thereby realizing the sampling of the battery voltage and effectively completing the collection of the battery performance parameters.

[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0050] Figure 1 A flow chart of a voltage sampling method provided by the first embodiment of the present invention is shown;

[0051] Figure 2 A flow chart of a method for reporting a diagnostic timeout fault provided by Embodiment 1 of the present invention is shown;

[0052] Figure 3 A flowchart of a method for exiting a fault diagnosis state mode provided in the first embodiment of the present invention is shown;

[0053] Figure 4 A flow chart of a sampling fault diagnosis method provided by the first embodiment of the present invention is shown;

[0054] Figure 5 A schematic diagram of the structure of a battery sampling system provided by Embodiment 1 of the present invention is shown, wherein;

[0055] Figure 6 A flowchart of a specific voltage sampling method provided by the first embodiment of the present invention is shown;

[0056] Figure 7 A schematic diagram of the structure of a voltage sampling device provided in the second embodiment of the present invention is shown;

[0057] Figure 8 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention is shown. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0059] Embodiment 1

[0060] To facilitate understanding of this application, Figure 1 The contents described in the flowchart of a voltage sampling method provided in the first embodiment of the present invention are described in detail in the first embodiment of the present application.

[0061] See also Figure 1 As shown, Figure 1 A flow chart of a voltage sampling method provided in the first embodiment of the present invention is shown, wherein the method comprises steps S101 to S102:

[0062] S101: Before sampling the battery voltage, determine whether the analog front-end circuit that performs the voltage sampling task is in a fault diagnosis state.

[0063] Specifically, the fault diagnosis state refers to the state flag of the battery information sampling circuit during fault diagnosis. When entering the fault diagnosis state, the sampling information is fault diagnosis information, not actual battery data information; the fault diagnosis state is determined by the internal register and diagnostic switch information of the AFE analog front-end circuit. Before executing the voltage sampling task and performing voltage sampling, determine whether the analog front-end circuit is in the fault diagnosis state.

[0064] S102: If the analog front-end circuit is not in a fault diagnosis state, the voltage sampling task is performed by the analog front-end circuit.

[0065] Specifically, if the analog front-end circuit is not in a fault diagnosis state, it means that there is no circuit fault at present, and the voltage sampling task is performed by the analog front-end circuit. The voltage sampling task includes turning on sampling enable, voltage AD analog-to-digital conversion, reading voltage data registers and other tasks.

[0066] After the voltage sampling task is successfully completed, the effective sampling value after AD analog-to-digital conversion is passed to other software modules through the interface.

[0067] In an alternative embodiment, see Figure 2 As shown, Figure 2 A flowchart of a method for reporting a diagnosis timeout fault provided by the first embodiment of the present invention is shown, wherein before voltage sampling is performed, the method further includes steps S201 to S203;

[0068] S201: Initialize the current voltage sampling task and clear the reading of the error counter, wherein the reading of the error counter is the number of times the analog front-end circuit that performs the voltage sampling task is in a fault diagnosis state before performing each voltage sampling task.

[0069] Specifically, the voltage sampling task is initialized, including parameter initialization, configuration initialization and state machine initialization. Parameter initialization includes the initial value assignment of software interface, internal variables and internal parameters. Configuration initialization includes the configuration writing of internal parameters and internal information of chip registers. State machine initialization includes the execution of internal task flow from fixed tasks.

[0070] Each time after the voltage sampling task of the analog front-end circuit is initialized, the error counter needs to restart counting, that is, the reading is cleared.

[0071] S202: If the analog front-end circuit is in a fault diagnosis state, determine whether the initialization of the voltage sampling task is the first initialization.

[0072] Specifically, if the analog front-end circuit is not in a fault diagnosis state, the voltage sampling step in step S102 is executed.

[0073] S203: If the initialization of the current voltage sampling task is not the first initialization, reporting a diagnosis timeout fault to a third-party system.

[0074] Specifically, if the initialization of this voltage sampling task is the first initialization, the analog front-end circuit is restarted to reinitialize this voltage sampling task.

[0075] In an alternative embodiment, see Figure 3 As shown, Figure 3 A flowchart of a method for exiting a fault diagnosis state provided in the first embodiment of the present invention is shown, wherein the method further includes steps S301 to S303:

[0076] S301: If the analog front-end circuit is in a fault diagnosis state, updating the reading of the error counter.

[0077] S302: Determine whether the updated reading of the error counter exceeds a preset value.

[0078] S303: If the updated reading of the error counter does not exceed the preset value, exiting the fault diagnosis state through the analog front-end circuit.

[0079] Specifically, if the analog front-end circuit is in a fault diagnosis state, the error counter reading is increased by 1. If the error counter reading is less than 3, the sampling diagnosis is exited. If the error counter reading exceeds 3, the initialization task in step S201 is executed.

[0080] In an optional embodiment, the method further comprises:

[0081] If the updated reading of the error counter exceeds the preset value, the next voltage sampling task is initialized and the reading of the error counter is cleared.

[0082] Specifically, after the voltage sampling task is completed, the reading of the error counter is cleared to 0, the diagnostic timeout fault is cleared to 0, and the validity of the sampling result is set to valid. The diagnostic timeout fault refers to the continuous attempt to perform the sampling fault diagnosis for 3 times but still exit the diagnostic mode, and then re-execute the initialization task in step S201 and still not exit the diagnostic mode. The validity of the sampling result refers to the flag of whether the sampling result is credible. Valid means that the sampling result is credible, and invalid means that the sampling result is unreliable.

[0083] In an optional implementation scheme, after completing the voltage sampling task, the method further includes:

[0084] The sampling result obtained by executing this voltage sampling task is set to be valid, and the sampling result is reported to a third-party system.

[0085] Specifically, the third-party system is other software modules.

[0086] In an alternative embodiment, see Figure 4 As shown, Figure 4 A flow chart of a sampling fault diagnosis method provided by the first embodiment of the present invention is shown, wherein after completing the voltage sampling task, the method further includes steps S401 to S402:

[0087] S401: Clear the reading of the error counter and the diagnosis timeout fault.

[0088] S402: Perform sampling fault diagnosis through the analog front-end circuit.

[0089] Specifically, after the voltage sampling task is completed, the reading of the error counter is cleared to 0, the diagnostic timeout fault is cleared to 0, and the validity of the sampling result is set to valid; the diagnostic timeout fault means that the fault diagnosis state is still exited after three consecutive attempts to perform the sampling fault diagnosis, and the initialization task in step S201 is re-executed and still does not exit the fault diagnosis state. The validity of the sampling result refers to the flag of whether the sampling result is credible. Valid means that the sampling result is credible, and invalid means that the sampling result is unreliable.

[0090] Sampling fault diagnosis includes configuring fault diagnosis status related registers, enabling sampling circuit switches, reading sampling data, performing fault diagnosis and other tasks.

[0091] Completing the sampling fault exit sampling diagnosis includes configuring the fault diagnosis status related registers, enabling the sampling circuit switch and other tasks.

[0092] After exiting sampling diagnosis, other tasks are executed, including: communication node diagnosis, AFE other information reading and other tasks that have no effect on the sampling results.

[0093] In an optional implementation, when initializing the voltage sampling task, the method further includes:

[0094] Reporting invalid sampling values ​​to the third-party system.

[0095] Specifically, when executing step S201 to initialize the voltage sampling task, the sampling data is reported as invalid to other modules to prevent unreliable sampling results from being used incorrectly.

[0096] A voltage sampling method provided in this application can be applied to a battery sampling system, see Figure 5 As shown, Figure 5The schematic diagram of the structure of a battery sampling system provided by the first embodiment of the present invention is shown, wherein the battery sampling system includes a battery cell, a slave control unit, a master control unit, an execution unit, a data processing unit (slave control), a communication unit (slave control), a data processing unit (master control), and a communication unit (master control). The battery cells are electrically connected to form a battery pack; the positive and negative electrodes of each cell are electrically connected to the sampling unit of the slave control unit. The slave control unit is a unit responsible for directly sampling and controlling the cell, and its interior is composed of a sampling unit, a data processing unit, and a communication unit. The master control unit is the core unit of the battery management system, responsible for battery fault diagnosis, battery key parameter calculation, large-scale data processing, information interaction with multiple peripherals, etc., and its interior is composed of a data processing unit and a communication unit. The execution unit is a unit in the slave control unit responsible for directly sampling data and switching control of the battery cell, including: sensors, transformers, sampling switches, diagnostic switches, etc.; and is connected to the battery cell and the data processing unit (slave control) through electrical signals. The data processing unit (slave control) is a unit in the slave control unit that is responsible for AD conversion, information processing, register configuration of the execution unit sampling signal, and enabling the switch control of the execution unit, including: data storage unit, data calculation unit, etc.; connected to the execution unit and the communication unit (slave control) through electrical signals. The communication unit (slave control) is a unit in the slave control unit that is responsible for information exchange with the main control unit, including: data cache unit, data encapsulation unit, data parsing unit, data verification unit, signal transceiver unit, etc.; connected to the data processing unit (slave control) and the communication unit (master control) through electrical signals. The data processing unit (master control) is the core unit of the master control unit, responsible for battery fault diagnosis, battery key parameter calculation, large amount of data processing, etc., and is also the medium supporting this application, including: storage unit, data calculation unit, etc.; connected to the communication unit (master control) through electrical signals. The communication unit (master control) is the unit in the slave control unit responsible for information exchange with the master control unit, including: data cache unit, data encapsulation unit, data parsing unit, data verification unit, signal transceiver unit, etc.; it is connected to the data processing unit (master control) and the communication unit (slave control) through electrical signals.

[0097] Here is an explanation of the process of voltage sampling using the above battery sampling system. Figure 6 As shown, Figure 6A flowchart of a specific voltage sampling method provided by the first embodiment of the present invention is shown, wherein, for this voltage sampling task, the task is initialized, the error counter is cleared to 0, and then the diagnostic status is read to determine whether the diagnostic status has been exited. If exited, voltage sampling is performed, and after the voltage sampling is completed, the error counter is cleared to 0, the diagnostic timeout fault is cleared to 0, the sampling result is set to valid, and the sampling value is updated to other software modules, and sampling fault diagnosis is performed at the same time. After the sampling fault diagnosis is completed, the sampling diagnosis is exited and other tasks are executed. If not exited, it is determined whether the initialization of this voltage sampling task is the first initialization; if not, the diagnostic supermarket fault is reported to other software modules. On the contrary, if not exited, the error counter is updated to determine whether the error counter is greater than 3; if so, the task is reinitialized, otherwise, the sampling diagnosis is exited.

[0098] Embodiment 2

[0099] Embodiment 2 of the present invention provides a voltage sampling device, see Figure 7 As shown, Figure 7 A schematic diagram of the structure of a voltage sampling device provided in Embodiment 2 of the present invention is shown, wherein the device comprises:

[0100] The first judgment module 701 is used to judge whether the analog front-end circuit performing the voltage sampling task is in a fault diagnosis state before sampling the battery voltage;

[0101] The voltage sampling module 702 is used to perform the voltage sampling task through the analog front-end circuit if the analog front-end circuit is not in a fault diagnosis state.

[0102] In an optional embodiment, the device further comprises a first diagnostic module, wherein the first diagnostic module is configured to:

[0103] Before performing voltage sampling, the current voltage sampling task is initialized and the reading of the error counter is cleared to zero, wherein the reading of the error counter is the number of times the analog front-end circuit performing the voltage sampling task is in a fault diagnosis state before performing each voltage sampling task;

[0104] If the analog front-end circuit is in a fault diagnosis state, determining whether the initialization of the voltage sampling task is the first initialization;

[0105] If the initialization of this voltage sampling task is not the first initialization, a diagnosis timeout fault is reported to a third-party system.

[0106] In an optional embodiment, the first diagnostic module is further used for:

[0107] If the analog front-end circuit is in a fault diagnosis state, updating the reading of the error counter;

[0108] Determining whether the updated reading of the error counter exceeds a preset value;

[0109] If the updated reading of the error counter does not exceed the preset value, the fault diagnosis state is exited through the analog front-end circuit.

[0110] In an optional embodiment, the first diagnostic module is further used for:

[0111] If the updated reading of the error counter exceeds the preset value, the next voltage sampling task is initialized and the reading of the error counter is cleared.

[0112] In an optional embodiment, the device further comprises a second diagnostic module, wherein the second diagnostic module is configured to:

[0113] After completing this voltage sampling task, the sampling result obtained by executing this voltage sampling task is set as valid, and the sampling result is reported to the third-party system.

[0114] In an optional embodiment, the second diagnostic module is further used for:

[0115] Reset the reading of the error counter to zero and reset the diagnostic timeout fault to zero;

[0116] Sampling fault diagnosis is performed by the analog front end circuit.

[0117] In an optional embodiment, the device further comprises a third diagnostic module, wherein the third diagnostic module is used for:

[0118] When initializing this voltage sampling task, the reported sampling value is invalid to the third-party system.

[0119] Embodiment 3

[0120] Based on the same application concept, see Figure 8 As shown, Figure 8 FIG. 4 shows a schematic diagram of the structure of a computer device provided by Embodiment 3 of the present invention, wherein: Figure 8 As shown, a computer device 800 provided in Embodiment 3 of the present application includes:

[0121] A processor 801, a memory 802 and a bus 803, wherein the memory 802 stores machine-readable instructions executable by the processor 801. When the computer device 800 is running, the processor 801 communicates with the memory 802 via the bus 803. When the processor 801 is running, the machine-readable instructions execute the steps of the voltage sampling method shown in the first embodiment.

[0122] Embodiment 4

[0123] Based on the same application concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the voltage sampling method described in any one of the above embodiments are executed.

[0124] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0125] The computer program product for voltage sampling provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.

[0126] The voltage sampling device provided in the embodiment of the present invention can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0127] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0129] In addition, each functional unit in the embodiment provided by the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0130] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0131] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0132] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A voltage sampling method, characterized in that: The method comprises: Before sampling the battery voltage, determine whether the analog front-end circuit that performs the voltage sampling task is in a fault diagnosis state; If the analog front-end circuit is not in a fault diagnosis state, the voltage sampling task is performed by the analog front-end circuit.

2. The method according to claim 1, characterized in that Before performing voltage sampling, the method further includes: Initialize the current voltage sampling task and clear the reading of the error counter, wherein the reading of the error counter is the number of times the analog front-end circuit that performs the voltage sampling task is in a fault diagnosis state before performing each voltage sampling task; If the analog front-end circuit is in a fault diagnosis state, determining whether the initialization of the voltage sampling task is the first initialization; If the initialization of this voltage sampling task is not the first initialization, a diagnosis timeout fault is reported to a third-party system.

3. The method according to claim 2, characterized in that The method further comprises: If the analog front-end circuit is in a fault diagnosis state, updating the reading of the error counter; Determining whether the updated reading of the error counter exceeds a preset value; If the updated reading of the error counter does not exceed the preset value, the fault diagnosis state is exited through the analog front-end circuit.

4. The method according to claim 3, characterized in that The method further comprises: If the updated reading of the error counter exceeds the preset value, the next voltage sampling task is initialized and the reading of the error counter is cleared.

5. The method according to claim 1, characterized in that After completing the voltage sampling task, the method further includes: The sampling result obtained by executing this voltage sampling task is set to be valid, and the sampling result is reported to a third-party system.

6. The method according to claim 2, characterized in that After completing the voltage sampling task, the method further includes: Reset the reading of the error counter to zero and reset the diagnostic timeout fault to zero; Sampling fault diagnosis is performed by the analog front end circuit.

7. The method according to claim 2, characterized in that When initializing the voltage sampling task, the method further includes: Reporting invalid sampling values ​​to the third-party system.

8. A voltage sampling device, characterized in that: The device comprises: The first judgment module is used to judge whether the analog front-end circuit performing the voltage sampling task is in a fault diagnosis state before sampling the battery voltage; The voltage sampling module is used to execute the voltage sampling task through the analog front-end circuit if the analog front-end circuit is not in a fault diagnosis state.

9. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the voltage sampling method as described in any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the voltage sampling method according to any one of claims 1 to 7 are executed.