Sampling time precision monitoring method and system for battery test system
By using a data accumulator and bidirectional time delay verification in the battery testing system, the problem of test data distortion caused by RTC chip frequency drift was solved. This enabled rapid location of the root cause of the fault and execution of safety policies, improving the validity of test data and system operation and maintenance efficiency, and reducing safety risks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN NEBULA ELECTRONICS CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-01
AI Technical Summary
In existing battery testing systems, the time accuracy of the sampling frequency depends on the RTC chips of the intermediate and lower-level machines. This frequency is prone to drift due to aging or environmental changes, resulting in distorted test data and difficulty in quickly locating the root cause of the problem, posing safety hazards and low efficiency.
By setting a data entry accumulator in the mid-level computer, combined with data entry verification and bidirectional delay verification, first and second deviation values are generated for comprehensive diagnosis, identifying problems such as clock source abnormalities, data sampling unit or network congestion, and implementing targeted security strategies.
It enables rapid and accurate location of the root cause of time accuracy distortion, avoids the accumulation of invalid data and security risks, improves the validity of test data and system operation and maintenance efficiency, and reduces security risks.
Smart Images

Figure CN121955728A_ABST
Abstract
Description
A method and system for monitoring sampling time accuracy in battery testing systems Technical Field
[0001] This invention relates to the field of battery testing technology, and in particular to a method and system for monitoring the sampling time accuracy of a battery testing system. Background Technology
[0002] In the research, development, production, and quality inspection of lithium batteries, battery testing systems are crucial equipment. To accurately assess battery performance, lifespan, and safety, testing systems need to collect key parameters such as voltage, current, and temperature over extended periods with high precision. Currently, the industry generally adopts a distributed, multi-tiered system architecture, typically including a host computer (for monitoring and data analysis), a mid-level computer (for data aggregation and control), and a slave computer (directly connected to the battery and performing sampling). The slave computer usually uses its built-in real-time clock (RTC) chip to periodically collect data at a preset sampling frequency (e.g., every 10 milliseconds) and temporarily store it in a buffer; the mid-level computer periodically retrieves this buffered data from the slave computer via a communication network (e.g., Ethernet).
[0003] In this system, the accuracy of the sampling frequency is crucial to ensuring the validity of the test data. Deviations in the sampling frequency will directly lead to distortion of the recorded battery charge-discharge curves, failing to accurately reflect battery performance. It may even cause safety hazards such as overcharging and over-discharging due to the inability to detect overvoltage or undervoltage states in a timely manner. Currently, the system's time accuracy relies entirely on the long-term stability of the RTC chips in both the mid-level and lower-level computers. However, in practical applications, the RTC chip may experience frequency drift (i.e., "running fast" or "running slow") due to factors such as crystal oscillator aging, changes in ambient temperature, or its own malfunction.
[0004] The main drawback of existing technology is that when test data anomalies occur, the system lacks an effective mechanism to quickly determine whether the time accuracy distortion originates from the intermediate or lower-level RTC chip. Since the intermediate and lower-level machines are physically independent devices with asynchronous internal clocks, maintenance personnel cannot directly compare the data sequence collected by the intermediate machine with the actual timeline. Currently, problem detection often relies on later data analysis or when obvious battery anomalies occur. By this time, a large amount of invalid test data may have accumulated, or battery damage may have occurred, leading to low testing efficiency and safety risks.
[0005] Therefore, how to provide a sampling time accuracy monitoring method and system for battery testing systems, so as to improve the effectiveness of test data and system operation and maintenance efficiency, and reduce safety risks, has become an urgent technical problem to be solved. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a method and system for monitoring the sampling time accuracy of a battery testing system, thereby improving the effectiveness of test data and the efficiency of system operation and maintenance, and reducing safety risks.
[0007] In a first aspect, the present invention provides a method for monitoring the sampling time accuracy of a battery testing system, comprising the following steps: Step S1, the intermediate computer of the battery testing system sets a data count accumulator, initializes the data count accumulator by clearing it to zero, sets a sampling frequency, and sends it to the lower computer; Step S2, the lower computer collects battery data based on the sampling frequency and caches the battery data; Step S3, the intermediate computer periodically sends a collection command to the lower computer based on a preset collection period to obtain the battery data cached by the lower computer, and adds the count of the battery data to the data count accumulator; Step S4, the intermediate computer... At each preset time interval, the theoretical number of sampled data points is calculated based on the sampling frequency and time interval. The theoretical number of sampled data points is compared with the count value of the data point accumulator to perform data point verification and generate a first deviation value. Step S5: The intermediate computer and the lower computer exchange time synchronization messages. Based on the sending timestamp and receiving timestamp of the time synchronization message, the clock deviation between the intermediate computer and the lower computer is calculated to perform bidirectional delay verification and generate a second deviation value. Step S6: Based on the first deviation value and the second deviation value, the intermediate computer performs a comprehensive diagnosis of the sampling time accuracy to obtain a diagnosis result and executes a security policy based on the diagnosis result.
[0008] Furthermore, in step S2, the battery data includes at least one of charging voltage, charging current, charging temperature, and SOC.
[0009] Furthermore, in step S5, the bidirectional delay verification is based on the PTP protocol or the NTP protocol.
[0010] Further, step S6 specifically involves: the intermediate unit setting a first threshold and a second threshold, comparing the first deviation value with the first threshold, the second deviation value with the second threshold; when the first deviation value exceeds the first threshold and the second deviation value exceeds the second threshold, a diagnostic result of clock source abnormality in the lower unit is generated; when the first deviation value exceeds the first threshold but the second deviation value does not exceed the second threshold, a diagnostic result of data sampling unit or data transmission network congestion in the lower unit is generated; when the first deviation value does not exceed the first threshold but the second deviation value exceeds the second threshold, a diagnostic result of network path abnormality or instantaneous error in time synchronization message is generated; the intermediate unit generates warning information based on the diagnostic results and executes a security policy; the security policy specifically involves: stopping battery testing of the abnormal lower unit, switching to a backup lower unit, or marking the sampled data within the corresponding time period as unreliable data.
[0011] Furthermore, the first threshold and the second threshold are dynamic thresholds calculated based on historical normal battery data.
[0012] Secondly, the present invention provides a sampling time accuracy monitoring system for a battery testing system, comprising the following modules: an initialization module, used by the host computer of the battery testing system to set a data entry accumulator, clear the data entry accumulator to initialize it, set a sampling frequency and send it to the slave computer; a battery data sampling module, used by the slave computer to collect battery data based on the sampling frequency and cache the battery data; a data entry accumulator module, used by the host computer to periodically send a collection command to the slave computer based on a preset collection period to obtain the battery data cached by the slave computer, and to add the number of battery data entries to the data entry accumulator; and a first deviation value calculation module. The intermediate unit is used to calculate the theoretical number of sampled data points at preset time intervals based on the sampling frequency and time interval, compare the theoretical number of sampled data points with the count value of the data point accumulator to perform data point count verification, and generate a first deviation value; the second deviation value calculation module is used for exchanging time synchronization messages between the intermediate unit and the lower unit, and calculates the clock deviation between the intermediate unit and the lower unit based on the sending timestamp and receiving timestamp of the time synchronization message to perform bidirectional delay verification and generate a second deviation value; the comprehensive diagnosis module is used for the intermediate unit to perform a comprehensive diagnosis of the sampling time accuracy based on the first deviation value and the second deviation value, obtain a diagnosis result, and execute a security policy based on the diagnosis result.
[0013] Furthermore, in the battery data sampling module, the battery data includes at least one of charging voltage, charging current, charging temperature, and SOC.
[0014] Furthermore, in the second deviation value calculation module, the bidirectional delay verification is based on the PTP protocol or the NTP protocol.
[0015] Furthermore, the comprehensive diagnostic module is specifically used for: the intermediate unit setting a first threshold and a second threshold, comparing the first deviation value with the first threshold, the second deviation value with the second threshold; when the first deviation value exceeds the first threshold and the second deviation value exceeds the second threshold, a diagnostic result of clock source abnormality of the lower unit is generated; when the first deviation value exceeds the first threshold but the second deviation value does not exceed the second threshold, a diagnostic result of data sampling unit or data transmission network congestion of the lower unit is generated; when the first deviation value does not exceed the first threshold but the second deviation value exceeds the second threshold, a diagnostic result of network path abnormality or instantaneous error of time synchronization message is generated; the intermediate unit generates early warning information based on the diagnostic results and executes a security policy; the security policy specifically includes: stopping battery testing of abnormal lower units, switching to a backup lower unit, or marking the sampled data within the corresponding time period as unreliable data.
[0016] Furthermore, the first threshold and the second threshold are dynamic thresholds calculated based on historical normal battery data.
[0017] The advantages of this invention are as follows: 1. A data accumulator is set in the mid-level computer of the battery testing system. The data accumulator is cleared to initialize it. A sampling frequency is set and sent to the lower-level computer. Then, the lower-level computer collects battery data based on the sampling frequency and caches it. The mid-level computer periodically sends a collection command to the lower-level computer to obtain the battery data cached by the lower-level computer and adds the number of battery data entries to the data accumulator. Then, at a preset time interval, the mid-level computer calculates the theoretical number of sampled data entries based on the sampling frequency and the time interval. It compares the theoretical number of sampled data entries with the count value of the data accumulator to perform data entry verification and generate a first deviation value. The mid-level computer and the lower-level computer exchange time synchronization messages. Based on the sending timestamp and receiving timestamp of the time synchronization message, the clock deviation between the mid-level computer and the lower-level computer is calculated to perform bidirectional time delay verification and generate a second deviation value. The difference and the second deviation value are used to comprehensively diagnose the sampling time accuracy, and a diagnostic result is obtained. Based on the diagnostic result, a safety policy is executed. By performing data count verification and bidirectional delay verification in parallel during the lower-level machine data sampling process, and based on the collaborative analysis and logical judgment of the two independent deviation values, the root cause of the time accuracy distortion can be quickly and accurately located, whether it is due to lower-level machine clock abnormality, its data sampling unit / network congestion, or synchronization message path problem. This transforms the originally ambiguous system fault into a clear diagnostic result. As a result, the system can automatically execute targeted safety policies such as stopping the test, switching devices, or marking invalid data based on the diagnostic result. This realizes the transformation from passive and delayed discovery to active real-time intervention, effectively avoiding the accumulation of invalid data and the expansion of battery safety risks. Ultimately, it greatly improves the effectiveness of test data and system operation and maintenance efficiency, and greatly reduces safety risks.
[0018] 2. By combining a dual mechanism of data count verification and bidirectional time delay verification, the accuracy of sampling time precision monitoring is significantly improved. The mid-level computer calculates the theoretical number of sampled data points based on the sampling frequency and time interval, and compares it with the actual count value to generate the first deviation value, which can effectively detect anomalies in the continuity of data acquisition. The second deviation value is generated by calculating the clock deviation through time synchronization messages, which can identify hardware clock drift. This dual verification reduces the limitations of a single monitoring method, reduces the risk of false alarms and missed alarms, and ensures that the time accuracy assessment of battery test data is more reliable, thereby improving the data quality of the entire test system.
[0019] 3. By adopting periodic data acquisition and deviation calculation, it can monitor changes in sampling time accuracy in real time. It performs verification at preset time intervals and, combined with comprehensive diagnosis, can quickly identify anomalies (such as clock source failure or network congestion) and immediately execute safety policies (such as stopping the test or switching devices). This real-time capability avoids test interruptions or data distortion caused by the accumulation of anomalies, improves the efficiency and response speed of the battery testing process, and is suitable for high-frequency sampling application scenarios.
[0020] 4. Based on the combined analysis of the first and second deviation values, the root cause of the problem can be accurately located, such as distinguishing between abnormal lower-level clock source, data sampling unit failure, or network path problem; by setting thresholds and comparing them, the diagnostic results are more targeted, avoiding generalized error handling; this comprehensive diagnostic capability not only improves the efficiency of fault diagnosis, but also reduces unnecessary system downtime, which is conducive to maintaining the continuity and stability of battery testing.
[0021] 5. By implementing safety strategies (such as stopping testing, switching to a backup lower-level machine, or marking data as unreliable), it can proactively prevent data contamination or equipment damage caused by sampling time accuracy issues. This is crucial for battery testing systems, as time accuracy deviations may lead to safety hazards (such as overcharging or over-discharging). The early warning mechanism ensures timely intervention in abnormal situations, protecting testing equipment and battery samples, and enhancing the robustness and safety of the overall system.
[0022] 6. Supports dynamic threshold setting, calculating thresholds based on historical normal data, enabling the monitoring process to adapt to different test conditions and environmental changes, improving the flexibility and stability of the method; in addition, using standardized protocols (such as PTP or NTP) for time synchronization ensures compatibility with existing systems, facilitates deployment on various battery testing platforms, and reduces implementation costs.
[0023] 7. By periodically accumulating data entries and using a caching mechanism, the frequent communication burden between the lower-level and middle-level machines is reduced, optimizing network resource utilization. At the same time, accurate monitoring avoids repeated testing or equipment maintenance due to accuracy issues, which reduces maintenance costs and improves the economics of battery testing in the long run.
[0024] 8. By integrating a dual monitoring mechanism of data count verification and bidirectional latency verification, the accuracy and reliability of sampling time precision are significantly improved, enabling real-time monitoring and rapid anomaly response. It can accurately locate the root cause of the fault (such as clock source abnormality or network congestion) and execute targeted safety policies (such as stopping the test or marking the data), thereby enhancing system security and data integrity. At the same time, its adaptive threshold design and standardized protocol support ensure the method's strong adaptability, easy integration, and resource optimization, ultimately improving the overall efficiency and cost-effectiveness of the battery testing system. Attached Figure Description
[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0026] Figure 1 is a flowchart of a sampling time accuracy monitoring method for a battery testing system according to the present invention.
[0027] Figure 2 is a schematic diagram of the sampling time accuracy monitoring system for a battery testing system according to the present invention. Detailed Implementation
[0028] The overall approach of the technical solution in this application is as follows: By performing parallel data count verification and bidirectional delay verification during the lower-level machine data sampling process, and based on the collaborative analysis and logical judgment of two independent deviation values, the root cause of time accuracy distortion can be quickly and accurately located as to whether it stems from lower-level machine clock anomaly, data sampling unit / network congestion, or synchronization message path problems. This transforms the originally ambiguous system fault into a clear diagnostic result. Consequently, the system can automatically execute targeted safety strategies such as stopping the test, switching devices, or marking invalid data based on the diagnostic results. This achieves a shift from passive, delayed discovery to proactive, real-time intervention, effectively avoiding the accumulation of invalid data and the expansion of battery safety risks. This improves the effectiveness of test data and system operation and maintenance efficiency, and greatly reduces safety risks.
[0029] Referring to Figures 1 and 2, a preferred embodiment of the sampling time accuracy monitoring method for a battery testing system according to the present invention includes the following steps: Step S1: The intermediate computer of the battery testing system sets a data count accumulator, clears the data count accumulator to initialize it, sets a sampling frequency (e.g., 10ms) and sends it to the lower computer; this step is the basis of monitoring, ensuring that the system starts from a consistent state; the data count accumulator is essentially a counter used to accumulate the actual number of data points collected, and its initialization avoids interference from historical data; the setting of the sampling frequency needs to be based on the battery testing requirements (e.g., 1-1 is commonly used for high-precision testing). Within a 00ms range, the intermediate computer sends frequency parameters to the lower-level computer via a communication protocol (such as Modbus or TCP / IP) to achieve parameter standardization. This demonstrates configuration flexibility and adaptability to different testing scenarios. Step S2: The lower-level computer collects battery data based on the sampling frequency and caches the battery data. The lower-level computer is typically implemented by a microcontroller or PLC, with its built-in real-time clock (RTC) driving the sampling timer. A caching mechanism (such as a circular buffer) prevents data loss, especially at high-frequency sampling (e.g., 10ms), where the buffer size needs to be optimized according to the acquisition cycle. The selection of battery data (voltage, current, etc.) covers... Key battery performance parameters were measured, ensuring comprehensive monitoring, and the independent operation of the lower-level machine reduced the burden on the middle-level machine. In step S3, the middle-level machine periodically sends acquisition commands to the lower-level machine based on a preset acquisition cycle to obtain the battery data cached by the lower-level machine, and adds the number of battery data entries to the data entry accumulator. The acquisition cycle setting needs to balance real-time performance and network load: too short a cycle increases communication pressure, while too long a cycle reduces monitoring sensitivity. The middle-level machine obtains data through a request-response mode, and the accumulator uses atomic operations to avoid concurrent errors. This step achieves data aggregation, providing raw data for subsequent deviation calculation. Step S4 The intermediate computer calculates the theoretical number of sampled data points at preset time intervals (e.g., 1 hour) based on the sampling frequency and time interval. It compares the theoretical number of sampled data points with the count value of the data point accumulator to perform data point verification and generate a first deviation value. The theoretical number of sampled data points = time interval / sampling frequency. The calculation of the theoretical number of data points is a direct measure of time accuracy. For example, at a sampling frequency of 10ms, the theoretical number of data points in 1 hour is 360,000. The first deviation value (e.g., relative error percentage) reflects the abnormality of data acquisition continuity: if the deviation is positive, it indicates that the lower computer is "running too fast" (sampling too fast); if the deviation is negative, it is "running too slow".The threshold setting (e.g., ±5%) can be dynamically adjusted based on historical statistics to avoid false alarms. In step S5, the intermediate unit and the lower unit exchange time synchronization messages. Based on the sending and receiving timestamps of the time synchronization messages, the clock deviation between the intermediate unit and the lower unit is calculated for bidirectional delay verification, generating a second deviation value. Bidirectional delay verification uses standard protocols (e.g., PTP for microsecond-level accuracy, NTP for millisecond-level accuracy), with timestamps recorded in the message header. The clock deviation calculation formula is typically: Deviation = [(Received timestamp 2 - Sending timestamp 1) - (Sending timestamp 2 - Received timestamp 1)] / 2, where 1 and 2 represent the messages from the intermediate unit and the lower unit, respectively. The second deviation value identifies hardware clock drift (e.g., RTC crystal oscillator aging) and complements the first deviation value. In step S6, the intermediate unit performs a comprehensive diagnosis of the sampling time accuracy based on the first and second deviation values to obtain a diagnostic result, and executes a security policy based on the diagnostic result. After performing the comprehensive diagnosis at each time interval, the data entry accumulator is cleared for initialization.
[0030] In step S2, the battery data includes at least one of charging voltage, charging current, charging temperature, and SOC.
[0031] In step S5, the bidirectional delay verification is based on the PTP protocol or the NTP protocol.
[0032] Step S6 specifically involves: the intermediate unit setting a first threshold and a second threshold, comparing the first deviation value with the first threshold, the second deviation value with the second threshold; when the first deviation value exceeds the first threshold and the second deviation value exceeds the second threshold, a diagnostic result of clock source abnormality (such as RTC damage) of the lower unit is generated, requiring hardware intervention; when the first deviation value exceeds the first threshold but the second deviation value does not exceed the second threshold, a diagnostic result of data sampling unit or data transmission network congestion (such as buffer overflow) of the lower unit is generated, which can be alleviated by optimizing the sampling logic; when the first deviation value does not exceed the first threshold but the second deviation value exceeds the second threshold, a diagnostic result of network path abnormality or instantaneous error (such as network jitter) of the time synchronization message is generated, requiring retransmission or ignoring; the intermediate unit generates warning information based on the diagnostic results and executes a security policy; the security policy specifically involves: stopping battery testing of the abnormal lower unit, switching to a backup lower unit, or marking the sampled data within the corresponding time period as unreliable data.
[0033] The first threshold and the second threshold are dynamic thresholds calculated based on historical normal battery data.
[0034] A preferred embodiment of the sampling time accuracy monitoring system for a battery testing system according to the present invention includes the following modules: an initialization module, used by the intermediate computer of the battery testing system to set a data count accumulator, clear the data count accumulator to initialize it, set a sampling frequency (e.g., 10ms) and send it to the lower computer; this step is the basis of monitoring, ensuring that the system starts from a consistent state; the data count accumulator is essentially a counter used to accumulate the actual number of data points collected, and its initialization avoids interference from historical data; the setting of the sampling frequency needs to be based on the battery testing requirements (e.g., high-precision testing often uses a range of 1-100ms), the intermediate computer... Frequency parameters are sent to the lower-level machine via communication protocols (such as Modbus or TCP / IP) to achieve parameter standardization, demonstrating configuration flexibility and adaptability to different testing scenarios. A battery data sampling module is used by the lower-level machine to collect battery data based on the sampling frequency and cache the battery data. The lower-level machine is typically implemented by a microcontroller or PLC, with its built-in real-time clock (RTC) driving the sampling timer. A caching mechanism (such as a circular buffer) avoids data loss, especially at high-frequency sampling (such as 10ms), where the buffer size needs to be optimized according to the sampling cycle. The selection of battery data (voltage, current, etc.) covers key battery performance parameters. The system ensures comprehensive monitoring, and the independent operation of the lower-level machine reduces the burden on the middle-level machine. The data entry accumulation module is used by the middle-level machine to periodically send collection commands to the lower-level machine based on a preset collection cycle to obtain the battery data cached by the lower-level machine, and then add the number of battery data entries to the data entry accumulator. The collection cycle setting needs to balance real-time performance and network load: too short a cycle will increase communication pressure, while too long a cycle will reduce monitoring sensitivity. The middle-level machine obtains data through a request-response mode, and the accumulator uses atomic operations to avoid concurrent errors. This step realizes data aggregation, providing raw data for subsequent deviation calculation. The first deviation value calculation module... The data acquisition unit calculates the theoretical number of data samples based on the sampling frequency and the time interval at preset intervals (e.g., 1 hour). It then compares the theoretical number of data samples with the count value of the data sample accumulator to perform data sample count verification, generating a first deviation value. The theoretical number of data samples = time interval / sampling frequency. The theoretical number of samples is a direct measure of time accuracy; for example, at a sampling frequency of 10ms, the theoretical number of samples per hour is 360,000. The first deviation value (e.g., relative error percentage) reflects an anomaly in the continuity of data acquisition: a positive deviation indicates that the lower-level machine is "running too fast" (sampling too quickly); a negative deviation indicates that it is "running too slow."The threshold setting (e.g., ±5%) can be dynamically adjusted based on historical statistics to avoid false alarms. The second deviation value calculation module is used for exchanging time synchronization messages between the intermediate and lower-level machines. Based on the sending and receiving timestamps of the time synchronization messages, it calculates the clock deviation between the intermediate and lower-level machines for bidirectional delay verification, generating a second deviation value. The bidirectional delay verification uses standard protocols (e.g., PTP for microsecond-level accuracy, NTP for millisecond-level accuracy), with timestamps recorded in the message header. The clock deviation calculation formula is typically: Deviation = [(Received timestamp 2 - Sending timestamp 1) - (Sending timestamp 2 - Received timestamp 1)] / 2, where 1 and 2 represent the messages from the intermediate and lower-level machines, respectively. The second deviation value identifies hardware clock drift (e.g., RTC crystal oscillator aging) and complements the first deviation value. The comprehensive diagnostic module is used by the intermediate machine to perform a comprehensive diagnosis of the sampling time accuracy based on the first and second deviation values, obtain a diagnostic result, and execute a security policy based on the diagnostic result. After performing the comprehensive diagnosis at each time interval, the data entry accumulator is cleared for initialization.
[0035] In the battery data sampling module, the battery data includes at least one of charging voltage, charging current, charging temperature, and SOC.
[0036] In the second deviation value calculation module, the bidirectional delay verification is based on the PTP protocol or the NTP protocol.
[0037] The comprehensive diagnostic module is specifically used for: setting a first threshold and a second threshold in the intermediate unit, comparing the first deviation value with the first threshold, the second deviation value with the second threshold; when the first deviation value exceeds the first threshold and the second deviation value exceeds the second threshold, a diagnostic result of clock source abnormality (such as RTC damage) of the lower unit is generated, requiring hardware intervention; when the first deviation value exceeds the first threshold but the second deviation value does not exceed the second threshold, a diagnostic result of data sampling unit or data transmission network congestion (such as buffer overflow) of the lower unit is generated, which can be alleviated by optimizing the sampling logic; when the first deviation value does not exceed the first threshold but the second deviation value exceeds the second threshold, a diagnostic result of network path abnormality or instantaneous error (such as network jitter) of the time synchronization message is generated, requiring retransmission or ignoring; the intermediate unit generates warning information based on the diagnostic results and executes a security policy; the security policy specifically includes: stopping battery testing of the abnormal lower unit, switching to a backup lower unit, or marking the sampled data within the corresponding time period as unreliable data.
[0038] The first threshold and the second threshold are dynamic thresholds calculated based on historical normal battery data.
[0039] In summary, the advantages of this invention are as follows: 1. A data accumulator is set in the mid-level computer of the battery testing system. The data accumulator is initialized by clearing it to zero. A sampling frequency is set and sent to the lower-level computer. Then, the lower-level computer collects battery data based on the sampling frequency and caches it. The mid-level computer periodically sends a collection command to the lower-level computer to obtain the battery data cached by the lower-level computer and adds the number of battery data entries to the data accumulator. Then, at a preset time interval, the mid-level computer calculates the theoretical number of sampled data entries based on the sampling frequency and the time interval. It compares the theoretical number of sampled data entries with the count value of the data accumulator to perform data entry verification and generate a first deviation value. The mid-level computer and the lower-level computer exchange time synchronization messages. Based on the sending and receiving timestamps of the time synchronization messages, the clock deviation between the mid-level computer and the lower-level computer is calculated to perform bidirectional delay verification and generate a second deviation value. The first and second deviation values are used to comprehensively diagnose the sampling time accuracy, resulting in a diagnostic result. Based on this result, safety policies are implemented. By performing parallel data count verification and bidirectional delay verification during the lower-level machine's data sampling process, and based on the collaborative analysis and logical judgment of the two independent deviation values, the root cause of time accuracy distortion can be quickly and accurately located—whether it stems from a lower-level machine clock anomaly, data sampling unit / network congestion, or synchronization message path problems. This transforms previously ambiguous system faults into clear diagnostic results. Consequently, the system can automatically execute targeted safety policies such as stopping testing, switching devices, or marking invalid data based on the diagnostic results. This achieves a shift from passive, delayed discovery to proactive, real-time intervention, effectively preventing the accumulation of invalid data and the expansion of battery safety risks. Ultimately, this greatly improves the effectiveness of test data and system operation and maintenance efficiency, and significantly reduces safety risks.
[0040] 2. By combining a dual mechanism of data count verification and bidirectional time delay verification, the accuracy of sampling time precision monitoring is significantly improved. The mid-level computer calculates the theoretical number of sampled data points based on the sampling frequency and time interval, and compares it with the actual count value to generate the first deviation value, which can effectively detect anomalies in the continuity of data acquisition. The second deviation value is generated by calculating the clock deviation through time synchronization messages, which can identify hardware clock drift. This dual verification reduces the limitations of a single monitoring method, reduces the risk of false alarms and missed alarms, and ensures that the time accuracy assessment of battery test data is more reliable, thereby improving the data quality of the entire test system.
[0041] 3. By adopting periodic data acquisition and deviation calculation, it can monitor changes in sampling time accuracy in real time. It performs verification at preset time intervals and, combined with comprehensive diagnosis, can quickly identify anomalies (such as clock source failure or network congestion) and immediately execute safety policies (such as stopping the test or switching devices). This real-time capability avoids test interruptions or data distortion caused by the accumulation of anomalies, improves the efficiency and response speed of the battery testing process, and is suitable for high-frequency sampling application scenarios.
[0042] 4. Based on the combined analysis of the first and second deviation values, the root cause of the problem can be accurately located, such as distinguishing between abnormal lower-level clock source, data sampling unit failure, or network path problem; by setting thresholds and comparing them, the diagnostic results are more targeted, avoiding generalized error handling; this comprehensive diagnostic capability not only improves the efficiency of fault diagnosis, but also reduces unnecessary system downtime, which is conducive to maintaining the continuity and stability of battery testing.
[0043] 5. By implementing safety strategies (such as stopping testing, switching to a backup lower-level machine, or marking data as unreliable), it can proactively prevent data contamination or equipment damage caused by sampling time accuracy issues. This is crucial for battery testing systems, as time accuracy deviations may lead to safety hazards (such as overcharging or over-discharging). The early warning mechanism ensures timely intervention in abnormal situations, protecting testing equipment and battery samples, and enhancing the robustness and safety of the overall system.
[0044] 6. Supports dynamic threshold setting, calculating thresholds based on historical normal data, enabling the monitoring process to adapt to different test conditions and environmental changes, improving the flexibility and stability of the method; in addition, using standardized protocols (such as PTP or NTP) for time synchronization ensures compatibility with existing systems, facilitates deployment on various battery testing platforms, and reduces implementation costs.
[0045] 7. By periodically accumulating data entries and using a caching mechanism, the frequent communication burden between the lower-level and middle-level machines is reduced, optimizing network resource utilization. At the same time, accurate monitoring avoids repeated testing or equipment maintenance due to accuracy issues, which reduces maintenance costs and improves the economics of battery testing in the long run.
[0046] 8. By integrating a dual monitoring mechanism of data count verification and bidirectional latency verification, the accuracy and reliability of sampling time precision are significantly improved, enabling real-time monitoring and rapid anomaly response. It can accurately locate the root cause of the fault (such as clock source abnormality or network congestion) and execute targeted safety policies (such as stopping the test or marking the data), thereby enhancing system security and data integrity. At the same time, its adaptive threshold design and standardized protocol support ensure the method's strong adaptability, easy integration, and resource optimization, ultimately improving the overall efficiency and cost-effectiveness of the battery testing system.
[0047] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for monitoring sampling time accuracy in a battery testing system, characterized in that: The process includes the following steps: Step S1: The host computer of the battery testing system sets a data entry accumulator, initializes it by clearing the accumulator, sets a sampling frequency, and sends it to the slave computer; Step S2: The slave computer collects battery data based on the sampling frequency and caches the battery data; Step S3: The host computer periodically sends collection commands to the slave computer based on a preset collection period to obtain the battery data cached by the slave computer, and adds the number of battery data entries to the data entry accumulator; Step S4: The host computer, at preset time intervals, calculates the number of data entries based on the sampling frequency. The theoretical number of sampled data points is calculated based on the sampling frequency and time interval. The theoretical number of sampled data points is compared with the count value of the data point accumulator to perform data point verification and generate a first deviation value. Step S5: The intermediate computer and the lower computer exchange time synchronization messages. Based on the sending timestamp and receiving timestamp of the time synchronization message, the clock deviation between the intermediate computer and the lower computer is calculated to perform bidirectional delay verification and generate a second deviation value. Step S6: Based on the first deviation value and the second deviation value, the intermediate computer performs a comprehensive diagnosis of the sampling time accuracy to obtain a diagnosis result and executes a security policy based on the diagnosis result.
2. The sampling time accuracy monitoring method for a battery testing system as described in claim 1, characterized in that: In step S2, the battery data includes at least one of charging voltage, charging current, charging temperature, and SOC.
3. The sampling time accuracy monitoring method for a battery testing system as described in claim 1, characterized in that: In step S5, the bidirectional delay verification is based on the PTP protocol or the NTP protocol.
4. The sampling time accuracy monitoring method for a battery testing system as described in claim 1, characterized in that: Step S6 specifically involves: the intermediate computer setting a first threshold and a second threshold, comparing the first deviation value with the first threshold, the second deviation value with the second threshold; when the first deviation value exceeds the first threshold and the second deviation value exceeds the second threshold, a diagnostic result of clock source abnormality of the lower-level machine is generated; when the first deviation value exceeds the first threshold but the second deviation value does not exceed the second threshold, a diagnostic result of data sampling unit or data transmission network congestion of the lower-level machine is generated; when the first deviation value does not exceed the first threshold but the second deviation value exceeds the second threshold, a diagnostic result of network path abnormality or instantaneous error of time synchronization message is generated; the intermediate computer generates warning information based on the diagnostic results and executes a security policy; the security policy specifically involves: stopping battery testing of the abnormal lower-level machine, switching to a backup lower-level machine, or marking the sampled data within the corresponding time period as unreliable data.
5. The sampling time accuracy monitoring method for a battery testing system as described in claim 4, characterized in that: The first threshold and the second threshold are dynamic thresholds calculated based on historical normal battery data.
6. A sampling time accuracy monitoring system for a battery testing system, characterized in that: The system includes the following modules: an initialization module, used by the host computer of the battery testing system to set a data accumulator, clear the data accumulator to initialize it, set a sampling frequency and send it to the slave computer; and a battery data sampling module, used by the slave computer to collect battery data based on the sampling frequency and cache the battery data. The data count accumulation module is used by the intermediate computer to periodically send acquisition commands to the lower computer based on a preset acquisition cycle to obtain the battery data cached by the lower computer, and to add the number of battery data entries to the data count accumulator; the first deviation value calculation module is used by the intermediate computer to calculate the theoretical number of sampled data entries based on the sampling frequency and the time interval at preset time intervals, compare the theoretical number of sampled data entries with the count value of the data count accumulator to perform data count verification, and generate a first deviation value; The second deviation value calculation module is used to exchange time synchronization messages between the intermediate machine and the lower machine. Based on the sending timestamp and receiving timestamp of the time synchronization message, it calculates the clock deviation between the intermediate machine and the lower machine to perform bidirectional delay verification and generates the second deviation value. The comprehensive diagnostic module is used by the mid-level machine to perform a comprehensive diagnosis of the sampling time accuracy based on the first deviation value and the second deviation value, obtain a diagnostic result, and execute a security policy based on the diagnostic result.
7. The sampling time accuracy monitoring system for a battery testing system as described in claim 6, characterized in that: In the battery data sampling module, the battery data includes at least one of charging voltage, charging current, charging temperature, and SOC.
8. The sampling time accuracy monitoring system for a battery testing system as described in claim 6, characterized in that: In the second deviation value calculation module, the bidirectional delay verification is based on the PTP protocol or the NTP protocol.
9. The sampling time accuracy monitoring system for a battery testing system as described in claim 6, characterized in that: The comprehensive diagnostic module is specifically used for: setting a first threshold and a second threshold in the intermediate unit, comparing the first deviation value with the first threshold, the second deviation value with the second threshold; when the first deviation value exceeds the first threshold and the second deviation value exceeds the second threshold, generating a diagnostic result of clock source abnormality in the lower unit; when the first deviation value exceeds the first threshold but the second deviation value does not exceed the second threshold, generating a diagnostic result of data sampling unit or data transmission network congestion in the lower unit; when the first deviation value does not exceed the first threshold but the second deviation value exceeds the second threshold, generating a diagnostic result of network path abnormality or instantaneous error in the time synchronization message; the intermediate unit generates warning information based on the diagnostic results and executes a security policy; the security policy specifically includes: stopping battery testing of the abnormal lower unit, switching to a backup lower unit, or marking the sampled data within the corresponding time period as unreliable data.
10. The sampling time accuracy monitoring system for a battery testing system as described in claim 9, characterized in that: The first threshold and the second threshold are dynamic thresholds calculated based on historical normal battery data.