A method, system and terminal for adaptively identifying CAN communication protocol of new energy vehicles

By adopting the CAN communication protocol adaptive identification method in new energy vehicles, the equipment can automatically match and connect products of different brands and models, solving the problem of lack of universality of CAN equipment in the existing technology, and achieving higher adaptability and Connection stability.

CN119011332BActive Publication Date: 2025-02-14LISHUI BOYUAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411487267.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-14
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

In the prior art, the CAN communication protocol in new energy vehicles lacks universality, resulting in dedicated CAN equipment that can only be used on products of specific brands and models, and cannot achieve universal connections across brands.

Method used

Through an adaptive identification method of CAN communication protocol in new energy vehicles, the device polls and judges the baud rate detection value on the CAN bus after power-on, acquires the communication data frame, and performs adaptive adjustment and matching with the preset communication protocol database. , analyze and determine compatible abnormal warning information or communication connection control information, and output it to achieve automatic matching and connection.

Benefits of technology

It realizes universality between various products, improves the adaptability and connection stability of CAN equipment, and avoids compatibility problems caused by device mismatch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011332B_ABST
    Figure CN119011332B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, system and terminal for adaptively identifying CAN communication protocol of new energy vehicles, and relates to the technical field of CAN communication protocol, which includes: after the device is powered on, polling and judging the baud rate detection value on the CAN bus after a preset waiting time; after determining the correct baud rate detection value, obtaining the communication data frame of normal data on the CAN bus in real time; adaptively adjusting and matching based on the communication data frame and the preset communication protocol database to form matching result information; analyzing and determining compatible abnormal warning information or communication connection control information according to the matching result information, and outputting compatible abnormal warning information or communication connection control information. The present invention has the effect of improving the versatility between various products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CAN communication protocol, and in particular to a method, system and terminal for adaptively identifying CAN communication protocol of a new energy vehicle. Background Art

[0002] Controller Area Network (CAN) is a high-performance serial communication protocol. The CAN communication protocol is widely used in many technical fields due to its high reliability, real-time and anti-interference capabilities.

[0003] In new energy vehicles, the CAN communication protocol plays a vital role. The CAN communication protocol is not only used for communication between electronic control units (ECUs), but also for connecting key components such as battery management systems (BMS), motor controllers, and charging systems.

[0004] With the increasing popularity of new energy vehicles, there are more and more different types of CAN communication protocols, which means that a dedicated CAN device can only be used on products of a specific brand and model and cannot be universally used. Summary of the invention

[0005] In order to improve the commonality between various products, the present invention provides a method, system and terminal for adaptively identifying the CAN communication protocol of a new energy vehicle.

[0006] In a first aspect, the present invention provides a method for adaptively identifying a CAN communication protocol for a new energy vehicle, which adopts the following technical solution:

[0007] A method for adaptively identifying a CAN communication protocol for a new energy vehicle, comprising:

[0008] After the device is powered on, it polls and determines the baud rate detection value on the CAN bus after a preset waiting time;

[0009] After determining the correct baud rate detection value, the communication data frame of normal data on the CAN bus is obtained in real time;

[0010] Based on the communication data frame, adaptive adjustment and matching are performed with a preset communication protocol database to form matching result information;

[0011] The compatible abnormality warning information or the communication connection control information is determined based on the matching result information analysis, and the compatible abnormality warning information or the communication connection control information is output.

[0012] Optionally, a method for determining a baud rate detection value includes:

[0013] Set the baud rate query value and query the data frame monitoring information in real time;

[0014] Within the preset monitoring time, the CNT count value is determined based on the data frame monitoring information analysis;

[0015] Determine whether the CNT count value is greater than a preset CNT reference value;

[0016] If yes, the baud rate query value is used as the baud rate detection value;

[0017] If not, reset the baud rate query value and query the data frame monitoring information in real time.

[0018] Optionally, a method for determining compatible abnormal warning information or communication connection control information includes:

[0019] Retrieve the number of matching data frames based on the matching result information;

[0020] Determine whether the number of matching data frames is greater than a preset reference number of matching data frames;

[0021] If yes, then retrieve the matching data frame information based on the matching result information;

[0022] Determine data frame adaptation rate information according to matching data frame information analysis;

[0023] Retrieve the value of the received data frame based on the communication data frame;

[0024] Determine the scheme matching rate based on the data frame adaptation rate information and the received data frame numerical analysis;

[0025] Determine the use function prompt information according to the solution matching rate analysis, and output the use function prompt information and the preset communication connection control information;

[0026] If not, the preset compatible abnormal warning information is output.

[0027] Optionally, the method for determining the data frame adaptation rate information includes:

[0028] Retrieving single data frame information based on matching data frame information;

[0029] Retrieving single matching frame information and corresponding matching reference frame information based on single data frame information;

[0030] Retrieving the matching frame period frequency value and the matching frame data content based on the single matching frame information;

[0031] Retrieving the reference frame frequency range and the reference frame data definition range based on the matching reference frame information;

[0032] Determine the matching frame frequency weight value according to the matching frame period frequency value and the reference frame frequency range analysis;

[0033] Determine the weight value of the matching frame data according to the matching frame data content and the reference frame data definition range analysis;

[0034] Calculate the product value between the matching frame frequency weight value, the matching frame data weight value and the preset single frame ID weight value and use it as the matching frame adaptation rate;

[0035] The matching frame adaptation rates corresponding to the individual data frame information are combined and used as the data frame adaptation rate information.

[0036] Optionally, a method for determining a weight value of matching frame data includes:

[0037] Determine whether the reference frame data definition range exists;

[0038] If yes, then determine the weight value of the range data according to the judgment result of whether the content of the matching frame data is within the definition range of the reference frame data, and use the weight value of the range data as the weight value of the matching frame data;

[0039] If not, the weight value of the out-of-range data is determined according to the consistency between the matching frame data content and the preset reference data content, and the weight value of the out-of-range data is used as the matching frame data weight value.

[0040] Optionally, the method further includes a step after calculating the product value between the matching frame frequency weight value, the matching frame data weight value and the preset single frame ID weight value and using the product value as the matching frame adaptation rate, which is specifically as follows:

[0041] Retrieving reference frame ID data based on matching reference frame information;

[0042] Determine whether the reference frame ID data is 0;

[0043] If yes, continue to output the matching frame adaptation rate;

[0044] If not, retrieve the associated ID reference frame information based on the matching reference frame information;

[0045] The associated frame adaptation rate is determined based on the associated ID reference frame information analysis, and the associated frame adaptation rate is added to the matching frame adaptation rate to form a new matching frame adaptation rate.

[0046] Optionally, the method further includes a step after combining the matching frame adaptation rates corresponding to the individual data frame information and using the matching frame adaptation rate information as the data frame adaptation rate information, which is specifically as follows:

[0047] Determine whether a single data frame information is repeated;

[0048] If yes, the repeated single data frame information is used as the repeated data frame information, the single data frame information other than the repeated data frame information is used as the remaining data frame information, and the matching frame adaptation rate corresponding to the repeated data frame information is used as the repeated frame single adaptation rate, and the matching frame adaptation rate corresponding to the remaining data frame information is used as the remaining frame single adaptation rate;

[0049] Calculate the average of the individual adaptation rates of the repeated frames and use it as the adaptation rate for adjusting the repeated frames;

[0050] Combining the single adaptation rate of the remaining frames with the adjusted adaptation rate of the repeated frames to form the comprehensive adaptation rate information of the repeated frames, and replacing the data frame adaptation rate information with the comprehensive adaptation rate information of the repeated frames;

[0051] If not, continue to output data frame adaptation rate information.

[0052] Optionally, the method for determining the solution matching rate includes:

[0053] Retrieving a single frame adaptation rate of each data frame based on the data frame adaptation rate information;

[0054] Based on the preset matching rate calculation formula, the single frame adaptation rate and the number of received data frames are analyzed and calculated to obtain the scheme matching rate, where the matching rate calculation formula is: , To receive the number of data frames, is the single frame adaptation rate of each data frame, and I is the number of received data frames.

[0055] In a second aspect, the present invention provides a new energy vehicle CAN communication protocol adaptive identification system, which adopts the following technical solution:

[0056] A new energy vehicle CAN communication protocol adaptive identification system, comprising:

[0057] An acquisition module is used to obtain a baud rate detection value and a communication data frame;

[0058] A memory, used to store a program of any one of the methods for adaptively identifying the CAN communication protocol of a new energy vehicle;

[0059] A processor loads and executes a program in a memory and implements any one of the methods for adaptively identifying the CAN communication protocol of a new energy vehicle.

[0060] In a third aspect, the present invention provides an intelligent terminal, which adopts the following technical solution:

[0061] An intelligent terminal comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and execute any one of the methods for adaptively identifying the CAN communication protocol of a new energy vehicle.

[0062] In summary, the present invention includes at least one of the following beneficial technical effects:

[0063] 1. The baud rate detection value is determined by polling to determine the correct baud rate detection value, and then the communication data frame is obtained. The communication data frame is adaptively adjusted and matched with the communication protocol database, so as to analyze and determine the compatible abnormal warning information or communication connection control information and output it, so that it can automatically match and connect, thereby improving the versatility between various products;

[0064] 2. Query the baud rate value of the device and query the data frame monitoring information in real time, and determine the CNT count value through the data frame monitoring information analysis, and when the CNT count value is greater than the preset CNT reference value, use the baud rate query value as the baud rate detection value, thereby improving the accuracy of the obtained baud rate detection value;

[0065] 3. Retrieve the number of matching data frames through the matching result information, and determine whether the number of matching data frames is greater than the preset number of matching data frames. If it is greater, retrieve the matching data frame information through the matching result information and analyze and determine the data frame adaptation rate information. Retrieve the number of received data frames through the communication data frame, and determine the scheme matching rate through the data frame adaptation rate information and the number of received data frames. Then determine the function prompt information through the scheme matching rate analysis, and output the function prompt information and the communication connection control information. If it is not greater than, output the preset compatibility anomaly warning information, thereby improving the accuracy of the obtained compatibility anomaly warning information or communication connection control information. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 This is a flow chart of a method for adaptively identifying the CAN communication protocol of a new energy vehicle according to an embodiment of the present application;

[0067] Figure 2 is a flow chart of a method for determining a baud rate detection value in an embodiment of the present application;

[0068] Figure 3 is a flow chart of a method for determining compatible abnormal warning information or communication connection control information according to an embodiment of the present application;

[0069] Figure 4 is a flow chart of a method for determining data frame adaptation rate information in an embodiment of the present application;

[0070] Figure 5 is a flow chart of a method for determining a weight value of matching frame data in an embodiment of the present application;

[0071] Figure 6It is a method flow chart of the steps after calculating the product value between the matching frame frequency weight value, the matching frame data weight value and the preset single frame ID weight value and using it as the matching frame adaptation rate in an embodiment of the present application;

[0072] Figure 7 It is a method flow chart of the step after combining the matching frame adaptation rates corresponding to each single data frame information as the data frame adaptation rate information in an embodiment of the present application. DETAILED DESCRIPTION

[0073] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0074] A method for adaptively identifying the CAN communication protocol of a new energy vehicle obtains a communication data frame after polling to determine if the baud rate detection value on the CAN bus is correct, and adaptively adjusts and matches the communication data frame to obtain matching result information, and then determines and outputs compatible abnormal warning information communication connection control information based on the matching result information analysis, thereby performing adaptive connection and improving the versatility between various products.

[0075] The embodiment of the present invention discloses a method for adaptively identifying the CAN communication protocol of a new energy vehicle. Figure 1 , a new energy vehicle CAN communication protocol adaptive identification method includes:

[0076] Step S100: After the device is powered on, it polls and determines the baud rate detection value on the CAN bus after a preset waiting time.

[0077] Among them, the waiting time refers to the time required to wait for the device to power on normally, and the waiting time is obtained after the operator pre-enters. The baud rate detection value refers to the detection value obtained after detecting the baud rate on the CAN bus. After the device is powered on, it is necessary to poll and judge after the preset waiting time to ensure that the device has been powered on normally and connected, and poll and judge the baud rate detection value on the CAN bus to facilitate subsequent identification.

[0078] Step S200: After determining the correct baud rate detection value, obtain the communication data frame of normal data on the CAN bus in real time.

[0079] Among them, the correct baud rate detection value refers to the baud rate value corresponding to the successful baud rate match, and the communication data frame refers to the data frame corresponding to the normal data on the CAN bus. After determining the correct baud rate detection value, it means that the baud rate match is successful at this time, so the communication data frame is obtained at this time to facilitate subsequent use.

[0080] Step S300: Adaptively adjust and match the communication data frame with a preset communication protocol database to form matching result information.

[0081] The communication protocol database refers to a database storing data frames and used for matching, and the communication protocol database is obtained after pre-input by the operator. The matching result information refers to the result information obtained after matching the communication data frame, and the matching result information includes the result information of the failed match or the result information of the successful match. When the matching result information is the result information of the successful match, the matching result information also includes the data frame corresponding to the successful match.

[0082] When performing adaptive adjustment and matching, it is necessary to define the data format of the communication protocol database. , , where N is the maximum storage value of the database, Frame_ID n Indicates a frame ID data record, ID n Indicates the frame ID value, f n Indicates the cycle frequency, ID_Byte n [m] indicates the storage data definition range, ID_C n [x][y] represents the association ID, which is used to calculate the adaptation rate of the association ID. x represents the number of stored association IDs, and y represents the number of data contents of an association ID. The current definition of y=3 means that an association ID has three data contents, namely frame ID, cycle frequency, and data definition range. In particular, the association ID is a unique frame by default.

[0083] And define the ID data storage format of the received communication data frame: , , Indicates the total number of IDs received, ID i Indicates the frame ID value, f i Indicates the cycle frequency, ID_data i [8] indicates frame data.

[0084] Step S400: determining compatible abnormality warning information or communication connection control information according to the matching result information analysis, and outputting the compatible abnormality warning information or communication connection control information.

[0085] Among them, compatibility anomaly warning information refers to warning information that warns when the connected devices are not compatible, and communication connection control information refers to control information used to control the device to connect. By analyzing the matching result information, the compatibility anomaly warning information or communication connection control information is determined and output based on whether the match is successful, so as to automatically match and connect the connected devices, thereby improving the commonality between various products.

[0086] exist Figure 1In step S100, in order to further ensure the rationality of the baud rate detection value, it is necessary to further analyze and calculate the baud rate detection value. Figure 2 The steps shown are explained in detail.

[0087] Reference Figure 2 , the method for determining the baud rate detection value includes the following steps:

[0088] Step S110: setting the baud rate query value and querying the data frame monitoring information in real time.

[0089] The baud rate query value refers to the baud rate value set for querying the baud rate. The baud rate query value can be randomly generated, or retrieved from a preset baud rate query database in accordance with a query order. The baud rate query database is obtained after being pre-entered by an operator. The data frame monitoring information refers to the monitoring result information obtained after monitoring the baud rate of the data frame. By querying the data frame monitoring information in real time, it is convenient for subsequent use.

[0090] Step S120: within a preset monitoring time, analyzing and determining the CNT count value according to the data frame monitoring information.

[0091] Among them, the monitoring time refers to the minimum time required to monitor the baud rate of the data frame, and the monitoring time is obtained after the operator pre-enters. The CNT count value refers to the count value counted when a data frame consistent with the baud rate query value is monitored. By analyzing the data frame monitoring information within the monitoring time, and counting according to the monitoring results to form the CNT count value, it is convenient for subsequent use.

[0092] Step S130: Determine whether the CNT count value is greater than a preset CNT reference value. If yes, execute step S400; if no, execute step S500.

[0093] The CNT reference value refers to the minimum count value required for determining the baud rate, and the CNT reference value is obtained after being pre-input by the operator. By judging whether the CNT count value is greater than the preset CNT reference value, it is judged whether the baud rate query value is accurate.

[0094] Step S140: using the baud rate query value as the baud rate detection value.

[0095] When the CNT count value is greater than the preset CNT reference value, it indicates that the baud rate query value at this time is accurate, so the baud rate query value is used as the baud rate detection value.

[0096] Step S150: Re-jump to execute step S110.

[0097] When the CNT count value is not greater than the preset CNT reference value, it indicates that the baud rate query value at this time is inaccurate, so the process jumps to step S110 again.

[0098] exist Figure 1 In step S400, in order to further ensure the rationality of the compatibility abnormality warning information or the communication connection control information, it is necessary to further analyze and calculate the compatibility abnormality warning information or the communication connection control information separately. Figure 3 The steps shown are explained in detail.

[0099] Reference Figure 3 , a method for determining compatible abnormal warning information or communication connection control information comprises the following steps:

[0100] Step S410: Retrieve the value of the matching data frame based on the matching result information.

[0101] The number of matched data frames is a number corresponding to the number of successfully matched data frames. The successfully matched data frames are retrieved and counted through the matching result information to form a number of matched data frames for subsequent use.

[0102] Step S420: Determine whether the number of matching data frames is greater than a preset reference number of matching data frames. If yes, execute step S430; if no, execute step S480.

[0103] The matching data frame reference number value refers to the minimum number value required for a successful data frame match, and the matching data frame reference number value is obtained after being pre-input by an operator. By judging whether the matching data frame number value is greater than the preset matching data frame reference number value, it is judged whether the data frame is successfully matched.

[0104] Step S430: Retrieve matching data frame information based on the matching result information.

[0105] Among them, the matching data frame information refers to the data frame information corresponding to the successful match. When the matching data frame number value is greater than the preset matching data frame benchmark number value, it means that the data frame is matched successfully at this time. Therefore, the matching result information is used to query and retrieve the successfully matched data frame and use it as the matching data frame information for subsequent use.

[0106] Step S440: Analyze and determine data frame adaptation rate information based on the matching data frame information.

[0107] The data frame adaptation rate information refers to the adaptation rate information corresponding to the successfully matched data frame. The data frame adaptation rate information is determined by analyzing the matched data frame information, which is convenient for subsequent use.

[0108] Step S450: Retrieve the value of the received data frame based on the communication data frame.

[0109] The received data frame number value refers to the number value corresponding to the received data frame, and the received data frame number value is retrieved through the communication data frame to facilitate subsequent use.

[0110] Step S460: Determine the scheme matching rate according to the data frame adaptation rate information and the received data frame numerical analysis.

[0111] Among them, the solution matching rate refers to the matching rate achieved when using the currently successfully matched data frame. The solution matching rate is determined by analyzing the data frame adaptation rate information and the number of received data frames to facilitate subsequent use.

[0112] The method for determining the solution matching rate includes the following steps:

[0113] Step S461: Retrieve the single frame adaptation rate of each data frame based on the data frame adaptation rate information.

[0114] The single frame adaptation rate refers to the adaptation rate corresponding to a single successfully matched data frame. The single frame adaptation rate of each data frame is retrieved through the data frame adaptation rate information to facilitate subsequent use.

[0115] Step S462: Analyze and calculate the single frame adaptation rate and the number of received data frames based on a preset matching rate calculation formula to obtain a solution matching rate.

[0116] The matching rate calculation formula is: , To receive the number of data frames, is the single frame adaptation rate of each data frame, and I is the number of received data frames.

[0117] For example, suppose three data frames are received, namely , and ID_R1=0.8, ID_R2=1, ID_R3=0.6, then .

[0118] Step S470: determining the use function prompt information according to the solution matching rate analysis, and outputting the use function prompt information and the preset communication connection control information.

[0119] Among them, the use function prompt information refers to the prompt information that prompts the current function that can be used. By analyzing the solution matching rate and the preset function usage benchmark interval value, when the solution matching rate does not fall into the function usage benchmark interval value and is less than the minimum value of the interval, it means that most functions are not supported for use, which is not suitable for the new energy vehicle. It is necessary to upgrade the Bluetooth firmware and improve the communication protocol database. Therefore, the non-new energy function use prompt information is output at this time and used as the use function prompt information.

[0120] When the solution matching rate falls within the function usage benchmark interval value, it means that the new energy vehicle is supported for use at this time, but some functions are not supported for use. Therefore, the preset new energy partial function usage prompt information is output at this time and used as the function usage prompt information.

[0121] When the scheme matching rate does not fall into the function usage benchmark interval value and is greater than the interval maximum value, it means that the use of the new energy vehicle is fully supported at this time, so the preset new energy full function usage prompt information is output and used as the use function prompt information, thereby determining the use function prompt information, and outputting the use function prompt information and the preset communication connection control information, so as to control the device to connect, and facilitate the operator to promptly understand the use of functions after the device is connected.

[0122] Step S480: Output preset compatibility anomaly warning information.

[0123] When the number of matching data frames is not greater than the preset reference number of matching data frames, it indicates that the data frame match is unsuccessful, so the preset compatibility anomaly warning information is output.

[0124] exist Figure 3 In step S440, in order to further ensure the rationality of the data frame adaptation rate information, it is necessary to further analyze and calculate the data frame adaptation rate information separately, specifically by Figure 4 The steps shown are explained in detail.

[0125] Reference Figure 4 , the method for determining the data frame adaptation rate information comprises the following steps:

[0126] Step S441: Retrieve single data frame information based on matching data frame information.

[0127] The single data frame information refers to the situation information corresponding to a single successfully matched data frame. The single data frame information is retrieved by matching the data frame information to facilitate subsequent use.

[0128] Step S442: Retrieve single matching frame information and corresponding matching reference frame information based on single data frame information.

[0129] Among them, single data frame information includes single matching frame information and matching reference frame information. Single matching frame information refers to the data frame information used for matching in the successfully matched data frame, and matching reference frame information refers to the reference data frame information matched in the successfully matched data frame. The single matching frame information and the corresponding matching reference frame information are retrieved through the single data frame information to facilitate subsequent use.

[0130] Step S443: Retrieve the matching frame period frequency value and the matching frame data content based on the single matching frame information.

[0131] Among them, a single matching frame information includes a matching frame period frequency value and a matching frame data content. The matching frame period frequency value refers to the period frequency value corresponding to the data frame used for matching, and the matching frame data content refers to the data content corresponding to the data frame used for matching. The matching frame period frequency value and the matching frame data content are retrieved through a single matching frame information to facilitate subsequent use.

[0132] Step S444: Retrieve the reference frame frequency range and the reference frame data definition range based on the matching reference frame information.

[0133] Among them, the matching benchmark frame information includes the benchmark frame frequency range and the benchmark frame data definition range. The benchmark frame frequency range refers to the range in which the periodic frequency corresponding to the matched benchmark data frame needs to be located. The benchmark frame data definition range refers to the range in which the data content definition corresponding to the matched benchmark data frame needs to be located. The benchmark frame frequency range and the benchmark frame data definition range are retrieved by matching the benchmark frame information to facilitate subsequent use.

[0134] Step S445: determining a matching frame frequency weight value based on the matching frame period frequency value and the reference frame frequency range analysis.

[0135] Among them, the matching frame frequency weight value refers to the weight value generated by the periodic frequency of the matching frame for the adaptation situation. By analyzing whether the matching frame periodic frequency value falls within the reference frame frequency range, when the matching frame periodic frequency value falls within the reference frame frequency range, the preset matching frame frequency first weight value is used as the matching frame frequency weight value, when the matching frame periodic frequency value does not fall within the reference frame frequency range and is less than the minimum value, the preset matching frame frequency second weight value is used as the matching frame frequency weight value, when the matching frame periodic frequency value does not fall within the reference frame frequency range and is greater than the maximum value, the preset matching frame frequency third weight value is used as the matching frame frequency weight value. The matching frame frequency first weight value, the matching frame frequency second weight value and the matching frame frequency third weight value are obtained after pre-input by the operator. In this embodiment, the matching frame frequency first weight value is 1, the matching frame frequency second weight value is 0.8, and the matching frame frequency third weight value is 0.5.

[0136] Step S446: Determine the weight value of the matching frame data according to the matching frame data content and the reference frame data definition range analysis.

[0137] Among them, the matching frame data weight value refers to the weight value generated by the data content of the matching frame for the adaptation situation. The matching frame data weight value is determined by analyzing the matching frame data content and the reference frame data definition range, which is convenient for subsequent use.

[0138] Step S447: Calculate the product value between the matching frame frequency weight value, the matching frame data weight value and the preset single frame ID weight value and use it as the matching frame adaptation rate.

[0139] Among them, the single-frame ID weight value refers to the weight value generated by the adaptation situation of the ID corresponding to a single successfully matched data frame. The single-frame ID weight value is obtained after pre-input by the operator. The matching frame adaptation rate refers to the adaptation rate corresponding to a single successfully matched data frame. The product value between the matching frame frequency weight value, the matching frame data weight value and the preset single-frame ID weight value is calculated and used as the matching frame adaptation rate for subsequent use.

[0140] Step S448: combining the matching frame adaptation rates corresponding to the individual data frame information and using the matching frame adaptation rate information as the data frame adaptation rate information.

[0141] The matching frame adaptation rates corresponding to the individual data frame information are combined to form the data frame adaptation rate information, thereby improving the accuracy of the acquired data frame adaptation rate information.

[0142] exist Figure 4 In step S446, in order to further ensure the rationality of the weight value of the matching frame data, it is necessary to further analyze and calculate the weight value of the matching frame data. Figure 5 The steps shown are explained in detail.

[0143] Reference Figure 5 , the method for determining the weight value of matching frame data includes the following steps:

[0144] Step S4461: Determine whether the reference frame data definition range exists. If yes, execute step S4462; if no, execute step S4463.

[0145] Wherein, by judging whether the reference frame data definition range exists, it is judged whether it is necessary to analyze the matching frame data weight value according to the reference frame data definition range.

[0146] Step S4462: Determine the range data weight value based on the judgment result of whether the contents of the matching frame data are all within the range defined by the reference frame data, and use the range data weight value as the matching frame data weight value.

[0147] Among them, the range data weight value refers to the weight value generated for the adaptation situation when the matching frame data content is within the definition range of the benchmark frame data. When the benchmark frame data definition range exists, it means that the matching frame data weight value needs to be analyzed according to the benchmark frame data definition range. Therefore, the range data weight value is determined by analyzing the judgment result of whether the matching frame data content is within the definition range of the benchmark frame data, and the range data weight value is used as the matching frame data weight value for subsequent use.

[0148] Furthermore, in order to improve the accuracy of the obtained ranged data weight value, the method for determining the ranged data weight value includes:

[0149] Step S44621: Determine whether the contents of the matching frame data are all within the definition range of the reference frame data. If yes, execute step S44622; if no, execute step S44623.

[0150] Wherein, by judging whether the contents of the matching frame data are all within the definition range of the reference frame data, it is judged whether further analysis and processing of the contents of the matching frame data is required.

[0151] Step S44622: Output the preset in-range benchmark weight value and use it as the in-range data weight value.

[0152] The in-range reference weight value refers to the reference weight value corresponding to the range, and the in-range reference weight value is obtained after being pre-input by the operator. When the matching frame data content is within the defined range of the reference frame data, it means that no further analysis and processing of the matching frame data content is required at this time, so the preset in-range reference weight value is output and used as the in-range data weight value. In this embodiment, the in-range reference weight value is 1.

[0153] Step S44623: Analyze the deviation between the content of the matching frame data and the definition range of the reference frame data and use it as the matching frame data deviation information.

[0154] Among them, the matching frame data deviation information refers to the deviation information when there is a deviation in the data content of the matching frame. When the matching frame data content is not within the definition range of the benchmark frame data, it means that the matching frame data content needs to be further analyzed and processed at this time. Therefore, the deviation between the matching frame data content and the definition range of the benchmark frame data is analyzed and used as the matching frame data deviation information to facilitate subsequent use.

[0155] Step S44624: Retrieve the deviation degree value and deviation direction information based on the matching frame data deviation information.

[0156] The deviation degree value refers to the specific degree value corresponding to the deviation of the data content of the matching frame, and the deviation direction information refers to the direction information corresponding to the deviation of the data content of the matching frame, and the deviation direction information is a positive deviation direction or a negative deviation direction. The deviation degree value and deviation direction information are retrieved through the matching frame data deviation information for subsequent use.

[0157] Step S44625: Determine the deviation degree impact value corresponding to the deviation degree value according to the correspondence between the deviation degree value and the preset deviation degree impact value.

[0158] The deviation degree impact value refers to the impact degree value when the deviation degree has an impact, and the deviation degree impact value is obtained by querying from a database storing deviation degree values ​​and deviation degree impact values, and the database is obtained after pre-input by the operator. The deviation degree impact value is determined by querying the deviation degree value, which is convenient for subsequent use.

[0159] Step S44626: Retrieve the deviation direction reference value based on the deviation direction information.

[0160] The deviation direction reference value refers to the reference weight value corresponding to the deviation direction, and the deviation direction reference value is retrieved through the deviation direction information for subsequent use. In this embodiment, when the deviation direction information is negative, the deviation direction reference value is 0.6, and when the deviation direction information is positive, the deviation direction reference value is 0.8.

[0161] Step S44627: Calculate the product value between the deviation direction reference value and the deviation degree influence value and use it as the out-of-range deviation weight value, and use the out-of-range deviation weight value as the in-range data weight value.

[0162] Among them, the out-of-range deviation weight value refers to the weight value corresponding to the existence of a deviation outside the range. The product value between the deviation direction reference value and the deviation degree influence value is calculated and used as the out-of-range deviation weight value, and the out-of-range deviation weight value is used as the in-range data weight value, thereby improving the accuracy of the obtained in-range data weight value.

[0163] Step S4463: Determine the weight value of the out-of-range data according to the consistency between the matching frame data content and the preset reference data content, and use the weight value of the out-of-range data as the matching frame data weight value.

[0164] Among them, the reference data content refers to the reference content corresponding to the absence of an influence on the matching frame data content, and the reference data content is obtained by querying the database storing the reference data content. The weight value of the out-of-range data refers to the weight value generated for the adaptation situation when the matching frame data content is not within the definition range of the reference frame data. When the reference frame data definition range does not exist, it means that the matching frame data weight value is not analyzed according to the reference frame data definition range at this time. Therefore, the consistency between the matching frame data content and the preset reference data content is analyzed to determine the weight value of the out-of-range data, and the weight value of the out-of-range data is used as the weight value of the matching frame data for subsequent use. In this embodiment, the reference data content is 0.

[0165] Furthermore, in order to improve the accuracy of the obtained non-range data weight value, the method for determining the non-range data weight value includes:

[0166] Step S44631: Determine whether the content of the matching frame data is consistent with the preset reference data content. If yes, execute step S44632; if no, execute step S44633.

[0167] Wherein, by judging whether the content of the matching frame data is consistent with the preset reference data content, it is judged that further analysis of the content of the matching frame data is required.

[0168] Step S44632: Output the preset range-free baseline weight value and use it as the range-free data weight value.

[0169] The range-free reference weight value refers to the reference weight value corresponding to the case where there is no range and the range-free reference weight value is consistent with the reference data content. The range-free reference weight value is obtained after being pre-input by the operator. When the matching frame data content is consistent with the preset reference data content, it means that no further analysis of the matching frame data content is required at this time, so the preset range-free reference weight value is output and used as the range-free data weight value to improve the accuracy of the obtained range-free data weight value. In this embodiment, the range-free reference weight value is 1.

[0170] Step S44633: Analyze the deviation between the matching frame data content and the benchmark data content and use it as data benchmark deviation information.

[0171] Among them, when the matching frame data content is inconsistent with the preset benchmark data content, it means that further analysis of the matching frame data content is required at this time. Therefore, the deviation between the matching frame data content and the benchmark data content is used as data benchmark deviation information to facilitate subsequent use.

[0172] Step S44634: Retrieve the deviation value based on the data baseline deviation information.

[0173] The deviation value refers to the value corresponding to the deviation between the matching frame data content and the reference data content. The deviation value is retrieved through the data reference deviation information to facilitate subsequent use.

[0174] Step S44635: Based on the deviation number value, a deviation number weight value is matched from a preset deviation number weight interval, and the deviation number weight value is used as the range-free data weight value.

[0175] Among them, the deviation number weight interval refers to the weight value interval corresponding to the query based on the deviation number, and each weight value in the deviation number weight interval corresponds to each deviation number value. The deviation number weight interval is obtained after pre-input by the operator. The deviation number weight value refers to the weight value corresponding to the deviation number, and the deviation number value is matched from the preset deviation number weight interval, so that the weight value in the deviation number weight interval that successfully matches the deviation number value is used as the deviation number weight value, and the deviation number weight value is used as the range-free data weight value, thereby improving the accuracy of the obtained range-free data weight value. In this embodiment, the deviation number weight interval is 0.5-0.6.

[0176] exist Figure 4 After step S447, in order to further ensure the rationality of the matching frame adaptation rate, it is necessary to further analyze and calculate the matching frame adaptation rate. Figure 6 The steps shown are explained in detail.

[0177] Reference Figure 6 The steps after calculating the product value between the matching frame frequency weight value, the matching frame data weight value and the preset single frame ID weight value and using it as the matching frame adaptation rate include the following steps:

[0178] Step S4471: Retrieve reference frame ID data based on matching reference frame information.

[0179] Among them, the reference frame ID data refers to the ID data corresponding to the reference data frame in the successful match. The reference frame ID data is retrieved by matching the reference frame information, so as to facilitate subsequent use. When the reference frame ID data is not received, the difference between the matching frame adaptation rate and the preset matching frame reference adaptation rate is calculated and used as the adaptation rate deviation value; according to the correspondence between the adaptation rate deviation value and the preset adaptation rate deviation adjustment value, the adaptation rate deviation adjustment value corresponding to the adaptation rate deviation value is determined, and the adaptation rate deviation adjustment value is added to the matching frame adaptation rate to form a new matching frame adaptation rate. In this embodiment, the adaptation rate deviation adjustment value is 0.3-0.5.

[0180] The adaptation rate deviation value refers to the deviation value when there is a deviation in the adaptation rate, and the adaptation rate deviation adjustment value refers to the adjustment value for adjusting when there is a deviation in the adaptation rate. The adaptation rate deviation adjustment value is obtained by querying a database storing the adaptation rate deviation value and the adaptation rate deviation adjustment value, and the database is obtained after pre-input by the operator.

[0181] Step S4472: Determine whether the reference frame ID data is 0. If yes, execute step S4473; if no, execute step S4474.

[0182] Here, by judging whether the reference frame ID data is 0, it is judged whether there is an associated ID.

[0183] Step S4473: Continue to output the matching frame adaptation rate.

[0184] When the reference frame ID data is 0, it means that there is no associated ID at this time, so the matching frame adaptation rate continues to be output.

[0185] Step S4474: Retrieve the associated ID reference frame information based on the matching reference frame information.

[0186] Among them, the associated ID reference frame information refers to the reference data frame corresponding to the associated ID. When the reference frame ID data is not 0, it means that the associated ID exists at this time. Therefore, the associated ID reference frame information is retrieved by matching the reference frame information to facilitate subsequent use.

[0187] Step S4475: Determine the associated frame adaptation rate based on the associated ID reference frame information analysis, and add the associated frame adaptation rate to the matching frame adaptation rate to form a new matching frame adaptation rate.

[0188] Among them, the associated frame adaptation rate refers to the adaptation rate corresponding to the benchmark data frame corresponding to the associated ID when it is matched. The associated ID benchmark frame information is re-analyzed according to the method of step S440, and the highest value of the adaptation rate corresponding to the associated frame obtained by analysis is used as the associated frame adaptation rate, and the product value of the associated frame adaptation rate and the matching frame adaptation rate is calculated to form a new matching frame adaptation rate, thereby improving the accuracy of the obtained matching frame adaptation rate.

[0189] exist Figure 4 After step S448, in order to further ensure the rationality of the data frame adaptation rate information, it is necessary to further analyze and calculate the data frame adaptation rate information separately, specifically by Figure 7 The steps shown are explained in detail.

[0190] Reference Figure 7 The steps after combining the matching frame adaptation rates corresponding to the individual data frame information and using the matching frame adaptation rate information as the data frame adaptation rate information include the following steps:

[0191] Step S4481: Determine whether there is duplication in a single data frame information. If yes, execute step S4482; if no, execute step S4485.

[0192] Wherein, by judging whether there is duplication in the single data frame information, it is judged whether the data frame adaptation rate information needs to be adjusted.

[0193] Step S4482: Take the repeated single data frame information as the repeated data frame information, take the single data frame information other than the repeated data frame information as the remaining data frame information, and take the matching frame adaptation rate corresponding to the repeated data frame information as the repeated frame single adaptation rate, and take the matching frame adaptation rate corresponding to the remaining data frame information as the remaining frame single adaptation rate.

[0194] Among them, when a single data frame information is repeated, it means that the data frame adaptation rate information needs to be adjusted at this time. Therefore, the repeated data frame information, the remaining data frame information, the repeated frame single adaptation rate and the remaining frame single adaptation rate are defined respectively for subsequent use.

[0195] Step S4483: Calculate the average of the individual adaptation rates of the repeated frames and use it as the adaptation rate for adjusting the repeated frames.

[0196] The repeated frame adjustment adaptation rate refers to the adaptation rate after the adaptation rate corresponding to the repeated data frame is adjusted. The average value of the single adaptation rate of the repeated frame is calculated and used as the repeated frame adjustment adaptation rate for convenience of subsequent use.

[0197] Step S4484: Combine the single adaptation rate of the remaining frames with the adjusted adaptation rate of the repeated frames to form the repeated frame comprehensive adaptation rate information, and replace the data frame adaptation rate information with the repeated frame comprehensive adaptation rate information.

[0198] Among them, the comprehensive adaptation rate information of repeated frames refers to all the adaptation rate information corresponding to the repeated data frames after the adaptation rate is adjusted. By combining the single adaptation rate of the remaining frames with the adjusted adaptation rate of the repeated frames, the single adaptation rate of the remaining frames and the adjusted adaptation rate of the repeated frames are used as the comprehensive adaptation rate information of the repeated frames, and the comprehensive adaptation rate information of the repeated frames replaces the data frame adaptation rate information, thereby improving the accuracy of the acquired data frame adaptation rate information.

[0199] Step S4485: Continue to output data frame adaptation rate information.

[0200] When there is no duplication of single data frame information, it means that the data frame adaptation rate information does not need to be adjusted at this time, so the data frame adaptation rate information continues to be output.

[0201] Based on the same inventive concept, an embodiment of the present invention provides a new energy vehicle CAN communication protocol adaptive identification system, comprising:

[0202] An acquisition module is used to obtain a baud rate detection value and a communication data frame;

[0203] Memory, used to store Figures 1 to 7 A program of any one of the methods for adaptively identifying the CAN communication protocol of a new energy vehicle;

[0204] The processor loads and executes the program in the memory and implements Figures 1 to 7 Any one of the methods for adaptively identifying the CAN communication protocol of a new energy vehicle described in .

[0205] Based on the same inventive concept, an embodiment of the present invention provides an intelligent terminal, including a memory and a processor, wherein the memory stores a program that can be loaded and executed by the processor. Figures 1 to 7 A computer program for any one of the methods for adaptively identifying the CAN communication protocol of a new energy vehicle.

[0206] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0207] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for adaptively identifying the CAN communication protocol of a new energy vehicle, characterized in that: include: After the device is powered on, it polls and determines the baud rate detection value on the CAN bus after a preset waiting time; After determining the correct baud rate detection value, the communication data frame of normal data on the CAN bus is obtained in real time; Based on the communication data frame, adaptive adjustment and matching are performed with a preset communication protocol database to form matching result information; Determine compatible abnormality warning information or communication connection control information according to the matching result information analysis, and output compatible abnormality warning information or communication connection control information; The method for determining compatible abnormal warning information or communication connection control information includes: Retrieve the number of matching data frames based on the matching result information; Determine whether the number of matching data frames is greater than a preset reference number of matching data frames; If yes, then retrieve the matching data frame information based on the matching result information; Determine data frame adaptation rate information according to matching data frame information analysis; Retrieve the value of the received data frame based on the communication data frame; Determine the scheme matching rate based on the data frame adaptation rate information and the received data frame numerical analysis; Determine the use function prompt information according to the solution matching rate analysis, and output the use function prompt information and the preset communication connection control information; If not, the preset compatible abnormal warning information is output; The method for determining the data frame adaptation rate information includes: Retrieving single data frame information based on matching data frame information; Retrieving single matching frame information and corresponding matching reference frame information based on single data frame information; Retrieving the matching frame period frequency value and the matching frame data content based on the single matching frame information; Retrieving the reference frame frequency range and the reference frame data definition range based on the matching reference frame information; Determine the matching frame frequency weight value according to the matching frame period frequency value and the reference frame frequency range analysis; Determine the weight value of the matching frame data according to the matching frame data content and the reference frame data definition range analysis; Calculate the product value between the matching frame frequency weight value, the matching frame data weight value and the preset single frame ID weight value and use it as the matching frame adaptation rate; The matching frame adaptation rates corresponding to the individual data frame information are combined and used as the data frame adaptation rate information.

2. The method for adaptively identifying the CAN communication protocol of new energy vehicles according to claim 1 is characterized in that: The baud rate detection value is determined by: Set the baud rate query value and query the data frame monitoring information in real time; Within the preset monitoring time, the CNT count value is determined based on the data frame monitoring information analysis; Determine whether the CNT count value is greater than a preset CNT reference value; If yes, the baud rate query value is used as the baud rate detection value; If not, reset the baud rate query value and query the data frame monitoring information in real time.

3. The method for adaptively identifying the CAN communication protocol of new energy vehicles according to claim 1 is characterized in that: The method for determining the weight value of the matching frame data includes: Determine whether the reference frame data definition range exists; If yes, then determine the weight value of the range data according to the judgment result of whether the content of the matching frame data is within the definition range of the reference frame data, and use the weight value of the range data as the weight value of the matching frame data; If not, the weight value of the out-of-range data is determined according to the consistency between the matching frame data content and the preset reference data content, and the weight value of the out-of-range data is used as the matching frame data weight value.

4. The method for adaptively identifying the CAN communication protocol of new energy vehicles according to claim 1 is characterized in that: The method further includes a step after calculating the product value between the matching frame frequency weight value, the matching frame data weight value and the preset single frame ID weight value and using the product value as the matching frame adaptation rate, which is specifically as follows: Retrieving reference frame ID data based on matching reference frame information; Determine whether the reference frame ID data is 0; If yes, continue to output the matching frame adaptation rate; If not, retrieve the associated ID reference frame information based on the matching reference frame information; The associated frame adaptation rate is determined based on the associated ID reference frame information analysis, and the associated frame adaptation rate is added to the matching frame adaptation rate to form a new matching frame adaptation rate.

5. The method for adaptively identifying the CAN communication protocol of new energy vehicles according to claim 1 is characterized in that: The method further includes a step after combining the matching frame adaptation rates corresponding to the individual data frame information and using the matching frame adaptation rate information as the data frame adaptation rate information, which is specifically as follows: Determine whether a single data frame information is repeated; If yes, the repeated single data frame information is used as the repeated data frame information, the single data frame information other than the repeated data frame information is used as the remaining data frame information, and the matching frame adaptation rate corresponding to the repeated data frame information is used as the repeated frame single adaptation rate, and the matching frame adaptation rate corresponding to the remaining data frame information is used as the remaining frame single adaptation rate; Calculate the average of the individual adaptation rates of the repeated frames and use it as the adaptation rate for adjusting the repeated frames; Combining the single adaptation rate of the remaining frames with the adjusted adaptation rate of the repeated frames to form the comprehensive adaptation rate information of the repeated frames, and replacing the data frame adaptation rate information with the comprehensive adaptation rate information of the repeated frames; If not, continue to output data frame adaptation rate information.

6. The method for adaptively identifying the CAN communication protocol of new energy vehicles according to claim 1 is characterized in that: Methods for determining the solution matching rate include: Retrieving a single frame adaptation rate of each data frame based on the data frame adaptation rate information; Based on the preset matching rate calculation formula, the single frame adaptation rate and the number of received data frames are analyzed and calculated to obtain the scheme matching rate, where the matching rate calculation formula is: , To receive the number of data frames, is the single frame adaptation rate of each data frame, and I is the number of received data frames.

7. A new energy vehicle CAN communication protocol adaptive identification system, characterized in that: include: An acquisition module is used to obtain a baud rate detection value and a communication data frame; A memory, used to store a program of the method for adaptively identifying the CAN communication protocol of a new energy vehicle according to any one of claims 1 to 6; A processor is configured to load and execute a program in a memory and implement the adaptive identification method for the CAN communication protocol of a new energy vehicle as described in any one of claims 1 to 6.

8. An intelligent terminal, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executes the method for adaptively identifying the CAN communication protocol of a new energy vehicle as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Multi-protocol automatic identification and conversion method and intelligent gateway

    CN112104654A