A synchronization method and system based on a TCP protocol hybrid CAN communication protocol

By obtaining CAN messages with high-precision timestamps for decentralized timing deviation calculation and adaptive adjustment, the problem of low synchronization reliability and security in the TCP and CAN bus hybrid communication protocol system is solved, achieving high-precision time synchronization and system stability.

CN121077604BActive Publication Date: 2026-02-10JIANGXI SHENGKUN INTELLIGENT EQUIPMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511460546.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2026-02-10
Estimated Expiration
2045-10-14

AI Technical Summary

Technical Problem

In the fields of industrial automation and energy management, complex systems using a hybrid communication protocol of TCP and CAN bus are difficult to detect before deployment due to potential communication asynchrony, data parsing errors, or transmission timeouts. This makes it difficult to detect and reproduce system-level faults and hidden anomalies in a timely manner, resulting in low protocol synchronization reliability and security.

Method used

By acquiring CAN messages with high-precision timestamps, decentralized timing deviation calculations are performed. The CAN network correction amount is calculated by combining global standard time and TCP network transmission characteristics. The local clock is then gradually and adaptively adjusted to achieve communication protocol synchronization.

Benefits of technology

It improves the reliability and security of the hybrid communication protocol, ensuring the system's operational reliability and data consistency in multi-node, high-concurrency scenarios, and promptly detects and responds to highly concealed timing anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121077604B_ABST
    Figure CN121077604B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on TCP protocol hybrid CAN communication protocol synchronization method and system, it is related to communication protocol technical field, method includes: obtaining CAN message with high-precision timestamp;According to the CAN message, carry out decentralization timing deviation calculation, obtain timing average deviation;The timing average deviation is sent to host computer, and the host computer is used to calculate CAN network correction according to the timing average deviation, global standard time and TCP network transmission characteristics;According to the global standard time, the CAN network correction and the timing average deviation, local clock is gradually self-adapting adjustment, to realize timing consensus.The application can combine timing deviation and network correction to adjust local clock, to realize communication protocol synchronization, improve reliability and security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication protocol technology, and in particular to a synchronization method and system based on TCP protocol and CAN communication protocol. Background Technology

[0002] In the fields of industrial automation and energy management, ensuring time synchronization among devices within a distributed control system is crucial. This is especially true in complex systems employing a hybrid TCP and CAN bus communication protocol. Due to the large system scale, intricate inter-system relationships, and the difficulty in fully simulating the real-world operating environment, potential communication asynchrony, data parsing errors, or transmission timeouts are difficult to detect before system deployment. These problems can trigger system-level failures and make it difficult to promptly detect and reproduce hidden anomalies such as hardware resource contention, buffer overflows, or timing disorders. Existing technologies typically employ a distributed architecture, with lower-level machines (e.g., DC-DC power modules), middle-level machines (data acquisition and control units), and upper-level machines (monitoring systems) working collaboratively via a hybrid TCP and CAN bus communication protocol. However, due to the large system scale and complex inter-system relationships, it is often difficult to fully simulate the real-world operating environment before actual deployment to the production site, making end-to-end verification of the entire communication link challenging. This makes it prone to system-level failures due to communication asynchrony, data parsing errors, or transmission timeouts, resulting in low protocol synchronization reliability and security.

[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention

[0004] The main objective of this invention is to propose a synchronization method and system based on TCP protocol and CAN communication protocol, which can adjust the local clock by combining timing deviation and network correction to achieve communication protocol synchronization, thereby improving reliability and security.

[0005] On one hand, embodiments of the present invention provide a synchronization method based on a TCP protocol and a hybrid CAN communication protocol, comprising the following steps:

[0006] Obtain CAN messages with high-precision timestamps;

[0007] Based on the CAN message, a decentralized timing deviation calculation is performed to obtain the average timing deviation;

[0008] The timing average deviation is sent to the host computer, which is used to calculate the CAN network correction amount based on the timing average deviation, global standard time, and TCP network transmission characteristics.

[0009] Based on the global standard time, the CAN network correction amount, and the average timing deviation, the local clock is progressively and adaptively adjusted to achieve timing consensus.

[0010] In some embodiments, the progressive adaptive adjustment of the local clock based on the global standard time, the CAN network correction amount, and the average timing deviation includes:

[0011] Obtain the deviation information between the TCP connection and the host computer's TCP connection;

[0012] The time series average deviation and the deviation information are filtered for outliers to obtain time series data;

[0013] The time-series data is subjected to feature evaluation processing to obtain short-term volatility evaluation results and long-term trend evaluation results;

[0014] Based on the short-term volatility assessment results and the long-term trend assessment results, identify time-series volatility patterns;

[0015] The local clock is progressively and adaptively adjusted based on the timing fluctuation pattern, the global standard time, and the CAN network correction.

[0016] In some embodiments, the feature evaluation processing of the time-series data to obtain short-term volatility evaluation results and long-term trend evaluation results includes:

[0017] Obtain the current operating mode information of the fractionation capacity power supply system;

[0018] Based on the current operating mode information, determine the length of the time window for short-term volatility assessment;

[0019] Based on the current working mode information, determine the number of data points for long-term trend assessment;

[0020] Based on the time window length, a short-term volatility assessment is performed on the time series data to obtain the short-term volatility assessment result;

[0021] Based on the number of data points, a long-term trend assessment is performed on the time-series data to obtain the long-term trend assessment result.

[0022] In some embodiments, identifying time-series volatility patterns based on the short-term volatility assessment results and the long-term trend assessment results includes:

[0023] Obtain the current operating mode information of the fractionation capacity power supply system;

[0024] Multi-dimensional features are extracted from the short-term volatility assessment results and the long-term trend assessment results to obtain multi-dimensional features;

[0025] Based on the preset fluctuation pattern feature template, template matching is performed between the multi-dimensional features and the current working mode information to obtain the matching result;

[0026] If the matching result is a transient noise pattern, the short-term volatility assessment result is an increase in variance, and the long-term trend assessment result is that the absolute value of the slope is less than a preset slope threshold, then the time-series volatility pattern is determined to be perceptual instability caused by transient noise.

[0027] If the matching result is a linear drift pattern, the short-term volatility assessment result is variance stable, and the long-term trend assessment result is a slope absolute value greater than a preset slope threshold, then the time series volatility pattern is determined to be a real clock drift.

[0028] In some embodiments, the progressive adaptive adjustment of the local clock based on the timing fluctuation pattern, the global standard time, and the CAN network correction includes:

[0029] Obtain the current operating mode information of the fractionation capacity power supply system;

[0030] Based on the current working mode information, a global time correction strategy is selected from the preset correction strategy library;

[0031] Based on the global time correction strategy, correction parameters are determined, including correction period, correction step size, and correction threshold.

[0032] If the timing fluctuation mode is perceived instability caused by transient noise, then the local clock is progressively and adaptively adjusted according to the global time correction strategy, the global standard time, and the correction parameters.

[0033] If the timing fluctuation mode is a real clock drift, then the local clock is progressively and adaptively adjusted according to the global time correction strategy, the CAN network correction amount, and the correction parameters.

[0034] In some embodiments, determining the correction parameters according to the global time correction strategy includes:

[0035] Acquire the operating status information of the batch-capacity power supply system, the operating status information including emergency mode switching information or fault event information;

[0036] Based on the operating status information, the correction period, the correction step size, and the correction threshold are selected from the preset correction parameter set.

[0037] In some embodiments, selecting the correction period, the correction step size, and the correction threshold from a preset correction parameter set based on the operating status information includes:

[0038] Get the duration of Emergency Mode;

[0039] Emergency mode type information is extracted from the operating status information, and the emergency mode type information includes emergency shutdown, fault isolation, and battery over-temperature protection.

[0040] Update the preset correction parameter set according to the duration of the emergency mode;

[0041] Based on the emergency mode type information, select a target parameter group from the updated preset correction parameter set;

[0042] Select the correction period, the correction step size, and the correction threshold from the target parameter set.

[0043] In some embodiments, selecting a target parameter group from the updated preset correction parameter set based on the emergency mode type information includes:

[0044] Obtain the first system operating parameters, which include battery pack voltage, current, temperature, system load rate, and fault type;

[0045] Based on the operating parameters of the first system, select a parameter adjustment strategy from the preset emergency parameter adjustment rule table;

[0046] Based on the emergency mode type information and the parameter adjustment strategy, a target parameter group is selected from the updated preset correction parameter set.

[0047] In some embodiments, obtaining the duration of the emergency mode includes:

[0048] Acquire historical system operating parameters and historical duration, including battery pack voltage, current, temperature, system load rate, and fault type;

[0049] The historical system operating parameters are associated with the historical duration and stored to obtain historical data records of emergency mode;

[0050] Monitor the operating parameters of the second system;

[0051] The second system operating parameters are matched with the historical emergency mode data records to obtain historical emergency mode records.

[0052] The duration of the emergency mode is obtained by statistically analyzing the duration of the historical emergency mode records.

[0053] On the other hand, embodiments of the present invention provide a synchronization system based on a TCP protocol and a hybrid CAN communication protocol, comprising:

[0054] The message acquisition module is used to acquire CAN messages with high-precision timestamps;

[0055] The timing deviation calculation module is used to perform decentralized timing deviation calculation based on the CAN message to obtain the average timing deviation.

[0056] The deviation upload module is used to send the timing average deviation to the host computer, and the host computer is used to calculate the CAN network correction amount based on the timing average deviation, global standard time, and TCP network transmission characteristics.

[0057] The adjustment module is used to progressively and adaptively adjust the local clock based on the global standard time, the CAN network correction amount, and the average timing deviation, so as to achieve timing consensus.

[0058] The embodiments of this application include at least the following beneficial effects: First, the embodiments of this application acquire CAN messages with high-precision timestamps. Then, based on the CAN messages, decentralized timing deviation calculation is performed to obtain the average timing deviation. The average timing deviation is then sent to the host computer. Based on the average timing deviation, global standard time, and TCP network transmission characteristics, the host computer calculates the CAN network correction amount. Finally, based on the global standard time, the CAN network correction amount, and the average timing deviation, the local clock is progressively and adaptively adjusted to achieve timing consensus. This allows the local clock to be adjusted by combining timing deviation and network correction amount to achieve communication protocol synchronization, thereby improving reliability and security.

[0059] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description and the drawings. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below.

[0061] Figure 1 This is a flowchart illustrating a synchronization method based on a TCP protocol and a hybrid CAN communication protocol according to an embodiment of the present invention.

[0062] Figure 2 This is a schematic diagram of a synchronization system based on TCP protocol and CAN communication protocol according to an embodiment of the present invention. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments.

[0064] In related technologies, ensuring time synchronization among devices within a distributed control system is crucial in industrial automation and energy management. This is especially true in complex systems employing a hybrid TCP and CAN bus communication protocol. Due to the large system scale, complex inter-system relationships, and the difficulty in fully simulating the real-world operating environment, potential communication asynchrony, data parsing errors, or transmission timeouts are difficult to detect before system deployment. These problems can lead to system-level failures and make it difficult to detect and reproduce subtle anomalies such as hardware resource contention, buffer overflows, or timing disorders in a timely manner. To address these challenges, a method is needed to effectively improve the reliability, data consistency, and timing accuracy of hybrid communication protocols.

[0065] For example, in the current field of industrial automation and energy management, batching and capacity-setting power supply systems are widely used in battery production and testing, and their operational reliability directly affects production efficiency and equipment safety. These systems typically employ a distributed architecture, with lower-level machines (such as DC-DC power modules), middle-level machines (data acquisition and control units), and upper-level machines (monitoring systems) working collaboratively via a hybrid TCP and CAN bus communication protocol. However, due to the large scale of the systems and the complex interrelationships between subsystems, it is often difficult to fully simulate the real operating environment before actual deployment to the production site, resulting in many potential problems going undetected during the testing phase. Especially in terms of system linkage, real-time data processing, and communication reliability, relying solely on traditional unit testing or partial simulation is insufficient to cover abnormal situations in multi-node, high-concurrency scenarios.

[0066] Existing testing methods have significant limitations: First, they lack the ability to reuse real-world operational data, making it impossible to effectively utilize historical data for regression testing and stress simulation. Second, they are difficult to verify the entire communication link (from TCP packet assembly to CAN frame forwarding) end-to-end, making it prone to system-level failures due to communication asynchrony, data parsing errors, or transmission timeouts. Third, due to the differences between the test environment and the field environment, many highly concealed anomalies (such as hardware resource contention, buffer overflows, or timing disorders) only become apparent under long-term operation or high load conditions, and conventional testing methods struggle to reproduce these problems, resulting in high operational risks and maintenance costs for the system after delivery.

[0067] In the field of industrial automation and energy management, the complexities of distributed multi-level architecture, mixed TCP and CAN bus communication protocols, and the challenge of fully simulating the real operating environment require effective solutions to problems such as communication asynchrony, data parsing errors, transmission timeouts, and timing disorders caused by protocol conversion and data transmission uncertainty in the communication link. This is necessary to ensure the system's operational reliability, data consistency, and timing accuracy in multi-node, high-concurrency scenarios, and to promptly detect and respond to highly concealed timing anomalies.

[0068] The embodiments of this application will be explained in detail below with reference to the accompanying drawings:

[0069] Figure 1 This is an optional flowchart of a synchronization method based on a TCP protocol and a hybrid CAN communication protocol provided in an embodiment of this application. Figure 1 The method may include, but is not limited to, steps S101 to S104.

[0070] Step S101: Obtain a CAN message with a high-precision timestamp;

[0071] Step S102: Based on the CAN message, perform decentralized timing deviation calculation to obtain the average timing deviation;

[0072] Step S103: Send the average timing deviation to the host computer. The host computer is used to calculate the CAN network correction amount based on the average timing deviation, global standard time, and TCP network transmission characteristics.

[0073] Step S104: Based on the global standard time, CAN network correction amount and average timing deviation, the local clock is progressively and adaptively adjusted to achieve timing consensus.

[0074] Steps S101 to S104 shown in the embodiments of this application can adjust the local clock by combining timing deviation and network correction amount to achieve communication protocol synchronization, thereby improving reliability and security.

[0075] In some embodiments, steps S101-S104 can first acquire a CAN message with a high-precision timestamp. For example, a high-precision clock source can be integrated at the CAN controller hardware level, such as a temperature-compensated crystal oscillator or a temperature-controlled crystal oscillator, and the hardware can automatically timestamp the message when it is sent. In another implementation, in the CAN driver layer software, the current system time is recorded as a timestamp immediately before the message enters the transmission queue or after it is retrieved from the reception queue, using a nanosecond-level time interface provided by the operating system. For example, the CAN controller can be configured to record the message reception time using an internal high-precision timer when a message is received, and encapsulate this timestamp along with the message data. It is understood that a CAN message refers to a data frame transmitted on the CAN (Controller Area Network) bus, which typically contains data, identifiers, and timestamps. In this embodiment, the CAN message is assigned a high-precision timestamp, which is crucial for subsequent timing deviation calculations.

[0076] Then, based on the CAN messages, a decentralized timing deviation calculation is performed to obtain the average timing deviation. Each CAN node can periodically broadcast a synchronization message with its own local timestamp. Other nodes, upon receiving these synchronization messages, calculate the timing difference with the sending node based on the timestamp in the message and their own local time. By collecting timing difference information from multiple nodes, statistical methods such as the average method, weighted average method, or least squares method can be used to calculate the average timing deviation of the entire CAN network. For example, if node A sends a message at time T1, and node B receives the message and records its local time T2, then node B considers its timing deviation from node A to be T2-T1. This process is repeated among multiple nodes, forming a deviation matrix, and then the average timing deviation is calculated using an algorithm. It can be understood that the average timing deviation is the result of decentralized timing deviation calculation; it reflects the overall deviation of each node in the CAN network relative to a virtual average clock.

[0077] The timing average deviation is then sent to the host computer, which calculates the CAN network correction amount based on the timing average deviation, global standard time, and TCP network transmission characteristics. One or more designated nodes in the CAN network can act as proxies, encapsulating the calculated timing average deviation via TCP / IP protocol and sending it to the host computer. Upon receiving this data, the host computer considers multiple factors to calculate the CAN network correction amount. For example, the host computer can periodically obtain the global standard time from the NTP server and monitor TCP network transmission delay and jitter with the CAN network proxy nodes. By comparing the timing average deviation with the global standard time and combining it with TCP network transmission characteristics (e.g., estimating transmission delay by measuring round-trip time RTT), the host computer can use algorithms such as Kalman filtering, minimum mean square error (LMS) algorithm, or adaptive PID controller to calculate an accurate CAN network correction amount. It is understood that the host computer typically refers to a higher-level computer in the control system, responsible for monitoring, managing, and coordinating the work of lower-level or intermediate-level computers. In this application, the host computer undertakes the task of calculating the CAN network correction amount. Global standard time refers to a unified, high-precision reference time, such as time obtained through an NTP (Network Time Protocol) server or GPS (Global Positioning System). It is the foundation for achieving timing consensus across the entire system. TCP network transmission characteristics refer to the latency, jitter, packet loss, and other features exhibited by the TCP (Transmission Control Protocol) during data transmission. These characteristics affect the accuracy of time synchronization and therefore need to be considered when calculating correction values. CAN network correction values ​​are calculated by the host computer based on various information and are used to compensate for clock drift and transmission delay in the CAN network.

[0078] Finally, based on the global standard time, CAN network correction, and average timing deviation, the local clock is progressively and adaptively adjusted to achieve timing consensus. For example, the host computer sends the calculated CAN network correction and the current global standard time to the agent nodes in the CAN network via TCP / IP. After receiving this information, the agent nodes broadcast it to other CAN nodes via the CAN bus. Each CAN node corrects its local clock using a progressive adaptive adjustment strategy based on the received global standard time, CAN network correction, and its own calculated average timing deviation. For example, frequency or phase adjustment can be used to gradually approach the target time in small steps and multiple iterations, avoiding clock jumps. This adjustment can be periodic or event-driven to ensure the entire CAN network remains highly synchronized with the global standard time. It is understood that the local clock refers to the clock within each CAN node.

[0079] Through the above technical solutions, the introduction of high-precision timestamps in this embodiment provides more reliable basic data for subsequent timing deviation calculations, significantly improving the initial accuracy of synchronization. The decentralized timing deviation calculation mechanism enables the system to maintain good timing synchronization capabilities even when facing local node failures or network topology changes, enhancing the system's fault tolerance. The host computer calculates the correction amount by combining global standard time and TCP network transmission characteristics, effectively compensating for the impact of TCP protocol transmission delays and jitter on synchronization accuracy, achieving high-precision time alignment across protocols. The progressive adaptive adjustment strategy ensures the smoothness and stability of local clock adjustments, avoiding system anomalies that may be caused by sudden clock changes, thereby improving the overall system reliability. This embodiment effectively solves the problems of low timing synchronization accuracy and poor stability in existing hybrid communication protocol systems, providing a more advanced and reliable time synchronization solution for distributed control systems in fields such as industrial automation and energy management.

[0080] In some embodiments, in step S104, the local clock is progressively and adaptively adjusted based on the global standard time, CAN network correction amount, and average timing deviation, which may include, but is not limited to, the following steps:

[0081] Step S201: Obtain the deviation information between the TCP connection and the host computer's TCP connection;

[0082] Step S202: Filter outliers from the time series average deviation and deviation information to obtain time series data;

[0083] Step S203: Perform feature evaluation processing on the time series data to obtain short-term volatility evaluation results and long-term trend evaluation results;

[0084] Step S204: Identify time-series volatility patterns based on the short-term volatility assessment results and the long-term trend assessment results;

[0085] Step S205: Based on the timing fluctuation mode, global standard time, and CAN network correction amount, perform progressive adaptive adjustment of the local clock.

[0086] In some embodiments, failure to adequately identify and differentiate different types of timing fluctuations (e.g., transient noise or real clock drift) may lead to inaccurate correction strategies or even introduce new instabilities, thereby affecting the robustness and accuracy of timing consensus. To address this, deviation information between the local device and the host computer's TCP connection can be obtained first. For example, the local device periodically measures or receives timing deviation data regarding TCP network transmission delays, jitter, etc., through a TCP connection established with the host computer. This deviation information can reflect the potential impact of the TCP network itself on time synchronization, such as round-trip time (RTT), packet loss, or out-of-order delivery. The aim is to comprehensively consider various factors affecting timing consensus, including network transmission characteristics.

[0087] Then, outlier filtering is performed on the time series average deviation and deviation information to obtain the time series data. Preprocessing can be performed on the raw time series average deviation and the deviation information obtained from the host computer's TCP. This preprocessing aims to identify and remove outliers or noise in the data, such as extreme values ​​caused by transient network congestion, hardware failure, or measurement errors. Outlier filtering methods can employ statistical methods, such as median absolute deviation (MAD) or machine learning-based anomaly detection algorithms. The purpose is to ensure that subsequent time series data analysis is based on clean and reliable data, avoiding outliers from misleading the evaluation results.

[0088] The time-series data is then subjected to feature evaluation processing to obtain short-term volatility assessment results and long-term trend assessment results. Statistical analysis and pattern recognition can be performed on the time-series data after outlier filtering. The short-term volatility assessment results reflect the instantaneous changes of the time-series data within a short time window, for example, by quantifying the degree of volatility by calculating the variance, standard deviation, or mean absolute deviation of the data. The long-term trend assessment results reveal the overall drift direction or trend of the time-series data over a longer time span, for example, by calculating the slope through linear regression analysis, or by using methods such as moving averages and exponential smoothing to smooth short-term volatility and highlight long-term trends. The aim is to comprehensively understand the dynamic characteristics of time-series bias from different time scales.

[0089] Finally, based on the short-term volatility assessment results and the long-term trend assessment results, timing fluctuation patterns are identified. For example, if short-term volatility is large but the long-term trend is not obvious, it may indicate the presence of transient noise; if short-term volatility is stable but the long-term trend shows a significant slope, it may indicate actual clock drift. The purpose is to classify complex timing deviation phenomena into identifiable patterns, providing a basis for subsequent accurate calibration. Simultaneously, the local clock is progressively and adaptively adjusted based on the timing fluctuation pattern, global standard time, and CAN network correction amount. Appropriate clock calibration strategies can be selected and executed according to the identified timing fluctuation pattern. For example, for perceived instability caused by transient noise, a more conservative calibration strategy may be needed, or calibration may be temporarily suppressed to avoid overreaction; while for actual clock drift, a more aggressive application of global standard time and CAN network correction amount is required. This adaptive adjustment ensures the accuracy and stability of the calibration process, avoiding the negative impacts that may arise from fixed-pattern calibration methods.

[0090] To illustrate this technical solution more clearly, a specific example is used below. Suppose a distributed capacity power supply system requires the local device to maintain high-precision time synchronization with the host computer. First, the local device continuously acquires deviation information between itself and the host computer's TCP, such as real-time TCP round-trip delay data. Simultaneously, the system receives the average timing deviation calculated via CAN messages. This raw data is then fed into an outlier filter, such as using a sliding window midpoint filter, to remove extreme deviation values ​​caused by network jitter or sensor malfunctions, thus obtaining clean timing data.

[0091] Then, the system performs feature evaluation on these time-series data. For example, in short-term volatility assessment, the system calculates the variance of the time-series data over the last 10 seconds; in long-term trend assessment, the system calculates the slope by performing linear regression on the data from the last 5 minutes. Based on these evaluation results, the system identifies the current time-series volatility pattern. Specifically, if the short-term variance increases significantly, but the long-term slope is close to zero (e.g., absolute value less than 0.01 microseconds / second), the system determines the current pattern as "perceived instability caused by transient noise." In this case, the system may choose delayed correction or use a smaller correction step size to avoid overreacting to transient noise. Conversely, if the short-term variance remains stable, but the long-term slope exhibits a significantly non-zero value (e.g., absolute value greater than 0.05 microseconds / second), the system determines the current pattern as "real clock drift." In this case, the system actively adjusts the local clock according to the global standard time and CAN network correction amount, with a preset correction period and step size, to compensate for the actual physical clock drift. In this way, the system can dynamically adjust the correction strategy according to the actual nature of the timing deviation, thereby achieving more stable and accurate time synchronization.

[0092] Through the above technical solutions, this embodiment, by introducing the acquisition of TCP deviation information and outlier filtering, enables the system to more comprehensively and accurately grasp the true situation of timing deviations, avoiding misjudgments caused by data noise or instantaneous network fluctuations. This embodiment, by performing feature evaluation on timing data and identifying timing fluctuation patterns, can distinguish between deviations of different natures, such as transient noise and real clock drift, thereby avoiding potential overcorrection of transient noise or delayed response to real drift. This pattern recognition-based adaptive adjustment mechanism makes the local clock correction process more intelligent and refined, effectively reducing clock synchronization errors and improving the robustness and reliability of the entire system's timing consensus in complex network environments.

[0093] In some embodiments, step S203, which involves performing feature evaluation processing on the time series data to obtain short-term volatility evaluation results and long-term trend evaluation results, may include, but is not limited to, the following steps:

[0094] Obtain the current operating mode information of the fractionation capacity power supply system;

[0095] Based on the current working mode information, determine the length of the time window for short-term volatility assessment;

[0096] Based on the current working mode information, determine the number of data points for long-term trend assessment;

[0097] Based on the length of the time window, a short-term volatility assessment is performed on the time series data to obtain the short-term volatility assessment results;

[0098] Based on the number of data points, a long-term trend assessment is performed on the time series data to obtain the long-term trend assessment results.

[0099] In some embodiments, using only fixed evaluation parameters may not accurately reflect the true timing fluctuation characteristics of the system under different operating modes. For example, when the system load changes drastically or is in a specific operating mode, a fixed time window length and number of data points may lead to deviations in the evaluation results, which in turn affect the identification of subsequent timing fluctuation patterns and the adjustment accuracy of the local clock, potentially resulting in decreased robustness of clock synchronization or even synchronization failure in critical operating modes.

[0100] To this end, we can first obtain the current operating mode information of the capacity-determining power supply system. This current operating mode information refers to the system's operating state at a specific point in time, such as charging mode, discharging mode, idle mode, maintenance mode, or high-power mode. Obtaining this information aims to provide context for subsequent time-series data evaluation, ensuring that the evaluation parameters match the actual operating conditions of the system.

[0101] Then, based on the current operating mode information, the length of the time window for short-term volatility assessment is determined. The length of the time window for short-term volatility assessment refers to the time span of the data samples considered when conducting short-term volatility analysis. This length is determined based on the current operating mode information. For example, when the system operating mode is relatively stable, a longer time window can be used to smooth out noise; while when the system operating mode changes drastically, a shorter time window may be needed to quickly capture transient fluctuations.

[0102] Based on the current working mode information, the number of data points for long-term trend assessment is determined. This number refers to the total number of historical data points used in the long-term trend analysis. This number is also dynamically adjusted based on the current working mode information to ensure that the long-term trend assessment reflects sufficiently long historical information while avoiding interference from outdated data in current trend judgments.

[0103] Finally, based on the length of the time window, a short-term volatility assessment is performed on the time series data to obtain the short-term volatility assessment results. Statistical methods can be used, such as calculating the variance, standard deviation, or root mean square error of the time series data within a specified time window, to quantify its instantaneous volatility. Simultaneously, based on the number of data points, a long-term trend assessment is performed on the time series data to obtain the long-term trend assessment results. Methods such as regression analysis, moving averages, or exponential smoothing can be used to identify the direction and rate of drift of the time series data over longer time scales.

[0104] To illustrate this technical solution more clearly, a specific example is used below. Assume a capacity-balanced power supply system has three typical operating modes: charging mode, discharging mode, and idle mode. When the system is in charging mode, the potential for large current and voltage fluctuations can increase the latency volatility of CAN message transmission. In this case, to quickly capture transient fluctuations, the system can set the short-term volatility assessment time window to a shorter value, such as 5 seconds, based on the current operating mode information, while simultaneously setting the number of data points for long-term trend assessment to a medium value, such as 100 data points, to balance short-term response and long-term stability.

[0105] When the system is in discharge mode, especially during high-power discharge, the internal temperature and load changes may be more drastic, placing higher demands on the stability of clock synchronization. In this mode, the system can further shorten the time window for short-term volatility assessment, for example, to 3 seconds, based on the current operating mode information, to more sensitively detect instantaneous deviations. At the same time, to ensure the accuracy of long-term trend assessment, the number of data points for long-term trend assessment can be appropriately increased, for example, to 150 data points, to better smooth noise and identify true drift.

[0106] When the system is in idle mode, its operation is relatively stable, and clock fluctuations are typically small and slow. In this state, to improve the noise immunity of the evaluation and identify minute long-term drifts, the system can set the time window length for short-term volatility evaluation to a longer value, such as 10 seconds, based on the current operating mode information, to better smooth transient noise. Simultaneously, the number of data points for long-term trend evaluation can be increased, such as 200 data points, to obtain trend information over a longer time range, thereby more accurately identifying minute clock drifts. In this way, this application can dynamically adjust the parameters for timing data characteristic evaluation according to the actual operating conditions of the componentized power supply system, ensuring accurate clock fluctuation evaluation results under various complex scenarios and laying the foundation for achieving high-precision timing consensus.

[0107] Through the above technical solution, this embodiment adaptively adjusts the evaluation parameters based on the current operating mode information of the componentized and capacitive power supply system. This allows for more accurate identification of short-term clock fluctuations and long-term drift, avoiding misjudgments or omissions caused by fixed parameter evaluation. This refined feature evaluation provides a high-quality data foundation for subsequent timing fluctuation pattern identification, making the gradual adaptive adjustment of the local clock more accurate and effective. Ultimately, it ensures that the synchronization method based on the TCP protocol hybrid CAN communication protocol can achieve higher-precision timing consensus in the complex and ever-changing operating environment of the componentized and capacitive power supply system.

[0108] In some embodiments, in step S204, identifying time-series volatility patterns based on short-term volatility assessment results and long-term trend assessment results may include, but is not limited to, the following steps:

[0109] Obtain the current operating mode information of the fractionation capacity power supply system;

[0110] Multi-dimensional features are extracted from the short-term volatility assessment results and the long-term trend assessment results to obtain multi-dimensional features;

[0111] Based on the preset fluctuation pattern feature template, template matching is performed on multi-dimensional features and current working mode information to obtain the matching result;

[0112] If the matching result is a transient noise pattern, the short-term volatility assessment result is an increase in variance, and the long-term trend assessment result is that the absolute value of the slope is less than the preset slope threshold, then the time-series volatility pattern is determined to be perceptual instability caused by transient noise.

[0113] If the matching result is a linear drift pattern, the short-term volatility assessment result is variance stable, and the long-term trend assessment result is that the absolute value of the slope is greater than the preset slope threshold, then the time series volatility pattern is determined to be real clock drift.

[0114] In some embodiments, timing fluctuations may be caused by various factors, such as transient noise or real clock drift. Failure to accurately distinguish the nature of these fluctuation patterns may lead to inaccurate subsequent local clock adjustment strategies, and could even negatively impact the stability and efficiency of system synchronization. Therefore, information on the current operating mode of the split-capacity power supply system can be obtained first, and multi-dimensional features can be extracted from the short-term volatility assessment results and long-term trend assessment results to obtain multi-dimensional features. Multiple quantitative indicators that can effectively characterize the timing fluctuation characteristics can be extracted from these assessment results. For example, statistical features such as kurtosis, skewness, autocorrelation coefficient, and power spectral density can be extracted, or frequency domain features can be extracted using wavelet analysis, Fourier transform, and other methods. The extraction of these multi-dimensional features aims to more comprehensively and finely characterize the inherent laws and manifestations of timing fluctuations, providing a rich data foundation for subsequent pattern recognition.

[0115] Then, based on the preset fluctuation pattern feature template, template matching is performed on the multi-dimensional features and the current operating mode information to obtain the matching result. The preset fluctuation pattern feature template can be a set of predefined feature vectors or rule sets corresponding to different time-series fluctuation patterns (such as transient noise patterns and linear drift patterns). These templates can be established through historical data analysis, expert experience, or machine learning training. The template matching process can employ various pattern recognition algorithms, such as support vector machines (SVM), neural networks, decision trees, or rule-based inference systems. Its purpose is to compare the currently extracted multi-dimensional features with the preset template to determine which predefined pattern the current time-series fluctuation is closest to.

[0116] If the matching result is a transient noise pattern, the short-term volatility assessment result is an increase in variance, and the long-term trend assessment result is a slope absolute value less than a preset slope threshold, then the time-series volatility pattern is determined to be perceptual instability caused by transient noise. Transient noise typically manifests as sharp fluctuations in data over a short period, leading to a significant increase in variance, but its impact on the long-term trend is relatively small, so the slope change is not obvious. If the matching result is a linear drift pattern, the short-term volatility assessment result is stable variance, and the long-term trend assessment result is a slope absolute value greater than a preset slope threshold, then the time-series volatility pattern is determined to be real clock drift. Real clock drift typically manifests as a persistent and directional deviation of the clock signal, resulting in a significant slope in the long-term trend, but short-term volatility may be relatively stable. The preset slope threshold is an empirical value or a parameter set according to system requirements, used to distinguish between minor trends and significant drifts.

[0117] To illustrate this technical solution more clearly, a specific example is used below. Assume a capacity-balanced power supply system is performing a high-current charging operation. In this situation, the internal electromagnetic environment of the system may be complex, easily generating transient noise. The system first obtains the current operating mode information as "high-current charging mode." Subsequently, it extracts multi-dimensional features from the previously obtained short-term volatility assessment results (e.g., variance of time-series data over the past second) and long-term trend assessment results (e.g., linear regression slope of time-series data over the past 10 minutes). For example, features such as variance, kurtosis, skewness, and the second derivative of the slope are extracted.

[0118] Next, these multi-dimensional features, along with the "high-current charging mode" information, are input into a preset fluctuation mode feature template for matching. Assume the matching result indicates a "transient noise mode." At this point, the system further examines the short-term volatility assessment results and finds a significant increase in variance (e.g., exceeding a preset threshold), while the absolute value of the slope of the long-term trend assessment results is very small (e.g., much smaller than the preset slope threshold). Based on these comprehensive judgments, the system ultimately determines that the current timing fluctuation mode is perceived instability caused by transient noise. In this case, the system tends to adopt a more conservative or delayed correction strategy to avoid unnecessary frequent adjustments to transient noise, thereby maintaining the overall stability of the system. If, in a stable discharge mode, the variance of the short-term volatility assessment results remains stable, but the absolute value of the slope of the long-term trend assessment results continues to increase and exceeds the preset slope threshold, and the template matching result indicates a "linear drift mode," then the system determines that the current timing fluctuation mode is a real clock drift. In this case, the system adopts a more aggressive correction strategy to correct the persistent deviation of the local clock and ensure the accuracy of timing consensus.

[0119] Through the above technical solution, this embodiment considers the current operating mode information of the modularized capacity-bound power supply system, making the pattern recognition process more targeted and adaptable. The introduction of multi-dimensional feature extraction and template matching enables the system to capture deeper fluctuation characteristics from complex timing data, effectively distinguishing between transient noise and true clock drift—two fundamentally different timing problems. This precise recognition capability avoids over-correction or under-correction due to misjudgment, ensuring the accuracy of local clock adjustment, and thus improving the stability and reliability of the entire TCP-based hybrid CAN communication protocol synchronization method, especially in complex industrial environments like modularized capacity-bound power supply systems where high timing accuracy is required.

[0120] In some embodiments, in step S205, the local clock is progressively and adaptively adjusted according to the timing fluctuation pattern, global standard time, and CAN network correction amount, which may include, but is not limited to, the following steps:

[0121] Step S301: Obtain the current operating mode information of the capacity-distribution power supply system;

[0122] Step S302: Select a global time correction strategy from the preset correction strategy library based on the current working mode information;

[0123] Step S303: Determine the correction parameters according to the global time correction strategy. The correction parameters include the correction period, correction step size and correction threshold.

[0124] Step S304: If the timing fluctuation mode is perceived instability caused by transient noise, then the local clock is progressively and adaptively adjusted according to the global time correction strategy, global standard time, and correction parameters.

[0125] Step S305: If the timing fluctuation mode is real clock drift, then the local clock is gradually and adaptively adjusted according to the global time correction strategy, CAN network correction amount and correction parameters.

[0126] In some embodiments, simply identifying timing fluctuation patterns may be insufficient to address the differentiated timing synchronization requirements of a split-capacity power supply system under different operating modes. For example, a more aggressive calibration may be required when the system is operating in a high-precision mode, while a gentler calibration may be needed in a mode with higher stability requirements. These issues may result in insufficient versatility of clock adjustment strategies, failing to achieve optimal synchronization in all operating scenarios, and may even introduce new instabilities due to improper calibration.

[0127] To this end, the current operating mode information of the component-capacitance power supply system can be obtained first. Based on this information, a global time correction strategy can be selected from a pre-defined correction strategy library. For example, the best-matching correction scheme can be chosen from a predefined set of strategies. For instance, in modes requiring extremely high time accuracy, a more aggressive correction strategy might be selected; while in modes requiring higher stability, a more gradual correction strategy might be chosen. The pre-defined correction strategy library can contain various correction algorithms or rule sets designed for different scenarios and fluctuation patterns.

[0128] Then, based on the global time correction strategy, correction parameters are determined, including the correction period, correction step size, and correction threshold. The correction period refers to the time interval for clock adjustments, the correction step size refers to the amount of clock adjustment each time, and the correction threshold is the threshold at which correction is triggered. These parameters are determined based on the selected global time correction strategy, aiming to finely control the clock adjustment process and avoid over- or under-correction.

[0129] If the timing fluctuation pattern is perceived as instability caused by transient noise, the local clock is progressively and adaptively adjusted according to the global time correction strategy, global standard time, and correction parameters. Transient noise is usually short-lived and non-persistent, so the adjustment focuses on smoothing it out and avoiding large and frequent changes to the local clock. Fine-tuning is mainly based on the global standard time to maintain overall synchronization.

[0130] If the timing fluctuation pattern is real clock drift, the local clock is progressively and adaptively adjusted based on the global time correction strategy, CAN network correction, and correction parameters. Real clock drift is a persistent and cumulative deviation between the system clock and standard time. In this case, the adjustment needs to more actively introduce CAN network correction to correct this long-term trend and ensure that the local clock gradually returns to synchronization with the global standard time and the CAN network.

[0131] To illustrate this technical solution more clearly, a specific example is used below. Assume that a capacity-balanced power supply system is operating in "charging mode." In this mode, the system requires high precision in timing synchronization but has a certain tolerance for transient fluctuations. At this time, the system selects a global time correction strategy called "High-Precision Charging Mode Correction Strategy" from a preset correction strategy library. This strategy might specify a correction period of 500 milliseconds, a correction step size of 10 microseconds, and a correction threshold of 20 microseconds in charging mode. Furthermore, if the timing fluctuation pattern identified by the system is "perceived instability caused by transient noise," such as timestamp anomalies due to short-term network jitter, the system will perform a progressive adaptive adjustment of the local clock based on the aforementioned "High-Precision Charging Mode Correction Strategy," the global standard time, and the determined correction parameters (correction period of 500 milliseconds, correction step size of 10 microseconds, and correction threshold of 20 microseconds). In this scenario, adjustments will be relatively conservative, primarily using fine-tuning based on the global standard time to smooth out the effects of transient noise and avoid significant and frequent changes to the local clock. Conversely, if the system identifies a timing fluctuation pattern as "real clock drift," such as a long-term frequency deviation of the local crystal oscillator, the system will also follow the "high-precision charging mode correction strategy." However, in this case, it will more actively utilize CAN network correction values ​​and defined correction parameters to progressively and adaptively adjust the local clock. For example, if the CAN network correction value indicates that the local clock is consistently too fast, the system will adjust in 10-microsecond steps every 500 milliseconds until the deviation is less than 20 microseconds, thereby effectively correcting the accumulated real clock drift. In this way, this application can intelligently select and apply the most suitable clock correction strategy and parameters based on the specific operating mode and timing fluctuation pattern of the componentized power supply system, thereby achieving efficient and stable timing synchronization under different operating conditions.

[0132] Through the above technical solution, this embodiment, by considering the current operating mode information of the componentized power supply system, can dynamically adjust the clock correction strategy according to the actual operating scenario. This ensures synchronization accuracy while avoiding unnecessary aggressive correction in non-critical modes or insufficient correction in critical modes. Furthermore, this embodiment can adopt differentiated adjustment strategies for two different timing fluctuation modes: transient noise and real clock drift. This results in a smoother response to transient noise, reducing system instability, while the correction of real clock drift is more precise and timely, effectively suppressing accumulated clock errors. Therefore, this embodiment can achieve more stable, efficient, and adaptable timing consensus in complex industrial control and power management environments, thereby improving the reliability and performance of the entire system.

[0133] In some embodiments, in step S303, determining the correction parameters according to the global time correction strategy may include, but is not limited to, the following steps:

[0134] Step S401: Obtain the operating status information of the capacity-determining power supply system. The operating status information includes emergency mode switching information or fault event information.

[0135] Step S402: Select the correction period, correction step size and correction threshold from the preset correction parameter set according to the running status information.

[0136] In some embodiments, since the correction parameters are determined solely based on the global time correction strategy, it may not be sufficient to meet the clock synchronization requirements of the fractional-capacity power supply system under complex and variable operating conditions. In particular, when the system faces emergency mode switching or fault events, the static or preset correction parameters may not be able to adjust the local clock in a timely and effective manner, thereby affecting the stability and security of the system.

[0137] To this end, the operating status information of the fractional-capacity power supply system can be obtained first. This operating status information refers to the various states the fractional-capacity power supply system is in during operation, reflecting the system's health, load conditions, and potential risks. Operating status information includes emergency mode switching information and fault event information. Emergency mode switching information can include switching from normal operation mode to emergency shutdown mode, fault isolation mode, battery over-temperature protection mode, etc.; fault event information can include abnormal battery voltage, current overload, excessive temperature, communication interruption, etc. This information can be monitored and collected in real time through internal system sensors, controllers, or diagnostic modules.

[0138] Then, based on the operating status information, the system selects the correction period, correction step size, and correction threshold from a preset correction parameter set. This preset correction parameter set is a database or lookup table containing various combinations of correction periods, correction step sizes, and correction thresholds. Each set of parameters is associated with specific operating status information or operating status ranges. Once the system obtains the current operating status information, it selects the most suitable correction period, correction step size, and correction threshold from this parameter set according to preset matching rules or lookup logic. For example, in emergency mode, a shorter correction period and a larger correction step size may be needed to achieve rapid clock adjustment and ensure the system's synchronization accuracy under abnormal conditions.

[0139] To illustrate this technical solution more clearly, a specific example is used below. Assume that the capacity-balanced power supply system is in normal operating mode. Its preset calibration parameter set might include a default calibration period of 100 milliseconds, a calibration step size of 10 microseconds, and a calibration threshold of 5 microseconds. However, when the system detects an emergency mode switching message for "battery over-temperature protection," it recognizes the current operating state as emergency mode. At this time, according to preset rules, the system selects a set of calibration parameters for emergency mode from the preset calibration parameter set. For example, it adjusts the calibration period to 50 milliseconds, the calibration step size to 20 microseconds, and the calibration threshold to 2 microseconds. This adjustment allows the local clock to be calibrated faster and more accurately to meet the higher time synchronization requirements of the battery over-temperature protection mode, ensuring the accuracy of data acquisition and control commands in emergency situations. If the system detects a "communication interruption" fault event, this may indicate significant uncertainty in the CAN or TCP network. In this situation, the system may select a more conservative set of correction parameters from the preset correction parameter set. For example, the correction period may be adjusted to 200 milliseconds, the correction step size to 5 microseconds, and the correction threshold to 10 microseconds. This is to avoid making overly aggressive adjustments when the network is unstable, thereby reducing additional errors introduced by incorrect correction and ensuring a smooth transition of clock synchronization after fault recovery.

[0140] Through the above technical solution, this embodiment can dynamically adjust the clock correction parameters according to the actual operating status of the batching and capacity-testing power supply system, especially in case of emergency mode switching or fault events. This makes the gradual adaptive adjustment process of the local clock more targeted and flexible, avoiding the accumulation of synchronization errors or adjustment lags caused by improper correction parameters at critical moments. Therefore, it significantly improves the clock synchronization accuracy and stability of the system under complex operating conditions and abnormal events, effectively ensuring the data integrity and operational safety of the batching and capacity-testing power supply system. Especially in the batching and capacity-testing process where time synchronization requirements are extremely high, it can effectively reduce production risks and data errors caused by clock deviations.

[0141] In some embodiments, step S402, selecting the correction period, correction step size, and correction threshold from a preset correction parameter set based on the operating status information, may include, but is not limited to, the following steps:

[0142] Step S501: Obtain the duration of emergency mode;

[0143] Step S502: Extract emergency mode type information from the operating status information. Emergency mode type information includes emergency shutdown, fault isolation, and battery over-temperature protection.

[0144] Step S503: Update the preset calibration parameter set according to the duration of the emergency mode;

[0145] Step S504: Select the target parameter group from the updated preset calibration parameter set according to the emergency mode type information;

[0146] Step S505: Select the correction period, correction step size and correction threshold from the target parameter group.

[0147] In some embodiments, relying solely on general operational status information, such as emergency mode switching or the occurrence of a fault event, may not adequately capture the subtle differences in emergency situations. Different emergency mode types or durations may impose different requirements on clock synchronization correction strategies. If the selection of correction parameters is not refined and adaptive enough, the local clock adjustment may be ineffective in certain emergency scenarios, potentially exacerbating system instability or prolonging recovery time.

[0148] To address this, the duration of the emergency mode can be obtained first. For example, after the system enters emergency mode, the duration of this mode can be monitored and recorded. This duration can reflect the severity of the emergency or its potential impact on system stability. For instance, a longer duration of emergency mode may indicate that the system faces deeper problems and requires a more robust correction strategy.

[0149] Then, emergency mode type information is extracted from the operating status information. This information includes emergency shutdown, fault isolation, and battery over-temperature protection. Emergency shutdown typically means that the system needs rapid and significant clock adjustments to ensure data consistency or safe shutdown; fault isolation may require more fine-tuning to avoid affecting normally operating parts outside the isolation area; and battery over-temperature protection may require an adjustment strategy that balances rapid response with avoiding system oscillations.

[0150] Then, based on the duration of the emergency mode, the preset correction parameter set is updated. For example, for short-duration, transient emergencies, a smaller correction step size and a shorter correction period may be preferred to avoid overreaction; while for long-duration, severe emergencies, a larger correction step size and a longer correction period may be required to ensure that the system can stably return to a synchronized state.

[0151] Finally, based on the emergency mode type information, a target parameter set is selected from the updated preset calibration parameter set. For example, for emergency shutdown mode, a set of parameters aimed at rapid convergence might be selected; for fault isolation mode, a set of parameters aimed at smooth transition might be selected. The calibration period, calibration step size, and calibration threshold are then selected from the target parameter set. The calibration period determines the frequency of clock adjustments, the calibration step size determines the magnitude of each adjustment, and the calibration threshold defines the conditions for starting or stopping adjustments.

[0152] To illustrate this technical solution more clearly, a specific example is used below. Suppose that a capacity-balanced power supply system suddenly detects a battery over-temperature protection event during operation and enters emergency mode. The system first obtains the duration of this emergency mode. For example, if the mode duration is short (e.g., less than 5 seconds), the system may update the preset correction parameter set to favor smaller correction step sizes and shorter correction cycles for quick and minor adjustments. If the duration is long (e.g., more than 30 seconds), the parameter set may be updated to allow for larger correction step sizes and longer correction cycles to handle more severe deviations. Simultaneously, the system identifies the emergency mode type as "battery over-temperature protection." Based on this type information, the system selects a target parameter set specifically optimized for the battery over-temperature protection scenario from the parameter set updated for duration. For example, this target parameter set might include a moderate correction cycle, a moderate correction step size, and a relatively lenient correction threshold, aiming to protect the battery while smoothly adjusting the local clock to a synchronized state, avoiding instability in other systems due to overly aggressive adjustments. In this way, the local clock adjustment strategy can be precisely matched to the characteristics of the current emergency, thereby achieving more efficient and safer clock synchronization.

[0153] Through the above technical solution, this embodiment dynamically considers the duration and specific type of emergency mode, enabling the system to select more precise and personalized correction parameters. This ensures that the local clock can be progressively and adaptively adjusted in the most appropriate way during critical scenarios such as emergency shutdown, fault isolation, or battery over-temperature protection. This not only helps maintain data consistency and operational stability under abnormal conditions but also effectively avoids system oscillations or recovery delays caused by inappropriate clock correction strategies, thereby improving the reliability and safety of the entire batching and capacity-building power supply system.

[0154] In some embodiments, step S504, selecting a target parameter group from the updated preset calibration parameter set based on the emergency mode type information, may include, but is not limited to, the following steps:

[0155] Obtain the first system operating parameters, which include battery pack voltage, current, temperature, system load rate, and fault type;

[0156] Based on the operating parameters of the first system, select a parameter adjustment strategy from the preset emergency parameter adjustment rule table;

[0157] Based on the emergency mode type information and parameter adjustment strategy, a target parameter group is selected from the updated preset calibration parameter set.

[0158] In some embodiments, selecting parameter groups solely based on emergency mode type information may not fully account for the specific differences in system operating parameters under different emergency states, resulting in insufficiently refined selected correction parameters and difficulty in achieving optimal clock synchronization correction. Therefore, it is possible to first obtain first system operating parameters, which are key indicators that reflect the system's health and operating status in real time during the operation of the batching and capacity-matching power supply system. These first system operating parameters include battery pack voltage, current, temperature, system load rate, and fault type. The purpose of obtaining these parameters is to provide a comprehensive and real-time basis for selecting subsequent parameter adjustment strategies.

[0159] Then, based on the operating parameters of the first system, a parameter adjustment strategy is selected from a preset emergency parameter adjustment rule table. This preset emergency parameter adjustment rule table is a pre-configured lookup table or decision matrix that stores the mapping relationship between different combinations of first system operating parameters and corresponding parameter adjustment strategies. This rule table aims to intelligently match the most suitable parameter adjustment strategy for the current emergency situation based on the specific operating parameters of the current system. For example, when the battery pack voltage is below a certain threshold and the temperature is above a certain threshold, a specific parameter adjustment strategy may be applied.

[0160] Then, based on the emergency mode type information and parameter adjustment strategy, a target parameter group is selected from the updated preset calibration parameter set. The parameter adjustment strategy is a rule or algorithm that guides how to select the target parameter group from the updated preset calibration parameter set. This strategy can be defined as a series of conditional judgments, weight assignments, or priority rankings to accurately determine the most suitable calibration period, calibration step size, and calibration threshold given the emergency mode type information and the first system operating parameters.

[0161] To illustrate this technical solution more clearly, a specific example is used below. Assume the battery pack system is currently in emergency mode with "battery over-temperature protection." First, the system's operating parameters can be obtained, for example, the battery pack voltage is 48V, the current is 100A, the temperature is 70℃, the system load rate is 80%, and there are currently no other fault types. The system inputs these first system operating parameters into a preset emergency parameter adjustment rule table. This rule table may contain the following rules: If the battery pack temperature is between 60℃ and 75℃ and the system load rate is higher than 70%, a "moderately aggressive" parameter adjustment strategy is selected. If the battery pack temperature is higher than 75℃ or a "battery short circuit" fault type exists, a "highly conservative" parameter adjustment strategy is selected. If the battery pack temperature is between 50℃ and 60℃ and the system load rate is lower than 70%, a "mild" parameter adjustment strategy is selected.

[0162] Then, based on the currently acquired first system operating parameters (temperature 70℃, load rate 80%), the system selects a "moderately aggressive" parameter adjustment strategy from the preset emergency parameter adjustment rule table. Subsequently, combining the emergency mode type information of "battery over-temperature protection" and the "moderately aggressive" parameter adjustment strategy, the system selects a target parameter set from the updated preset calibration parameter set, which includes a moderate calibration period, a large calibration step size, and a small calibration threshold. For example, the calibration period might be set to 5 seconds, the calibration step size to 50 microseconds, and the calibration threshold to 10 microseconds. This dynamic adjustment based on real-time operating parameters allows the clock calibration process to respond more accurately to specific emergency situations, thereby maintaining optimal timing synchronization while ensuring system safety.

[0163] Through the above technical solution, this embodiment comprehensively considers the operating parameters of the first system, making the selection of calibration parameters more closely match the actual operating conditions of the system and the severity of emergency events. Therefore, it effectively avoids overcalibration or undercalibration problems caused by improper parameter selection, significantly improving the accuracy, stability, and security of clock synchronization in emergency mode. This embodiment ensures that the system maintains high-precision time consensus even in complex and changing operating environments, thereby guaranteeing the reliable operation and efficient management of the fractional-capacity power supply system.

[0164] In some embodiments, obtaining the duration of the emergency mode in step S501 may include, but is not limited to, the following steps:

[0165] Obtain historical system operating parameters and historical duration. Historical system operating parameters include battery pack voltage, current, temperature, system load rate, and fault type.

[0166] Historical system operating parameters are associated with historical durations and stored to obtain historical data records of emergency mode;

[0167] Monitor the operating parameters of the second system;

[0168] The operating parameters of the second system are matched with the historical emergency mode data records to obtain the historical emergency mode records.

[0169] The duration of the emergency mode is obtained by statistical analysis of the recorded duration of the historical emergency mode.

[0170] In some embodiments, historical system operating parameters and historical durations can be obtained first. These historical system operating parameters refer to key operating indicators recorded by the fractional-capacity power supply system under different emergency modes during past operation. Historical system operating parameters include battery pack voltage, current, temperature, system load rate, and fault type.

[0171] Then, historical system operating parameters are associated with historical durations and stored to obtain historical emergency mode data records. The purpose is to establish a comprehensive historical database for subsequent pattern recognition and duration prediction. For example, different types of data can be logically linked and stored using common identifiers or timestamps, such as in a relational database or time-series database, to achieve associated storage.

[0172] Next, the system's operating parameters are monitored. These parameters refer to the system's operational status parameters at the current moment or in the near future, and their type is consistent with historical system operating parameters. The purpose of monitoring is to obtain the latest system status in real time for comparison with historical data. Simultaneously, feature matching is performed between the second system operating parameters and historical emergency mode data records to obtain historical emergency mode records. Algorithms (such as pattern recognition algorithms, machine learning algorithms, or rule-based matching algorithms) can be used to compare features in the current system operating parameters with those in historical data records to identify the types of emergency modes the current system may be in or has been in, and their corresponding historical records. This yields historical emergency mode records, which contain information on historical events similar to the current emergency mode and their durations.

[0173] Finally, statistical analysis is performed on the durations of historical emergency mode records to obtain the emergency mode duration. Statistical analysis may include calculating statistics such as the mean, median, mode, and standard deviation, or employing more complex time-series analysis methods to obtain a reliable emergency mode duration that can represent the current emergency mode. The aim is to extract the most representative duration information from multiple similar historical events, thereby providing an accurate basis for the subsequent selection of correction parameters.

[0174] Through the above technical solution, this embodiment, by associating and storing historical system operating parameters and historical durations, and combining them with feature matching of real-time monitored second system operating parameters, can more accurately and reliably obtain the duration of the current emergency mode. This method enables the system to dynamically determine the duration of the emergency mode based on actual operating experience and the current state, rather than using a static preset value. Therefore, the obtained emergency mode duration can more accurately reflect the actual situation, providing more precise input for subsequent updates to the preset correction parameter set and selection of target parameter groups. This, in turn, improves the accuracy and robustness of the local clock's progressive adaptive adjustment, ensuring the stability and reliability of timing synchronization in emergency mode.

[0175] The beneficial effects of implementing the embodiments of the present invention include: First, the embodiments of this application acquire CAN messages with high-precision timestamps. Then, based on the CAN messages, a decentralized timing deviation calculation is performed to obtain the average timing deviation. The average timing deviation is then sent to the host computer. Based on the average timing deviation, global standard time, and TCP network transmission characteristics, the host computer calculates the CAN network correction amount. Finally, based on the global standard time, the CAN network correction amount, and the average timing deviation, the local clock is progressively and adaptively adjusted to achieve timing consensus. This allows the local clock to be adjusted by combining the timing deviation and the network correction amount to achieve communication protocol synchronization, thereby improving reliability and security.

[0176] like Figure 2 As shown, this embodiment of the invention also provides a synchronization system based on a TCP protocol and a hybrid CAN communication protocol, comprising:

[0177] The message acquisition module 601 is used to acquire CAN messages with high-precision timestamps;

[0178] The timing deviation calculation module 602 is used to perform decentralized timing deviation calculation based on CAN messages to obtain the average timing deviation.

[0179] The deviation upload module 603 is used to send the timing average deviation to the host computer, which then calculates the CAN network correction amount based on the timing average deviation, global standard time, and TCP network transmission characteristics.

[0180] The adjustment module 604 is used to progressively and adaptively adjust the local clock based on the global standard time, CAN network correction amount and average timing deviation to achieve timing consensus.

[0181] The content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0182] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

Claims

1. A synchronization method based on TCP protocol and CAN communication protocol, characterized in that, Includes the following steps: Obtain CAN messages with high-precision timestamps; Based on the CAN message, a decentralized timing deviation calculation is performed to obtain the average timing deviation; The timing average deviation is sent to the host computer, which is used to calculate the CAN network correction amount based on the timing average deviation, global standard time, and TCP network transmission characteristics. Based on the global standard time, the CAN network correction amount, and the average timing deviation, the local clock is progressively and adaptively adjusted to achieve timing consensus.

2. The method according to claim 1, characterized in that, The step of progressively adaptively adjusting the local clock based on the global standard time, the CAN network correction, and the average timing deviation includes: Obtain the deviation information between the TCP connection and the host computer's TCP connection; The time series average deviation and the deviation information are filtered for outliers to obtain time series data; The time-series data is subjected to feature evaluation processing to obtain short-term volatility evaluation results and long-term trend evaluation results; Based on the short-term volatility assessment results and the long-term trend assessment results, identify time-series volatility patterns; The local clock is progressively and adaptively adjusted based on the timing fluctuation pattern, the global standard time, and the CAN network correction.

3. The method according to claim 2, characterized in that, The process of performing feature evaluation on the time-series data to obtain short-term volatility evaluation results and long-term trend evaluation results includes: Obtain the current operating mode information of the fractionation capacity power supply system; Based on the current operating mode information, determine the length of the time window for short-term volatility assessment; Based on the current working mode information, determine the number of data points for long-term trend assessment; Based on the time window length, a short-term volatility assessment is performed on the time series data to obtain the short-term volatility assessment result; Based on the number of data points, a long-term trend assessment is performed on the time-series data to obtain the long-term trend assessment result.

4. The method according to claim 2, characterized in that, The step of identifying time-series volatility patterns based on the short-term volatility assessment results and the long-term trend assessment results includes: Obtain the current operating mode information of the fractionation capacity power supply system; Multi-dimensional features are extracted from the short-term volatility assessment results and the long-term trend assessment results to obtain multi-dimensional features; Based on the preset fluctuation pattern feature template, template matching is performed between the multi-dimensional features and the current working mode information to obtain the matching result; If the matching result is a transient noise pattern, the short-term volatility assessment result is an increase in variance, and the long-term trend assessment result is that the absolute value of the slope is less than a preset slope threshold, then the time-series volatility pattern is determined to be perceptual instability caused by transient noise. If the matching result is a linear drift pattern, the short-term volatility assessment result is variance stable, and the long-term trend assessment result is that the absolute value of the slope is greater than a preset slope threshold, then the time series volatility pattern is determined to be a real clock drift.

5. The method according to claim 2, characterized in that, The step of progressively and adaptively adjusting the local clock based on the timing fluctuation pattern, the global standard time, and the CAN network correction includes: Obtain the current operating mode information of the fractionation capacity power supply system; Based on the current working mode information, a global time correction strategy is selected from the preset correction strategy library; Based on the global time correction strategy, correction parameters are determined, including correction period, correction step size, and correction threshold. If the timing fluctuation mode is perceived instability caused by transient noise, then the local clock is progressively and adaptively adjusted according to the global time correction strategy, the global standard time, and the correction parameters. If the timing fluctuation mode is a real clock drift, then the local clock is progressively and adaptively adjusted according to the global time correction strategy, the CAN network correction amount, and the correction parameters.

6. The method according to claim 5, characterized in that, The step of determining the correction parameters according to the global time correction strategy includes: Acquire the operating status information of the batch-capacity power supply system, the operating status information including emergency mode switching information or fault event information; Based on the operating status information, the correction period, the correction step size, and the correction threshold are selected from the preset correction parameter set.

7. The method according to claim 6, characterized in that, The step of selecting the correction period, the correction step size, and the correction threshold from a preset correction parameter set based on the operating status information includes: Get the duration of Emergency Mode; Emergency mode type information is extracted from the operating status information, and the emergency mode type information includes emergency shutdown, fault isolation, and battery over-temperature protection. Update the preset correction parameter set according to the duration of the emergency mode; Based on the emergency mode type information, select a target parameter group from the updated preset correction parameter set; Select the correction period, the correction step size, and the correction threshold from the target parameter set.

8. The method according to claim 7, characterized in that, The step of selecting a target parameter group from the updated preset correction parameter set based on the emergency mode type information includes: Obtain the first system operating parameters, which include battery pack voltage, current, temperature, system load rate, and fault type; Based on the operating parameters of the first system, select a parameter adjustment strategy from the preset emergency parameter adjustment rule table; Based on the emergency mode type information and the parameter adjustment strategy, a target parameter group is selected from the updated preset correction parameter set.

9. The method according to claim 7, characterized in that, The process of obtaining the duration of emergency mode includes: Acquire historical system operating parameters and historical duration, including battery pack voltage, current, temperature, system load rate, and fault type; The historical system operating parameters are associated with the historical duration and stored to obtain historical data records of emergency mode; Monitor the operating parameters of the second system; The second system operating parameters are matched with the historical emergency mode data records to obtain historical emergency mode records. The duration of the emergency mode is obtained by statistically analyzing the duration of the historical emergency mode records.

10. A synchronization system based on TCP protocol and CAN communication protocol, characterized in that, include: The message acquisition module is used to acquire CAN messages with high-precision timestamps; The timing deviation calculation module is used to perform decentralized timing deviation calculation based on the CAN message to obtain the average timing deviation. The deviation upload module is used to send the timing average deviation to the host computer, and the host computer is used to calculate the CAN network correction amount based on the timing average deviation, global standard time, and TCP network transmission characteristics. The adjustment module is used to progressively and adaptively adjust the local clock based on the global standard time, the CAN network correction amount, and the average timing deviation, so as to achieve timing consensus.

Citation Information

Patent Citations

  • Communication circuit based on electric balance duplexer

    CN119382853A

  • Technologies to compensate for errors in time synchronization due to clock drift

    EP4178127A1