A charger communication test method, system, storage medium and program product
By constructing a timing queue and association model for charger communication messages, a test message sequence is generated, which solves the problems of low efficiency and insufficient accuracy in traditional charger communication testing, and achieves efficient and accurate communication fault detection.
Patent Information
- Application Number
- CN202411654819.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Traditional charger communication testing methods are inefficient, unable to simulate various communication scenarios in actual charging processes, and difficult to detect communication faults with memory characteristics, thus reducing the accuracy and efficiency of testing.
By continuously collecting communication messages from the charger, a message time sequence queue is constructed, the dispersion coefficient and trend change rate of the message interval sequence are calculated, a state transition matrix and correlation model are established, a test message sequence is generated, high-probability abnormal scenarios are simulated, and the communication response capability of the charger is actively verified.
It improves the accuracy and efficiency of charger communication testing, enabling proactive detection of potential communication vulnerabilities and assessment of potential risks, thus exhibiting greater foresight and targetedness.
Smart Images

Figure CN119484331B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication testing, and in particular relates to a charger communication testing method, system, storage medium and program product. Background Technology
[0002] Communication testing is a crucial step in the commissioning and maintenance of chargers, directly impacting their normal operation. Traditional charger communication testing methods typically involve manual operation, requiring operators to check each data item of the communication protocol one by one. This is not only inefficient but also prone to omissions and human error, making it difficult to guarantee the comprehensiveness and accuracy of the test. Furthermore, manual testing methods cannot simulate various communication scenarios during actual charging, leading to the discovery of potential communication problems only during actual operation.
[0003] In related technologies, a pre-programmed intelligent controller can be connected to the charger to simulate the BMS system of an electric vehicle sending standard communication messages. The built-in data analysis module collects and analyzes the charger's response data. This method uses timed polling to sequentially verify the charger's communication functions during the handshake, parameter configuration, and charging control phases, and records and stores the test results in real time, improving the automation level and efficiency of the test.
[0004] However, some communication anomalies during the charging process may require the accumulation of specific message timings to trigger, and this cumulative effect is closely related to factors such as the charger's running time and temperature changes. Traditional single-message testing methods are difficult to detect communication faults with memory characteristics, which reduces the accuracy and efficiency of the test. Summary of the Invention
[0005] This application provides a charger communication testing method, system, storage medium, and program product to improve the accuracy and efficiency of charger communication testing.
[0006] In a first aspect, this application provides a charger communication testing method to obtain the status parameters of the charger under test, including temperature data, runtime data and operating current data;
[0007] The communication messages of the charger under test are continuously collected within a preset collection period, and the communication messages are constructed into a message timing queue according to the order of receipt time.
[0008] Calculate the time interval between adjacent messages in the message timing queue and generate a message interval sequence that reflects the timing characteristics of the messages;
[0009] The dispersion coefficient of the message timing is calculated based on the message interval sequence. The dispersion coefficient characterizes the variation pattern of the message transmission time interval.
[0010] When a communication anomaly is determined to occur, the discreteness coefficient, state parameters, and communication anomaly type at the time of the anomaly are recorded. The recorded data is then input into a preset state transition matrix to obtain the correspondence between the state parameters, discreteness coefficient, and communication anomaly type. The recorded data consists of the discreteness coefficient, state parameters, and communication anomaly type at the time of the anomaly. Based on the preset state transition matrix, the probability distribution of communication anomalies under different state parameters is calculated to obtain an association model representing the triggering pattern of communication anomalies.
[0011] Test message sequences are generated based on the association model. The temporal characteristics of the test message sequences are the same as the state parameters and dispersion coefficients corresponding to high-probability abnormal scenarios with a probability greater than a preset probability threshold in the association model.
[0012] Send a sequence of test messages to the charger under test to detect its response data.
[0013] By adopting the above technical solution, communication message data is continuously collected, message timing feature parameters are extracted, and a correlation model is established between charger status parameters, message dispersion, and communication anomalies. This correlation model is then used to accurately reproduce high-probability anomaly scenarios, proactively verifying the charger's communication response capability. This allows for proactive detection of communication vulnerabilities and assessment of potential risks, demonstrating greater predictability and targetedness. Quantitative analysis of the correlation between message timing features and anomalies improves the scientific rigor and effectiveness of charger communication testing. This technical solution enhances the accuracy and efficiency of charger communication testing.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, the dispersion coefficient of the message timing is calculated based on the message interval sequence, specifically including:
[0015] Calculate the standard deviation of each time interval value in the message interval sequence to obtain the time interval fluctuation coefficient;
[0016] The trend change rate of the message interval sequence is calculated based on the moving weighted average algorithm. The trend change rate characterizes the direction and speed of change of the message interval.
[0017] By weighting and fusing the time interval fluctuation coefficient and the trend change rate, a dispersion coefficient characterizing the dispersion of message time sequence is obtained.
[0018] By adopting the above technical solution, the standard deviation of each time interval value in the message interval sequence is calculated to obtain the fluctuation coefficient. The moving weighted average algorithm is used to calculate the trend change rate to characterize the direction and speed of the time interval change. The two indicators are weighted and fused to obtain the dispersion coefficient, which realizes the multi-dimensional quantitative characterization of the message time sequence dispersion characteristics. This enables the dispersion coefficient to more comprehensively and accurately reflect the message time sequence characteristics, providing a reliable feature quantification basis for the subsequent identification and reproduction of abnormal scenarios.
[0019] In conjunction with some embodiments of the first aspect, in some embodiments, the probability distribution of communication anomalies under different state parameters is calculated based on a preset state transition matrix, specifically including:
[0020] Construct a state transition probability matrix, where the matrix elements represent the conditional probability of a communication anomaly occurring under a set of state parameters and discreteness coefficients.
[0021] Calculate the multi-step transition probability of state parameters and dispersion coefficients;
[0022] Calculate the prior probability of various communication anomalies based on historical anomaly data;
[0023] By combining multi-step transition probabilities and prior probabilities, Bayes' theorem is used to calculate the probability distribution of communication anomalies under different combinations of state parameters.
[0024] By employing the above technical solution, a state transition probability matrix is constructed, where each element represents the conditional probability of a communication anomaly occurring given state parameters and dispersion coefficients. Then, the multi-step transition probabilities of the state parameters and dispersion coefficients are calculated. Simultaneously, prior probabilities of various communication anomalies are calculated based on historical anomaly data. Finally, combining the multi-step transition probabilities and prior probabilities, Bayes' theorem is used to calculate the probability distribution of communication anomalies under different combinations of state parameters. The introduction of the transition probability matrix and Bayesian inference imbues the state transition matrix with probabilistic meaning, enabling quantitative characterization of the conditional dependencies and dynamic evolution patterns of anomaly occurrence. The calculation of multi-step transition probabilities considers the temporal correlation of state transitions, capturing the cumulative effect and path dependence characteristics of the anomaly triggering process. The utilization of prior probabilities fully draws upon the statistical regularities of historical anomaly data, improving the reliability of probability estimation. The anomaly analysis method based on probabilistic graphical models reduces the limitations of traditional rule-based and threshold-based methods, enabling a global perspective to characterize the correlation between state parameters, dispersion, and anomalies, quantifying the probability distribution of anomaly risks, thereby improving test coverage and effectiveness.
[0025] In conjunction with some embodiments of the first aspect, in some embodiments, the method further includes, before sending a sequence of test messages to the charger under test:
[0026] The test message sequence is segmented into several test segments with different timing characteristics.
[0027] Calculate the dispersion coefficient for each test segment;
[0028] Temporal feature optimization is performed on test segments that do not match the target abnormal scenario to obtain optimized test segments;
[0029] The optimized test fragments are recombined to obtain the complete test sequence.
[0030] By employing the above technical solution, the test message sequence is segmented into several test segments with different temporal characteristics. Then, the dispersion coefficient of each test segment is calculated to determine if it matches the target abnormal scenario. For mismatched test segments, temporal feature optimization is performed to obtain optimized test segments. Finally, the optimized test segments are recombined to obtain the complete test sequence. The segmentation and temporal optimization of the test sequence further improve the accuracy and effectiveness of anomaly testing. By calculating the dispersion coefficient segmented by segment, the similarity between the test segments and the target abnormal scenario can be evaluated at a finer granular level, identifying local atypical feature segments. Optimizing the temporal features of these segments, while satisfying the charging protocol constraints, maximizes their approximation to the characteristics of the abnormal scenario, reducing the deviation between test data and real abnormal data and improving the confidence level of the test.
[0031] In conjunction with some embodiments of the first aspect, in some embodiments, temporal feature optimization is performed on test segments that do not match the target abnormal scene to obtain optimized test segments, specifically including:
[0032] Calculate the deviation between the dispersion coefficient of the test segment that does not match the target abnormal scenario and the preset target value;
[0033] Construct an optimization objective function, and under the condition of satisfying the maximum and minimum time intervals specified by the charging protocol, iteratively optimize the objective function to make its value less than a preset threshold.
[0034] The optimized time interval sequence is updated to the test segment that does not match the target abnormal scenario.
[0035] By employing the above technical solution, the deviation between the dispersion coefficient of the mismatched segments and the target value is calculated, and an optimization objective function is constructed. Under the condition of meeting the time interval constraints specified by the charging protocol, an iterative optimization algorithm is used to make the objective function value less than a preset threshold, and the optimized time interval sequence is updated to the mismatched test segments. The introduction of the optimization objective function establishes a quantitative measure of the deviation between the temporal characteristics of the test segments and the characteristics of the abnormal scene, allowing the temporal characteristic optimization problem to be transformed into an extremum problem of the objective function. During the iterative optimization process, the feature gap between the test segments and the real abnormal data is continuously narrowed by dynamically adjusting the time interval sequence, ultimately making the optimized test segments highly fit the abnormal scene in terms of temporal characteristics. The time interval constraints conforming to the charging protocol are applied during the optimization process, improving the feasibility and effectiveness of the optimization results. By updating the original test segments with the optimized time interval sequence, targeted adjustments can be made to the detailed features of the test sequence locally, reducing the overfitting problem that may be caused by global optimization and improving the quality and reliability of the test samples.
[0036] In conjunction with some embodiments of the first aspect, in some embodiments, the objective function is optimized as follows:
[0037] J=α×|S c -S t |+β×|V c -V t |+γ×|T c -T t |
[0038] In the function, J is the objective function, α, β, and γ are weight coefficients that satisfy α + β + γ = 1, and S c S represents the current dispersion coefficient. t V is the target dispersion coefficient. c V represents the current volatility coefficient. t T is the target volatility coefficient. c T represents the rate of change of the current trend. t The target trend change rate.
[0039] By adopting the above technical solution, the objective function measures the deviation of the test segment from the abnormal scenario in terms of temporal characteristics from three aspects: dispersion coefficient, fluctuation coefficient, and trend change rate. The three deviation indicators are integrated into a single scalar optimization objective through weighted summation. Introducing multiple feature deviation terms provides a comprehensive characterization and multi-dimensional evaluation of the temporal characteristics of the test segment, reducing the potential bias of evaluation caused by a single indicator and improving the accuracy and reliability of temporal feature optimization.
[0040] In conjunction with some embodiments of the first aspect, in some embodiments, after recombining the optimized test fragments to obtain a complete test sequence, the method further includes:
[0041] Construct a digital fingerprint of the complete test sequence and store the digital fingerprint in a preset database. The digital fingerprint contains the timing characteristics and state parameter information of the complete test sequence.
[0042] Establish a database mapping complete test sequences to communication anomalies;
[0043] When a new communication anomaly is detected, the feature information of the new anomaly scenario is extracted, and the feature information is matched with each digital fingerprint in the mapping relationship database;
[0044] If no matching digital fingerprint is found, the new digital fingerprint corresponding to the new abnormal scenario is stored in the preset database, and the mapping relationship corresponding to the new communication abnormality is stored in the mapping relationship database.
[0045] By adopting the above technical solutions, a digital fingerprint of the complete test sequence is constructed, condensing key information such as the temporal characteristics and state parameters of the test sequence into a digital feature vector, forming a refined representation of the test sample. Storing the digital fingerprint in a pre-set feature database enables efficient management and rapid retrieval of test sequences, facilitating subsequent test sequence comparison and reuse. A mapping database between complete test sequences and communication anomalies is established, constructing an association model between test samples and anomaly types. This allows testers to quickly locate and select the corresponding test sequence based on the anomaly type, improving the targeting and efficiency of anomaly testing. The introduction of a digital fingerprint comparison mechanism allows for the extraction of feature information from new anomaly scenarios and matching it with existing digital fingerprints to quickly determine whether the anomaly is of a known type. For unknown anomalies, features can be extracted to construct new digital fingerprints and stored in the feature database, continuously enriching and improving the anomaly feature library. This improves testing efficiency, enables the continuous accumulation of testing experience in anomaly scenarios, and enhances the intelligence and practicality of the testing system.
[0046] Secondly, embodiments of this application provide a charger communication testing system, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the system to perform the method described in the first aspect and any possible implementation thereof.
[0047] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a system, cause the system to perform the method described in the first aspect and any possible implementation thereof.
[0048] Fourthly, embodiments of this application provide a computer program product, characterized in that, when the computer program product is run on a system, it causes the system to execute the method described in any possible implementation of the first aspect.
[0049] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0050] 1. This application provides a charger communication testing method that continuously collects communication message data, extracts message timing characteristic parameters, establishes a correlation model between charger status parameters, message dispersion, and communication anomalies, and uses this correlation model to accurately reproduce high-probability anomaly scenarios, proactively verifying the charger's communication response capability. This method can proactively identify communication vulnerabilities and assess potential risks, exhibiting stronger predictability and targetedness. By quantitatively analyzing the correlation between message timing characteristics and anomalies, the scientific rigor and effectiveness of charger communication testing are improved. This technical solution enhances the accuracy and efficiency of charger communication testing.
[0051] 2. This application provides a charger communication testing method. The method involves segmenting the test message sequence into several test segments with different timing characteristics. Then, the dispersion coefficient of each test segment is calculated to determine if it matches a target abnormal scenario. For mismatched test segments, timing feature optimization is performed to obtain optimized test segments. Finally, the optimized test segments are recombined to obtain a complete test sequence. The segmentation and timing optimization of the test sequence further improve the accuracy and effectiveness of abnormal testing. By calculating the dispersion coefficient segmented by segment, the similarity between the test segments and the target abnormal scenario can be evaluated at a finer granular level, identifying local atypical feature segments. Optimizing the timing features of these segments, while satisfying charging protocol constraints, maximizes their approximation to the characteristics of the abnormal scenario, reducing the deviation between test data and real abnormal data and improving the confidence level of the test.
[0052] 3. This application provides a charger communication testing method. It calculates the deviation between the dispersion coefficient of mismatched segments and a target value, constructs an optimization objective function, and, under the condition of satisfying the time interval constraints specified in the charging protocol, uses an iterative optimization algorithm to make the objective function value less than a preset threshold. The optimized time interval sequence is then updated to the mismatched test segments. The introduction of the optimization objective function establishes a quantitative measure of the deviation between the temporal characteristics of the test segments and the characteristics of abnormal scenarios, allowing the temporal characteristic optimization problem to be transformed into an extremum problem of the objective function. During the iterative optimization process, the feature gap between the test segments and real abnormal data is continuously reduced by dynamically adjusting the time interval sequence, ultimately making the optimized test segments highly fit the abnormal scenarios in terms of temporal characteristics. The time interval constraints conforming to the charging protocol are applied during the optimization process, improving the feasibility and effectiveness of the optimization results. By updating the original test segments with the optimized time interval sequence, targeted adjustments can be made to the detailed features of the test sequence locally, reducing the overfitting problem that may be caused by global optimization and improving the quality and reliability of the test samples. Attached Figure Description
[0053] Figure 1 This is a flowchart illustrating a charger communication testing method in an embodiment of this application.
[0054] Figure 2 This is another flowchart illustrating a charger communication testing method in an embodiment of this application.
[0055] Figure 3 This is a schematic diagram of the physical device structure of a charger communication testing system provided in an embodiment of this application. Detailed Implementation
[0056] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0057] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0058] The following example is used in conjunction with Figure 1 The present application describes a charger communication testing method according to an embodiment of the present application:
[0059] Please see Figure 1 This is a flowchart illustrating a charger communication testing method in an embodiment of this application.
[0060] S101. Obtain the status parameters of the charger under test, continuously collect the communication messages of the charger under test within the preset collection period, and construct a message timing queue according to the order of the receiving time of the communication messages.
[0061] The system acquires the status parameters of the charger under test, including temperature data, runtime data, and operating current data. It continuously acquires the communication messages of the charger under test within a preset acquisition period and constructs a message timing queue according to the order of reception time.
[0062] The system acquires the status parameters of the charger under test, including temperature data, runtime data, and operating current data. Temperature data can be collected by temperature sensors installed inside or outside the charger to monitor temperature changes in key components. Runtime data is obtained by recording the charger's startup time and cumulative operating time, used to assess the charger's lifespan and reliability. Operating current data is obtained by real-time monitoring of the charger's output current through a current sampling circuit, used to determine the charger's load status and operational stability. In addition to these three types of status parameters, the system can also acquire other parameters reflecting the charger's operating status, such as output voltage, battery level, and fault codes, to achieve comprehensive monitoring of the charger's status.
[0063] Within a preset acquisition period, the system continuously acquires communication messages from the charger under test. The acquisition period can be set according to the characteristics of the charger's communication protocol and testing requirements, ensuring that the acquisition's temporal resolution meets the accuracy requirements for anomaly detection while also considering the efficiency of data storage and processing. Communication message acquisition can be achieved by connecting a signal acquisition device in parallel to the charger's communication line. This device converts the communication messages into digital signals and records the received timestamps, forming the original message data stream. Furthermore, for different types of charger communication interfaces, such as CAN and RS485, the system can select appropriate communication adapters and parsing software to support compatible access and unified management of various chargers.
[0064] The system constructs a message time-series queue based on the received communication messages in chronological order. Specifically, a first-in, first-out (FIFO) data buffer can be created, and received messages and their timestamps are sequentially pushed into the queue, forming a message sequence arranged in chronological order. To facilitate subsequent time-series feature analysis, the system can preprocess the message queue, such as filtering invalid messages and correcting time drift, to improve data quality. Furthermore, considering that the charger's communication behavior may differ under different operating conditions, the system can also segment the message queue based on changes in state parameters, generating sub-queues corresponding to specific operating conditions, thus supporting fine-grained anomaly detection.
[0065] S102. Calculate the time interval between adjacent messages in the message timing queue and generate a message interval sequence that reflects the message timing characteristics.
[0066] The system calculates the time interval between adjacent messages in the message timing queue, generating a message interval sequence that reflects the message timing characteristics. Specifically, it iterates through each message in the message queue, subtracts its received timestamp from the timestamp of the previous message to obtain the time interval between adjacent messages, and stores all interval values sequentially to form the message interval sequence. The message interval sequence intuitively reflects the transmission frequency and time distribution characteristics of communication messages and is an important indicator for evaluating message timing characteristics.
[0067] To fully uncover the inherent patterns in message timing, the system can perform statistical analysis on message interval sequences, calculating a series of indicators reflecting timing characteristics, such as mean, variance, and median, to characterize the central tendency and dispersion of message time distribution. Furthermore, considering that communication anomalies may cause abrupt or gradual changes in message intervals, the system can also employ a sliding window method for local analysis of the interval sequence, tracking dynamic changes in intervals in real time and promptly detecting abnormal fluctuations. Simultaneously, the normal range of message intervals may differ for different types of chargers and communication protocols. The system can set interval thresholds based on historical data or expert experience, marking intervals exceeding the threshold as abnormal, providing a basis for anomaly detection.
[0068] S103. Calculate the dispersion coefficient of the message timing based on the message interval sequence;
[0069] The dispersion coefficient of the message timing is calculated based on the message interval sequence. The dispersion coefficient characterizes the variation law of the message transmission time interval. Specifically, the standard deviation of each time interval value in the message interval sequence is calculated to obtain the time interval fluctuation coefficient; the trend change rate of the message interval sequence is calculated based on the moving weighted average algorithm. The trend change rate characterizes the direction and speed of change of the message time interval.
[0070] By weighting and fusing the time interval fluctuation coefficient and the trend change rate, a dispersion coefficient characterizing the dispersion of message time sequence is obtained.
[0071] The system calculates the standard deviation of each time interval value in the message interval sequence to obtain the time interval fluctuation coefficient. Standard deviation is a commonly used indicator reflecting the degree of data dispersion; a larger fluctuation coefficient indicates more drastic fluctuations in the message intervals and less stable communication. By tracking the changing trend of the fluctuation coefficient, the quality of communication can be judged, providing a basis for anomaly early warning.
[0072] The system calculates the trend rate of change of the message interval sequence based on a moving weighted average algorithm. The trend rate of change characterizes the direction and speed of change of the message intervals. Specifically, a sliding window of a certain length can be selected, and the interval values within the window are weighted and averaged. The weights are adjusted based on the distance from the current time, resulting in a smoothed interval curve. The curve is then differentially calculated to obtain the trend rate of change. By analyzing the sign and magnitude of the rate of change, it is possible to determine whether the interval is increasing or decreasing, and whether the change is slow or rapid, thereby inferring whether there are any abnormal risks in the communication.
[0073] The system weights and fuses the time interval fluctuation coefficient and the trend change rate to obtain a dispersion coefficient that comprehensively reflects the dispersion of message timing. During the fusion process, the weight ratio of the two indicators can be dynamically adjusted according to their importance and sensitivity. For example, the weight of the fluctuation coefficient is increased when volatility is high, and the weight of the trend change rate is increased when changes are rapid, so that the dispersion coefficient can more accurately reflect the communication status. Simultaneously, the system can set a threshold or reference range for the dispersion coefficient. When the dispersion coefficient exceeds the normal range, an anomaly alarm is triggered promptly, prompting relevant personnel to conduct diagnosis and handling.
[0074] S104. When it is determined that a communication anomaly has occurred, record the dispersion coefficient, state parameters and communication anomaly type at the time of the anomaly. Input the recorded data into a preset state transition matrix to obtain the correspondence between state parameters, dispersion coefficient and communication anomaly type.
[0075] When a communication anomaly is detected, the system records the dispersion coefficient, state parameters, and communication anomaly type at the time of the anomaly. The recorded data is then input into a preset state transition matrix to obtain the correspondence between the state parameters, the dispersion coefficient, and the communication anomaly type. The recorded data consists of the dispersion coefficient, state parameters, and communication anomaly type at the time of the anomaly.
[0076] When a communication anomaly is detected, the system records the dispersion coefficient, state parameters, and anomaly type at the time of the anomaly. The determination of a communication anomaly can be based on preset anomaly detection rules, such as message intervals exceeding thresholds or dispersion coefficients exceeding control limits. When the anomaly triggering conditions are met, the system automatically marks the time of the anomaly and collects various parameter indicators at that time. The dispersion coefficient reflects the dispersion of the communication message timing at the time of the anomaly; state parameters such as temperature and current reflect the charger's operating state at the time of the anomaly; and the communication anomaly type describes the manifestation of the anomaly, such as message loss or malformed messages. By recording these three types of key information, the scenario of the communication anomaly can be fully described, providing data support for anomaly mechanism analysis.
[0077] The system inputs recorded anomaly data into a pre-defined state transition matrix and obtains the correspondence between state parameters, dispersion coefficients, and communication anomaly types through table lookup. The state transition matrix is a multi-dimensional data structure that pre-stores the anomaly probability distribution under various state combinations, reflecting the correlation between charger state changes and communication anomalies. Matching the input anomaly data quickly identifies the most likely anomaly type for the current state, avoiding the high time overhead of traversal searches and improving anomaly diagnosis efficiency. Simultaneously, the matching results verify the effectiveness of the state transition matrix, providing new samples for dynamic matrix optimization.
[0078] S105. Calculate the probability distribution of communication anomalies under different state parameters based on the preset state transition matrix to obtain an association model representing the triggering pattern of communication anomalies.
[0079] The system calculates the probability distribution of communication anomalies under different state parameters based on the preset state transition matrix, and obtains an association model representing the triggering pattern of communication anomalies. Specifically, it constructs a state transition probability matrix, where the matrix elements represent the conditional probability of communication anomalies occurring under a set of state parameters and discreteness coefficients.
[0080] Calculate the multi-step transition probability of state parameters and dispersion coefficients;
[0081] Calculate the prior probability of various communication anomalies based on historical anomaly data;
[0082] By combining multi-step transition probabilities and prior probabilities, Bayes' theorem is used to calculate the probability distribution of communication anomalies under different combinations of state parameters.
[0083] The system constructs a state transition probability matrix. The rows and columns of the matrix correspond to combinations of various state parameters and dispersion coefficients of the charger, respectively, and the matrix elements represent the probability of transitioning from one state combination to another. These transition probabilities can be obtained through statistical analysis of a large amount of historical operating data, reflecting the general laws of charger state evolution. During the construction process, the system can employ data mining algorithms, such as association rule mining and time series pattern mining, to automatically extract state transition patterns from massive heterogeneous data, overcoming the limitations of manual summarization and comprehensively revealing the temporal correlations of charger behavior.
[0084] The system is based on a Markov chain model, calculating the multi-step transition probabilities of state parameters and dispersion coefficients. Since state transitions are time-dependent, the current state depends not only on the state at the previous moment but also on the sequence of previous states. The multi-step transition probability characterizes the likelihood of reaching the current state from the initial state through multiple transitions, comprehensively considering the historical trajectory of state evolution. The system can employ a dynamic programming algorithm, iteratively calculating the powers of the state transition matrix to efficiently solve for the multi-step transition probabilities, avoiding the state space explosion problem. Furthermore, the system can introduce a time-varying Markov model to consider the changes in the state transition mechanism itself over time, dynamically updating the transition probability matrix and improving the adaptability of the prediction.
[0085] The system calculates the prior probability of various communication anomalies based on historical anomaly data. The prior probability reflects the frequency of occurrence of different anomaly types and is crucial prior knowledge for anomaly inference. The system can perform statistical analysis on anomaly logs and alarm records to obtain the occurrence frequency and proportion of various anomalies, and correct the probability values using methods such as maximum likelihood estimation to improve the reliability of the prior probability.
[0086] S106. Generate a test message sequence based on the correlation model;
[0087] The system generates test message sequences based on the association model. The temporal characteristics of the test message sequences are the same as the state parameters and dispersion coefficients corresponding to high-probability abnormal scenarios with a probability greater than a preset probability threshold in the association model.
[0088] The system generates test message sequences based on an association model. The temporal characteristics of these test message sequences are identical to the state parameters and dispersion coefficients corresponding to high-probability anomaly scenarios with a probability greater than a preset probability threshold in the association model. The association model characterizes the probabilistic mapping relationship between charger state changes and communication anomalies. High-probability anomaly scenarios in the model reflect communication problems that are more easily triggered by the charger under specific states, and are the key focus of anomaly testing. Therefore, the system prioritizes high-probability anomaly scenarios, extracting their corresponding state parameters and dispersion coefficients as reference indicators for generating test messages. By designing message sequences with the same temporal characteristics, the system constructs test samples most likely to cause anomalies, thereby achieving targeted anomaly testing.
[0089] The generation of test messages needs to satisfy constraints in two dimensions: state parameters and dispersion coefficient. For state parameters, the system sets the data content of corresponding fields in the message based on parameter values in abnormal scenarios, such as temperature and current, to simulate the communication behavior of the charger in that state. As for the dispersion coefficient, the system controls the distribution of the time intervals of the generated messages to make its statistical characteristics consistent with the dispersion coefficient in abnormal scenarios. For example, by adjusting the frequency and randomness of message transmission, fluctuations and trends that conform to the target dispersion are introduced.
[0090] S107. Send a test message sequence to the charger under test to detect the response data of the charger under test.
[0091] The system sends a sequence of test messages to the charger under test. By detecting the charger's response data to the test messages, it evaluates its communication performance and anti-interference capability under abnormal scenarios. Specifically, the system establishes a connection with the charger using a communication interface and sends test messages to the charger according to the generated test message sequence and a predetermined timing pattern. Simultaneously, the system monitors the charger's response messages in real time, recording key data such as the response time and content for subsequent anomaly analysis.
[0092] During the transmission of test messages, the system can take a series of measures to improve the effectiveness and reliability of the test. For example, the system can select a suitable communication adapter and transmission method based on the charger's communication protocol and interface type to ensure that the test messages are accurately transmitted to the charger. Simultaneously, to simulate the complexity of the actual communication environment, the system can introduce artificial interference factors, such as signal attenuation and electromagnetic interference, to examine the charger's communication stability under harsh conditions. Furthermore, considering that the charger's response may have a certain degree of randomness and delay, the system needs to set reasonable time tolerance and retry mechanisms when judging abnormal responses to avoid false alarms due to accidental factors.
[0093] In the above embodiments, communication message data is continuously collected, message timing feature parameters are extracted, and a correlation model is established between charger status parameters, message dispersion, and communication anomalies. This correlation model is then used to accurately reproduce high-probability anomaly scenarios, proactively verifying the charger's communication response capability. This allows for proactive detection of communication vulnerabilities and assessment of potential risks, demonstrating greater predictability and targetedness. By quantitatively analyzing the correlation between message timing features and anomalies, the scientific rigor and effectiveness of charger communication testing are improved. This technical solution enhances the accuracy and efficiency of charger communication testing.
[0094] The above embodiments provide a charger communication testing method based on a state transition matrix and an association model. To further improve the accuracy and effectiveness of the test sequence, another charger communication testing method is introduced below. This method, after generating the test message sequence, refines the test sequence through segmentation optimization and digital fingerprint feature matching, and establishes a mapping database between abnormal scenarios and test sequences to achieve the accumulation and reuse of test experience. The following section combines... Figure 2 Another charger communication testing method in the embodiments of this application is described below:
[0095] Please see Figure 2 This is another flowchart illustrating a charger communication testing method in an embodiment of this application.
[0096] S201. The test message sequence is segmented into several test segments with different timing characteristics.
[0097] The system can employ various methods to segment the test message sequence. One feasible approach is to first preprocess the test message sequence, including noise removal and normalization, and then divide it into multiple consecutive time windows based on the timestamp information. Next, the system extracts features from the message sequence within each time window to obtain a temporal feature vector. These temporal features can include message transmission frequency, message length distribution, and message type distribution. Finally, the system uses clustering algorithms (such as K-means, DBSCAN, etc.) to merge time windows with similar temporal features, forming several test segments. Each test segment represents the communication behavior pattern of the test message sequence over a period of time.
[0098] Furthermore, the system can utilize deep learning models to automatically learn the temporal features of test message sequences and segment the message sequences based on the learned feature representations. For example, the system can use an attention-based sequence-to-sequence model (such as the Transformer) to encode the entire message sequence, and then perform clustering in the encoded feature space to obtain different test segments. This method can adaptively capture complex temporal patterns in message sequences without requiring manual feature design.
[0099] S202. Calculate the dispersion coefficient of each test segment, and optimize the temporal features of test segments that do not match the target abnormal scene to obtain optimized test segments.
[0100] The system calculates the dispersion coefficient of each test segment, performs temporal feature optimization on test segments that do not match the target abnormal scenario, and obtains optimized test segments. Specifically, it calculates the deviation between the dispersion coefficient of the test segment that does not match the target abnormal scenario and the preset target value.
[0101] Construct an optimization objective function, and under the condition of satisfying the maximum and minimum time intervals specified by the charging protocol, iteratively optimize the objective function to make its value less than a preset threshold.
[0102] The optimized time interval sequence is updated to the test segment that does not match the target abnormal scenario.
[0103] The objective function is:
[0104] J=α×|S c -S t |+β×|V c -V t |+γ×|T c -T t |
[0105] In the function, J is the objective function, α, β, and γ are weight coefficients that satisfy α + β + γ = 1, and S c S represents the current dispersion coefficient. t V is the target dispersion coefficient. c V represents the current volatility coefficient. t T is the target volatility coefficient. c T represents the rate of change of the current trend. t The target trend change rate.
[0106] After obtaining the test segments, the system needs to evaluate the degree of matching between each segment and the target abnormal scenario, and optimize the segments that do not match. The dispersion coefficient is an important evaluation metric used to measure the dispersion of the message transmission time intervals within the test segments. Higher dispersion indicates a more uneven distribution of message transmission time within the segment, making it more likely to trigger certain types of anomalies. The system can use statistical measures such as variance and standard deviation to calculate the dispersion coefficient.
[0107] For test segments where the dispersion coefficient deviates significantly from a preset threshold, the system can optimize their temporal characteristics to more closely approximate the target abnormal scenario. Specifically, the system first establishes an optimization objective function, which comprehensively considers multiple factors such as the dispersion, volatility, and trend changes of the test segment, and sets corresponding weight coefficients. Then, guided by the optimization objective function, the system searches for the optimal message transmission time interval sequence within the time interval allowed by the charging protocol using iterative optimization algorithms (such as gradient descent, evolutionary algorithms, etc.), ensuring that the value of the optimization objective function is lower than the preset threshold. Finally, the system updates the original test segment with the optimized time interval sequence, resulting in the optimized test segment.
[0108] S203. Recombine the optimized test segments to obtain the complete test sequence;
[0109] After obtaining the optimized test fragments, the system needs to recombine these fragments to generate a complete test sequence. The key here is to ensure that the recombined test sequence is semantically coherent while preserving the optimized temporal characteristics. To this end, the system can employ a heuristic search algorithm to explore the optimal fragment combination method.
[0110] Specifically, the system can model the fragment combination problem as a search problem of a directed acyclic graph (DAG). Each node in the graph represents a test fragment, and directed edges represent the order relationship between two fragments. The goal of the system is to find a path from the start node to the end node in the graph, such that the fragments on the path can be arranged in sequence to form a semantically coherent complete test sequence. Simultaneously, the system also needs to consider optimized temporal characteristics, striving to maintain a smooth transition in time intervals between adjacent fragments and avoiding the introduction of new anomalies.
[0111] When searching for the optimal path, the system can employ algorithms such as breadth-first search or a reinforcement learning-based search strategy. During the search process, the system evaluates the quality of the current path using an evaluation function that comprehensively considers multiple factors, including semantic coherence and temporal smoothness. Furthermore, the system can leverage domain knowledge to guide the search, such as constraining the combination order of segments based on the transition rules of the protocol state machine.
[0112] Through intelligent search algorithms, the system can ultimately obtain one or more high-quality complete test sequences. These sequences are not only semantically coherent but also inherit optimized temporal characteristics, effectively covering target anomaly scenarios. The generated complete test sequences can be directly used for actual charger testing, or they can be further manually reviewed and adjusted to meet specific testing needs.
[0113] S204. Construct a digital fingerprint of the complete test sequence and store the digital fingerprint in a preset database;
[0114] The system constructs a digital fingerprint of the complete test sequence and stores the digital fingerprint in a preset database. The digital fingerprint contains the timing characteristics and state parameter information of the complete test sequence.
[0115] After generating a complete test sequence, the system also needs to construct a unique digital fingerprint for each test sequence and store it in a pre-set database for subsequent rapid retrieval and comparison. A digital fingerprint is a compact representation of a test sequence that can accommodate key feature information of the sequence, such as temporal characteristics and state parameters.
[0116] A common method for constructing digital fingerprints is using hash algorithms. The system extracts key feature information from the test sequence and then maps it to a fixed-length hash value using a hash function (such as MD5, SHA-256, etc.), which serves as the digital fingerprint of the test sequence. Hash algorithms ensure that different test sequences map to different digital fingerprints and also have good collision resistance, minimizing the possibility of different sequences mapping to the same fingerprint.
[0117] Besides hash algorithms, the system can also employ other fingerprint construction methods, such as Euclidean distance metrics based on feature vectors and edit distance metrics based on sequence patterns. These methods generate digital fingerprints by measuring the similarity between test sequences, thus better reflecting the semantic features of the sequences. The system can select the appropriate fingerprint construction method based on specific needs.
[0118] After constructing the digital fingerprint, the system stores it in a pre-defined database and establishes a mapping relationship with the corresponding complete test sequence. For storage, the system can use different database types such as relational databases (e.g., MySQL), NoSQL databases (e.g., MongoDB), or a distributed storage system (e.g., HDFS) to support the storage and management of massive test sequences.
[0119] S205. Establish a database mapping complete test sequences to communication anomalies;
[0120] After constructing the digital fingerprints of the complete test sequences, the system also needs to establish a mapping relationship between the test sequences and potential communication anomalies, and store the mapping relationship in a dedicated database. This mapping database records information such as the anomaly type, anomaly description, and anomaly severity that each test sequence may trigger, providing an important basis for subsequent anomaly detection and diagnosis.
[0121] Establishing mapping relationships requires full utilization of historical test data and expert experience. The system can mine and analyze historical test records to identify the actual anomalies triggered by each test sequence and associate them with the digital fingerprint of the test sequence. For newly generated test sequences, the system can infer the types of anomalies they may trigger using expert experience and heuristic rules, and add them to the mapping relationship. As testing continues, the system can also dynamically update and optimize the mapping relationship through a feedback mechanism, continuously improving the accuracy and completeness of the mapping.
[0122] When storing mapping relationships, the system can adopt a relational database table structure, using the numerical fingerprint of the test sequence as the primary key and anomaly type and description as attribute fields. To support flexible querying and analysis, the system can also create multiple indexes in the database, such as indexes by anomaly type or by severity. Furthermore, for some complex anomalies, the system can organize them into an anomaly case library, stored separately from the mapping relationship database, to provide richer diagnostic information.
[0123] After constructing the mapping database, the system can quickly retrieve relevant test sequences based on newly detected anomalies, and then analyze the causes and impacts of the anomalies. Simultaneously, the mapping database provides a basis for optimizing test sequences, allowing the system to adjust test sequences to cover more anomaly scenarios. In the long run, the establishment and maintenance of the mapping database can significantly improve the intelligence level of charger communication testing, enabling the accumulation and reuse of testing experience, reducing testing costs, and improving testing efficiency.
[0124] S206. When a new communication anomaly is detected, extract the feature information of the new anomaly scenario and match the feature information with each digital fingerprint in the mapping relationship database;
[0125] During the actual operation of the charger, the system monitors the communication status in real time, recording various raw communication data and logs. When a potential communication anomaly is detected, the system needs to respond promptly, diagnose the cause of the anomaly, and provide corresponding handling measures. At this point, the system needs to utilize its mapping database to quickly identify test sequences related to the anomaly, providing a reference for anomaly analysis.
[0126] Specifically, when a new communication anomaly is detected, the system first needs to extract the characteristic information of the anomaly scenario. The characteristics of the anomaly scenario can include the time of occurrence, duration of the anomaly, anomaly manifestations (such as message delay, packet loss, etc.), and state parameters during the anomaly (such as voltage, current, etc.). The system can automatically extract these characteristics from raw communication data and logs, or they can be manually entered by experts based on experience.
[0127] After extracting the feature information of the abnormal scene, the system matches it with each digital fingerprint in the mapping relation database. The matching process essentially involves calculating the similarity between the abnormal features and the digital fingerprint, identifying the most similar test sequences. Similarity can be calculated using various metrics, such as Euclidean distance, cosine similarity, and KL divergence, or by using machine learning models to learn the matching function. During matching, the system can also comprehensively consider factors such as the trigger probability and severity of the anomaly of the test sequence to rank and filter candidate sequences.
[0128] S207. If it is determined that no matching digital fingerprint is found, the new digital fingerprint corresponding to the new abnormal scenario is stored in the preset database, and the mapping relationship corresponding to the new communication abnormality is stored in the mapping relationship database.
[0129] During anomaly detection and diagnosis, some entirely new anomaly scenarios may be encountered, whose characteristics cannot be well matched with existing fingerprints in the mapping database. In such cases, the system needs to be able to identify new anomalies and record them in the database, continuously accumulating and expanding the anomaly detection knowledge base to improve the system's adaptability and intelligence.
[0130] Specifically, when the system determines that an abnormal scenario cannot be matched with an existing digital fingerprint, it first needs to analyze and summarize the abnormal scenario, extract its key features, and construct a new digital fingerprint. The process of constructing the new fingerprint is similar to the methods mentioned earlier, and can use hash algorithms, feature vectors, etc., to generate a compact fingerprint representation. When generating a new fingerprint, the system can also refer to expert analysis opinions, combining human and machine input to improve the quality and interpretability of the fingerprint.
[0131] After constructing a new fingerprint, the system stores it in the fingerprint database, managing it alongside existing fingerprints. During storage, the system records metadata such as the new fingerprint's generation time, generation method, and responsible person, for later traceability and optimization. Simultaneously, the system establishes a mapping relationship between the new fingerprint and its corresponding anomaly scenario, adding this mapping relationship to the mapping relationship database. When adding mapping relationships, the system can fully utilize expert diagnostic results, recording rich semantic information such as anomaly type, cause, and handling measures for reference during subsequent anomaly analysis.
[0132] In the above embodiments, the test message sequence is segmented into several test segments with different temporal characteristics. Then, the dispersion coefficient of each test segment is calculated to determine whether it matches the target abnormal scenario. For mismatched test segments, temporal feature optimization is performed to obtain optimized test segments. Finally, the optimized test segments are recombined to obtain the complete test sequence. The segmentation and temporal optimization of the test sequence can further improve the accuracy and effectiveness of anomaly testing. By calculating the dispersion coefficient segmented by segment, the similarity between the test segments and the target abnormal scenario can be evaluated at a finer granular level, identifying local atypical feature segments. Optimizing the temporal features of these segments, while satisfying the charging protocol constraints, maximizes their approximation to the characteristics of the abnormal scenario, reducing the deviation between test data and real abnormal data and improving the confidence level of the test.
[0133] The system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 3 This is a schematic diagram of the physical device structure of a charger communication testing system provided in an embodiment of this application.
[0134] It should be noted that, Figure 3 The structure of the system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0135] like Figure 3 As shown, the system includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on a program stored in Read-Only Memory (ROM) 302 or a program loaded from storage portion 308 into Random Access Memory (RAM) 303. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.
[0136] The following components are connected to I / O interface 305: input section 306 including a camera, infrared sensor, etc.; output section 307 including a liquid crystal display (LCD) and speakers, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.
[0137] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.
[0138] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. The transmitted data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0140] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the system described in the above embodiments; or it may exist independently and not assembled into the system. The storage medium carries one or more computer programs that, when executed by a processor of a system, cause the system to implement the methods provided in the above embodiments.
[0141] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0142] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0143] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0144] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A charger communication testing method, characterized in that, include: Obtain the status parameters of the charger under test, including temperature data, runtime data, and operating current data; The communication messages of the charger under test are continuously collected within a preset collection period, and the communication messages are constructed into a message timing queue according to the order of receipt time. Calculate the time interval between adjacent messages in the message timing queue to generate a message interval sequence that reflects the message timing characteristics; The dispersion coefficient of the message timing is calculated based on the message interval sequence, and the dispersion coefficient characterizes the variation pattern of the message transmission time interval; When a communication anomaly is determined to occur, the discreteness coefficient, state parameters, and communication anomaly type at the time of the anomaly are recorded, and the recorded data is input into a preset state transition matrix to obtain the correspondence between the state parameters, the discreteness coefficient, and the communication anomaly type. The recorded data are the discreteness coefficient, state parameters, and communication anomaly type at the time of the anomaly. The probability distribution of the communication anomaly under different state parameters is calculated based on the preset state transition matrix to obtain an association model representing the triggering pattern of the communication anomaly. A test message sequence is generated based on the association model. The temporal characteristics of the test message sequence are the same as the state parameters and dispersion coefficients corresponding to high-probability abnormal scenarios with a probability greater than a preset probability threshold in the association model. The test message sequence is sent to the charger under test to detect the response data of the charger under test.
2. The method according to claim 1, characterized in that, The step of calculating the dispersion coefficient of the message timing based on the message interval sequence specifically includes: Calculate the standard deviation of each time interval value in the message interval sequence to obtain the time interval fluctuation coefficient; The trend change rate of the message interval sequence is calculated based on the moving weighted average algorithm, and the trend change rate characterizes the direction and speed of change of the message time interval. The time interval fluctuation coefficient and the trend change rate are weighted and fused to obtain the dispersion coefficient, which characterizes the dispersion of message timing.
3. The method according to claim 1, characterized in that, The step of calculating the probability distribution of communication anomalies under different state parameters based on a preset state transition matrix specifically includes: Construct a state transition probability matrix, wherein the matrix elements in the state transition probability matrix represent the conditional probability of a communication anomaly occurring under a set of state parameters and discreteness coefficients; Calculate the multi-step transition probability of the state parameters and the dispersion coefficient; Calculate the prior probability of various communication anomalies based on historical anomaly data; Combining the multi-step transition probabilities and the prior probabilities, the probability distribution of the communication anomaly under different combinations of state parameters is calculated using Bayes' theorem.
4. The method according to claim 1, characterized in that, Before sending the test message sequence to the charger under test, the method further includes: The test message sequence is segmented into several test segments with different timing characteristics. Calculate the dispersion coefficient for each of the test segments; Temporal feature optimization is performed on test segments that do not match the target abnormal scenario to obtain optimized test segments; The optimized test segments are then recombined to obtain a complete test sequence.
5. The method according to claim 4, characterized in that, The optimization of test segments that do not match the target abnormal scenario through temporal feature optimization yields optimized test segments, specifically including: Calculate the deviation between the dispersion coefficient of the test segment that does not match the target abnormal scenario and the preset target value; An optimization objective function is constructed, and under the condition of satisfying the maximum and minimum time intervals specified by the charging protocol, the value of the optimization objective function is made to be less than a preset threshold through iterative optimization. The optimized time interval sequence is updated to the test segment that does not match the target abnormal scenario.
6. The method according to claim 5, characterized in that, The optimization objective function is: J=α×|S c -S t |+β×|V c -V t |+γ×|T c -T t | In the function, J is the optimization objective function, α, β, and γ are weight coefficients satisfying α + β + γ = 1, and S... c S represents the current dispersion coefficient. t V is the target dispersion coefficient. c V represents the current volatility coefficient. t For the target volatility coefficient, the T c The current trend change rate, T t The target trend change rate.
7. The method according to claim 4 or 5, characterized in that, After recombining the optimized test fragments to obtain a complete test sequence, the method further includes: Construct a digital fingerprint of the complete test sequence and store the digital fingerprint in a preset database. The digital fingerprint contains the temporal characteristics and state parameter information of the complete test sequence. Establish a database mapping the complete test sequence to the communication anomalies; When a new communication anomaly is detected, the feature information of the new anomaly scenario is extracted, and the feature information is matched with each digital fingerprint in the mapping relationship database; If no matching digital fingerprint is found, the new digital fingerprint corresponding to the new abnormal scenario is stored in the preset database, and the mapping relationship corresponding to the new communication abnormality is stored in the mapping relationship database.
8. A charger communication testing system, characterized in that, The system includes: One or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the system to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the system, the system performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on the system, the system performs the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Low-voltage distributed power supply safety abnormity sensing method and device, memory and equipment
CN115761299A
Communication method and network system
EP3826249A1