Vehicle type automatic identification method, device, equipment and storage medium based on CAN bus
Through the automatic vehicle model identification method of the CAN bus, the vehicle bus baud rate and node ID list are used to automatically identify vehicle model information, solving the equipment diversity problems caused by different vehicle model protocols, and realizing data collection of the same device firmware compatible with multiple models. Reduced management and stocking costs.
Patent Information
- Application Number
- CN202411181936.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-27
AI Technical Summary
The communication protocols of different models are inconsistent, resulting in the need of multiple collection and transmission equipment, which increases the cost of management and stocking, especially in operating companies with many models but not many types of each model, management is difficult.
Through the automatic vehicle model identification method based on the CAN bus, the vehicle bus baud rate and pre-established vehicle model information are used to determine the initial matching vehicle model information, and the vehicle model information is automatically identified through the matching and veto node ID list, thereby using the same device firmware Compatible with data acquisition of multiple models and interactive communication with CAN.
It realizes that the same device firmware is compatible with data acquisition and CAN interactive communication between multiple models, reducing the difficulty and cost of device management and enhancing the universality of the device.
Smart Images

Figure CN118714051B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle networking technology, and in particular to a method, device, equipment and storage medium for automatic vehicle type recognition based on a CAN bus. Background Art
[0002] At present, most vehicles have the need for remote data collection and monitoring, and the TBOX (wireless vehicle terminal) installation rate has reached 60-70%. For various safety considerations, new energy vehicles are required by law to be equipped with TBOX to collect data before leaving the factory and transmit relevant data to the national platform.
[0003] For different vehicle CAN protocol models, it is necessary to design embedded software for wireless acquisition equipment (TBOX type equipment), and the acquisition protocol in the software must be consistent with the corresponding vehicle model. Different protocol models require different acquisition and transmission equipment, and enterprises need to manage different material numbers separately. Since the communication protocols of different models are different, multiple models require multiple acquisition and transmission equipment (TBOX, vehicle monitoring terminal). Greatly increase management and stocking costs. Especially for operating companies with many models but a small number of vehicles of each model, it will increase costs and management difficulties.
[0004] A car company has many car models, and it is troublesome to develop a TBOX for each small model. Car companies hope that the products can be as universal as possible, which will greatly reduce management costs and inventory costs. Therefore, wireless data collection terminals such as TBOX are needed to automatically identify car models and automatically collect data according to the stored car model protocols. There are also many vehicle operation-related companies, such as car rental companies, which also need to collect and monitor vehicle data for operating vehicles. The company has many types of vehicles, and it is very important to have a device that can support data collection of multiple models at the same time. Summary of the invention
[0005] The main purpose of this application is to provide a method, device, equipment and storage medium for automatic vehicle identification based on CAN bus; it is used to solve the problem that due to different communication protocols of different vehicle models, multiple vehicle models require multiple acquisition and transmission equipment (TBOX). This greatly increases the management and stocking costs. In particular, for operating companies with many vehicle models but a small number of vehicles of each model, it will increase the cost and increase the difficulty of management.
[0006] To achieve the above object, the present invention provides a vehicle type automatic identification method based on CAN bus, comprising: determining initial matching vehicle type information with baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and a pre-established vehicle type information list;
[0007] Based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, determining whether the acquired CAN bus node ID list of the vehicle to be identified meets a first preset condition;
[0008] In response to determining that the CAN bus node ID list satisfies a first preset condition, rejecting the CAN node ID list based on the vehicle type corresponding to the initial matching vehicle type information in the vehicle type information list, and determining whether the CAN bus node ID list satisfies a second preset condition;
[0009] In response to determining that the CAN bus node ID list satisfies a second preset condition, the vehicle model information of the vehicle to be identified is determined.
[0010] Optionally, before determining the initial matching vehicle model information with baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list, the method further includes:
[0011] Connecting a collection device to the vehicle bus of the vehicle to be identified to collect the baud rate of the vehicle bus of the vehicle to be identified;
[0012] Based on the acquired vehicle model information set, the vehicle model information list is established, wherein the vehicle model information list includes the vehicle model name, number, vehicle model CAN bus baud rate information, vehicle model CAN bus node ID list and vehicle model veto CAN node ID list.
[0013] Optionally, the determining of initial matching vehicle model information with baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and a pre-established vehicle model information list includes:
[0014] Select the CAN bus baud rate information of the target vehicle model from the vehicle model information list;
[0015] Determine the vehicle bus baud rate and compare it with the baud rate corresponding to the CAN bus baud rate information of the target vehicle model;
[0016] In response to determining that the vehicle bus baud rate is different from the baud rate corresponding to the target vehicle model CAN bus baud rate information, selecting vehicle model CAN bus baud rate information from a vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information;
[0017] In response to determining that the vehicle bus baud rate is the same as the baud rate corresponding to the CAN bus baud rate information of the target vehicle model, the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model is used as the initial matching vehicle model information.
[0018] Optionally, the determining whether the acquired CAN bus node ID list of the vehicle to be identified satisfies a first preset condition based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list includes:
[0019] Obtain a vehicle model CAN bus node ID list corresponding to the target vehicle model CAN bus baud rate information from the vehicle model information list;
[0020] Obtaining a CAN bus node ID list of the vehicle to be identified;
[0021] Determine whether the CAN bus node ID list of the vehicle to be identified contains all the node IDs in the vehicle model CAN bus node ID list;
[0022] In response to determining that not all node IDs are included, the vehicle type CAN bus baud rate information is selected from the vehicle type information list that does not include the target vehicle type CAN bus baud rate information as the target vehicle type CAN bus baud rate information.
[0023] Optionally, in response to determining that the CAN bus node ID list satisfies a first preset condition, rejecting the CAN node ID list based on the vehicle type corresponding to the initial matching vehicle type information in the vehicle type information list, and determining whether the CAN bus node ID list satisfies a second preset condition includes:
[0024] In response to determining that the CAN bus node ID list satisfies a first preset condition, acquiring a vehicle type veto CAN node ID list corresponding to the CAN bus baud rate information of the target vehicle type from the vehicle type information list;
[0025] Determine whether the CAN bus node ID list of the vehicle to be identified contains any rejected CAN node ID in the vehicle type rejected CAN node ID list;
[0026] In response to determining that any one of the rejected CAN node IDs is included, the vehicle type CAN bus baud rate information is selected from the vehicle type information list that does not include the target vehicle type CAN bus baud rate information as the target vehicle type CAN bus baud rate information.
[0027] Optionally, in response to determining that the CAN bus node ID list satisfies a second preset condition, determining the vehicle model information of the vehicle to be identified includes:
[0028] In response to determining that the CAN bus node ID list satisfies a second preset condition, obtaining vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list, and using the vehicle model information as the vehicle model information of the vehicle to be identified;
[0029] Based on the vehicle model information, determining the vehicle model protocol corresponding to the vehicle to be identified;
[0030] Based on the vehicle type protocol, relevant data of the vehicle to be identified is collected.
[0031] Optionally, the method further comprises:
[0032] In response to determining that the CAN bus node ID list does not satisfy a second preset condition, determining the amount of vehicle model information to be matched in the vehicle model information list;
[0033] In response to the number of vehicle model information to be matched being zero, a matching failure prompt message is generated.
[0034] In addition, to achieve the above purpose, the present invention also provides a vehicle type automatic identification device based on CAN bus, comprising:
[0035] A matching module, for determining initial matching vehicle model information for baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and a pre-established vehicle model information list;
[0036] A first determination module, configured to determine whether the acquired CAN bus node ID list of the vehicle to be identified meets a first preset condition based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list;
[0037] A first determination module, configured to, in response to determining that the CAN bus node ID list satisfies a first preset condition, reject the CAN node ID list based on the vehicle type corresponding to the initial matching vehicle type information in the vehicle type information list, and determine whether the CAN bus node ID list satisfies a second preset condition;
[0038] The vehicle model information determination module is used to determine the vehicle model information of the vehicle to be identified in response to determining that the CAN bus node ID list meets the second preset condition.
[0039] Optionally, before the matching module, the device further includes:
[0040] A collection module, used to access a collection device on the vehicle bus of the vehicle to be identified, and collect the vehicle bus baud rate of the vehicle to be identified;
[0041] A construction module is used to establish the vehicle model information list based on the acquired vehicle model information set, wherein the vehicle model information list includes the vehicle model name, number, vehicle model CAN bus baud rate information, vehicle model CAN bus node ID list and vehicle model veto CAN node ID list.
[0042] Optionally, the matching module includes:
[0043] A first selection submodule, used to select CAN bus baud rate information of a target vehicle model from the vehicle model information list;
[0044] A comparison submodule, used to determine and compare the vehicle bus baud rate with the baud rate corresponding to the CAN bus baud rate information of the target vehicle model;
[0045] a second selection submodule, configured to select a vehicle model CAN bus baud rate information from a vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information in response to determining that the vehicle bus baud rate is different from the baud rate corresponding to the target vehicle model CAN bus baud rate information;
[0046] The matching submodule is used for, in response to determining that the vehicle bus baud rate is the same as the baud rate corresponding to the CAN bus baud rate information of the target vehicle model, using the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model as the initial matching vehicle model information.
[0047] Optionally, the first determining module includes:
[0048] The first acquisition submodule is used to obtain a vehicle model CAN bus node ID list corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list;
[0049] The second acquisition submodule is used to acquire the CAN bus node ID list of the vehicle to be identified;
[0050] A node ID determination submodule, used to determine whether the CAN bus node ID list of the vehicle to be identified contains all the node IDs in the vehicle model CAN bus node ID list;
[0051] The third selection submodule is used for selecting the vehicle type CAN bus baud rate information from the vehicle type information list that does not include the target vehicle type CAN bus baud rate information as the target vehicle type CAN bus baud rate information in response to determining that all node IDs are not included.
[0052] Optionally, the second determining module includes:
[0053] A third acquisition submodule is used for acquiring, in response to determining that the CAN bus node ID list satisfies the first preset condition, a vehicle model rejected CAN node ID list corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list;
[0054] A rejected CAN node ID determination submodule is used to determine whether the CAN bus node ID list of the vehicle to be identified contains any rejected CAN node ID in the rejected CAN node ID list of the vehicle type;
[0055] The fourth selection submodule is used to select the vehicle model CAN bus baud rate information from the vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information in response to determining that any one of the rejected CAN node IDs is included.
[0056] Optionally, the vehicle model information determination module includes:
[0057] a fourth acquisition submodule, configured to, in response to determining that the CAN bus node ID list satisfies a second preset condition, acquire the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list, and use the vehicle model information as the vehicle model information of the vehicle to be identified;
[0058] A vehicle model protocol determination submodule, used to determine the vehicle model protocol corresponding to the vehicle to be identified based on the vehicle model information;
[0059] The collection submodule is used to collect relevant data of the vehicle to be identified based on the vehicle model protocol.
[0060] Optionally, the device further comprises:
[0061] A quantity determination submodule, configured to determine the quantity of vehicle model information to be matched in the vehicle model information list in response to determining that the CAN bus node ID list does not satisfy a second preset condition;
[0062] The information generation submodule is used to generate matching failure prompt information in response to the number of vehicle model information to be matched being zero.
[0063] In addition, to achieve the above-mentioned purpose, the present invention also provides a vehicle type automatic identification device based on a CAN bus, characterized in that the vehicle type automatic identification device based on a CAN bus comprises: a memory, a processor and a vehicle type automatic identification program based on a CAN bus stored in the memory and executable on the processor, and when the vehicle type automatic identification program based on a CAN bus is executed by the processor, the steps of the vehicle type automatic identification method based on a CAN bus as described in any one of the above are implemented.
[0064] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, characterized in that a vehicle type automatic identification program based on the CAN bus is stored on the computer-readable storage medium, and when the vehicle type automatic identification program based on the CAN bus is executed by the processor, the steps of the vehicle type automatic identification method based on the CAN bus as described in any one of the above are implemented.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] Based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list, the initial matching vehicle model information matching the baud rate is determined; based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, it is determined whether the acquired CAN bus node ID list of the vehicle to be identified meets the first preset condition; in response to determining that the CAN bus node ID list meets the first preset condition, based on the vehicle model rejection CAN node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, it is determined whether the CAN bus node ID list meets the second preset condition; in response to determining that the CAN bus node ID list meets the second preset condition, the vehicle model information of the vehicle to be identified is determined. The embodiment of the present disclosure realizes automatic identification of vehicle model information through the vehicle CAN bus baud rate and the CAN node ID on the bus, so that the same device firmware is used to simultaneously be compatible with data collection and CAN interactive communication of multiple vehicle models. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 A schematic diagram of an embodiment of a method for automatic vehicle type identification based on a CAN bus in an embodiment of the present invention;
[0068] Figure 2 It is a schematic diagram of another embodiment of the method for automatic vehicle type identification based on CAN bus in an embodiment of the present invention;
[0069] Figure 3 A schematic diagram of an embodiment of a vehicle type automatic identification device based on a CAN bus in an embodiment of the present invention;
[0070] Figure 4 The figure is a schematic diagram of an embodiment of a vehicle type automatic identification device based on a CAN bus in an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The main purpose of this application is to provide a method, device, equipment and storage medium for automatic vehicle model identification based on the CAN bus; to realize automatic identification of vehicle model information through the vehicle CAN bus baud rate and the CAN node ID on the bus, so as to use the same device firmware to simultaneously be compatible with data collection and CAN interactive communication of multiple vehicle models; and there is no need to burn different device firmware or use different devices for different vehicle models, which greatly enhances the versatility of the equipment and greatly reduces the difficulty of equipment management.
[0072] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0073] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , is a schematic diagram of an embodiment of a method for automatic vehicle identification based on a CAN bus in an embodiment of the present invention, comprising:
[0074] Step 101 : determining initial matching vehicle model information with a baud rate match based on the collected vehicle bus baud rate of the vehicle to be identified and a pre-established vehicle model information list.
[0075] It is understandable that the execution subject of the present invention can be a method for automatically identifying a vehicle type based on a CAN bus, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0076] The execution subject may collect the vehicle bus baud rate using a collection device; the vehicle model information list includes vehicle model information corresponding to multiple different vehicle models; the vehicle bus baud rate may be a one-way bus baud rate or a two-way bus baud rate. The vehicle bus baud rate may be the baud rate of the vehicle to be identified; the baud rate may be 250K or 500K. The vehicle model information may be all relevant information corresponding to a vehicle model, such as the name of the vehicle model, the corresponding vehicle model protocol, etc. The execution subject may select a vehicle model information having the same baud rate as the vehicle bus baud rate of the vehicle to be identified from the vehicle model information list as the initial matching vehicle model information.
[0077] Optionally, a collection device is connected to the vehicle bus of the vehicle to be identified to collect the vehicle bus baud rate of the vehicle to be identified; based on the acquired vehicle model information set, the vehicle model information list is established, wherein the vehicle model information list includes the vehicle model name, number, vehicle model CAN bus baud rate information, vehicle model CAN bus node ID list and vehicle model veto CAN node ID list.
[0078] After the acquisition device is connected to the vehicle bus and powered on, it starts to identify the vehicle CAN bus baud rate. The commonly used vehicle communication CAN bus is generally 1 or 2. After accessing the vehicle bus, first configure the CAN controller to monitoring mode. The monitoring mode can prevent vehicle failure when matching the baud rate. The baud rate of the vehicle bus is confirmed through the monitoring mode. The above-mentioned vehicle failure may be that the baud rate configuration of the acquisition device CAN bus is inconsistent with the baud rate configuration of the vehicle bus, which will cause the vehicle CAN bus to report a fault, thereby causing a fault code to appear on the vehicle instrument or the vehicle to malfunction.
[0079] The above-mentioned execution subject can obtain the vehicle model information set through a wired connection or a wireless connection, establish a vehicle model information list, and store it in the acquisition device as a parameter for vehicle model matching; the above-mentioned vehicle model information set can be all vehicle models and corresponding vehicle model information of a car company; the vehicle model information includes the vehicle model name, number, vehicle model CAN bus baud rate information, vehicle model CAN bus node ID list and vehicle model veto CAN node ID list; the vehicle model name or number can be defined according to the actual project requirements, which is the result of the vehicle model matching method output. If it is defined as the vehicle model name, the output is the vehicle model name. If it is defined as the vehicle model number, the vehicle model number is output after the matching is completed. The vehicle model CAN bus baud rate information should include the vehicle model's first CAN bus baud rate and the second CAN bus baud rate. The vehicle model CAN bus node ID list is a list of CAN node IDs that are already in use on the vehicle model bus for periodic reporting data. The CAN node ID in this list can be less than all CAN node IDs on the vehicle model bus, and the number of IDs is generally not more than 50. The vehicle model veto CAN node ID list is a CAN node ID that does not exist for the vehicle model obtained by comparing it with other vehicle model information in the acquired vehicle model information set.
[0080] Optionally, the initial matching vehicle model information for baud rate matching is determined based on the collected vehicle bus baud rate of the vehicle to be identified and a pre-established vehicle model information list, including: selecting the target vehicle model CAN bus baud rate information from the vehicle model information list; determining the vehicle bus baud rate and comparing it with the baud rate corresponding to the target vehicle model CAN bus baud rate information; in response to determining that the vehicle bus baud rate is different from the baud rate corresponding to the target vehicle model CAN bus baud rate information, selecting the vehicle model CAN bus baud rate information from the vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information; in response to determining that the vehicle bus baud rate is the same as the baud rate corresponding to the target vehicle model CAN bus baud rate information, using the vehicle model information corresponding to the target vehicle model CAN bus baud rate information as the initial matching vehicle model information.
[0081] The above-mentioned target vehicle model CAN bus baud rate information can be randomly selected from the above-mentioned vehicle model information list; as an example, a vehicle model CAN bus baud rate information is randomly selected from the vehicle model information list as the target vehicle model CAN bus baud rate information; because the target vehicle model CAN bus baud rate information can be one CAN bus baud rate or two CAN bus baud rates; so it is possible to first determine whether the vehicle bus baud rate of the vehicle to be identified is one or two; if they are consistent, determine whether the baud rates of the corresponding vehicle bus baud rates are consistent, if not consistent, reselect a vehicle model CAN bus baud rate information from the above-mentioned vehicle model information list as the target vehicle model CAN bus baud rate information; if they are consistent, the vehicle model information corresponding to the target vehicle model CAN bus baud rate information is used as the initial matching vehicle model information.
[0082] Step 102, based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, determine whether the acquired CAN bus node ID list of the vehicle to be identified meets a first preset condition.
[0083] The above-mentioned execution entity can determine whether the CAN bus node ID list of the vehicle to be identified meets the first preset condition based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information; the above-mentioned first preset condition can be artificially preset, for example, the above-mentioned first preset condition can be that the CAN bus node ID list of the vehicle to be identified includes all the node IDs in the vehicle model CAN bus node ID list.
[0084] Optionally, a vehicle model CAN bus node ID list corresponding to the target vehicle model CAN bus baud rate information is obtained from the vehicle model information list; the CAN bus node ID list of the vehicle to be identified is obtained; it is determined whether the CAN bus node ID list of the vehicle to be identified contains all the node IDs in the vehicle model CAN bus node ID list; in response to determining that all node IDs are not contained, the vehicle model CAN bus baud rate information is selected from the vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information.
[0085] Obtain a vehicle model CAN bus node ID list corresponding to the target vehicle model CAN bus baud rate information from the vehicle model information list; wherein, the above-mentioned target vehicle model CAN bus baud rate information also corresponds to the initial matching vehicle model information; the above-mentioned execution entity can obtain the CAN bus node ID list of the vehicle to be identified through a wired connection method or a wireless connection method; determine whether the CAN bus node ID list of the above-mentioned vehicle to be identified includes all the node IDs in the vehicle model CAN bus node ID list; if it does not include all the node IDs, reselect the vehicle model CAN bus baud rate information from the vehicle model information list again, and match it. If the match is successful, determine again whether the CAN bus node ID list of the above-mentioned vehicle to be identified includes all the node IDs in the vehicle model CAN bus node ID list.
[0086] Step 103, in response to determining that the CAN bus node ID list satisfies the first preset condition, based on the vehicle model corresponding to the initial matching vehicle model information in the vehicle model information list, the CAN bus node ID list is rejected to determine whether the CAN bus node ID list satisfies the second preset condition.
[0087] The above-mentioned execution entity may, when determining that the CAN bus node ID list satisfies the first preset condition, determine whether the CAN bus node ID list satisfies the second preset condition based on the vehicle type veto CAN node ID list corresponding to the initial matching vehicle type information; the above-mentioned second preset condition may be artificially preset, for example, the above-mentioned second preset condition may be that the CAN bus node ID list does not include any vetoed CAN node ID in the vehicle type veto CAN node ID list corresponding to the initial matching vehicle type information.
[0088] Optionally, in response to determining that the CAN bus node ID list satisfies a first preset condition, obtaining a vehicle model rejected CAN node ID list corresponding to the target vehicle model CAN bus baud rate information from the vehicle model information list; determining whether the CAN bus node ID list of the vehicle to be identified contains any one of the rejected CAN node IDs in the vehicle model rejected CAN node ID list; in response to determining that any one of the rejected CAN node IDs is contained, selecting a vehicle model CAN bus baud rate information from the vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information.
[0089] Obtain a vehicle model rejected CAN node ID list corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list; determine whether the CAN bus node ID list contains any rejected CAN node ID in the vehicle model rejected CAN node ID list; in response to determining that any one rejected CAN node ID is contained, reselect the vehicle model CAN bus baud rate information from the vehicle model information list again and perform a match. If the match is successful, determine again whether the CAN bus node ID list of the vehicle to be identified contains any one rejected CAN node ID in the vehicle model rejected CAN node ID list.
[0090] Step 104 , in response to determining that the CAN bus node ID list satisfies a second preset condition, determining the vehicle model information of the vehicle to be identified.
[0091] When it is determined that the CAN bus node ID list satisfies the second preset condition, all vehicle model information corresponding to the vehicle model corresponding to the initial matching vehicle model information is used as the vehicle model information of the vehicle to be identified.
[0092] Optionally, in response to determining that the CAN bus node ID list satisfies a second preset condition, the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model is obtained from the vehicle model information list, and the vehicle model information is used as the vehicle model information of the vehicle to be identified; based on the vehicle model information, the vehicle model protocol corresponding to the vehicle to be identified is determined; based on the vehicle model protocol, relevant data of the vehicle to be identified is collected.
[0093] When it is determined that the CAN bus node ID list meets the second preset condition, the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model is obtained from the vehicle model information list, and the vehicle model information is used as the vehicle model information of the vehicle to be identified; based on the vehicle model information, the vehicle model protocol corresponding to the vehicle model information is obtained from the vehicle model information list, and the vehicle model protocol is used as the vehicle model protocol corresponding to the above-mentioned vehicle to be identified; because most vehicles currently have the need for remote data collection and monitoring, the TBOX (wireless vehicle terminal) assembly rate has also reached 60-70%. For various safety considerations, new energy vehicles are required by regulations to assemble TBOX to collect data before leaving the factory, and transmit the relevant data to the national platform; therefore, the above-mentioned execution entity can collect the relevant data of the vehicle to be identified based on the determined vehicle model protocol; the relevant data of the above-mentioned vehicle can be the data generated by the vehicle during driving.
[0094] Optionally, in response to determining that the CAN bus node ID list does not meet the second preset condition, the number of vehicle model information to be matched in the vehicle model information list is determined; in response to the number of vehicle model information to be matched being zero, a matching failure prompt message is generated.
[0095] In the case where it is determined that the CAN bus node ID list does not meet the second preset condition, the number of vehicle model information to be matched in the vehicle model information list is determined; in the case where the number of vehicle model information to be matched is zero, a matching failure prompt message is generated; the above-mentioned vehicle model information to be matched may be the vehicle model information that has not been selected for comparison in the vehicle model information list; the above-mentioned matching failure prompt message may be information used to describe that the vehicle model to be identified has failed to be identified and there is no matching vehicle model. As an example, in the case where the CAN bus node ID list does not meet the second preset condition, the number of vehicle model information that has not been selected for comparison in the vehicle model information list is determined; in the case where it is determined that there is no vehicle model information that has not been selected for comparison, information used to indicate vehicle model identification failure is generated.
[0096] In an embodiment of the present invention, based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list, the initial matching vehicle model information of the baud rate matching is determined; based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, it is determined whether the acquired CAN bus node ID list of the vehicle to be identified meets the first preset condition; in response to determining that the CAN bus node ID list meets the first preset condition, based on the vehicle model rejection CAN node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, it is determined whether the CAN bus node ID list meets the second preset condition; in response to determining that the CAN bus node ID list meets the second preset condition, the vehicle model information of the vehicle to be identified is determined. The embodiment of the present disclosure realizes automatic identification of vehicle model information through the vehicle CAN bus baud rate and the CAN node ID on the bus, thereby using the same device firmware to simultaneously be compatible with data collection and CAN interactive communication of multiple vehicle models.
[0097] The overall process of the embodiment of the present invention is described below. Figure 2 , is a schematic diagram of another embodiment of the method for automatic vehicle type identification based on CAN bus in an embodiment of the present invention;
[0098] After collecting the vehicle bus baud rate of the vehicle to be identified and establishing the vehicle model information list, the vehicle bus baud rate is identified, including:
[0099] Step 1: Compare and judge based on the vehicle model baud rate (i.e., determine and compare the vehicle bus baud rate with the baud rate corresponding to the CAN bus baud rate information of the target vehicle model); if they are inconsistent, the current vehicle model fails to match and compares with the next vehicle model (wherein the above-mentioned next vehicle model is the unmatched vehicle model in the vehicle model information list), and executes Step 1 again; if they are all inconsistent, the matching fails (i.e., in response to the number of vehicle model information to be matched being zero, a matching failure prompt message is generated);
[0100] If they are consistent, proceed to the second step: it should include CANID list judgment (i.e. determine whether the CAN bus node ID list of the vehicle to be identified contains all the node IDs in the CAN bus node ID list of the vehicle model); if not all are included, the matching of this vehicle model fails and the next vehicle model is compared, and the first step is performed again; if they are not consistent, the matching fails;
[0101] If all are included, proceed to the third step: CAN ID list rejection judgment (i.e., determine whether the CAN bus node ID list of the vehicle to be identified contains any CAN node ID in the vehicle model rejection CAN node ID list); if any CAN node ID in the vehicle model rejection CAN node ID list is included, the vehicle model fails to match and compares with the next vehicle model, and the first step is executed again; if they are not consistent, the match fails;
[0102] If the vehicle model does not contain any rejected CAN node ID in the rejected CAN node ID list, the vehicle model is successfully matched and determined (i.e., in response to determining that the CAN bus node ID list meets the second preset condition, the vehicle model information of the vehicle to be identified is determined).
[0103] The above describes the vehicle type automatic identification method based on the CAN bus in the embodiment of the present invention. The following describes the vehicle type automatic identification device 300 based on the CAN bus in the embodiment of the present invention. Figure 3 In one embodiment of the present invention, a vehicle type automatic identification device based on a CAN bus includes:
[0104] A matching module 301 is used to determine initial matching vehicle model information with baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and a pre-established vehicle model information list;
[0105] A first determination module 302 is used to determine whether the acquired CAN bus node ID list of the vehicle to be identified meets a first preset condition based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list;
[0106] A first determination module 303 is used for, in response to determining that the CAN bus node ID list satisfies the first preset condition, rejecting the CAN node ID list based on the vehicle type corresponding to the initial matching vehicle type information in the vehicle type information list, and determining whether the CAN bus node ID list satisfies the second preset condition;
[0107] The vehicle model information determination module 304 is used to determine the vehicle model information of the vehicle to be identified in response to determining that the CAN bus node ID list meets the second preset condition.
[0108] The functional implementation of each module in the above-mentioned CAN bus-based vehicle type automatic identification device corresponds to the steps in the above-mentioned CAN bus-based vehicle type automatic identification method embodiment, and its functions and implementation processes will not be repeated here one by one.
[0109] Optionally, before the matching module 301, the device further includes:
[0110] A collection module, used to access a collection device on the vehicle bus of the vehicle to be identified, and collect the vehicle bus baud rate of the vehicle to be identified;
[0111] A construction module is used to establish the vehicle model information list based on the acquired vehicle model information set, wherein the vehicle model information list includes the vehicle model name, number, vehicle model CAN bus baud rate information, vehicle model CAN bus node ID list and vehicle model veto CAN node ID list.
[0112] Optionally, the matching module 301 includes:
[0113] A first selection submodule, used to select CAN bus baud rate information of a target vehicle model from the vehicle model information list;
[0114] A comparison submodule, used to determine and compare the vehicle bus baud rate with the baud rate corresponding to the CAN bus baud rate information of the target vehicle model;
[0115] a second selection submodule, configured to select a vehicle model CAN bus baud rate information from a vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information in response to determining that the vehicle bus baud rate is different from the baud rate corresponding to the target vehicle model CAN bus baud rate information;
[0116] The matching submodule is used for, in response to determining that the vehicle bus baud rate is the same as the baud rate corresponding to the CAN bus baud rate information of the target vehicle model, using the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model as the initial matching vehicle model information.
[0117] Optionally, the first determining module 302 includes:
[0118] The first acquisition submodule is used to obtain a vehicle model CAN bus node ID list corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list;
[0119] The second acquisition submodule is used to acquire the CAN bus node ID list of the vehicle to be identified;
[0120] A node ID determination submodule, used to determine whether the CAN bus node ID list of the vehicle to be identified contains all the node IDs in the vehicle model CAN bus node ID list;
[0121] The third selection submodule is used for selecting the vehicle type CAN bus baud rate information from the vehicle type information list that does not include the target vehicle type CAN bus baud rate information as the target vehicle type CAN bus baud rate information in response to determining that all node IDs are not included.
[0122] Optionally, the second determining module 303 includes:
[0123] A third acquisition submodule is used for acquiring, in response to determining that the CAN bus node ID list satisfies the first preset condition, a vehicle model rejected CAN node ID list corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list;
[0124] A rejected CAN node ID determination submodule is used to determine whether the CAN bus node ID list of the vehicle to be identified contains any rejected CAN node ID in the rejected CAN node ID list of the vehicle type;
[0125] The fourth selection submodule is used to select the vehicle model CAN bus baud rate information from the vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information in response to determining that any one of the rejected CAN node IDs is included.
[0126] Optionally, the vehicle model information determination module 304 includes:
[0127] a fourth acquisition submodule, configured to, in response to determining that the CAN bus node ID list satisfies a second preset condition, acquire the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list, and use the vehicle model information as the vehicle model information of the vehicle to be identified;
[0128] A vehicle model protocol determination submodule, used to determine the vehicle model protocol corresponding to the vehicle to be identified based on the vehicle model information;
[0129] The collection submodule is used to collect relevant data of the vehicle to be identified based on the vehicle model protocol.
[0130] Optionally, the device 300 further includes:
[0131] A quantity determination submodule, configured to determine the quantity of vehicle model information to be matched in the vehicle model information list in response to determining that the CAN bus node ID list does not satisfy a second preset condition;
[0132] The information generation submodule is used to generate matching failure prompt information in response to the number of vehicle model information to be matched being zero.
[0133] In an embodiment of the present invention, based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list, the initial matching vehicle model information of the baud rate matching is determined; based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, it is determined whether the acquired CAN bus node ID list of the vehicle to be identified meets the first preset condition; in response to determining that the CAN bus node ID list meets the first preset condition, based on the vehicle model rejection CAN node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, it is determined whether the CAN bus node ID list meets the second preset condition; in response to determining that the CAN bus node ID list meets the second preset condition, the vehicle model information of the vehicle to be identified is determined. The embodiment of the present disclosure realizes automatic identification of vehicle model information through the vehicle CAN bus baud rate and the CAN node ID on the bus, thereby using the same device firmware to simultaneously be compatible with data collection and CAN interactive communication of multiple vehicle models.
[0134] above Figure 3 The vehicle type automatic identification device based on the CAN bus in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The vehicle type automatic identification device based on the CAN bus in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0135] Figure 4 4 is a schematic diagram of a vehicle type automatic identification device based on a CAN bus provided by an embodiment of the present invention. The vehicle type automatic identification device 400 based on a CAN bus may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 410 (for example, one or more processors) and a memory 420, and one or more storage media 430 (for example, one or more mass storage devices) storing application programs 433 or data 432. Among them, the memory 420 and the storage medium 430 may be short-term storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of computer program operations in the vehicle type automatic identification device 400 based on the CAN bus. Furthermore, the processor 410 may be configured to communicate with the storage medium 430 to execute a series of computer program operations in the storage medium 430 on the vehicle type automatic identification device 400 based on the CAN bus.
[0136] The vehicle type automatic identification device 400 based on the CAN bus may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input and output interfaces 460, and / or one or more operating systems 431, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It can be understood by those skilled in the art that Figure 4 The structure of the automatic vehicle identification device based on the CAN bus shown does not constitute a limitation on the automatic vehicle identification device based on the CAN bus, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0137] The present invention also provides a vehicle type automatic identification device based on a CAN bus, comprising: a memory and at least one processor, wherein a computer program is stored in the memory, and the memory and the at least one processor are interconnected via a line; the at least one processor calls the computer program in the memory so that the vehicle type automatic identification device based on the CAN bus executes the steps in the above-mentioned vehicle type automatic identification method based on the CAN bus.
[0138] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer executes the steps of a method for automatic vehicle identification based on a CAN bus.
[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0140] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several computer programs to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0141] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatic vehicle identification based on CAN bus. It is characterized in that include: Based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list, the initial matching vehicle model information of the baud rate matching is determined, wherein the vehicle model information list includes the vehicle model CAN bus baud rate information, the vehicle model CAN bus node ID list and the vehicle model rejected CAN node ID list; the vehicle model CAN bus node ID list is the CAN node ID list of the periodic reporting data that is already in use on the vehicle model bus; the vehicle model rejected CAN node ID list is the CAN node ID of the vehicle model that is obtained by comparing with other vehicle model information in the acquired vehicle model information set, and the CAN node ID of the vehicle model that does not exist; Based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list, determining whether the acquired CAN bus node ID list of the vehicle to be identified includes all the node IDs in the vehicle model CAN bus node ID list; In response to determining that the CAN bus node ID list includes all the node IDs in the vehicle type CAN bus node ID list, determining whether the CAN bus node ID list includes any one of the vehicle type vetoed CAN node IDs in the vehicle type vetoed CAN node ID list based on the vehicle type vetoed CAN node ID list corresponding to the initial matching vehicle type information in the vehicle type information list; In response to determining that the CAN bus node ID list does not include any rejected CAN node ID in the vehicle type rejected CAN node ID list, the initial matching vehicle type information is used as the vehicle type information of the vehicle to be identified.
2. According to claim 1, a method for automatic vehicle type recognition based on CAN bus, It is characterized in that Before determining the initial matching vehicle model information with baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list, the method further includes: Connecting a collection device to the vehicle bus of the vehicle to be identified to collect the baud rate of the vehicle bus of the vehicle to be identified; Based on the acquired vehicle model information set, the vehicle model information list is established, wherein the vehicle model information list includes the vehicle model name and number.
3. The method for automatic vehicle type recognition based on CAN bus according to claim 1, It is characterized in that The determining of initial matching vehicle model information with baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list includes: Select the CAN bus baud rate information of the target vehicle model from the vehicle model information list; Determine the vehicle bus baud rate and compare it with the baud rate corresponding to the CAN bus baud rate information of the target vehicle model; In response to determining that the vehicle bus baud rate is different from the baud rate corresponding to the target vehicle model CAN bus baud rate information, selecting vehicle model CAN bus baud rate information from a vehicle model information list that does not include the target vehicle model CAN bus baud rate information as the target vehicle model CAN bus baud rate information; In response to determining that the vehicle bus baud rate is the same as the baud rate corresponding to the CAN bus baud rate information of the target vehicle model, the vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model is used as the initial matching vehicle model information.
4. According to claim 3, a method for automatic vehicle type recognition based on CAN bus, It is characterized in that The determining whether the acquired CAN bus node ID list of the vehicle to be identified includes all the node IDs in the CAN bus node ID list of the vehicle model based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list comprises: Obtain a vehicle model CAN bus node ID list corresponding to the target vehicle model CAN bus baud rate information from the vehicle model information list; Obtaining a CAN bus node ID list of the vehicle to be identified; Determine whether the CAN bus node ID list of the vehicle to be identified contains all the node IDs in the vehicle model CAN bus node ID list; In response to determining that not all node IDs are included, the vehicle type CAN bus baud rate information is selected from the vehicle type information list that does not include the target vehicle type CAN bus baud rate information as the target vehicle type CAN bus baud rate information.
5. According to claim 4, a method for automatic vehicle type recognition based on CAN bus, It is characterized in that In response to determining that the CAN bus node ID list includes all the node IDs in the vehicle type CAN bus node ID list, determining whether the CAN bus node ID list includes any one of the rejected CAN node IDs in the vehicle type rejected CAN node ID list based on the vehicle type rejected CAN node ID list corresponding to the initial matching vehicle type information in the vehicle type information list comprises: In response to determining that the CAN bus node ID list includes all the node IDs in the vehicle type CAN bus node ID list, acquiring a vehicle type veto CAN node ID list corresponding to the target vehicle type CAN bus baud rate information from the vehicle type information list; Determine whether the CAN bus node ID list of the vehicle to be identified contains any rejected CAN node ID in the vehicle type rejected CAN node ID list; In response to determining that any one of the rejected CAN node IDs is included, the vehicle type CAN bus baud rate information is selected from the vehicle type information list that does not include the target vehicle type CAN bus baud rate information as the target vehicle type CAN bus baud rate information.
6. The method for automatic vehicle type recognition based on CAN bus according to claim 4, It is characterized in that In response to determining that the CAN bus node ID list does not include any rejected CAN node ID in the vehicle type rejected CAN node ID list, using the initial matching vehicle type information as the vehicle type information of the vehicle to be identified, including: In response to determining that the CAN bus node ID list does not include any rejected CAN node ID in the vehicle model rejected CAN node ID list, acquiring vehicle model information corresponding to the CAN bus baud rate information of the target vehicle model from the vehicle model information list, and using the vehicle model information as the vehicle model information of the vehicle to be identified; Based on the vehicle model information, determining the vehicle model protocol corresponding to the vehicle to be identified; Based on the vehicle type protocol, relevant data of the vehicle to be identified is collected.
7. The method for automatic vehicle type recognition based on CAN bus according to claim 4, It is characterized in that The method further comprises: In response to determining that the CAN bus node ID list includes any one of the vehicle type rejected CAN node IDs in the vehicle type rejected CAN node ID list, determining the number of vehicle type information to be matched in the vehicle type information list; In response to the number of vehicle model information to be matched being zero, a matching failure prompt message is generated.
8. A vehicle type automatic identification device based on CAN bus, It is characterized in that include: A matching module is used to determine the initial matching vehicle model information of baud rate matching based on the collected vehicle bus baud rate of the vehicle to be identified and the pre-established vehicle model information list, wherein the vehicle model information list includes vehicle model CAN bus baud rate information, vehicle model CAN bus node ID list and vehicle model veto CAN node ID list; the vehicle model CAN bus node ID list is a CAN node ID list of periodic reporting data already in use on the vehicle model bus; the vehicle model veto CAN node ID list is a CAN node ID of a vehicle model that does not exist, obtained by comparing with other vehicle model information in the acquired vehicle model information set; A first determination module is used to determine whether the acquired CAN bus node ID list of the vehicle to be identified includes all the node IDs in the vehicle model CAN bus node ID list based on the vehicle model CAN bus node ID list corresponding to the initial matching vehicle model information in the vehicle model information list; A first determination module is configured to determine, in response to determining that the CAN bus node ID list includes all the node IDs in the vehicle type CAN bus node ID list, whether the CAN bus node ID list includes any one of the rejected CAN node IDs in the vehicle type rejected CAN node ID list based on the vehicle type rejected CAN node ID list corresponding to the initial matching vehicle type information in the vehicle type information list; The vehicle model information determination module is used to respond to determining that the CAN bus node ID list does not include any rejected CAN node ID in the vehicle model rejected CAN node ID list, and use the initial matching vehicle model information as the vehicle model information of the vehicle to be identified.
9. A vehicle type automatic identification device based on CAN bus, It is characterized in that The CAN bus-based vehicle type automatic identification device includes: a memory, a processor, and a CAN bus-based vehicle type automatic identification program stored in the memory and executable on the processor. When the CAN bus-based vehicle type automatic identification program is executed by the processor, the steps of the CAN bus-based vehicle type automatic identification method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a vehicle type automatic identification program based on the CAN bus, and when the vehicle type automatic identification program based on the CAN bus is executed by the processor, the steps of the vehicle type automatic identification method based on the CAN bus as described in any one of claims 1 to 7 are implemented.
