Vehicle signal acquisition method, device and equipment and storage medium
By introducing a parsing whitelist into the vehicle signal acquisition method, only the required CAN messages are analyzed, the problem of excessive resources being occupied for the analysis of the full CAN messages is solved, reducing the load on the vehicle side and improving processing efficiency.
Patent Information
- Application Number
- CN202411542529.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, parsing the full CAN message takes up too much CPU resources and memory resources, resulting in a higher vehicle load, a lower processing efficiency, and affecting the implementation of functions.
By analyzing the whitelist method, we judge whether the current frame CAN message meets the resolution conditions, and only the messages that meet the conditions are fully parsed, the vehicle signal is obtained, and the target signal is collected.
Reduce the CPU resources occupied by the analysis process and the memory resources occupied by the cache signal, reduce the load on the vehicle side, improve processing efficiency, and ensure the normal implementation of the vehicle side functions.
Smart Images

Figure CN119420829A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle-side data processing technology, and in particular to vehicle signal acquisition methods, devices, equipment and storage media. Background Art
[0002] At present, the vehicle side usually parses the received full CAN (Controller Area Network) messages, and then selects the required signals from the parsed vehicle signals for collection. If the CPU (Central Processing Unit) resources and memory resources of the controller chip are sufficient, it can support the parsing of the full CAN messages. However, if the controller chip resources are limited, if the full CAN messages are still parsed, it will occupy too many CPU resources and memory resources, making the vehicle side in a high-load state, reducing processing efficiency and affecting function realization.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a vehicle signal acquisition method, device, equipment and storage medium, aiming to solve the technical problems in the prior art that parsing the full amount of CAN messages takes up too many resources, the vehicle-side load is high, and the function realization is affected.
[0005] To achieve the above objectives, the present application provides a vehicle signal acquisition method, the method comprising:
[0006] Receive the current frame CAN message of the target vehicle;
[0007] Based on the parsing whitelist, determine whether the current frame CAN message meets the parsing conditions;
[0008] When the current frame CAN message meets the parsing condition, the current frame CAN message is completely parsed to obtain a corresponding vehicle signal;
[0009] A target vehicle signal is determined in the vehicle signals, and the target vehicle signal is collected.
[0010] In one embodiment, the step of determining whether the current frame CAN message meets the parsing condition based on the parsing whitelist includes:
[0011] Parsing the identification information of the current frame CAN message;
[0012] When the identification information of the current frame CAN message matches the whitelist identification information in the parsing whitelist, determining that the current frame CAN message meets the parsing condition;
[0013] When the identification information of the current frame CAN message does not match the whitelist identification information in the parsing whitelist, it is determined that the current frame CAN message does not meet the parsing condition.
[0014] In one embodiment, before the step of receiving the current frame CAN message of the target vehicle, the step further includes:
[0015] Based on the identification information of the CAN message to which the required vehicle signal belongs, determine the whitelist identification information;
[0016] The parsing whitelist is generated based on the whitelist identification information.
[0017] In one embodiment, before the step of determining the whitelist identification information based on the identification information of the CAN message to which the demand vehicle signal belongs, the step further includes:
[0018] Based on the running status of the signal acquisition task in the task list, determine the current startup task;
[0019] Determining the acquisition signal of the currently started task based on the acquisition rule information of the currently started task;
[0020] The required vehicle signal is determined based on the collected signal of the current startup task.
[0021] In one embodiment, the step of determining the whitelist identification information based on the identification information of the CAN message to which the demand vehicle signal belongs includes:
[0022] Determine the demand vehicle signal corresponding to each flow based on the flow information of the currently started task;
[0023] Based on the identification information of the CAN message to which the demand vehicle signal corresponding to each flow belongs, determine the whitelist identification information of each flow;
[0024] The step of generating the parsing whitelist based on the whitelist identification information includes:
[0025] Based on the whitelist identification information of each flow, a parsing whitelist for each flow is determined.
[0026] In one embodiment, the method further comprises:
[0027] When a new signal acquisition task is acquired or the running state of a signal acquisition task in the task list changes, updating the task list;
[0028] Based on the running status of the signal acquisition task in the updated task list, the required vehicle signal is re-determined, the whitelist identification information is re-determined, and the parsing whitelist is updated.
[0029] In one embodiment, after the step of determining whether the current frame CAN message meets the parsing condition based on the parsing whitelist, the step further includes:
[0030] When the current frame CAN message does not meet the parsing condition, the current frame CAN message is discarded.
[0031] In addition, to achieve the above purpose, the present application also proposes a vehicle signal collection device, the vehicle signal collection device comprising:
[0032] A data parsing module is used to receive the current frame CAN message of the target vehicle;
[0033] The data parsing module is further used to determine whether the current frame CAN message meets the parsing conditions based on the parsing whitelist;
[0034] The data parsing module is further used to completely parse the current frame CAN message to obtain a corresponding vehicle signal when the current frame CAN message meets the parsing condition;
[0035] The signal acquisition module is used to determine the target vehicle signal in the vehicle signal and to acquire the target vehicle signal.
[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a vehicle signal acquisition device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the vehicle signal acquisition method as described above.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the vehicle signal acquisition method as described above are implemented.
[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the vehicle signal acquisition method as described above are implemented.
[0039] The present application provides a vehicle signal acquisition method, receiving the current frame CAN message of the target vehicle; judging whether the current frame CAN message meets the parsing conditions based on the parsing whitelist; when the current frame CAN message meets the parsing conditions, the current frame CAN message is fully parsed to obtain the corresponding vehicle signal; the target vehicle signal is determined in the vehicle signal, and the target vehicle signal is collected. The present application uses the whitelist to quickly and accurately find the CAN message where the signal to be collected is located, fully parses it, and collects the corresponding signal, while other messages are discarded and not parsed. It is not necessary to parse the full amount of vehicle CAN messages, and only the necessary CAN messages need to be parsed, which can reduce the CPU resources occupied by the parsing process. At the same time, it is not necessary to cache the full amount of vehicle signals, and only the vehicle signals of some CAN messages need to be cached, which reduces the memory resources occupied by the cached signals after the parsing is completed, reduces resource consumption, avoids the vehicle end being in a high load state due to parsing a large number of messages, reduces the vehicle end load, improves processing efficiency, and ensures the normal realization of the vehicle end function, and solves the technical problem that the full amount of CAN messages are parsed and occupy too many resources, the vehicle end load is high, and the function realization is affected. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 This is a flow chart of the first embodiment of the vehicle signal acquisition method of the present application;
[0043] Figure 2 A schematic diagram of a traditional analysis of the vehicle signal acquisition method provided in the first embodiment of the present application;
[0044] Figure 3 A schematic diagram of whitelist parsing of the vehicle signal collection method provided in Example 1 of the present application;
[0045] Figure 4 This is a flow chart of the second embodiment of the vehicle signal acquisition method of the present application;
[0046] Figure 5 A schematic diagram of a process of updating a whitelist based on a new task in a vehicle signal acquisition method provided in Embodiment 2 of the present application;
[0047] Figure 6A schematic diagram of a process of updating a whitelist based on a task status in a vehicle signal acquisition method provided in Embodiment 2 of the present application;
[0048] Figure 7 This is a flow chart of the third embodiment of the vehicle signal acquisition method of the present application;
[0049] Figure 8 A schematic diagram of a simplified process of a vehicle signal acquisition method provided in Embodiment 3 of the present application;
[0050] Fig. 9 This is a schematic diagram of the module structure of the vehicle signal acquisition device according to an embodiment of the present application;
[0051] Fig.10 This is a schematic diagram of the device structure of the hardware operating environment involved in the vehicle signal acquisition method in the embodiment of the present application.
[0052] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0055] The main solution of the embodiment of the present application is: receiving the current frame CAN message of the target vehicle; judging whether the current frame CAN message meets the parsing conditions based on the parsing whitelist; when the current frame CAN message meets the parsing conditions, completely parsing the current frame CAN message to obtain the corresponding vehicle signal; determining the target vehicle signal in the vehicle signal, and collecting the target vehicle signal.
[0056] At present, in the case of limited controller chip resources, if the full amount of CAN messages are still parsed, it will take up too many CPU resources and memory resources, causing the vehicle end to be in a high-load state, reducing processing efficiency and affecting function realization.
[0057] The present application provides a solution, which uses a white list to quickly and accurately find the CAN message containing the signal that needs to be collected, fully parses it, and collects the corresponding signal. Other messages are discarded and not parsed. There is no need to parse the full CAN messages of the vehicle, only the necessary CAN messages need to be parsed, which can reduce the CPU resources occupied by the parsing process. At the same time, there is no need to cache the full vehicle signals, only the vehicle signals of some CAN messages need to be cached, and the memory resources occupied by the cached signals after the parsing is completed are reduced, resource consumption is reduced, and the vehicle-side is prevented from being in a high-load state due to parsing a large number of messages, reducing the load on the vehicle-side, improving processing efficiency, and ensuring the normal implementation of the vehicle-side functions. The technical problem that the parsing of the full CAN messages takes up too many resources, the vehicle-side load is high, and the function implementation is affected is solved.
[0058] It should be noted that the execution subject of this embodiment can be a vehicle signal acquisition device that can realize the above functions, such as: a vehicle controller, i.e., an ECU (Electronic Control Unit), an MCU (Micro Control Unit), etc., or other devices that need to parse CAN messages and collect related signals, and this embodiment does not specifically limit this. The following takes the vehicle controller as an example to illustrate this embodiment and the following embodiments.
[0059] The present application embodiment provides a vehicle signal acquisition method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the vehicle signal acquisition method of the present application.
[0060] In this embodiment, the vehicle signal collection method includes steps S10 to S40:
[0061] Step S10, receiving the current frame CAN message of the target vehicle;
[0062] It should be noted that the target vehicle is the vehicle currently collecting vehicle signals, and the vehicle signal is the relevant parameter information fed back by each component of the vehicle, such as speed, battery status, door status, light status, etc., which is not specifically limited. Each component can transmit the corresponding vehicle signal to the controller in the form of a CAN message through the CAN bus. After receiving the CAN message, the controller parses it to obtain these vehicle signals. The current frame message is a frame of CAN message currently received by the controller.
[0063] In addition, it should be noted that not all vehicle signals obtained through analysis are collected. The collected signals are usually request / demand signals, that is, required signals, such as signals corresponding to data to be displayed on the vehicle's central control screen and signals corresponding to information requested by users. There is no specific limitation on this. The business personnel determine the signals currently required, and the cloud generates the corresponding signal collection tasks and sends them to the controller. The controller finds the required signals in the vehicle signals obtained through analysis according to the signal collection tasks and uploads them to the cloud.
[0064] It is understandable that different CAN messages usually contain different vehicle signals, and the number of vehicle signals contained in each CAN message needs to be determined according to the actual situation, and there is no specific limitation on this. Different CAN messages are usually distinguished by identification information, and the identification information can be ID (Identity Document, ID card identification number), that is, CAN ID, and there is no specific limitation on this. This embodiment takes CAN ID as an example for explanation. Exemplarily, referring to Table 1, the CAN message with CAN ID of 1549 contains the following vehicle signals: VEHICLE_SPEED, ACCELEROMETER, TORE_PRESSURE, the CAN message with CAN ID of 235 contains the following vehicle signals: TEMPERATURE, HUMIDITY, BATTERY_STATUS, and the CAN message with CAN ID of 1029 contains the following vehicle signals: WINDOWS_STATUS, DOORS_STATUS, LIGHT_STATUS.
[0065] Table 1
[0066]
[0067] Step S20, based on the parsing whitelist, determining whether the current frame CAN message meets the parsing conditions;
[0068] Generally speaking, the controller will parse the full amount of CAN messages received, find the required signals in the full amount of vehicle signals for collection, for example, refer to Figure 2, assuming that the required signal is VEHICLE_SPEED, and a total of 3 CAN messages are received, all of these 3 CAN messages are parsed to obtain 9 vehicle signals, and the VEHICLE_SPEED signal is found in these 9 vehicle signals for collection. Since the resources of the vehicle-side controller are usually limited, the traditional parsing method will occupy too many CPU resources and memory resources, causing the controller to be in a high-load state, reducing processing efficiency and affecting function implementation. Therefore, after receiving the CAN message, this embodiment will determine whether it needs to be parsed, and only parse the necessary CAN messages to reduce CPU resource occupation and CPU resource consumption.
[0069] It is understandable that CAN messages with the same CAN ID usually contain the same vehicle signal (the value of the vehicle signal may be different), that is, the vehicle signal that can be obtained after parsing the current frame CAN message can be determined based on the CAN ID of the current frame CAN message, or the CAN ID of the message in which the signal is required can be determined to determine whether the current frame CAN message needs to be parsed. The parsing condition is the condition under which the current frame CAN message needs to be parsed, that is, the current frame CAN message contains the required signal. If the current frame CAN message contains the required signal, it means that the current frame CAN message meets the parsing condition. If the current frame CAN message does not contain the required signal, it means that the current frame CAN message does not meet the parsing condition.
[0070] It should be noted that in order to quickly and accurately determine whether the current frame CAN message meets the parsing conditions, the present embodiment sets a parsing whitelist. The parsing whitelist is a list of CAN messages that need to be parsed, that is, a list of CAN messages where the required signals are located. The parsing whitelist is usually composed of the CAN IDs of the CAN messages where the required signals are located. For example, the parsing whitelist is: 1549.
[0071] In a feasible implementation, step S20 may include: parsing the identification information of the current frame CAN message; when the identification information of the current frame CAN message matches the whitelist identification information in the parsing whitelist, determining that the current frame CAN message meets the parsing conditions; when the identification information of the current frame CAN message does not match the whitelist identification information in the parsing whitelist, determining that the current frame CAN message does not meet the parsing conditions.
[0072] It should be noted that the identification information of the current frame CAN message is the CAN ID of the current frame CAN message, and the whitelist identification information is the CAN ID in the parsed whitelist, that is, the CAN ID of the CAN message where the required signal is located.
[0073] It can be understood that the CAN ID of the current frame CAN message can be obtained by parsing the identification field (ID field) of the current frame CAN message. When the current frame CAN message is received, the entire frame message is not parsed first, but the identification field is parsed first to obtain the CAN ID of the current frame CAN message. The remaining information exists in the current frame CAN message in the form of a data field (DATA field).
[0074] It should be understood that when the CAN ID of the current frame CAN message is in the parsing whitelist, it is considered that the identification information of the current frame CAN message matches the whitelist identification information in the parsing whitelist. At this time, the current frame CAN message contains the required signal and meets the parsing conditions; when the CAN ID of the current frame CAN message is not in the parsing whitelist, it is considered that the identification information of the current frame CAN message does not match the whitelist identification information in the parsing whitelist. At this time, the current frame CAN message does not contain the required signal and does not meet the parsing conditions.
[0075] In this embodiment, by using the parsing whitelist, it is possible to quickly and accurately determine whether the current frame CAN message meets the parsing conditions, and find the CAN message where the required signal is located.
[0076] Step S30, when the current frame CAN message meets the parsing condition, completely parse the current frame CAN message to obtain a corresponding vehicle signal;
[0077] It should be noted that the current frame CAN message is fully parsed, that is, the entire frame message is parsed to obtain complete information / data, and all vehicle signals and signal values contained in the current frame CAN message can be obtained. When the current frame CAN message meets the parsing conditions, it is fully parsed to obtain the corresponding vehicle signal. Since the ID field has been parsed, in the specific implementation, it is only necessary to use the DBC (Database Can, communication database) file to parse the remaining DATA field to obtain complete data / information, wherein the DBC file stores the relevant definition of the CAN message, and the vehicle signal in the current frame CAN message can be parsed using the DBC file.
[0078] It is understandable that when the current frame CAN message does not meet the parsing condition, the current frame CAN message is discarded. If the current frame CAN message does not meet the parsing condition, no parsing is performed and the frame message is directly discarded.
[0079] It should be understood that all parsed information / data will be cached. Since this embodiment parses the messages in the parsing whitelist, the number of parsed messages is greatly reduced. Therefore, the data that needs to be cached is reduced, the occupied memory resources can be reduced, and the consumption of memory resources can be reduced.
[0080] Step S40, determining a target vehicle signal from the vehicle signals, and collecting the target vehicle signal.
[0081] It should be noted that the target vehicle signal is the signal that needs to be collected contained in the vehicle signal obtained through analysis. After the vehicle signal is obtained through analysis, the required signal and the value of the signal are collected.
[0082] In the specific implementation, refer to Figure 3 Assuming that the required signal is VEHICLE_SPEED, and the CANID of the CAN message is 1549, the parsing whitelist is 1549. When receiving the CAN message, first parse the ID field of the CAN message to get the CAN ID of the CAN message. If the CAN ID of the CAN message is in the parsing whitelist, continue to parse the DATA field of the CAN message to get the corresponding vehicle signal, and find the VEHICLE_SPEED signal for collection. If the CAN ID of the CAN message is not in the parsing whitelist, discard the message.
[0083] This embodiment provides a vehicle signal acquisition method, receiving the current frame CAN message of the target vehicle; judging whether the current frame CAN message meets the parsing conditions based on the parsing whitelist; when the current frame CAN message meets the parsing conditions, completely parsing the current frame CAN message to obtain the corresponding vehicle signal; determining the target vehicle signal in the vehicle signal, and collecting the target vehicle signal. The whitelist is used to quickly and accurately find the CAN message where the signal to be collected is located, and it is completely parsed and the corresponding signal is collected. Other messages are discarded and not parsed. It is not necessary to parse the full amount of vehicle CAN messages, and only the necessary CAN messages need to be parsed, which can reduce the CPU resources occupied by the parsing process. At the same time, it is not necessary to cache the full amount of vehicle signals, and only the vehicle signals of some CAN messages need to be cached, which reduces the memory resources occupied by the cached signals after the parsing is completed, reduces resource consumption, avoids the vehicle end being in a high load state due to parsing a large number of messages, reduces the load on the vehicle end, improves processing efficiency, and ensures the normal realization of vehicle end functions.
[0084] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 4 , before step S10, steps S01 to S02 may be included:
[0085] Step S01, determining whitelist identification information based on identification information of the CAN message to which the demand vehicle signal belongs;
[0086] It should be noted that the required vehicle signal is the vehicle signal that needs to be collected, and the identification information of the CAN message to which the required vehicle signal belongs is the CAN ID of the CAN message where the required vehicle signal is located.
[0087] It can be understood that the CAN ID of each CAN message containing the required vehicle signal is added to the parsing whitelist as whitelist identification information.
[0088] In a feasible implementation manner, step S01 may include steps A11 to A13:
[0089] Step A11, determining the current startup task based on the running status of the signal acquisition task in the task list;
[0090] It should be noted that the signal acquisition task is a task issued by the cloud to collect the required signals. The signal acquisition task at least includes basic task information and initial startup status. The basic task information is the specific content of the signal acquisition task, including at least the accessed stream information and acquisition rule information. The accessed stream information is the stream accessed when collecting signals, and the acquisition rule information is the rules to be followed when collecting signals. The basic task information is usually in the form of SQL (Structured Query Language) statements. For example, the basic task information of signal acquisition task A is: select a, b from100ms_stream when c>0, that is, access data from the stream named 100ms_stream, and the acquisition rule is: when c>0, collect a signal and b signal. The initial startup status is whether the controller is immediately started when receiving the signal acquisition task. If so, the signal acquisition task needs to be started immediately. If not, the signal acquisition task will be started later.
[0091] In addition, it should be noted that the task list is a list of all signal acquisition tasks received by the controller. The running status of the signal acquisition task includes two states, the start state and the stop state (pause state). If the signal acquisition task is in the start state, it means that the signal acquisition task is running. If the signal acquisition task is in the stop state, it means that the signal acquisition task is not running. The controller will mark the running status of each signal acquisition task in the task list.
[0092] It can be understood that the stream is where the signal acquisition task collects data. After the vehicle receives the CAN message, it will be divided into different data flows, that is, diversion. For example, the received CAN message is divided into 100ms stream, 1s stream, and 10s stream, where the 100ms stream outputs data at a frequency of 100ms / time, the 1s stream outputs data at a frequency of 1s / time, and the 10s stream outputs data at a frequency of 10s / time. For some signals with low acquisition frequency, it is not necessary to parse the CAN message at a high frequency. Diversion can reduce the CPU resource consumption of the vehicle. Different signal acquisition tasks can be assigned to different streams.
[0093] It should be understood that the current startup task is the signal acquisition task that is currently running, which is determined according to the running state of the signal acquisition task. The signal acquisition task whose running state is the startup state is the current startup task. The vehicle side can run multiple signal acquisition tasks at the same time, that is, there can be multiple current startup tasks. The specific number is determined according to the actual situation and is not specifically limited.
[0094] Step A12, determining the collection signal of the currently started task based on the collection rule information of the currently started task;
[0095] It should be noted that the signals that need to be collected by each currently started task, i.e., the collected signals, are determined according to the collection rules of the currently started task. For example, assuming that the collection rule information of the currently started task B is: when c>0, collect a signal and b signal, then the collected signals of the currently started task B are a signal and b signal.
[0096] Step A13: determining the required vehicle signal based on the collected signal of the current startup task.
[0097] It can be understood that all collected signals of the currently started tasks are used as demand vehicle signals.
[0098] In a feasible implementation, step S01 includes: determining the required vehicle signal corresponding to each flow based on the flow information of the currently started task; and determining the whitelist identification information of each flow based on the identification information of the CAN message to which the required vehicle signal corresponding to each flow belongs.
[0099] It should be noted that the flow information of the current startup task is the flow connected to the current startup task. According to the flow connected to the current startup task and the collection signal of the current startup task, the collection signal corresponding to each flow is determined, so as to obtain the demand vehicle signal corresponding to each flow.
[0100] It can be understood that the identification information of the CAN message to which the demand vehicle signal corresponding to each flow belongs, that is, the CAN ID of the CAN message to which the demand vehicle signal corresponding to each flow belongs, is used as the CAN ID in the parsing whitelist of each flow.
[0101] Step S02: Generate the parsing whitelist based on the whitelist identification information.
[0102] In a feasible implementation manner, step S02 includes: determining a parsing whitelist for each flow based on whitelist identification information of each flow.
[0103] It is understandable that each flow has its own parsing whitelist, and different flows can share the parsing whitelist. The parsing whitelist of each flow is determined according to the CAN ID of the CAN message to which the demand vehicle signal corresponding to each flow belongs.
[0104] In the specific implementation, it can be determined whether the current frame CAN message meets the parsing conditions according to the parsing whitelist of the corresponding flow.
[0105] Furthermore, in this embodiment, the parsing whitelist can be automatically updated. The step of updating the parsing whitelist includes: updating the task list when a new signal collection task is acquired or the running status of the signal collection task in the task list changes; based on the running status of the signal collection task in the updated task list, re-determining the required vehicle signal and re-determining the whitelist identification information, and updating the parsing whitelist.
[0106] It is understandable that the new signal collection task is the signal collection task newly issued by the cloud. Figure 5 After receiving the signal acquisition task issued, the vehicle side will parse the signal acquisition task, determine the access flow, acquisition rules, whether it is started immediately and other information, add it to the task list, and mark the running status of the new signal acquisition task, and update the task list. If the running status of the new signal acquisition task is started, the latest information in the task list is obtained, and the CAN ID corresponding to the required signal of all running signal acquisition tasks under the same flow is found. The flow that needs to add a new CAN ID in the parsing whitelist is found, and its parsing whitelist is updated.
[0107] It should be understood that the change in the running state of the signal acquisition task refers to the change in the running state of the signal acquisition task from the start state to the stop / pause state, or the change in the running state of the signal acquisition task from the stop / pause state to the start state. The running state of the signal acquisition task may change. Figure 6When the running status of the signal acquisition task in the task list changes, the task list is updated, the running status of the task is updated, the flow of the task is found, and the latest information in the task list is re-acquired, the CAN ID corresponding to the required signal of all running signal acquisition tasks under the same flow is found, and the flow that needs to add / reduce CAN ID in the parsing whitelist is found, and its parsing whitelist is updated.
[0108] This embodiment provides a vehicle signal collection method, which determines whitelist identification information based on the identification information of the CAN message to which the required vehicle signal belongs; and generates a parsing whitelist based on the whitelist identification information. According to the signal collection task, the signal to be collected is found, and the corresponding parsing whitelist is generated. The parsing whitelist is used to quickly and accurately find the CAN message where the signal to be collected is located, and it is fully parsed and the corresponding signal is collected. Other messages are discarded and not parsed. It is not necessary to parse all the CAN messages of the vehicle, and only the necessary CAN messages need to be parsed. The CPU resources occupied by the parsing process can be reduced, and the memory resources occupied by the cached signal after the parsing is completed can be reduced, so as to avoid the vehicle end being in a high load state due to parsing a large number of messages, reduce the load on the vehicle end, improve processing efficiency, and ensure the normal implementation of the vehicle end functions.
[0109] Based on the above embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 7 , step S20 may include:
[0110] Step S30': when the current frame CAN message does not meet the parsing condition, discard the current frame CAN message.
[0111] It should be noted that the current frame CAN message does not meet the parsing conditions, which means that the current frame CAN message does not contain the required signal. At this time, the current frame CAN message is skipped and discarded without parsing, thereby reducing the CPU resources occupied by the parsing process, reducing CPU resource consumption, and avoiding the high load caused by parsing the full CAN message.
[0112] This embodiment provides a vehicle signal acquisition method, when the current frame CAN message does not meet the parsing conditions, the current frame CAN message is discarded. The white list is used to quickly and accurately find the CAN message where the signal to be collected is located, and it is fully parsed and the corresponding signal is collected. Other messages are discarded and not parsed. It is not necessary to parse the full amount of vehicle CAN messages, only the necessary CAN messages need to be parsed, which can reduce the CPU resources occupied by the parsing process. At the same time, it is not necessary to cache the full amount of vehicle signals, only the vehicle signals of some CAN messages need to be cached, and the memory resources occupied by the cached signals after the parsing is completed are reduced, reducing resource consumption, avoiding the vehicle end being in a high load state due to parsing a large number of messages, reducing the load on the vehicle end, improving processing efficiency, and ensuring the normal realization of vehicle end functions.
[0113] For example, in order to help understand the implementation process of the vehicle signal acquisition method obtained by combining this embodiment with the above-mentioned embodiment 3, please refer to Figure 8 , Figure 8 A brief flow chart of a vehicle signal acquisition method is provided, specifically:
[0114] The controller receives a vehicle signal collection task, identifies the CAN ID corresponding to the vehicle signal that needs to be collected based on the collection task, and forms a parsing whitelist for the CAN IDs corresponding to all vehicle signals that need to be collected; the controller receives the full CAN message of the vehicle, does not parse the entire frame message first, and only parses the ID field; if the ID of the frame message belongs to the parsing whitelist, the controller will parse the remaining DATA fields of the frame message based on the DBC file to obtain the vehicle signal; if the ID of the frame message is not in the parsing whitelist, the frame message is skipped and no parsing is performed; the vehicle signal that needs to be collected is selected from a small range of vehicle signals.
[0115] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the vehicle signal acquisition method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0116] This application also provides a vehicle signal collection device, please refer to Fig. 9 , the vehicle signal acquisition device includes:
[0117] The data analysis module 10 is used to receive the current frame CAN message of the target vehicle.
[0118] The data parsing module 10 is further used to determine whether the current frame CAN message meets the parsing conditions based on the parsing whitelist.
[0119] The data analysis module 10 is further configured to completely analyze the current frame CAN message to obtain a corresponding vehicle signal when the current frame CAN message meets the analysis condition.
[0120] The signal acquisition module 20 is used to determine the target vehicle signal in the vehicle signals and to acquire the target vehicle signal.
[0121] In a feasible implementation manner, the data parsing module 10 is further used to parse out the identification information of the current frame CAN message;
[0122] When the identification information of the current frame CAN message matches the whitelist identification information in the parsing whitelist, determining that the current frame CAN message meets the parsing condition;
[0123] When the identification information of the current frame CAN message does not match the whitelist identification information in the parsing whitelist, it is determined that the current frame CAN message does not meet the parsing condition.
[0124] In a feasible implementation manner, the data analysis module 10 is further used to determine the whitelist identification information based on the identification information of the CAN message to which the demand vehicle signal belongs;
[0125] The parsing whitelist is generated based on the whitelist identification information.
[0126] In a feasible implementation manner, the data analysis module 10 is further used to determine the current startup task based on the running status of the signal acquisition task in the task list;
[0127] Determining the acquisition signal of the currently started task based on the acquisition rule information of the currently started task;
[0128] The required vehicle signal is determined based on the collected signal of the current startup task.
[0129] In a feasible implementation manner, the data analysis module 10 is further used to determine the demand vehicle signal corresponding to each flow based on the flow information of the currently started task;
[0130] Based on the identification information of the CAN message to which the demand vehicle signal corresponding to each flow belongs, the whitelist identification information of each flow is determined.
[0131] In a feasible implementation manner, the data parsing module 10 is further configured to determine a parsing whitelist for each flow based on the whitelist identification information of each flow.
[0132] In a feasible implementation manner, the data analysis module 10 is further used to update the task list when a new signal acquisition task is acquired or the running state of a signal acquisition task in the task list changes;
[0133] Based on the running status of the signal acquisition task in the updated task list, the required vehicle signal is re-determined, the whitelist identification information is re-determined, and the parsing whitelist is updated.
[0134] In a feasible implementation manner, the data parsing module 10 is further configured to discard the current frame CAN message when the current frame CAN message does not meet the parsing condition.
[0135] The vehicle signal acquisition device provided by the present application adopts the vehicle signal acquisition method in the above embodiment, which can solve the technical problem that the analysis of the full amount of CAN messages occupies too many resources, the vehicle-side load is high, and the function realization is affected. Compared with the prior art, the beneficial effects of the vehicle signal acquisition device provided by the present application are the same as the beneficial effects of the vehicle signal acquisition method provided by the above embodiment, and the other technical features in the vehicle signal acquisition device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0136] The present application provides a vehicle signal acquisition device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the vehicle signal acquisition method in the above-mentioned embodiment one.
[0137] Reference below Fig.10 , which shows a schematic diagram of the structure of a vehicle signal acquisition device suitable for implementing the embodiment of the present application. The vehicle signal acquisition device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The vehicle signal acquisition device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0138] like Fig.10As shown, the vehicle signal acquisition device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the vehicle signal acquisition device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the vehicle signal acquisition device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a vehicle signal acquisition device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0139] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0140] The vehicle signal acquisition device provided by the present application adopts the vehicle signal acquisition method in the above embodiment, which can solve the technical problem that the analysis of the full amount of CAN messages occupies too many resources, the vehicle-side load is high, and the function realization is affected. Compared with the prior art, the beneficial effects of the vehicle signal acquisition device provided by the present application are the same as the beneficial effects of the vehicle signal acquisition method provided by the above embodiment, and the other technical features in the vehicle signal acquisition device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0141] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0142] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0143] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the vehicle signal acquisition method in the above-mentioned embodiment.
[0144] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0145] The computer-readable storage medium may be included in the vehicle signal acquisition device; or may exist independently without being assembled into the vehicle signal acquisition device.
[0146] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the vehicle signal acquisition device, the vehicle signal acquisition device: receives the current frame CAN message of the target vehicle; based on the parsing whitelist, determines whether the current frame CAN message meets the parsing conditions; when the current frame CAN message meets the parsing conditions, completely parses the current frame CAN message to obtain the corresponding vehicle signal; determines the target vehicle signal in the vehicle signal, and collects the target vehicle signal.
[0147] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0150] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned vehicle signal acquisition method, and can solve the technical problem that the analysis of the full amount of CAN messages takes up too many resources, the vehicle-side load is high, and the function realization is affected. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the vehicle signal acquisition method provided by the above-mentioned embodiment, and will not be repeated here.
[0151] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned vehicle signal acquisition method when executed by a processor.
[0152] The computer program product provided by the present application can solve the technical problem that the analysis of the full amount of CAN messages occupies too many resources, the vehicle-side load is high, and the function realization is affected. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the vehicle signal acquisition method provided by the above embodiment, and will not be repeated here.
[0153] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A vehicle signal acquisition method, characterized in that: The method comprises: Receive the current frame CAN message of the target vehicle; Based on the parsing whitelist, determine whether the current frame CAN message meets the parsing conditions; When the current frame CAN message meets the parsing condition, the current frame CAN message is completely parsed to obtain a corresponding vehicle signal; A target vehicle signal is determined in the vehicle signals, and the target vehicle signal is collected.
2. The method according to claim 1, characterized in that The step of judging whether the current frame CAN message meets the parsing condition based on the parsing whitelist comprises: Parsing the identification information of the current frame CAN message; When the identification information of the current frame CAN message matches the whitelist identification information in the parsing whitelist, determining that the current frame CAN message meets the parsing condition; When the identification information of the current frame CAN message does not match the whitelist identification information in the parsing whitelist, it is determined that the current frame CAN message does not meet the parsing condition.
3. The method according to claim 1, characterized in that The step of receiving the current frame CAN message of the target vehicle also includes: Based on the identification information of the CAN message to which the required vehicle signal belongs, determine the whitelist identification information; The parsing whitelist is generated based on the whitelist identification information.
4. The method according to claim 3, characterized in that The step of determining the whitelist identification information based on the identification information of the CAN message to which the demand vehicle signal belongs also includes: Based on the running status of the signal acquisition task in the task list, determine the current startup task; Determining the acquisition signal of the currently started task based on the acquisition rule information of the currently started task; The required vehicle signal is determined based on the collected signal of the current startup task.
5. The method according to claim 4, characterized in that The step of determining the whitelist identification information based on the identification information of the CAN message to which the demand vehicle signal belongs comprises: Determine the demand vehicle signal corresponding to each flow based on the flow information of the currently started task; Based on the identification information of the CAN message to which the demand vehicle signal corresponding to each flow belongs, determine the whitelist identification information of each flow; The step of generating the parsing whitelist based on the whitelist identification information includes: Based on the whitelist identification information of each flow, a parsing whitelist for each flow is determined.
6. The method according to claim 4, characterized in that The method further comprises: When a new signal acquisition task is acquired or the running state of a signal acquisition task in the task list changes, updating the task list; Based on the running status of the signal acquisition task in the updated task list, the required vehicle signal is re-determined, the whitelist identification information is re-determined, and the parsing whitelist is updated.
7. The method according to any one of claims 1 to 6, characterized in that After the step of determining whether the current frame CAN message meets the parsing condition based on the parsing whitelist, the following steps are further included: When the current frame CAN message does not meet the parsing condition, the current frame CAN message is discarded.
8. A vehicle signal acquisition device, characterized in that: The device comprises: A data parsing module is used to receive the current frame CAN message of the target vehicle; The data parsing module is further used to determine whether the current frame CAN message meets the parsing conditions based on the parsing whitelist; The data parsing module is further used to completely parse the current frame CAN message to obtain a corresponding vehicle signal when the current frame CAN message meets the parsing condition; The signal acquisition module is used to determine the target vehicle signal in the vehicle signal and to acquire the target vehicle signal.
9. A vehicle signal acquisition device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the vehicle signal acquisition method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the vehicle signal acquisition method according to any one of claims 1 to 7 are implemented.