Communication anomaly detection system and method based on vehicle-mounted communication gateway

By dividing log files into four categories and setting four judgment mechanisms, and adaptively switching judgment methods, the problems of error and low efficiency in vehicle communication interruption anomaly detection are solved, and the accuracy and efficiency are improved.

CN121907730APending Publication Date: 2026-04-21SHENZHEN YOUWEI INFORMATION TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN YOUWEI INFORMATION TECH DEV CO LTD
Filing Date
2026-02-25
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies suffer from errors and low efficiency in detecting vehicle communication interruptions, and cannot adaptively plan detection mechanisms to improve accuracy and efficiency.

Method used

By classifying log files into four categories—namely, abnormal file size or generation time caused by vehicle communication interruption, fluctuations in data volume of the vehicle terminal, and disk I/O anomalies—four judgment mechanisms are set up, and the judgment mechanism is adaptively switched to improve accuracy and efficiency.

Benefits of technology

This approach improves both the accuracy and efficiency of vehicle communication interruption detection, prioritizing accuracy by analyzing historical data to select the optimal judgment mechanism and reduce redundant detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907730A_ABST
    Figure CN121907730A_ABST
Patent Text Reader

Abstract

The invention discloses a communication anomaly detection system and method based on a vehicle-mounted communication gateway, and relates to the technical field of communication detection, and the method comprises the steps: receiving vehicle positioning data through the vehicle-mounted communication gateway, writing the data into a log file, and importing the positioning data into a database, the method comprises the following steps: acquiring positioning data imported into a database in a log file form in the past, acquiring the size and generation time of the log file, calling the size and generation time data of abnormal log files generated due to different reasons in the past, and dividing the abnormal log files into four types, generating four sections for judging whether a vehicle communication interruption abnormal condition occurs or not, setting four communication interruption abnormal judgment mechanisms, and judging whether the vehicle communication interruption abnormal condition occurs or not according to switching of the four mechanisms and the four sections; the detection efficiency is improved while the vehicle communication interruption anomaly detection 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 communication detection technology, specifically a communication anomaly detection system and method based on an in-vehicle communication gateway. Background Technology

[0002] The vehicle communication gateway is responsible for coordinating communication between different electronic systems to ensure the safe and efficient operation of the vehicle. Its main functions include protocol conversion, data routing, fault diagnosis, and network security protection. When performing the task of importing vehicle positioning data, the vehicle communication gateway receives positioning data from the vehicle terminal and writes the positioning data to a log file in the local disk folder. The database import program then periodically scans the log file directory and parses the log files. Finally, it calls the import command to write the positioning data in the log file to the database, thereby completing the data import task. During the data import process, the generation time and file size of log files can be used to detect whether a vehicle communication interruption has occurred. However, log file generation anomalies are not necessarily caused by vehicle communication interruptions. For example, if the log file generation is delayed, the cause may be a vehicle communication interruption or a disk I / O anomaly. In some cases, a single judgment mechanism may lead to errors in the detection of vehicle communication interruptions. However, using a multi-layer judgment mechanism in all cases will reduce detection efficiency. Existing technology lacks a way to adaptively plan and switch vehicle communication interruption detection mechanisms, and cannot improve the detection efficiency while improving the accuracy of vehicle communication interruption detection. Summary of the Invention

[0003] The purpose of this invention is to provide a communication anomaly detection system and method based on an in-vehicle communication gateway to solve the problems raised in the prior art.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a communication anomaly detection method based on an in-vehicle communication gateway, the method comprising: The vehicle communication gateway is used to receive vehicle location data and write the data to a log file, and then import the location data into the database. Collect location data that was previously imported into the database in the form of log files, obtain the log file size and log file generation time, and retrieve the size and generation time data of abnormal log files generated for different reasons in the past.

[0005] Preferably, the abnormal log files are divided into four categories: log files with abnormal file size due to vehicle communication interruption, log files with abnormal file size due to fluctuations in the data volume of the vehicle terminal, log files with abnormal file generation time due to vehicle communication interruption, and log files with abnormal file generation time due to disk I / O abnormality. The four types of abnormal log files are defined as the first log file, the second log file, the third log file, and the fourth log file, respectively. Since abnormal log file sizes may be caused by vehicle communication interruptions or fluctuations in data volume of the vehicle terminal without interruption of vehicle communication, and abnormal log file generation delays may be caused by vehicle communication interruptions or disk I / O anomalies without interruption of vehicle communication, log file anomalies caused by vehicle communication interruptions are generally more serious than those caused by data volume fluctuations or disk I / O anomalies. However, existing technologies cannot define the range of differences between the log file size and the normal log file size caused by different reasons, as well as the range of abnormal log file generation delays. Therefore, this invention collects historical log files, extracts abnormal log files from them, and classifies them into four categories, each representing log files with different anomalies caused by different reasons. This is beneficial for providing accurate data support for setting different anomaly ranges based on subsequent data comparisons of historical log files. Preferably, the differences between the sizes of all first log files and the set normal log file size, the differences between the sizes of all second log files and the set normal log file size, the generation delay time of all third log files and all fourth log files are obtained, and the difference range between the log file size caused by vehicle communication interruption and the normal log file size, the difference range between the log file size caused by fluctuations in the data volume of the vehicle terminal and the normal log file size, the log file generation delay time range caused by vehicle communication interruption, and the log file generation delay time range caused by disk I / O abnormality are generated and defined as the first interval, the second interval, the third interval, and the fourth interval, respectively.

[0006] Preferably, four communication interruption exception judgment mechanisms are set up, namely: the first mechanism: judging whether a vehicle communication interruption has occurred based solely on the comparison of log file size; the second mechanism: judging whether a vehicle communication interruption has occurred based solely on the comparison of log file generation delay duration; the third mechanism: judging whether a vehicle communication interruption has occurred based on the first judgment path: comparing log file size → comparing log file generation delay duration; and the fourth mechanism: judging whether a vehicle communication interruption has occurred based on the second judgment path: comparing log file generation delay duration → comparing log file size. By setting up four communication interruption anomaly judgment mechanisms, different judgment mechanisms can be adaptively switched according to different situations to achieve accurate judgment of vehicle communication interruption status. In the prior art, judging whether a vehicle communication interruption anomaly has occurred based on only one parameter is prone to errors in judgment results. That is, the cause of the corresponding parameter abnormality is not vehicle communication interruption but other reasons, but it is misjudged as being caused by vehicle communication interruption. Usually, multiple judgment mechanisms are set up for judgment, such as using the third and fourth mechanisms mentioned above. However, if multiple judgment mechanisms are used in all cases, in some cases, a severe abnormality of only one parameter is sufficient to judge that the vehicle communication interruption is abnormal, and the detection efficiency of vehicle communication interruption is not improved. Therefore, this invention sets up four mechanisms to flexibly switch judgment mechanisms according to actual conditions, thereby improving both the accuracy and efficiency of vehicle communication interruption anomaly detection.

[0007] Preferably, the third or fourth mechanism is used to determine communication anomalies. Considering that detection accuracy is more important than detection efficiency, this invention prioritizes a multi-layered mechanism to determine abnormal communication conditions, thus ensuring the accuracy of vehicle communication interruption detection.

[0008] If the third mechanism is used first to determine communication anomalies, the size of the log file currently imported into the database is obtained. If the difference between the current log file size and the normal log file size is within the first interval, the third mechanism is switched to the first mechanism, indicating that the vehicle has experienced a communication interruption. If the difference between the current log file size and the normal log file size is within the second interval, the mechanism is not switched, and the generation delay of the current log file is obtained. If the generation delay of the current log file is within the third interval, the vehicle has experienced a communication interruption; otherwise, the vehicle has not experienced a communication interruption. If the fourth mechanism is prioritized to determine communication anomalies, the generation delay of the current log file is obtained. If the generation delay is within the third interval, the fourth mechanism is switched to the second mechanism, indicating a communication interruption for the vehicle. If the generation delay is within the fourth interval, the mechanism is not switched, and the size of the currently imported log file is obtained. If the difference between the current log file size and the normal log file size is within the first interval, the vehicle is considered to have experienced a communication interruption; otherwise, the vehicle is considered not to have experienced a communication interruption.

[0009] Preferably, the preferred selection method for the third and fourth mechanisms is as follows: when communication interruptions occur consecutively n times before the current time, the number of times the difference between the generated log file size and the normal log file size is within the first interval is obtained as a, and the probability of abnormal log file size is predicted as P1 if communication interruption occurs at the current time according to the formula P1=a / n. When the number of times that the log file generation delay duration is within the third interval during n consecutive communication interruptions before the current time is obtained as b, according to the formula P2 = b / n, the probability of log file generation delay abnormality when a communication interruption occurs currently is predicted as P2. Compare P1 and P2: If P1 > P2, the third mechanism is preferentially selected to judge the communication abnormality condition; if P1 < P2, the fourth mechanism is preferentially selected to judge the communication abnormality condition; if P1 = P2, a mechanism is randomly selected from the third mechanism and the fourth mechanism as the preferentially selected mechanism to judge the communication abnormality condition. Among the two preferentially selected mechanisms, further judge the currently best preferential judgment mechanism. By analyzing the proportion of the number of occurrences of log file size abnormality and the proportion of the number of occurrences of log file generation delay duration abnormality during several consecutive communication interruptions before the current time, judge the log file abnormality condition with a higher probability when a communication interruption occurs currently, and further select a preferential mechanism to judge the communication abnormality condition, that is, preferentially detect the log file abnormality condition that is more likely to occur. If it is detected that the corresponding condition is indeed abnormal, there is no need to detect the other condition, and the first mechanism or the second mechanism can be switched to judge, further improving the detection efficiency of the communication abnormality condition.

[0010] Preferably, the generation method of the first interval is as follows: The set of differences between the sizes of all first log files and the set normal log file size is retrieved as L = {L1, L2,..., L m}, m represents the number of first log files, each difference term in the set L is numbered, and the number set is {1, 2,..., m}, generating data points {(1, L1), (2, L2),..., (m, L m )}. Map the data points to the rectangular coordinate system, perform linear fitting on the data points to generate the best fit line, and the equation of the best fit line is: y = βx + γ, where β is the slope of the best fit line and γ is the intercept of the best fit line. Set the difference change degree threshold as H, and compare β and H: If β < H, the generation method of the first interval is selected as: Screen out the maximum value as L max and the minimum value as L min from the set L, and set the first interval as [L min , L max ; if β ≥ H, the generation method of the first interval is selected as: Screen out several values with the most occurrences from the set L, obtain the minimum value c among the selected several values and the maximum value d among the selected several values, and set the first interval as [c, d].

[0011] Preferably, the generation methods of the second interval, the third interval, and the fourth interval are the same as the generation method of the first interval.

[0012] Preferably, the step of receiving vehicle positioning data using the vehicle communication gateway and writing the data to a log file includes: receiving vehicle positioning data using the vehicle communication gateway and writing the positioning data to a log file in a local disk folder; the step of importing the positioning data into the database includes: periodically scanning the log file directory using a database import program, reading the log file and parsing the file content, and writing the positioning data into the database using an import command from the database.

[0013] A communication anomaly detection system based on a vehicle-mounted communication gateway includes: a data import planning module, an import data acquisition module, a detection mechanism setting module, and a communication anomaly detection module; The data import planning module uses the vehicle communication gateway to receive vehicle positioning data and writes the data to a log file, then imports the positioning data into the database. The data acquisition module collects location data that was previously imported into the database in the form of log files, and obtains the log file size and log file generation time. The detection mechanism setting module retrieves the size and generation time data of abnormal log files generated for different reasons in the past, divides the abnormal log files into four categories, generates four intervals for judging whether a vehicle communication interruption abnormal situation has occurred, and sets four communication interruption abnormal judgment mechanisms. The communication anomaly detection module uses four mechanisms and four intervals to determine whether a vehicle communication interruption anomaly has occurred.

[0014] Compared with the prior art, the beneficial effects of the present invention are: Since abnormal log file sizes may be caused by vehicle communication interruptions or fluctuations in data volume of the vehicle terminal without interruption of vehicle communication, and abnormal log file generation delays may be caused by vehicle communication interruptions or disk I / O anomalies without interruption of vehicle communication, log file anomalies caused by vehicle communication interruptions are generally more serious than those caused by data volume fluctuations or disk I / O anomalies. However, existing technologies cannot define the range of differences between the log file size and the normal log file size caused by different reasons, as well as the range of abnormal log file generation delays. Therefore, this invention collects historical log files, extracts abnormal log files from them, and classifies them into four categories, each representing log files with different anomalies caused by different reasons. This is beneficial for providing accurate data support for setting different anomaly ranges based on subsequent data comparisons of historical log files. By setting up four communication interruption anomaly judgment mechanisms, different judgment mechanisms can be adaptively switched according to different situations to achieve accurate judgment of vehicle communication interruption status. This improves both the accuracy and efficiency of vehicle communication interruption anomaly detection. In addition, considering that detection accuracy is more important than detection efficiency, this invention prioritizes the use of multi-layer mechanisms to judge communication anomaly status, which can prioritize the accuracy of vehicle communication interruption anomaly detection. Among the two preferred mechanisms, the optimal priority mechanism is determined by analyzing the percentage of abnormal log file size and log file generation delay times during several consecutive communication interruptions prior to the current time. This helps identify the log file anomalies that are more likely to occur if a communication interruption occurs. The preferred mechanism is then selected to detect more likely log file anomalies. If an anomaly is detected, there is no need to detect the other anomaly; the system can switch to either the first or second mechanism for judgment, thus improving the efficiency of communication anomaly detection. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating a communication anomaly detection method based on a vehicle-mounted communication gateway according to the present invention. Figure 2 This is a schematic diagram illustrating the mechanism switching of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example

[0017] like Figure 1 As shown, this embodiment provides a communication anomaly detection method based on an in-vehicle communication gateway. The method includes: The process involves using an onboard communication gateway to receive vehicle location data and write it to a log file, then importing the location data into a database. This includes: periodically scanning the log file directory using a database import program, reading the log files and parsing their contents, and then using the database import command to write the location data into the database. Collect location data that was previously imported into the database in the form of log files, and obtain the log file size and log file generation time; Retrieve the size and generation time data of abnormal log files generated due to different reasons in the past, classify the abnormal log files into four categories, and generate four intervals for judging whether there is an abnormal situation of vehicle communication interruption currently: The abnormal log files are classified into the following four types of abnormal log files: log files with abnormal file size caused by vehicle communication interruption, log files with abnormal file size caused by fluctuations in in-vehicle terminal data volume, log files with abnormal file generation time caused by vehicle communication interruption, and log files with abnormal file generation time caused by disk I / O abnormality; Define the four types of abnormal log files as the first log file, the second log file, the third log file, and the fourth log file respectively, obtain the difference between the size of all first log files and the size of the set normal log file, the difference between the size of all second log files and the size of the set normal log file, obtain the generation delay duration of all third log files and all fourth log files, generate the difference interval between the size of the log file caused by vehicle communication interruption and the size of the normal log file, the difference interval between the size of the log file caused by fluctuations in in-vehicle terminal data volume and the size of the normal log file, the generation delay duration interval of the log file caused by vehicle communication interruption, and the generation delay duration interval of the log file caused by disk I / O abnormality, and define them as the first interval, the second interval, the third interval, and the fourth interval respectively; The generation method of the first interval is: Retrieve the difference set between the size of all first log files and the size of the set normal log file as L = {L1, L2,..., L m}, m represents the number of first log files, number each difference item in the set L, and the number set is {1, 2,..., m}, generate data points {(1, L1), (2, L2),..., (m, L m )}, map the data points to the rectangular coordinate system, perform linear fitting on the data points to generate the best fitting line, and the equation of the best fitting line is: y = βx + γ, where β is the slope of the best fitting line and γ is the intercept of the best fitting line. Set the difference change degree threshold as H, and compare β and H: If β < H, the generation method of the first interval is: Select the maximum value as L max and the minimum value as L min from the set L, and set the first interval as [L min , L max ; If β ≥ H, the generation method of the first interval is: Select several values with the most occurrences from the set L, obtain the minimum value c among the selected several values and the maximum value d among the selected several values, and set the first interval as [c, d]; For example: If the slope of the best-fit line is β=0.4, and the threshold for the degree of difference change is set to H=0.25, then β>H, the method for generating the first interval is as follows: Select the most frequently occurring values ​​from the set L, and obtain the minimum value c and the maximum value d among the selected values. Set the first interval as [c,d]. Retrieve the set of differences between the size of all first log files and the set normal log file size as L={50, 48, 45, 60, 48, 50, 60}, in KB. Select the most frequently occurring values ​​from the set L as 50, 48, and 60, with the minimum value being 48 and the maximum value being 60. Then set the first interval as [48,60].

[0018] Four communication interruption exception detection mechanisms are set up: Mechanism 1: Determines whether vehicle communication interruption has occurred based solely on log file size comparison; Mechanism 2: Determines whether vehicle communication interruption has occurred based solely on log file generation delay comparison; Mechanism 3: Determines whether vehicle communication interruption has occurred based on the first judgment path: comparing log file size → comparing log file generation delay comparison; Mechanism 4: Determines whether vehicle communication interruption has occurred based on the second judgment path: comparing log file generation delay → comparing log file size. Based on the switching of four mechanisms and four intervals, it is determined whether a vehicle communication interruption has occurred: the third or fourth mechanism is prioritized to determine the communication anomaly, such as... Figure 2 As shown, if the third mechanism is used first to determine the communication anomaly, the size of the log file currently imported into the database is obtained. If the difference between the current log file size and the normal log file size is within the first interval, the third mechanism is switched to the first mechanism, and it is determined that the vehicle has experienced a communication interruption. If the difference between the current log file size and the normal log file size is within the second interval, the mechanism is not switched, and the generation delay of the current log file is obtained. If the generation delay of the current log file is within the third interval, it is determined that the vehicle has experienced a communication interruption; otherwise, it is determined that the vehicle has not experienced a communication interruption. If the fourth mechanism is prioritized to determine communication anomalies, the generation delay of the current log file is obtained. If the generation delay is within the third interval, the fourth mechanism is switched to the second mechanism, indicating a communication interruption for the vehicle. If the generation delay is within the fourth interval, the mechanism is not switched, and the size of the currently imported log file is obtained. If the difference between the current log file size and the normal log file size is within the first interval, the vehicle is considered to have experienced a communication interruption; otherwise, the vehicle is considered not to have experienced a communication interruption. The priority selection methods for the third and fourth mechanisms are as follows: When the difference between the size of the log file generated during n consecutive communication interruptions before the current time and the size of the normal log file is within the first interval, the number of occurrences is a. According to the formula P1 = a / n, the probability of abnormal log file size when a communication interruption occurs currently is predicted as P1. When the number of occurrences of the log file generation delay duration within the third interval during n consecutive communication interruptions before the current time is b, according to the formula P2 = b / n, the probability of abnormal log file generation delay when a communication interruption occurs currently is predicted as P2. Compare P1 and P2: If P1 > P2, the third mechanism is preferentially selected to determine the communication abnormal situation; if P1 < P2, the fourth mechanism is preferentially selected to determine the communication abnormal situation; if P1 = P2, a mechanism is randomly selected from the third mechanism and the fourth mechanism as the preferentially selected mechanism to determine the communication abnormal situation. Embodiment

[0019] This embodiment provides a communication abnormal detection system based on a vehicle-mounted communication gateway, which is implemented based on the communication abnormal detection method in the embodiment, and specifically includes: A data import planning module, an imported data acquisition module, a detection mechanism setting module, and a communication abnormal detection module; Through the data import planning module, the vehicle-mounted communication gateway is used to receive vehicle positioning data and write the data into a log file, and the positioning data is imported into the database; Through the imported data acquisition module, the positioning data previously imported into the database in the form of a log file is collected, and the size of the log file and the log file generation time are obtained; Through the detection mechanism setting module, the sizes and generation time data of abnormal log files generated due to different reasons in the past are retrieved, the abnormal log files are divided into four categories, four intervals for determining whether a vehicle communication interruption abnormal situation occurs currently are generated, and four communication interruption abnormal judgment mechanisms are set; Through the communication abnormal detection module, it is determined whether a vehicle communication interruption abnormal situation occurs currently according to the four mechanisms and the four intervals.

[0020] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any reference signs in the claims should not be regarded as limiting the claims involved.

Claims

1. A communication anomaly detection method based on an in-vehicle communication gateway, characterized in that: The method includes: The vehicle communication gateway is used to receive vehicle location data and write the data to a log file, and then import the location data into the database. Collect location data that was previously imported into the database in the form of log files, and obtain the log file size and log file generation time; Retrieve the size and generation time data of abnormal log files generated in the past for different reasons, divide the abnormal log files into four categories, and generate four intervals to determine whether a vehicle communication interruption abnormality has occurred. Four communication interruption anomaly detection mechanisms are set up, and the current vehicle communication interruption anomaly is determined based on the switching of the four mechanisms and four intervals.

2. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 1, characterized in that: The exception log files are divided into four categories, including: Abnormal log files are classified into the following four categories: log files with abnormal file size due to vehicle communication interruption, log files with abnormal file size due to fluctuations in the amount of data in the vehicle terminal, log files with abnormal file generation time due to vehicle communication interruption, and log files with abnormal file generation time due to disk I / O abnormalities. The four types of exception log files are defined as the first log file, the second log file, the third log file, and the fourth log file, respectively.

3. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 2, characterized in that: The four intervals generated to determine whether a vehicle communication interruption has occurred include: Obtain the difference between the size of all first log files and the set normal log file size, the difference between the size of all second log files and the set normal log file size, obtain the generation delay time of all third log files and all fourth log files, and generate the difference range between the log file size caused by vehicle communication interruption and the normal log file size, the difference range between the log file size caused by fluctuation of data volume of vehicle terminal and the normal log file size, the log file generation delay time range caused by vehicle communication interruption, and the log file generation delay time range caused by disk I / O abnormality, which are defined as the first interval, the second interval, the third interval, and the fourth interval, respectively.

4. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 3, characterized in that: The generation method of the first interval is as follows: Obtain the set of differences between the sizes of all the first log files and the set normal log file size as L = {L1, L2,..., L m}, where m represents the number of first log files. Number each difference term in the set L, and the number set is {1, 2,..., m}, generating data points {(1, L1), (2, L2),..., (m, L m )}. Map the data points into a rectangular coordinate system, perform linear fitting on the data points to generate the best-fit line, and the equation of the best-fit line is: y = βx + γ, where β is the slope of the best-fit line and γ is the intercept of the best-fit line. Set the threshold for the degree of difference change as H, and compare β and H: If β < H, select the generation method of the first interval as: Screen out the maximum value L max and the minimum value L min from the set L, and set the first interval as [L min , L max ; If β ≥ H, select the generation method of the first interval as: Screen out several values that appear the most times from the set L, obtain the minimum value c among the several screened-out values and the maximum value d among the several screened-out values, and set the first interval as [c, d].

5. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 1, characterized in that: The four communication interruption exception judgment mechanisms are set up, including: The system employs the following mechanisms: a first mechanism: determining whether vehicle communication has been interrupted solely based on log file size comparison; a second mechanism: determining whether vehicle communication has been interrupted solely based on log file generation delay comparison; a third mechanism: determining whether vehicle communication has been interrupted based on the first judgment path: comparing log file size → comparing log file generation delay comparison; and a fourth mechanism: determining whether vehicle communication has been interrupted based on the second judgment path: comparing log file generation delay → comparing log file size.

6. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 5, characterized in that: The third or fourth mechanism should be used as the primary basis for judging communication anomalies.

7. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 6, characterized in that: If the communication anomaly status is judged preferentially according to the third mechanism, obtain the size of the log file currently imported into the database. If the difference between the current log file size and the normal log file size is within the first interval, switch the third mechanism to the first mechanism and judge that the vehicle has a communication interruption. If the difference between the current log file size and the normal log file size is within the second interval, do not switch the mechanism. Obtain the generation delay duration of the current log file. If the generation delay duration of the current log file is within the third interval, judge that the vehicle has a communication interruption; otherwise, judge that the vehicle has no communication interruption. If the communication anomaly status is judged preferentially according to the fourth mechanism, obtain the generation delay duration of the current log file. If the generation delay duration of the current log file is within the third interval, switch the fourth mechanism to the second mechanism and judge that the vehicle has a communication interruption. If the generation delay duration of the current log file is within the fourth interval, do not switch the mechanism. Obtain the size of the log file currently imported into the database. If the difference between the current log file size and the normal log file size is within the first interval, judge that the vehicle has a communication interruption. Otherwise, judge that the vehicle has no communication interruption.

8. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 7, characterized in that: The preferred selection methods for the third mechanism and the fourth mechanism are as follows: When it is obtained that the number of times the difference between the size of the log file generated when a communication interruption occurs continuously n times before the current time and the normal log file size is within the first interval is a, according to the formula P1 = a / n, predict the probability P1 of the log file size being abnormal when a communication interruption occurs currently. When it is obtained that the number of times the generation delay duration of the log file is within the third interval when a communication interruption occurs continuously n times before the current time is b, according to the formula P2 = b / n, predict the probability P2 of the generation delay of the log file being abnormal when a communication interruption occurs currently. Compare P1 and P2: If P1 > P2, preferentially select the third mechanism to judge the communication anomaly status; if P1 < P2, preferentially select the fourth mechanism to judge the communication anomaly status; if P1 = P2, randomly select one of the third mechanism and the fourth mechanism as the preferentially selected mechanism to judge the communication anomaly status.

9. The communication anomaly detection method based on a vehicle-mounted communication gateway according to claim 1, characterized in that: The use of the vehicle-mounted communication gateway to receive vehicle positioning data and write the data into a log file includes: using the vehicle-mounted communication gateway to receive vehicle positioning data and write the positioning data into the log file in the local disk folder. The import of the positioning data into the database includes: using the database import program to periodically scan the log file directory, read the log file and parse the file content, and write the positioning data into the database by the import instruction of the database.

10. A communication anomaly detection system based on an in-vehicle communication gateway, applied to the communication anomaly detection method based on an in-vehicle communication gateway as described in any one of claims 1-9, characterized in that: The system includes: a data import planning module, an imported data collection module, a detection mechanism setting module, and a communication anomaly detection module; Through the data import planning module, use the vehicle-mounted communication gateway to receive vehicle positioning data and write the data into a log file, and import the positioning data into the database; Through the imported data collection module, collect the positioning data previously imported into the database in the form of a log file, and obtain the log file size and the log file generation time; The detection mechanism setting module retrieves the size and generation time data of abnormal log files generated for different reasons in the past, divides the abnormal log files into four categories, generates four intervals for judging whether a vehicle communication interruption abnormal situation has occurred, and sets four communication interruption abnormal judgment mechanisms. The communication anomaly detection module uses four mechanisms and four intervals to determine whether a vehicle communication interruption anomaly has occurred.