Fault diagnosis method and device, electronic equipment and readable storage medium

CN123012814APending Publication Date: 2026-10-30CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611148467.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明的目的之一在于提供一种故障诊断方法,以解决现有技术中的不同设备记录的日志事件的时间戳无法对齐至统一时间戳,造成后续基于日志事件进行故障诊断出错的问题;目的之二在于提供一种故障诊断装置;目的之三在于提供一种电子设备;目的之四在于提供一种计算机可读存储介质

Benefits of technology

[0059](1)通过从候选匹配点对中筛选出目标匹配点对,即使是在地下车库等无卫星定位信号或网络时间协议信号的环境下,也可以实现车机端和手机端蓝牙日志的跨端时间对齐,不依赖任何外部时钟源,也不需要对蓝牙协议栈做侵入性修改,克服对使用场景的依赖,具有更强的场景适应性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012814A_ABST
    Figure CN123012814A_ABST
Patent Text Reader

Abstract

The application relates to a fault diagnosis method and device, electronic equipment and a readable storage medium. The method comprises the following steps: acquiring log events recorded by a first device and a second device respectively and time stamps of each log event; at least two candidate matching point pairs are generated according to the log events recorded by the first device and the second device respectively, the candidate matching point pairs comprise a first log event recorded by the first device and a second log event recorded by the second device, and the first log event and the second log event satisfy a preset matching condition; abnormal points in the at least two candidate matching point pairs are removed, and a target matching point pair is acquired; the time stamps of each target log event in the target matching point pair are aligned to a same time axis; and fault diagnosis is performed on the first device and the second device based on each target log event after time axis alignment. The method can align the time stamps of the log events recorded by different devices to a unified time stamp, so that the fault diagnosis accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle technology, and more specifically to a fault diagnosis method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] In the field of intelligent vehicles, users can send parking commands to the vehicle via their mobile phones, and the vehicle's infotainment system will then execute the parking operation upon receiving the command. During the parking process, the mobile phone and the vehicle's infotainment system will each use their own local system clock to record Bluetooth communication event logs. Due to the asynchrony of the clocks and differences in crystal oscillator precision between the two ends, the logs from both ends cannot be directly correlated to a unified timeline.

[0003] Therefore, there is an urgent need for a method to align the timestamps of the event logs on the vehicle's infotainment system and the event logs on the mobile phone to a unified timestamp, so as to facilitate fault diagnosis using the aligned event logs. Summary of the Invention

[0004] One objective of this invention is to provide a fault diagnosis method to solve the problem in the prior art where the timestamps of log events recorded by different devices cannot be aligned to a unified timestamp, causing errors in subsequent fault diagnosis based on log events; a second objective is to provide a fault diagnosis device; a third objective is to provide an electronic device; and a fourth objective is to provide a computer-readable storage medium.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A fault diagnosis method, comprising:

[0007] Obtain the log events recorded by the first device and the second device respectively, and the timestamp of each log event;

[0008] Based on the log events recorded by the first device and the second device respectively, at least two candidate matching point pairs are generated. The candidate matching point pairs include a first log event recorded by the first device and a second log event recorded by the second device, and the first log event and the second log event satisfy a preset matching condition.

[0009] Anomaly removal is performed on the at least two candidate matching point pairs to obtain the target matching point pair;

[0010] Align the timestamps of each target log event in the target matching point pair to the same timeline;

[0011] Based on the timeline-aligned target log events, fault diagnosis is performed on the first device and the second device.

[0012] Furthermore, the step of generating at least two candidate matching point pairs based on the log events recorded by the first device and the second device respectively includes:

[0013] Extract the event fingerprint of each log event recorded by the first device and the second device respectively;

[0014] Determine a first event fingerprint and a second event fingerprint that match each other from the various event fingerprints, wherein the first event fingerprint is the event fingerprint of the first log event and the second event fingerprint is the event fingerprint of the second log event;

[0015] The first log event and the second log event are combined to form the candidate matching point pair.

[0016] Furthermore, the step of removing anomalies from the at least two candidate matching point pairs to obtain the target matching point pair includes:

[0017] An abnormal matching point pair is determined among the at least two candidate matching point pairs, wherein the log events in the abnormal matching point pair are duplicated with the log events in other candidate matching point pairs, or the timestamps of the log events in the abnormal matching point pair are out of order.

[0018] The abnormal matching point pairs are removed from the at least two candidate matching point pairs to obtain the target matching point pairs.

[0019] Furthermore, determining the abnormal matching point pair among the at least two candidate matching point pairs includes:

[0020] Based on the at least two candidate matching point pairs, a temporary linear model is fitted to obtain the temporary linear model, which includes a first temporary parameter and a second temporary parameter.

[0021] Based on the first temporary parameter, the second temporary parameter, and the timestamp of the first log event in each candidate matching point pair, the predicted timestamp of the second log event in each candidate matching point pair is calculated.

[0022] Based on the predicted timestamp of the second log event and the actual timestamp of the second log event, the time residual of each candidate matching point pair is calculated;

[0023] The matching point pairs to be screened are determined from each candidate matching point pair and added to the initial inlier set. The time residual of the matching point pairs to be screened is less than a preset residual threshold.

[0024] A time-series check is performed on the pairs of matching points to be screened in the initial set of interior points to identify the abnormal matching points.

[0025] Furthermore, the step of performing a time-series check on the pairs of matching points to be screened in the initial set of interior points to determine the abnormal matching point pairs includes:

[0026] Sort each pair of matching points to be filtered to generate a sequence of matching points, wherein the timestamp of the first log event of the previous pair of matching points to be filtered in the sequence of matching points is less than the timestamp of the first log event of the next pair of matching points to be filtered.

[0027] If the timestamp of the second log event in the previous pair of matching points to be filtered is greater than the timestamp of the second log event in the next pair of matching points to be filtered, then the previous pair of matching points to be filtered is determined as the abnormal matching pair.

[0028] Furthermore, aligning the timestamps of each target log event in the target matching point pair to the same timeline includes:

[0029] Using the target matching point pairs, a time drift model is obtained by fitting.

[0030] Based on the time drift model, the timestamps of each target log event in the target matching point pair are aligned to the same time axis.

[0031] Furthermore, the step of fitting a time-drift model using the target matching point pairs includes:

[0032] A time window is determined based on the timestamps of each target log event in the target matching point pair;

[0033] If the time window is a short time window, then the time drift model is constructed based on the timestamp of the target log event recorded by the first device, the preset clock drift rate, and the preset initial offset. The short time window refers to a time window with a duration less than the preset duration.

[0034] Furthermore, the step of fitting a time-drift model using the target matching point pairs includes:

[0035] If the time window is a long time window, then each target log event in the target matching point pair will be divided into different sub-time windows. The long time window refers to a time window with a duration greater than or equal to a preset duration.

[0036] Obtain the first and second correction parameters corresponding to each sub-time window;

[0037] Based on the first correction parameter, the second correction parameter, and the timestamp of the target log event recorded by the first device, the time drift model corresponding to each sub-time window is determined.

[0038] Furthermore, it also includes:

[0039] Obtain the number of the target matching point pairs and the standard deviation of the residuals corresponding to the time residuals of the target matching point pairs;

[0040] If the number of target matching point pairs and the residual standard deviation meet a preset first condition, then the timestamp alignment result of each target log event is determined to be of high confidence; the preset first condition is that the number of target matching point pairs is greater than a first quantity threshold and the residual standard deviation is less than a first time threshold.

[0041] If the number of target matching point pairs and the residual standard deviation meet the preset second condition, then the timestamp alignment result of each target log event is determined to be of medium confidence. The preset second condition is that the number of target matching point pairs is greater than the second quantity threshold, and the residual standard deviation is less than the second time threshold. The second quantity threshold is less than the first quantity threshold, and the second time threshold is greater than the first time threshold.

[0042] If the number of target matching point pairs and the residual standard deviation do not meet the preset first condition and the preset second condition, then the timestamp alignment result of each target log event is determined to be of low confidence.

[0043] Furthermore, the fault diagnosis of the first device and the second device based on the time-axis aligned target log events includes:

[0044] Construct an event state machine and the state transition rules for each event in the event state machine;

[0045] Traverse each target log event after timestamp alignment, and determine whether there is a target anomaly in the first device and the second device based on the event state machine and the state transition rules. The target anomaly includes at least one of timing anomaly, state transition anomaly and event missing.

[0046] When the target anomaly is present, a diagnostic result is generated, which includes at least one of the following: fault type, root cause location, and confidence level.

[0047] Furthermore, the first device is an in-vehicle infotainment system, and the second device is a remote mobile device.

[0048] A fault diagnosis device, comprising:

[0049] The acquisition module is used to acquire the log events recorded by the first device and the second device respectively, and the timestamp of each log event;

[0050] The generation module is configured to generate at least two candidate matching point pairs based on the log events recorded by the first device and the second device respectively. The candidate matching point pairs include a first log event recorded by the first device and a second log event recorded by the second device, and the first log event and the second log event satisfy a preset matching condition.

[0051] The elimination module is used to eliminate anomalies from the at least two candidate matching point pairs to obtain the target matching point pair;

[0052] The alignment module is used to align the timestamps of each target log event in the target matching point pair to the same timeline;

[0053] The diagnostic module is used to perform fault diagnosis on the first device and the second device based on the target log events after time axis alignment.

[0054] An electronic device includes: a memory and a processor;

[0055] The memory stores computer-executed instructions;

[0056] The processor executes the computer execution instructions stored in the memory, causing the processor to perform the above-described method.

[0057] A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the above-described method.

[0058] The beneficial effects of this invention are:

[0059] (1) By selecting target matching pairs from candidate matching pairs, even in environments such as underground parking garages where there are no satellite positioning signals or network time protocol signals, cross-terminal time alignment of Bluetooth logs between vehicle and mobile terminals can be achieved. It does not rely on any external clock source and does not require intrusive modifications to the Bluetooth protocol stack, thus overcoming the dependence on the usage scenario and having stronger scenario adaptability.

[0060] (2) Through anomaly removal, it can handle noise unique to Bluetooth log events: false positive matches caused by retransmission, out-of-order matching caused by caching, incorrect matching caused by hash collision, sparse and uneven distribution of event matching points, and can still accurately fit the clock drift model even when the matching point pairs contain noise.

[0061] (3) By outputting the alignment confidence level (high / medium / low), the downstream fault diagnosis module can adopt different strategies according to the confidence level to avoid misdiagnosis under low confidence level.

[0062] (4) Based on the aligned multi-end event sequence, the root cause of the fault can be automatically diagnosed and the interpretable diagnostic results (including fault type, root cause location, key evidence chain) can be output, supporting cross-end causal relationship analysis. Attached Figure Description

[0063] Figure 1 A flowchart illustrating the fault diagnosis method provided in the embodiments of this application;

[0064] Figure 2 This is a schematic diagram of the fault diagnosis system framework provided in the embodiments of this application;

[0065] Figure 3 Flowchart of the RANSAC+ timing constraint anomaly removal algorithm provided in the embodiments of this application;

[0066] Figure 4 A flowchart illustrating the timestamp alignment process provided in this application's embodiments;

[0067] Figure 5 This is a comparison diagram of the event sequence before and after alignment provided in an embodiment of this application;

[0068] Figure 6 This is a schematic diagram illustrating the confidence level determination provided in an embodiment of this application;

[0069] Figure 7 This is a schematic diagram of the fault diagnosis output provided in an embodiment of this application;

[0070] Figure 8 This is a schematic diagram of the overall process of the fault diagnosis method provided in the embodiments of this application;

[0071] Figure 9 A schematic diagram of the fault diagnosis device provided in this application;

[0072] Figure 10 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0073] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0074] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0075] With the development of intelligent vehicle technology, Bluetooth parking functionality has gradually become a standard feature in vehicles. This function enables remote parking control of the vehicle via Bluetooth Low Energy (BLE) connection between the mobile phone and the vehicle's infotainment system. When faults such as connection failure, control timeout, or loss of status occur during parking, it is necessary to analyze the Bluetooth communication logs of the vehicle's infotainment system and the mobile phone to locate the root cause of the fault.

[0076] However, the vehicle-mounted system and the mobile phone each use their own local system clock to record logs independently. Due to limitations such as clock asynchrony and differences in crystal oscillator accuracy, the timestamps of the logs from both ends are inconsistent. Furthermore, in scenarios such as underground parking garages where there are no satellite or network signals, the logs from both ends cannot be directly correlated to a unified timeline, making it impossible to determine the sequence of events and causal relationships, and making root cause analysis of faults extremely difficult.

[0077] Currently, there are several technical paths for multi-terminal log time alignment and fault diagnosis: (1) Using Network Time Protocol (NTP) calibration + device local clock compensation algorithm to achieve log alignment. However, this method relies on satellite positioning signals or NTP signals, which is not available in the underground parking scenario. It also requires the device to have network connectivity and each device to be able to access the same time server. (2) Time synchronization and data alignment method based on BLE application layer. This method achieves time alignment of multiple sensors by sending active synchronization signals. However, it requires intrusive modification of the Bluetooth protocol stack, increasing development and maintenance costs. (3) General time series alignment method. This method assumes that the input data is clean and uses the least squares method to fit a linear model. However, it cannot handle the noise unique to Bluetooth logs, such as retransmission, out-of-order, and hash collision. (4) Bluetooth fault diagnosis is performed directly on a single end (such as a car unit or mobile phone) without involving cross-terminal log alignment. This method cannot associate the causal relationship between the events at both ends, which is prone to misjudgment and requires multiple personnel to investigate, which is time-consuming and labor-intensive.

[0078] To address the aforementioned issues, this application provides a fault diagnosis method that can at least resolve cross-terminal time alignment of Bluetooth logs between the vehicle and mobile devices in scenarios without satellite positioning signals or NTP signals, such as underground parking garages, without relying on any external clock source or requiring intrusive modifications to the Bluetooth protocol stack.

[0079] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0080] Figure 1 This is a flowchart illustrating the fault diagnosis method provided in an embodiment of this application. Figure 1 As shown, this fault diagnosis method can be implemented through the following steps:

[0081] Step 110: Obtain the log events recorded by the first device and the second device respectively, and the timestamp of each log event.

[0082] Step 120: Generate at least two candidate matching point pairs based on the log events recorded by the first device and the second device respectively. The candidate matching point pairs include a first log event recorded by the first device and a second log event recorded by the second device, and the first log event and the second log event satisfy a preset matching condition.

[0083] Step 130: Remove anomalies from at least two candidate matching point pairs to obtain the target matching point pair.

[0084] Step 140: Align the timestamps of each target log event in the target matching point pair to the same timeline.

[0085] Step 150: Based on the timeline-aligned target log events, perform fault diagnosis on the first and second devices.

[0086] In this embodiment, the execution entity can be an electronic device, which can be a host computer or a cloud server. For example, the first and second devices can upload their respective recorded log events and the timestamp of each log event to the cloud server, where the server's analysis engine performs fault diagnosis.

[0087] In step 110 above, the first device records a first set of log events and provides corresponding timestamps, serving as one of the data sources for cross-device alignment. The second device records a second set of log events and provides corresponding timestamps, together with the first device, forming the data foundation for fault diagnosis.

[0088] Log events are used to characterize event records on two devices during the same business process, and timestamps are used to describe the occurrence time of each log event on the corresponding device. In this application, the timestamps are generated independently by the local clock of each device, and can be monotonically increasing time values, system runtime count values, or local time records in milliseconds.

[0089] For example, taking a vehicle-mounted infotainment system as the first device and a mobile phone or similar remote mobile device as the second device, Figure 2 This is a schematic diagram of the fault diagnosis system framework provided in the embodiments of this application, such as... Figure 2 As shown, the vehicle-mounted device 20 includes a Bluetooth controller firmware 201 and a log collection module 202. The Bluetooth controller firmware 201 is deployed in the vehicle's Bluetooth controller and is responsible for recording Host Controller Interface (HCI) event logs, including events such as connection requests, connection completions, and authentication requests. The log collection module 202 is responsible for collecting Bluetooth event logs with local monotonic timestamps and uploading them to a cloud-based analysis engine.

[0090] The remote mobile terminal 21 (taking a mobile phone as an example) includes a Bluetooth Application Programming Interface (API) interception module 203 and a log collection module 204. The Bluetooth API interception module 203 is deployed in the mobile application and is responsible for intercepting Bluetooth Generic Attribute Profile (GATT) operation logs. The log collection module 204 is responsible for collecting mobile Bluetooth event logs with local monotonic timestamps and uploading them to a cloud-based analysis engine.

[0091] The cloud-based analysis engine 22 includes a fingerprint extraction module 205, a matching module 206, a robust fitting module 207, a drift modeling module 208, a time transformation module 209, a confidence calculation module 2101, a fault diagnosis module 2102, and a diagnosis result output 2103.

[0092] The fingerprint extraction module 205 extracts event fingerprints from each log entry. The fingerprint consists of a Bluetooth connection handle, an opcode, and a payload hash. The matching module 206 matches the fingerprints from the vehicle's infotainment system with those from the mobile phone, generating a set of matching point pairs. The robust fitting module 207 uses a RANSAC algorithm with time constraints to remove outliers and filter out the inlier set. The drift modeling module 208 fits a clock drift model based on the inlier set, supporting both linear and piecewise linear models. The time transformation module 209 transforms the mobile logs to the vehicle's infotainment system timeline based on the drift model. The confidence calculation module 2101 outputs a confidence level based on the number of inliers, residual standard deviation, and time span. The fault diagnosis module 2102 constructs a state machine based on the aligned multi-terminal event sequence for root cause analysis. The diagnosis result output 2103 outputs a report containing the fault type, root cause location, evidence chain, and recommended actions. Data flow is as follows: Figure 2As shown by the middle arrow: Logs from the vehicle's infotainment system and mobile device are uploaded to the cloud. After fingerprint extraction, matching, robust fitting, drift modeling, time transformation, and confidence calculation, the fault diagnosis module outputs the diagnostic results.

[0093] In step 110 above, the first device and the second device respectively collect Bluetooth HCI event logs. Each log record contains: (1) local monotonic timestamp (precision 1 millisecond); (2) Bluetooth connection handle (conn_handle, 2 bytes); opcode (opcode, 2 bytes); (3) event payload.

[0094] In some implementations, both the first and second devices generate the fingerprint corresponding to the event log using a fingerprint generation algorithm. For example, the fingerprint generation algorithm is: fingerprint = hash(conn_handle, opcode, payload_low16) & 0xFFFFFFFF. Here, fingerprint represents the fingerprint corresponding to the event, and payload_low16 is the lower 16 bits of the hash value of the event payload content.

[0095] Regarding step 120 above, the candidate matching point pair is used to represent the preliminary correspondence between the first log event recorded by the first device and the second log event recorded by the second device, and serves as the input for subsequent anomaly removal and timeline alignment.

[0096] Here, the first log event represents the selected log event in the first device, and the second log event represents the selected log event in the second device. Each provides its own timestamp for subsequent processing. Preset matching conditions are used to determine whether two events across devices can be considered corresponding records within the same business process.

[0097] For example, in some implementations, the first log event and the second log event can be determined in the following manner:

[0098] Step 11: Extract the event fingerprint of each log event recorded by the first device and the second device respectively.

[0099] Step 12: Determine the first and second event fingerprints that match each other from the event fingerprints.

[0100] Wherein, the first event fingerprint is the event fingerprint of the first log event, and the second event fingerprint is the event fingerprint of the second log event;

[0101] Step 13: Combine the first log event and the second log event to form candidate matching point pairs.

[0102] In this embodiment, the fingerprint generation algorithm mentioned above can be used to generate an event fingerprint corresponding to each log event.

[0103] When the first device and the second device collect log events independently, they each record the following: (1) local monotonic timestamp; (2) Bluetooth connection handle; opcode; and (3) event payload. Using the fingerprint generation algorithm mentioned above, they generate event fingerprints corresponding to the log events collected by each device.

[0104] For example, consider log events A1, A2, and A3 of the first device, and log events B1, B2, and B3 of the second device. Assuming the event fingerprint of log event A1 is fingerprint0, and the event fingerprint of log event B2 is also fingerprint0, then log event A1 is considered the first log event, and log event B2 is considered the second log event.

[0105] This fingerprint matching method can generate candidate matching point pairs based on the corresponding event fingerprints, thereby linking the recorded results of the same event interaction process in the logs of the first and second devices. This method can form a cross-end event candidate set without relying on unified time synchronization and provides a stable input for subsequent timestamp alignment and fault diagnosis.

[0106] For example, the set of candidate matching point pairs is P={(t_car_i, t_phone_i)|i=1,2,…,N}. Here, taking the first device as the in-vehicle infotainment system and the second device as a mobile phone as an example, t_car_i represents the timestamp of the first log event in the i-th candidate matching point pair, and t_phone_i represents the timestamp of the second log event in the i-th candidate matching point pair.

[0107] When matching the event fingerprint of the vehicle's infotainment system with the event fingerprint of the mobile phone, and identifying the same fingerprint as the same physical Bluetooth event, the matching result may contain false positives (i.e. hash collisions) and out-of-order points.

[0108] A hash collision occurs when two completely different log events produce the same event fingerprint after hash calculation. For example, log event A2 might also produce an event fingerprint of fingerprint0 using a fingerprint algorithm, resulting in a hash collision: both log events A1 and A2 are considered the first log event, while log event B2 is considered the paired second log event.

[0109] Out-of-order points refer to situations where different log events within the same physical Bluetooth event exhibit a disordered timing sequence. For example, the log events recorded by the vehicle's infotainment system might be in the following chronological order: data packet 1 is sent first (log event 1), followed by data packet 3 (log event 2); while the log events recorded by the mobile device might be in the following chronological order: data packet 3 is received first (log event 3), followed by data packet 1 (log event 4). Therefore, although the event fingerprints of log events 1 and 4 match, the temporal order is out of sequence, and this will be considered an out-of-order point.

[0110] Regarding step 130 above, the anomaly removal is used to remove anomalies from candidate matching point pairs that do not conform to the overall correspondence or time relationship, and only retains the target matching point pairs that can truly reflect the correspondence between the two ends.

[0111] For example, in some implementations, abnormal matching point pairs can be identified from at least two candidate matching point pairs; then, the abnormal matching point pairs from the at least two candidate matching point pairs are eliminated to obtain the target matching point pair. Specifically, the log events in the abnormal matching point pair are duplicates of the log events in other candidate matching point pairs, or the timestamps of the log events in the abnormal matching point pair are out of order.

[0112] In this implementation, refer to the hash collision and out-of-order points mentioned above. A hash collision occurs when the log events in an abnormal matching point pair are duplicated with log events in other candidate matching point pairs. An out-of-order point is indicated when the timestamps of the log events in an abnormal matching point pair are out of order.

[0113] In step 140 above, timestamp alignment is used to establish the time correspondence between the first device and the second device based on the target matching point pair, and to convert the timestamps of each target log event to a unified time base. The same time axis can be selected from the first device's time axis, the second device's time axis, or an independent unified reference time axis can be constructed. Target log events refer to events in the target matching point pair and other relevant log events within the same log interval that need to participate in diagnostic analysis; after alignment, they are all represented using a unified time base.

[0114] For example, suppose the vehicle's infotainment system records a "connection request" event at t=1000.000, a "connection complete" event at t=1000.052, an "authentication request" event at t=1000.120, and a "connection timeout" event at t=1000.521. Meanwhile, the mobile phone records a "connection complete" event at t=1000.150, an "authentication request" event at t=1000.200, and a "disconnect" event at t=1000.800.

[0115] For example, if the same timeline is used as the vehicle's timeline, the timestamps of the above log events recorded by the mobile phone will be updated accordingly to "Connection Completed" at t=1000.061, "Authentication Request" at t=1000.111, and "Disconnected" at t=1000.711.

[0116] By using this implementation method for filtering, the noise unique to Bluetooth logs can be processed: (1) false positive matches caused by retransmission, (2) out-of-order matching caused by caching, and (3) incorrect matches caused by hash collisions, thereby improving the subsequent time alignment effect and ensuring the accuracy of fault analysis results.

[0117] In step 150 above, fault diagnosis utilizes the time-axis-aligned cross-device fused event sequence to analyze the event correlation, sequence, interval duration, missing events, and state changes between the first and second devices, thereby identifying the fault type or locating the fault cause. After alignment, the target log events are on the same time axis, allowing for direct comparison of time differences and timing relationships between cross-device events.

[0118] Specifically, based on the timeline-aligned target log events, the system can analyze the event sequence, event intervals, missing events, and state changes between the first and second devices, and output diagnostic results based on the analysis. The diagnostic results can include at least one of the following: fault type, anomaly occurrence interval, and associated devices.

[0119] For example, suppose the vehicle's infotainment system records a first target log event, "Connection complete," at t=1000.052, while the mobile phone records a second target log event, "Connection complete," at t=1000.800. Since the time interval between these two log events is too long, it will be considered that "there is a serious delay."

[0120] The fault diagnosis method provided in this application first generates cross-terminal candidate correspondences, then performs anomaly elimination on the candidate correspondences, and uses the eliminated target matching point pairs to establish time correspondences between devices. Finally, it performs joint analysis on the logs of both ends under a unified time axis. This method can achieve cross-terminal time alignment of Bluetooth logs between the vehicle terminal and the mobile phone terminal in environments without satellite positioning signals or NTP signals, such as underground parking garages. It does not rely on any external clock source, reduces scenario dependence, and thus further improves the accuracy and efficiency of subsequent fault diagnosis.

[0121] The following examples illustrate in detail how to implement anomaly removal.

[0122] In some embodiments, anomalous matching point pairs can be determined by the following steps:

[0123] Step 21: Fit a temporary linear model based on at least two candidate matching point pairs.

[0124] The temporary linear model includes a first temporary parameter and a second temporary parameter.

[0125] Step 22: Calculate the predicted timestamp of the second log event in each candidate matching point pair based on the first temporary parameter, the second temporary parameter, and the timestamp of the first log event in each candidate matching point pair.

[0126] Step 23: Calculate the time residual for each candidate matching point pair based on the predicted timestamp of the second log event and the actual timestamp of the second log event.

[0127] Step 24: Determine the matching point pairs to be filtered from each candidate matching point pair and add them to the initial inlier set. The time residual of the matching point pairs to be filtered should be less than the preset residual threshold.

[0128] Step 25: Perform a time-series check on the pairs of matching points to be screened in the initial interior point set to identify abnormal matching points.

[0129] In this embodiment, the time relationship is first linearly fitted based on at least two candidate matching point pairs to obtain a temporary linear model that can reflect the correspondence between the log times at both ends. Then, the timestamp of the first log event in each candidate matching point pair is input into the temporary linear model to obtain the predicted timestamp of the corresponding second log event. The predicted timestamp is then compared with the actual timestamp to obtain the time residual.

[0130] Specifically, when the time residual of a candidate matching point pair is less than the preset residual threshold, it is added to the initial inner point set as a matching point pair to be screened. Then, the event sequence of each point pair in the set is checked. If a point pair that is inconsistent with the overall time sequence is found, it is identified as an abnormal matching point pair and removed from the subsequent alignment analysis.

[0131] For example, as mentioned above, the set of candidate matching point pairs is P={(t_car_i, t_phone_i)|i=1,2,…,N}. Taking the timestamp of the first log event as t_car and the timestamp of the second log event as t_phone, we can traverse all candidate matching point pairs (t_car, t_phone) in the matching point pair set P, calculate the predicted timestamp of the second log event as t_phone_pred=α_temp×t_car+β_temp, and then calculate the residual r=|t_phone-t_phone_pred|.

[0132] where α_temp is the first temporary parameter, β_temp is the second temporary parameter, t_car is the timestamp of the first log event paired with the second log event, and t_phone is the timestamp of the first log event.

[0133] where, if r is less than the preset residual threshold δ, (t_car, t_phone) is added to the initial inlier set current_inliers.

[0134] In this embodiment, a temporary linear model is first used to complete the coarse screening of candidate matching point pairs, and then residual abnormal matching point pairs are identified in combination with time sequence inspection, so that the matching relationship on which subsequent log alignment is based is more stable, the accuracy of cross-device log association is improved, and the interference of abnormal matching point pairs on fault diagnosis results is reduced.

[0135] Further, on the basis of the above embodiments, in some embodiments, the time sequence inspection may be specifically implemented through the following steps:

[0136] Step 31: Sort each to-be-screened matching point pair to generate a matching point pair sequence.

[0137] where the timestamp of the first log event of the previous to-be-screened matching point pair in the matching point pair sequence is less than the timestamp of the first log event of the next to-be-screened matching point pair.

[0138] Step 32: If the timestamp of the second log event in the previous to-be-screened matching point pair is greater than the timestamp of the second log event in the next to-be-screened matching point pair, the previous to-be-screened matching point pair is determined as an abnormal matching point pair.

[0139] In this embodiment, the to-be-screened matching point pairs in the initial inlier set current_inliers may be sorted in the chronological order of t_car, to check whether the corresponding t_phone is also incremented: if there exists i<j such that t_phone_i>t_phone_j, the to-be-screened matching point pair that violates the constraint is removed from the initial inlier set current_inliers (that is, determined as an abnormal matching point pair).

[0140] In addition, the above step 21, step 22, step 23, step 24, step 31 and step 32 may be executed cyclically, and each execution is equivalent to one iteration. In each iteration, the first temporary parameter and the second temporary parameter in the temporary linear model may be updated. Specifically, Figure 3 is a flowchart of the RANSAC+time sequence constraint abnormal elimination algorithm provided in the embodiments of the present application, as shown in Figure 3 the figure, which includes the following steps:

[0141] Step 301: Input the set P of candidate matching point pairs. It contains N (t_car, t_phone).

[0142] Step 302: Initialize best_inliers = empty set, best_score = 0, K = 0.

[0143] Step 303: Determine if K equals 100. Here, 100 represents the total number of iterations, which can be adjusted according to the actual situation.

[0144] Step 304: Randomly select two candidate matching point pairs.

[0145] Step 305: Fit a temporary linear model. Here, α_temp is the first temporary parameter, and β_temp is the second temporary parameter.

[0146] Step 306: Calculate the residual for each candidate matching pair. The residual r = |t_phone - t_phone_pred|.

[0147] Step 307: Iterate through each candidate matching point pair.

[0148] Step 308: Determine whether the residual r is less than the preset residual threshold δ.

[0149] Step 309: If not, skip the candidate matching point pair.

[0150] Step 310: If yes, add the candidate matching point pair to the initial inlier set current_inliers.

[0151] Step 311: Timing Constraint Check. This involves comparing the temporal order of t_car and t_phone for the pairs of matching points to be filtered in the initial inlier set current_inliers.

[0152] Step 312: Determine if there is an inconsistency in the order.

[0153] Step 313: If yes, then remove the candidate matching point pair.

[0154] Step 314: If not, determine whether the initial inlier set current_inliers is greater than best_score;

[0155] Step 315: If so, then perform the following update:

[0156] best_score =|current_inliers|

[0157] best_inliers = current_inliers

[0158] best_model =(α_temp,β_temp)

[0159] Specifically, the final model (α, β) is refitted using the least squares method with all point pairs in best_inliers, and then inliers=best_inliers, model parameters (α, β) are returned.

[0160] Step 316: Let K = K + 1.

[0161] Step 317: Refit the least squares method using best_inliers.

[0162] Step 318: Output the set of interior points and model parameters α, β.

[0163] In this embodiment, K=100 (to ensure a 99% probability of selecting a sample without outliers, assuming an outlier ratio of <50%), and δ=50 milliseconds (typical time precision for Bluetooth events).

[0164] In this embodiment, by using the ascending order of the timestamps of the first log events as the sorting criterion and the descending order of the timestamps of the second log events as the anomaly criterion, point pairs in the same candidate set can be verified for consistency across both time dimensions. The abnormal matching point pairs screened out in this way can be identified and removed from the initial internal point set, thereby retaining the target matching point pairs that meet the cross-end time sequence consistency, providing a more stable input for subsequent timeline alignment and fault diagnosis.

[0165] The following examples illustrate in detail how to align the timestamps of each target log event in a target matching point pair to the same timeline.

[0166] Figure 4 The timestamp alignment flowchart provided for the embodiments of this application is as follows: Figure 4 As shown, it includes the following steps:

[0167] Step 410: Use the target matching point pairs to fit and obtain the time drift model;

[0168] Step 420: Based on the time drift model, align the timestamps of each target log event in the target matching point pair to the same time axis.

[0169] In this embodiment, the timestamp of the first log event in the target matching point pair can be recorded as the first time series, the timestamp of the second log event can be recorded as the second time series, and a mapping function can be established with the first time series as the independent variable and the second time series as the dependent variable to fit the time drift model.

[0170] For example, in a Bluetooth parking fault diagnosis scenario, considering that the drift of the local clocks at both ends (e.g., the vehicle's infotainment system and the mobile phone) changes relatively smoothly within a short time window, the slope parameter and bias parameter of the time drift model can be obtained through least squares fitting. The slope parameter represents the difference in time progression rate, and the bias parameter represents the initial time offset.

[0171] In addition, if there are a large number of target matching point pairs and their distribution covers multiple moments in the business process, regression fitting can be performed on each point under a unified time benchmark, so that the model can take into account both offset correction and drift correction.

[0172] When aligning timestamps based on a time-drift model, the timestamp of the second device in the target matching point pair can be converted to a unified time axis based on the time axis of the first device, or the timestamps at both ends can be mapped to an intermediate time reference jointly determined by both parties.

[0173] Specifically, for any target log event's original timestamp, its corresponding unified timestamp can be calculated using a time drift model, and this unified timestamp can replace the original recording time, thus placing target log events on the same business chain in a consistent time coordinate system. The alignment result on this unified time axis can be directly used for subsequent event sequence determination, latency calculation, and fault root cause correlation analysis.

[0174] This embodiment utilizes a target matching point pair to fit a time drift model, and then uses this model to uniformly transform the timestamps of each target log event. This enables the log events recorded by two devices under different local clocks to be converted to the same time base, making the temporal and interval relationships of cross-device events comparable, thereby providing a consistent time basis for fault diagnosis.

[0175] For example, in some implementations, a time window can be determined based on the timestamps of each target log event in the target matching point pair; if the time window is a short time window, a time drift model is constructed based on the timestamps of the target log events recorded by the first device, a preset clock drift rate, and a preset initial offset. Here, a short time window refers to a time window with a duration less than a preset duration.

[0176] In this embodiment, after obtaining the target matching point pair, the timestamp of each target log event is extracted first, and the start and end range of the time window is determined based on the minimum and maximum values ​​of these timestamps, thereby obtaining the time window. Then, the duration corresponding to the time window is compared with the preset duration.

[0177] For example, the preset duration can be set to 30 minutes. That is, for short time windows (<30 minutes), a global linear model can be used: T_phone_unified=a×T_phone_local+b, as the time drift model.

[0178] Wherein, T_phone_unified is the global linear model, a is the preset clock drift rate (i.e., slope parameter), which reflects the difference in crystal oscillator accuracy at both ends; b is the preset initial offset (i.e., bias parameter); and T_phone_local is the timestamp of the target log event recorded by the first device.

[0179] In this embodiment, the time drift model can be represented as a mapping relationship between the timestamp of the first device and the timestamp of the second device obtained by linear transformation of the timestamp of the first device. Specifically, it can be obtained by multiplying the timestamp by the clock drift rate and then adding the initial offset, thereby uniformly converting each target log event in the target matching point pair to the same time axis. The preset clock drift rate and preset initial offset can be preset by historical calibration data, device factory parameters, or previous matching results.

[0180] This implementation determines whether to enter a short time window model based on a time window, and directly uses the first device timestamp, preset clock drift rate, and preset initial offset to construct a time drift model within the short time window. This allows the model to maintain a concise expression and adapt to the drift characteristics within a short period of time, thereby providing a stable mapping basis for the timestamp alignment of target log events and improving the time consistency of event association results during subsequent fault diagnosis.

[0181] In other implementations, if the time window is a long time window, the target log events in the target matching point pair are divided into different sub-time windows; then, the first correction parameter and the second correction parameter corresponding to each sub-time window are obtained; and based on the first correction parameter, the second correction parameter, and the timestamp of the target log event recorded by the first device, the time drift model corresponding to each sub-time window is determined. Here, a long time window refers to a time window with a duration greater than or equal to a preset duration.

[0182] In this embodiment, the time window is first determined based on the timestamp span of each target log event. When the span is determined to be greater than or equal to the preset duration, it is regarded as a long time window. The target matching point pairs are then segmented according to the time sequence, so that the target log events in different time periods are respectively assigned to the corresponding sub-time windows.

[0183] Within each sub-time window, based on the target matching point pairs within that interval, the first correction parameter and the second correction parameter are estimated by combining the timestamps of the target log events recorded by the first device.

[0184] The first correction parameter can be used to describe the initial offset of the interval, and the second correction parameter can be used to describe the drift slope of the interval over time. Both can be obtained by least squares fitting, robust regression or other parameter estimation methods.

[0185] Subsequently, the first correction parameter, the second correction parameter, and the target log event timestamp recorded by the first device are substituted into the corresponding time mapping expression to obtain the time drift model corresponding to the sub-time window. The time drift model is then saved as segmented timestamp alignment parameters for subsequent timestamp alignment.

[0186] When the time window is a long window (≥30 minutes), a piecewise linear model needs to be constructed as the time drift model. The specific steps are as follows:

[0187] 1. Divide the time span into multiple sub-time windows (e.g., one window every 10 minutes).

[0188] 2. Fit a linear model independently within each sub-time window (first correction parameter α_k, second correction parameter β_k).

[0189] 3. Smooth transition of linear interpolation at window boundaries: T_phone_unified = α(t) × T_phone_local + β(t).

[0190] Among them, α(t) and β(t) are linearly interpolated over time.

[0191] In addition, other segmentation conditions can be set, such as the residual standard deviation within the window exceeding a threshold (e.g., 100 milliseconds) and / or the α change of consecutive windows exceeding 10%. When these segmentation conditions are met, each target log event in the target matching point pair can be divided into different sub-time windows; then, the first correction parameter and the second correction parameter corresponding to each sub-time window are obtained; and based on the first correction parameter, the second correction parameter, and the timestamp of the target log event recorded by the first device, the time drift model corresponding to each sub-time window is determined.

[0192] This implementation divides a long time window into multiple sub-time windows and estimates local drift parameters for each, enabling the time drift model to update as time periods change. This allows for a segmented characterization of the time correspondence between different stages within the same long time period. Since each sub-time window corresponds to independent first and second correction parameters, the model's adaptability to clock offsets and drift changes over long periods is improved. This results in more consistent log association results based on timestamp alignment, and more accurate timing determination and event correspondence during fault diagnosis.

[0193] After completing the drift model construction, taking the first device as the vehicle's infotainment system and the second device as a remote mobile device (phone) as an example, the timestamps of all log events on the mobile phone can be transformed to the vehicle's timeline based on the drift model. For example, Figure 5 This application provides a comparison diagram of the event sequence before and after alignment, as shown in the embodiments. Figure 5 As shown,

[0194] Before alignment, there was a time offset between the vehicle-mounted events (triangle markers) and the mobile events (circle markers) (dashed line connection). After drift model correction, the matching event pairs overlapped on a unified time axis (solid line connection), and false positive matching points were eliminated by the RANSAC algorithm.

[0195] Furthermore, traditional fault diagnosis methods are prone to misdiagnosis. Therefore, in some embodiments, after time alignment is completed, an alignment confidence level (high / medium / low) can be output. This allows downstream fault diagnosis modules to adopt different strategies based on the confidence level, avoiding misdiagnosis under low confidence conditions. The specific steps are as follows:

[0196] Step 31: Obtain the number of target matching point pairs and the standard deviation of the residuals corresponding to the time residuals of the target matching point pairs.

[0197] Step 32: If the number of target matching point pairs and the residual standard deviation meet the preset first condition, then determine the timestamp alignment result of each target log event as high confidence.

[0198] The first preset condition is that the number of target matching point pairs is greater than a first quantity threshold, and the residual standard deviation is less than a first time threshold.

[0199] Step 33: If the number of target matching point pairs and the residual standard deviation meet the preset second condition, then determine the timestamp alignment result of each target log event as medium confidence.

[0200] The second preset condition is that the number of target matching point pairs is greater than the second quantity threshold, and the standard deviation of the difference is less than the second time threshold. The second quantity threshold is less than the first quantity threshold, and the second time threshold is greater than the first time threshold.

[0201] Step 34: If the number of target matching point pairs and the residual standard deviation do not meet the preset first condition and the preset second condition, then determine the timestamp alignment result of each target log event as low confidence.

[0202] In this embodiment, the confidence level grading mechanism (high / medium / low) is output synchronously with the timestamp alignment results during operation, enabling the subsequent fault diagnosis module to select different analysis strategies based on different confidence levels.

[0203] For example, high-confidence results can be directly used as the basis for cross-end event association; medium-confidence results can be combined with other log contexts for auxiliary confirmation; and low-confidence results indicate that the current timestamp alignment reliability is weak. By jointly determining the number of target matching point pairs and the residual standard deviation, the reliability of timestamp alignment results can be more clearly expressed, and a more stable input can be provided for Bluetooth parking fault location.

[0204] For example, Figure 6 This is a schematic diagram of confidence level determination provided in an embodiment of this application, such as... Figure 6 As shown, the confidence level is mainly determined based on the three factors in Table 1 below:

[0205]

[0206] Table 1

[0207] For example, based on Table 1 above, the following confidence level grading rules can be configured:

[0208] Confidence level determination rules:

[0209] If N_in >= 10 and σ < 50 milliseconds, then the confidence level is "high".

[0210] If N_in >= 5 and σ < 200 milliseconds: then the confidence level is "Medium".

[0211] Otherwise, the confidence level is set to "low", and a warning can be added: "The alignment results are unreliable. It is recommended to combine them with other information for collaborative diagnosis."

[0212] After the confidence level is determined, the diagnostic phase will begin. In some embodiments, the diagnostic phase includes the following steps:

[0213] Step 41: Construct the event state machine and the state transition rules for each event in the event state machine.

[0214] Step 42: Traverse each target log event after timestamp alignment, and determine whether there is a target anomaly in the first and second devices based on the event state machine and state transition rules. The target anomaly includes at least one of the following: timing anomaly, state transition anomaly, and missing event.

[0215] Step 43: When a target anomaly is found, generate a diagnostic result. The diagnostic result includes at least one of the following: fault type, root cause location, and confidence level.

[0216] In this embodiment, the constructed event state machine and state transition rules are different in different application scenarios. Specifically, the event state machine can perform state modeling according to business links such as link establishment, authentication request, authentication response, control issuance, control confirmation, and state feedback, and establish corresponding predecessor and successor states for each type of event.

[0217] State transition rules can be generated by a preset protocol process or obtained from historical normal log statistics. The rules record the allowed order of events, the maximum interval duration, and whether repeated arrivals are allowed.

[0218] During the traversal of the target log events after timeline alignment, if the current event is earlier than the minimum time point allowed by the preceding state, or later than the time window defined by the rules, it is judged as a timing abnormality; if the current event cannot enable the state machine to complete a legal state transition, or if a state transition that is not defined in the rules occurs, it is judged as a state transition abnormality; if the target event that the state machine is waiting for within the preset window is not traversed, it is judged as an event missing.

[0219] After summarizing the above abnormal results, the electronic device generates diagnostic results based on the abnormality type and the corresponding state path, and identifies the fault type as connection timeout, authentication failure, control interruption or abnormal state feedback, etc., locates the root cause of the fault to the specific event link, abnormal state node or missing event location, and outputs the diagnostic confidence level in combination with the confidence level of the aforementioned timestamp alignment results.

[0220] For example, a state machine is constructed for the Bluetooth parking process, including the following event states and state transition rules:

[0221]

[0222] Table 2

[0223]

[0224] Table 3

[0225] Traverse the event sequence in aligned chronological order:

[0226] Current state = S0

[0227] Read events one by one according to the aligned event sequence (in ascending order of time):

[0228] The event conforms to the state transition rules:

[0229] (1) Normal time interval → Normal switching state, update jump time;

[0230] (2) If the time interval is too short, mark it as noise / retransmission and discard the event;

[0231] (3) The time interval is too long → record the timing alarm and still switch states.

[0232] If there is no corresponding valid state transition rule for the event, mark the state as abnormal and switch to the ERROR error state.

[0233] When locating the root cause of a fault, the root cause can be determined based on the type of anomaly detected:

[0234]

[0235] Table 4

[0236] Figure 7 This is a schematic diagram of the fault diagnosis output provided in the embodiments of this application, such as... Figure 7 As shown, the diagnostic results output includes a diagnostic report with the following 5 fields and the key chain of evidence in Table 6:

[0237]

[0238] Table 5

[0239]

[0240] Table 6

[0241] in addition, Figure 7 It also includes the interface layout of the diagnostic report, including a title bar, basic information area, key evidence chain timeline, recommended measures area, and operation buttons (expand detailed log, export diagnostic report).

[0242] Using the above diagnostic method, the diagnostic process no longer relies on simple comparison of raw timestamps. Instead, it uses event state machines and state transition rules to constrain and verify events after timestamp alignment. This allows for the simultaneous identification of timing anomalies, state transition anomalies, and missing events, and outputs the fault type, root cause location, and confidence level accordingly. This makes the cross-device log diagnostic results more complete and the location more precise.

[0243] Figure 8 This is a schematic diagram of the overall process of the fault diagnosis method provided in the embodiments of this application, as shown below. Figure 8 As shown, it includes the following steps:

[0244] Step 801: Collect Bluetooth logs from the vehicle's infotainment system;

[0245] Step 802: Collect Bluetooth logs from the mobile device;

[0246] Step 803: Extract the event fingerprint. This event fingerprint is calculated from the connection handle, opcode, and payload hash.

[0247] Step 804: Extract the event fingerprint. This event fingerprint is calculated from the connection handle, opcode, and payload hash.

[0248] Step 805: Cross-platform fingerprint matching;

[0249] Step 806: Obtain the set of matching point pairs (t_car, t_phone);

[0250] Step 807: RANSAC + timing constraint iteration;

[0251] Step 808: If the maximum number of iterations has not been reached, randomly sample two candidate matching point pairs;

[0252] Step 809: Fit a temporary linear model;

[0253] Step 810: Calculate the residuals for all candidate matching pairs;

[0254] Step 811: Determine whether the residual is less than the preset residual threshold;

[0255] Step 812: If yes, add to the initial inlier set current_inliers;

[0256] Step 813: If not, skip the candidate matching point pair;

[0257] Step 814: Check if the timing constraint order is consistent;

[0258] Step 815: If yes, then determine whether the candidate matching point pairs in the initial inlier set current_inliers are optimal;

[0259] Step 816: If not, then remove the candidate matching point pair;

[0260] Step 817: Update the optimal initial inlier set current_inliers;

[0261] Step 818: Refit using the optimal initial inlier set current_inliers;

[0262] Step 819: Fit the drift model. This can be divided into a global model or a piecewise model;

[0263] Step 820: Time Transformation. This involves unifying the timeline.

[0264] Step 821: Confidence calculation;

[0265] Step 822: Determine the confidence level;

[0266] Step 823: If the confidence level is medium or high, then construct the state machine;

[0267] Step 824: Traverse the aligned event sequence;

[0268] Step 825: Anomaly Detection;

[0269] Step 826: Root cause identification;

[0270] Step 827: Output diagnostic results. This may include the fault type, chain of evidence, and recommendations.

[0271] Step 828: If the confidence level is low, output a warning that the table alignment result is unreliable.

[0272] This embodiment proposes a complete "alignment + diagnosis" solution, the above Figure 8 This demonstrates the complete methodology of this solution from log collection to fault diagnosis output, comprising two main parts: the alignment phase and the diagnosis phase.

[0273] I. Alignment Stage: First, cross-end matching point pairs are obtained through Bluetooth event fingerprinting (noise exists); then, the RANSAC algorithm with time constraints is used to remove false positive matches and out-of-order points; next, a drift model is fitted based on the set of interior points (supporting piecewise linearity to adapt to changes in drift rate); finally, the alignment results and confidence levels are output.

[0274] II. Diagnostic Phase: Construct a state machine based on the aligned multi-terminal event sequence, traverse it in chronological order and detect abnormal patterns such as timing window anomalies, illegal state transitions, and missing events, and output the fault diagnosis results based on the confidence level.

[0275] The above-mentioned alignment stage can solve the defects of traditional alignment methods and can handle the noise unique to Bluetooth logs, such as false positive matches caused by retransmission, out-of-order matching caused by buffering, incorrect matching caused by hash collisions, and sparse and uneven distribution of matching points. It can still accurately fit the clock drift model even when the matching points contain noise.

[0276] In addition, the above-mentioned diagnostic phase can overcome the shortcomings of traditional single-end diagnostic methods. By aligning the multi-end event sequences, the root cause of the fault can be automatically diagnosed, and interpretable diagnostic results (including fault type, root cause location, and key evidence chain) can be output, supporting cross-end causal relationship analysis.

[0277] For example, taking a Bluetooth parking connection timeout failure as an example, the complete implementation process of this solution is illustrated:

[0278] (1) Scenario setting: The user initiates Bluetooth parking in the underground garage through a mobile application and a connection timeout failure occurs during the parking process. The vehicle terminal and the mobile terminal record Bluetooth logs respectively. The logs contain duplicate events caused by retransmission (about 15% false positives) and out-of-order events caused by caching.

[0279] (2) Alignment stage:

[0280] Vehicle-mounted logs: T_car=1000.052 records connection completed, T_car=1000.120 records authentication request; Mobile-mounted logs: T_phone=1000.150 records connection completed, T_phone=1000.200 records authentication request, and there is also an out-of-order record T_phone=1000.250.

[0281] The RANSAC+ temporal constraint algorithm eliminated out-of-order false positive matches, selected the inlier set {M1, M3}, and fitted a drift model: a=1.0, b=0.089. After time transformation, the mobile events were transformed to a unified time axis: T=1000.061, T=1000.111. Confidence calculation: number of inliers = 2, residual standard deviation = 9 milliseconds → medium confidence.

[0282] (3) Diagnostic stage:

[0283] 1. Build a state machine and traverse the aligned event sequence; 2. If no authentication response is received after 400 milliseconds following the detection of an authentication request, a connection timeout is eventually triggered; 3. Root cause analysis: The mobile device did not respond to the authentication request; 4. Output a diagnostic report, including the fault type, root cause analysis, confidence level, chain of evidence, and recommended actions.

[0284] Figure 9 A schematic diagram of the fault diagnosis device provided in this application is shown below. Figure 9 As shown, the fault diagnosis device 90 provided in this embodiment includes:

[0285] The acquisition module 901 is used to acquire the log events recorded by the first device and the second device respectively, and the timestamp of each log event;

[0286] The generation module 902 is used to generate at least two candidate matching point pairs based on the log events recorded by the first device and the second device respectively. The candidate matching point pairs include the first log event recorded by the first device and the second log event recorded by the second device, and the first log event and the second log event satisfy a preset matching condition.

[0287] The elimination module 903 is used to eliminate at least two candidate matching point pairs to obtain the target matching point pair;

[0288] Alignment module 904 is used to align the timestamps of each target log event in a target matching point pair to the same timeline;

[0289] The diagnostic module 905 is used to perform fault diagnosis on the first and second devices based on the target log events after time axis alignment.

[0290] Optionally, the generation module can be specifically used for:

[0291] Extract the event fingerprint of each log event recorded by the first device and the second device respectively;

[0292] From each event fingerprint, determine the first event fingerprint and the second event fingerprint that match each other. The first event fingerprint is the event fingerprint of the first log event, and the second event fingerprint is the event fingerprint of the second log event.

[0293] The first log event and the second log event are combined to form candidate matching point pairs.

[0294] Optionally, the elimination module can be specifically used to: identify abnormal matching point pairs among at least two candidate matching point pairs; and then eliminate the abnormal matching point pairs from the at least two candidate matching point pairs to obtain the target matching point pairs. Specifically, the log events in the abnormal matching point pairs are duplicates of the log events in other candidate matching point pairs, or the timestamps of the log events in the abnormal matching point pairs are out of order.

[0295] Optionally, the rejection module can be specifically used for:

[0296] A temporary linear model is fitted based on at least two candidate matching point pairs. The temporary linear model includes a first temporary parameter and a second temporary parameter.

[0297] Based on the first temporary parameter, the second temporary parameter, and the timestamp of the first log event in each candidate matching point pair, the predicted timestamp of the second log event in each candidate matching point pair is calculated.

[0298] Based on the predicted timestamp of the second log event and the actual timestamp of the second log event, the time residual of each candidate matching point pair is calculated;

[0299] The matching point pairs to be filtered are determined from each candidate matching point pair and added to the initial inlier set. The time residual of the matching point pairs to be filtered is less than the preset residual threshold.

[0300] A time-series check is performed on the pairs of matching points to be screened in the initial set of interior points to identify abnormal matching points.

[0301] Optionally, the rejection module can be specifically used to: sort each pair of matching points to be filtered, generating a sequence of matching point pairs; if the timestamp of the second log event in the previous pair of matching point pairs to be filtered is greater than the timestamp of the second log event in the next pair of matching point pairs to be filtered, then the previous pair of matching point pairs to be filtered is identified as an abnormal matching point pair. Specifically, the timestamp of the first log event in the previous pair of matching point pairs to be filtered is less than the timestamp of the first log event in the next pair of matching point pairs to be filtered.

[0302] Optionally, the alignment module can be used to: fit a time drift model using target matching point pairs; and align the timestamps of each target log event in the target matching point pair to the same time axis based on the time drift model.

[0303] Optionally, the alignment module can be used to: determine a time window based on the timestamps of each target log event in the target matching point pair; if the time window is a short time window, then construct a time drift model based on the timestamps of the target log events recorded by the first device, the preset clock drift rate, and the preset initial offset. A short time window refers to a time window with a duration less than the preset duration.

[0304] Optionally, the alignment module can be specifically used to: if the time window is a long time window, divide each target log event in the target matching point pair into different sub-time windows; obtain the first correction parameter and the second correction parameter corresponding to each sub-time window; and determine the time drift model corresponding to each sub-time window based on the first correction parameter, the second correction parameter, and the timestamp of the target log event recorded by the first device. Here, a long time window refers to a time window with a duration greater than or equal to a preset duration.

[0305] Optionally, the fault diagnosis device also includes a hierarchical module for:

[0306] Obtain the number of target matching point pairs and the standard deviation of the residuals corresponding to the time residuals of the target matching point pairs;

[0307] If the number of target matching point pairs and the residual standard deviation meet the preset first condition, then the timestamp alignment result of each target log event is determined to be of high confidence; the preset first condition is that the number of target matching point pairs is greater than the first quantity threshold and the residual standard deviation is less than the first time threshold.

[0308] If the number of target matching point pairs and the standard deviation of residuals meet the preset second condition, then the timestamp alignment result of each target log event is determined to be of medium confidence. The preset second condition is that the number of target matching point pairs is greater than the second quantity threshold, and the standard deviation of residuals is less than the second time threshold. The second quantity threshold is less than the first quantity threshold, and the second time threshold is greater than the first time threshold.

[0309] If the number of target matching point pairs and the residual standard deviation do not meet the preset first condition and the preset second condition, then the timestamp alignment result of each target log event is determined to be of low confidence.

[0310] Optionally, the diagnostic module can be specifically used for:

[0311] Construct an event state machine and the state transition rules for each event in the event state machine;

[0312] Iterate through each target log event after timestamp alignment, and determine whether there is a target anomaly in the first device and the second device based on the event state machine and state transition rules. The target anomaly includes at least one of the following: timing anomaly, state transition anomaly, and event missing.

[0313] When a target anomaly is present, a diagnostic result is generated, which includes at least one of the following: fault type, root cause location, and confidence level.

[0314] Optionally, the first device is an in-vehicle device, and the second device is a remote mobile device.

[0315] The fault diagnosis device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0316] Figure 10 A schematic diagram of the structure of the electronic device provided in this application. Figure 10 As shown, the electronic device 1000 provided in this embodiment includes at least one processor 1001 and a memory 1002. Optionally, the electronic device 1000 also includes a communication component 1003.

[0317] The processor 1001, memory 1002, and communication component 1003 are connected via a bus.

[0318] In a specific implementation, at least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the above-described method.

[0319] The specific implementation process of the processor can be found in the above method embodiments, and its implementation principle and technical effect are similar, so it will not be repeated here.

[0320] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0321] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0322] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0323] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0324] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0325] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0326] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0327] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

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

[0329] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0330] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0331] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0332] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

[0333] The above embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention.

Claims

1. A fault diagnosis method, characterized in that, include: Obtain the log events recorded by the first device and the second device respectively, and the timestamp of each log event; Based on the log events recorded by the first device and the second device respectively, at least two candidate matching point pairs are generated. The candidate matching point pairs include a first log event recorded by the first device and a second log event recorded by the second device, and the first log event and the second log event satisfy a preset matching condition. Anomaly removal is performed on the at least two candidate matching point pairs to obtain the target matching point pair; Align the timestamps of each target log event in the target matching point pair to the same timeline; Based on the timeline-aligned target log events, fault diagnosis is performed on the first device and the second device.

2. The method according to claim 1, characterized in that, The step of generating at least two candidate matching point pairs based on the log events recorded by the first device and the second device respectively includes: Extract the event fingerprint of each log event recorded by the first device and the second device respectively; Determine a first event fingerprint and a second event fingerprint that match each other from the various event fingerprints, wherein the first event fingerprint is the event fingerprint of the first log event and the second event fingerprint is the event fingerprint of the second log event; The first log event and the second log event are combined to form the candidate matching point pair.

3. The method according to claim 1, characterized in that, The step of removing anomalies from the at least two candidate matching point pairs to obtain the target matching point pair includes: An abnormal matching point pair is determined among the at least two candidate matching point pairs, wherein the log events in the abnormal matching point pair are duplicated with the log events in other candidate matching point pairs, or the timestamps of the log events in the abnormal matching point pair are out of order. The abnormal matching point pairs are removed from the at least two candidate matching point pairs to obtain the target matching point pairs.

4. The method according to claim 3, characterized in that, The step of determining abnormal matching point pairs among the at least two candidate matching point pairs includes: Based on the at least two candidate matching point pairs, a temporary linear model is fitted to obtain the temporary linear model, which includes a first temporary parameter and a second temporary parameter. Based on the first temporary parameter, the second temporary parameter, and the timestamp of the first log event in each candidate matching point pair, the predicted timestamp of the second log event in each candidate matching point pair is calculated. Based on the predicted timestamp of the second log event and the actual timestamp of the second log event, the time residual of each candidate matching point pair is calculated; The matching point pairs to be screened are determined from each candidate matching point pair and added to the initial inlier set. The time residual of the matching point pairs to be screened is less than a preset residual threshold. A time-series check is performed on the pairs of matching points to be screened in the initial set of interior points to identify the abnormal matching points.

5. The method according to claim 4, characterized in that, The step of performing a time-series check on the pairs of matching points to be screened in the initial set of interior points to determine the abnormal matching point pairs includes: Sort each pair of matching points to be filtered to generate a sequence of matching points, wherein the timestamp of the first log event of the previous pair of matching points to be filtered in the sequence of matching points is less than the timestamp of the first log event of the next pair of matching points to be filtered. If the timestamp of the second log event in the previous pair of matching points to be filtered is greater than the timestamp of the second log event in the next pair of matching points to be filtered, then the previous pair of matching points to be filtered is determined as the abnormal matching pair.

6. The method according to claim 1, characterized in that, Aligning the timestamps of each target log event in the target matching point pair to the same timeline includes: Using the target matching point pairs, a time drift model is obtained by fitting. Based on the time drift model, the timestamps of each target log event in the target matching point pair are aligned to the same time axis.

7. The method according to claim 6, characterized in that, The step of fitting a time-drift model using the target matching point pairs includes: A time window is determined based on the timestamps of each target log event in the target matching point pair; If the time window is a short time window, then the time drift model is constructed based on the timestamp of the target log event recorded by the first device, the preset clock drift rate, and the preset initial offset. The short time window refers to a time window with a duration less than the preset duration.

8. The method according to claim 6, characterized in that, The step of fitting a time-drift model using the target matching point pairs includes: If the time window is a long time window, then each target log event in the target matching point pair will be divided into different sub-time windows. The long time window refers to a time window with a duration greater than or equal to a preset duration. Obtain the first and second correction parameters corresponding to each sub-time window; Based on the first correction parameter, the second correction parameter, and the timestamp of the target log event recorded by the first device, the time drift model corresponding to each sub-time window is determined.

9. The method according to claim 1, characterized in that, Also includes: Obtain the number of the target matching point pairs and the standard deviation of the residuals corresponding to the time residuals of the target matching point pairs; If the number of target matching point pairs and the residual standard deviation meet a preset first condition, then the timestamp alignment result of each target log event is determined to be of high confidence; the preset first condition is that the number of target matching point pairs is greater than a first quantity threshold and the residual standard deviation is less than a first time threshold. If the number of target matching point pairs and the residual standard deviation meet the preset second condition, then the timestamp alignment result of each target log event is determined to be of medium confidence. The preset second condition is that the number of target matching point pairs is greater than the second quantity threshold, and the residual standard deviation is less than the second time threshold. The second quantity threshold is less than the first quantity threshold, and the second time threshold is greater than the first time threshold. If the number of target matching point pairs and the residual standard deviation do not meet the preset first condition and the preset second condition, then the timestamp alignment result of each target log event is determined to be of low confidence.

10. The method according to claim 1, characterized in that, The fault diagnosis of the first and second devices based on the time-axis aligned target log events includes: Construct an event state machine and the state transition rules for each event in the event state machine; Traverse each target log event after timestamp alignment, and determine whether there is a target anomaly in the first device and the second device based on the event state machine and the state transition rules. The target anomaly includes at least one of timing anomaly, state transition anomaly and event missing. When the target anomaly is present, a diagnostic result is generated, which includes at least one of the following: fault type, root cause location, and confidence level.

11. The method according to any one of claims 1-10, characterized in that, The first device is an in-vehicle infotainment system, and the second device is a remote mobile device.

12. A fault diagnosis device, characterized in that, include: The acquisition module is used to acquire the log events recorded by the first device and the second device respectively, and the timestamp of each log event; The generation module is configured to generate at least two candidate matching point pairs based on the log events recorded by the first device and the second device respectively. The candidate matching point pairs include a first log event recorded by the first device and a second log event recorded by the second device, and the first log event and the second log event satisfy a preset matching condition. The elimination module is used to eliminate anomalies from the at least two candidate matching point pairs to obtain the target matching point pair; The alignment module is used to align the timestamps of each target log event in the target matching point pair to the same timeline; The diagnostic module is used to perform fault diagnosis on the first device and the second device based on the target log events after time axis alignment.

13. An electronic device, characterized in that, include: Memory and processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-11.