Real vehicle data acquisition method, device and equipment based on diagnosis CAN (Controller Area Network) and storage medium
By accessing the test equipment in the real vehicle OBD diagnostic CAN network segment, and sending diagnostic instructions to enable the gateway routing function, it solves the problem of high cost and low efficiency of market vehicle data acquisition, and realizes efficient and safe real vehicle data acquisition, reducing the Development costs and simplifies operations.
Patent Information
- Application Number
- CN202411402702.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-07
AI Technical Summary
The existing technology is difficult to collect data in real-time vehicles in the market, resulting in problem analysis hindering. The development cost of using big data platforms is high and the network is unstable, resulting in failed data upload or abnormal coverage, and local broken lead operations are complicated. And there are hidden dangers.
By connecting to the test equipment for real vehicle OBD diagnostic CAN network segment, sending diagnostic instructions to the gateway controller, allowing it to enter the extended session mode and secure access unlocking state, turning on the routing function of the corresponding network segment of the diagnostic parameters to realize real vehicle data acquisition. Reduce development costs and avoid the risk of wire harness breaking.
It realizes the efficiency and security of real-vehicle data acquisition, reduces development costs, avoids data upload failure caused by network instability, simplifies operations and avoids the risk of wire harness breaking.
Smart Images

Figure CN119276653A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle diagnosis technology, and in particular to a method, device, equipment and storage medium for collecting real vehicle data based on a diagnostic CAN. Background Art
[0002] When troubleshooting vehicle failures in the market, we often encounter situations where problem analysis is hindered due to difficulties in collecting data from real vehicles. The reason is that after the vehicle model is mass-produced, in order to ensure information security and prevent data leakage, the OBD debugging port in the development stage is usually cancelled and only the interface for diagnosing CAN and other network segments is reserved, which makes it very difficult to collect data from real vehicles. At present, obtaining real vehicle data usually involves developing a big data cloud platform in the research and development stage. After the data collected by the gateway is transmitted to the platform in real time through TBOX, the data is obtained from the background through vehicle information, or the real vehicle (such as the gateway controller connector) is broken and wired to collect data. The use of a big data platform not only has high development costs, but also relies on the TBOX network to upload data; if the network is unstable / blocked, data upload failure or abnormal coverage often occurs, and real-time data cannot be obtained; breaking the wires and wires from the real vehicle locally will require necessary dismantling of the vehicle and modification of the original vehicle wiring harness, which is not only cumbersome to operate, but also has great hidden dangers and risks after the real vehicle wiring harness is restored.
[0003] The above contents are only used to assist in understanding the technical solution of the present application 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 method, device, equipment and storage medium for real vehicle data collection based on diagnostic CAN, aiming to solve the technical problems of high cost and low efficiency in vehicle data collection in the prior art.
[0005] To achieve the above purpose, the present application proposes a method for collecting real vehicle data based on a diagnostic CAN, and the method for collecting real vehicle data based on a diagnostic CAN includes:
[0006] When the test device is connected to the real vehicle OBD diagnostic CAN network segment, a first diagnostic instruction is sent to the gateway controller to make the gateway controller enter the extended session mode, and monitor the session state to obtain the session monitoring result;
[0007] When the session monitoring result is the target session state, sending a second diagnostic instruction to the gateway controller to enable the gateway controller to perform security access unlocking, and monitoring the unlocking state to obtain a security access unlocking result;
[0008] When the security access unlocking result is unlocking success, sending a third diagnostic instruction to the gateway controller, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and enables the routing function of the network segment corresponding to the diagnostic parameters;
[0009] When the routing function of the network segment corresponding to the diagnostic parameter is turned on, real vehicle data is collected.
[0010] In one embodiment, when the result of the security access unlocking is unlocking success, the step of sending a third diagnostic instruction to the gateway controller so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and enables the routing function of the network segment corresponding to the diagnostic parameters includes:
[0011] When the security access unlocking result is unlocking success, sending a third diagnostic instruction to the gateway controller, and reading a diagnostic request of the third diagnostic instruction;
[0012] receiving response information generated by the gateway controller based on the diagnostic request;
[0013] When the response information is preset response information, a routing function of the network segment corresponding to the diagnostic parameter is enabled.
[0014] In one embodiment, when the result of the security access unlocking is unlocking success, the step of sending a third diagnostic instruction to the gateway controller so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and enables the routing function of the network segment corresponding to the diagnostic parameters includes:
[0015] When the response information is preset response information, matching the diagnostic parameter with the network segment routing table to obtain a matching result;
[0016] When the matching result is the first matching result, a routing function for collecting INFO-CAN network segment data is enabled;
[0017] When the matching result is the second matching result, a routing function for collecting CH-CAN network segment data is enabled;
[0018] When the matching result is the third matching result, starting a routing function for collecting BD-CAN network segment data;
[0019] When the matching result is the fourth matching result, starting the routing function of collecting PT-CAN network segment data;
[0020] When the matching result is the fifth matching result, a routing function for collecting COMF-CAN network segment data is enabled.
[0021] In one embodiment, when the session monitoring result is the target session state, the step of sending a second diagnostic instruction to the gateway controller to enable the gateway controller to unlock security access and monitor the unlock state to obtain the security access unlock result includes:
[0022] When the session monitoring result is a target session state, sending a second diagnostic instruction to the gateway controller, reading a key in the second diagnostic instruction, and performing security access unlocking based on the key;
[0023] When the key is a preset key, a result of successful security access unlocking is obtained; otherwise, a result of failed security access unlocking is obtained.
[0024] In one embodiment, when the session monitoring result is a target session state, the steps of sending a second diagnostic instruction to the gateway controller, reading a key in the second diagnostic instruction, and performing security access unlocking based on the key include:
[0025] When the session monitoring result is a target session state, sending a second diagnostic instruction to the gateway controller, and reading first request information of the second diagnostic instruction;
[0026] Receiving first response information generated by the gateway controller based on the first request information, wherein the first response information includes a seed;
[0027] determining a key according to the seed, generating a second request according to the key, and transmitting the second request to the gateway controller;
[0028] Receive second response information generated by the gateway controller based on the second request, and perform security access unlocking based on the key.
[0029] In one embodiment, when the routing function of the network segment corresponding to the diagnostic parameter is turned on, after the step of collecting real vehicle data, the step further includes:
[0030] detecting the diagnostic instruction, and when the diagnostic instruction is a fourth diagnostic instruction, determining a diagnostic parameter according to the fourth diagnostic instruction;
[0031] Disable the routing function of the network segment corresponding to the diagnostic parameter.
[0032] In one embodiment, when the routing function of the network segment corresponding to the diagnostic parameter is turned on, after the step of collecting real vehicle data, the step further includes:
[0033] Determine the session time of the last session in the session log;
[0034] Obtaining the session waiting time according to the current time and the session time;
[0035] When the session waiting time is greater than the session timeout time, the routing function corresponding to the session is closed.
[0036] In addition, to achieve the above purpose, the present application also proposes a real vehicle data collection device based on a diagnostic CAN, the real vehicle data collection device based on a diagnostic CAN comprises:
[0037] The extended session module is used to send a first diagnostic instruction to the gateway controller when the test device is connected to the real vehicle OBD diagnostic CAN network segment, so that the gateway controller enters the extended session mode, monitors the session state, and obtains the session monitoring result;
[0038] A security access module, configured to send a second diagnostic instruction to the gateway controller to enable the gateway controller to unlock security access when the session monitoring result is a target session state, and to monitor the unlocking state to obtain a security access unlocking result;
[0039] A function activation module, configured to send a third diagnostic instruction to the gateway controller when the security access unlocking result is unlocking success, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and activates the routing function of the network segment corresponding to the diagnostic parameters;
[0040] The data collection module is used to collect real vehicle data when the routing function of the network segment corresponding to the diagnostic parameter is turned on.
[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for collecting real vehicle data based on diagnostic CAN, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for collecting real vehicle data based on diagnostic CAN as described above.
[0042] In addition, to achieve the above-mentioned purpose, the present application 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 the processor, the steps of the method for collecting real vehicle data based on diagnostic CAN as described above are implemented.
[0043] 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 method for collecting real vehicle data based on diagnostic CAN as described above are implemented.
[0044] One or more technical solutions proposed in the present application have at least the following technical effects: when the test equipment is connected to the OBD diagnostic CAN network segment of the actual vehicle, a first diagnostic instruction is sent to the gateway controller, so that the gateway controller enters the extended session mode, and monitors the session status to obtain the session monitoring result; when the session monitoring result is the target session state, a second diagnostic instruction is sent to the gateway controller, so that the gateway controller performs security access unlocking, and monitors the unlocking status to obtain the security access unlocking result; when the security access unlocking result is successful unlocking, a third diagnostic instruction is sent to the gateway controller, so that the gateway controller obtains the diagnostic parameters according to the third diagnostic instruction, and turns on the routing function of the network segment corresponding to the diagnostic parameters; when the routing function of the network segment corresponding to the diagnostic parameters is turned on, the actual vehicle data is collected, and only simple operations are performed to realize the actual vehicle data collection, thereby improving the efficiency of problem analysis and avoiding the risks brought by breaking and leading the local wiring harness of the actual vehicle. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] 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.
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or 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.
[0047] Figure 1 A flow chart of the first embodiment of the method for collecting real vehicle data based on the diagnostic CAN of the present application;
[0048] Figure 2 A schematic diagram of the control gateway diagnostic routing function flow provided in an embodiment of the present application for a method of collecting real vehicle data based on a diagnostic CAN;
[0049] Figure 3 This is a schematic diagram of the module structure of a real vehicle data acquisition device based on a diagnostic CAN according to an embodiment of the present application;
[0050] Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the method for collecting real vehicle data based on the diagnostic CAN in the embodiment of the present application.
[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0052] 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.
[0053] 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.
[0054] The main solution of the embodiment of the present application is: when the test equipment is connected to the real vehicle OBD diagnostic CAN network segment, a first diagnostic instruction is sent to the gateway controller to make the gateway controller enter the extended session mode, and monitor the session status to obtain the session monitoring result; when the session monitoring result is the target session state, a second diagnostic instruction is sent to the gateway controller to make the gateway controller securely unlock the access, and monitor the unlocking status to obtain the secure access unlocking result; when the secure access unlocking result is unlocking success, a third diagnostic instruction is sent to the gateway controller to make the gateway controller obtain the diagnostic parameters according to the third diagnostic instruction, and turn on the routing function of the network segment corresponding to the diagnostic parameters; when the routing function of the network segment corresponding to the diagnostic parameters is turned on, real vehicle data is collected.
[0055] In this embodiment, for the convenience of description, the following description is made by taking the identification of a real vehicle data collection device based on a diagnostic CAN as the execution subject.
[0056] Because the existing technology usually develops a big data cloud platform in the R&D stage to obtain real vehicle data, after the data collected by the gateway is transmitted to the platform in real time through TBOX, the data is obtained from the background through vehicle information, or the real vehicle (such as the gateway controller connector) is broken and wired to collect data. The use of a big data platform not only has high development costs, but also relies on the TBOX network to upload data; if the network is unstable / blocked, data upload failures or abnormal coverage often occur, and real-time data cannot be obtained; breaking and wiring from the real vehicle locally will require necessary vehicle dismantling and modification of the original vehicle wiring harness, which is not only cumbersome to operate, but also has great hidden dangers and risks after the real vehicle wiring harness is restored.
[0057] This application provides a solution that replaces the development of a data cloud platform by changing the gateway software to implement the diagnostic CAN routing function, which greatly reduces the development cost. By simply operating the diagnostic CAN to collect real vehicle data, the efficiency of problem analysis is greatly improved, and the risk of breaking and leading the local wiring harness of the real vehicle is avoided.
[0058] It can be seen from the above embodiments that the present application sends a first diagnostic instruction to the gateway controller when the test device is connected to the real vehicle OBD diagnostic CAN network segment, so that the gateway controller enters the extended session mode, monitors the session status, and obtains the session monitoring result; when the session monitoring result is the target session state, sends a second diagnostic instruction to the gateway controller, so that the gateway controller securely unlocks the access, and monitors the unlocking status to obtain the secure access unlocking result; when the secure access unlocking result is a successful unlocking, sends a third diagnostic instruction to the gateway controller, so that the gateway controller obtains the diagnostic parameters according to the third diagnostic instruction, and turns on the routing function of the network segment corresponding to the diagnostic parameters; when the routing function of the network segment corresponding to the diagnostic parameters is turned on, collects real vehicle data, and only performs simple operations to realize real vehicle data collection, thereby improving the efficiency of problem analysis and avoiding the risks of breaking and leading the local wiring harness of the real vehicle.
[0059] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a real vehicle data collection device based on a diagnostic CAN, etc. The following takes a real vehicle data collection device based on a diagnostic CAN as an example to illustrate this embodiment and the following embodiments.
[0060] Based on this, the embodiment of the present application provides a method for collecting real vehicle data based on diagnostic CAN, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for collecting real vehicle data based on the diagnostic CAN of the present application.
[0061] In this embodiment, the method for collecting real vehicle data based on the diagnostic CAN includes steps S10 to S40:
[0062] Step S10, when the test device is connected to the real vehicle OBD diagnostic CAN segment, a first diagnostic instruction is sent to the gateway controller to make the gateway controller enter the extended session mode, monitor the session status, and obtain the session monitoring result.
[0063] It should be noted that the gateway controller has routing characteristics. Therefore, based on this, on the basis of the software diagnostic CAN which only supports diagnostic message routing, it can add the routing function of non-diagnostic messages, and at the same time support the control of turning on and off the routing function through specific diagnostic instructions.
[0064] It can be understood that the first diagnosis instruction refers to an instruction for entering the extended session mode, and the session state is used to reflect whether the current session behavior is in a maintenance state.
[0065] In the specific implementation, in order to avoid excessive diagnostic CAN load rate caused by network segment data not required by gateway routing, routine parameters can be used to control a certain route / multiple routes of network segment data to improve communication stability. When the test equipment is connected to the real vehicle OBD diagnostic CAN segment, the routing function can be turned on or off by setting the routine control type. 0x01: StartRoutine (turn on routine), 0x02: StopRoutine (turn off routine) can be defined. Routine control data identifier (DID), by defining the routine DID (such as 0xC505) to describe the routine control as a routing function, refer to Figure 2 , Figure 2 This is a flow chart of the gateway diagnostic routing function. By defining a 1-byte parameter 0xXX, the routing behavior of each CAN segment is controlled. The first diagnostic instruction is sent to the gateway controller, and a 0x3E 80 cut-off message is sent at a 2s cycle to maintain the current session. The diagnostic expression is Request: 0x10 03, Response: 0x50 03.
[0066] Step S20, when the session monitoring result is the target session state, sending a second diagnostic instruction to the gateway controller to enable the gateway controller to perform security access unlocking, and monitoring the unlocking state to obtain a security access unlocking result.
[0067] It should be noted that the security access unlocking results include two states: security access unlocking success and security access unlocking failure. The security access unlocking behavior will only be executed when the session monitoring result is the target session state, where the target session state is the session maintenance state, and the second diagnostic instruction refers to the diagnostic instruction used for security access unlocking.
[0068] In a specific implementation, when the session monitoring result is a session maintenance state, a second diagnostic instruction can be sent to the gateway controller, and the second diagnostic instruction can be parsed, and the key in the diagnostic instruction can be read. At this time, the key can be verified. When the key verification is successful, security access unlocking can be performed and a result of successful security access unlocking can be obtained. Otherwise, a result of failed security access unlocking can be obtained.
[0069] In a feasible implementation manner, when the session monitoring result is the target session state, the steps of sending a second diagnostic instruction to the gateway controller, reading a key in the second diagnostic instruction, and performing security access unlocking based on the key include:
[0070] When the session monitoring result is a target session state, sending a second diagnostic instruction to the gateway controller, and reading first request information of the second diagnostic instruction;
[0071] Receiving first response information generated by the gateway controller based on the first request information, wherein the first response information includes a seed;
[0072] determining a key according to the seed, generating a second request according to the key, and transmitting the second request to the gateway controller;
[0073] Receive second response information generated by the gateway controller based on the second request, and perform security access unlocking based on the key.
[0074] In a specific implementation, when the session monitoring result is the target session state, a second diagnostic instruction is sent to the gateway controller, and the first request information of the second diagnostic instruction is read, which is Requset (request): 0x27 01. At this time, the gateway controller can generate a first response information according to the received first request information, which is Response (response): 0x67 01mmmm mm mm. Where mm is the 4-byte seed replied by the ECU, and then the key is determined according to the seed, and the second request is generated according to the key, which is Requset (request): 0x27 02zz zz zz zz, and the second request is transmitted to the gateway controller, where zz is the 4-byte key of the test equipment calculation request.
[0075] Step S30, when the security access unlocking result is unlocking success, sending a third diagnostic instruction to the gateway controller, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and enables the routing function of the network segment corresponding to the diagnostic parameters.
[0076] It should be noted that the third diagnostic instruction refers to a diagnostic instruction for enabling a routing function.
[0077] In a specific implementation, when the security access unlocking result is successful unlocking, a third diagnostic instruction is sent to the gateway controller, the diagnostic request of the third diagnostic instruction is read, and the response information generated by the gateway controller based on the diagnostic request is received. When the response information is a preset response information, the routing function of the network segment corresponding to the diagnostic parameter is enabled.
[0078] In a feasible implementation manner, when the response information is preset response information, the step of enabling the routing function of the network segment corresponding to the diagnostic parameter includes:
[0079] When the response information is preset response information, matching the diagnostic parameter with the network segment routing table to obtain a matching result;
[0080] When the matching result is the first matching result, a routing function for collecting INFO-CAN network segment data is enabled;
[0081] When the matching result is the second matching result, a routing function for collecting CH-CAN network segment data is enabled;
[0082] When the matching result is the third matching result, starting a routing function for collecting BD-CAN network segment data;
[0083] When the matching result is the fourth matching result, starting the routing function of collecting PT-CAN network segment data;
[0084] When the matching result is the fifth matching result, a routing function for collecting COMF-CAN network segment data is enabled.
[0085] In a specific implementation, a 1-byte parameter 0xXX is defined in the third diagnostic information to control the routing behavior of each CAN network segment. The corresponding relationship between the parameter and the network segment is shown in Table 1.
[0086] Table 1:
[0087]
[0088] By setting the corresponding bit position of each network segment to 1, the gateway is enabled to route the network segment message to the diagnostic CAN; if there is no demand, it is set to 0 by default. Among them, bit5 to bit7 are reserved for the CAN network segment that may be expanded by subsequent models (Res). After the diagnostic parameters are matched with the network segment routing table and the matching result is obtained, the matching result can be tested. Taking a single network segment data collection scenario as an example, the network segment routing table is shown in Table 2.
[0089] Table 2:
[0090]
[0091] When the matching result is the first matching result, the description byte is 0x01, and the corresponding binary is 00000001, and the routing function of collecting INFO-CAN network segment data is turned on; when the matching result is the second matching result, the description byte is 0x02, and the corresponding binary is 0000 0010, and the routing function of collecting CH-CAN network segment data is turned on; when the matching result is the third matching result, the description byte is 0x04, and the corresponding binary is 0000 0100, and the routing function of collecting BD-CAN network segment data is turned on; when the matching result is the fourth matching result, the description byte is 0x08, and the corresponding binary is 0000 1000, and the routing function of collecting PT-CAN network segment data is turned on; when the matching result is the fifth matching result, the description byte is 0x10, and the corresponding binary is 0001 0000, and the routing function of collecting COMF-CAN network segment data is turned on. Taking the scenario of collecting data from multiple network segments as an example, when the byte is detected to be 0x03, the corresponding binary is 0000 0011, and the routing function for collecting INFO-CAN network segment data and the routing function for collecting CH-CAN network segment data are enabled.
[0092] Step S40, when the routing function of the network segment corresponding to the diagnostic parameter is turned on, real vehicle data is collected.
[0093] It should be noted that when the routing function of the network segment corresponding to the diagnostic parameter is turned on, the operation of collecting real vehicle data can be performed. During the process of collecting real vehicle data, due to the existence of data transmission behavior, the session is always maintained. When collecting data, it is possible to send a Requset (request): 0x3101C5 05XX, and receive a Response (response): 0x71 01C5 05XX generated based on the request, and feedback the result of the routing function being turned on. If the routing function fails to be turned on, the gateway controller will not perform the corresponding routing function, and the diagnostic CAN network segment cannot collect the data of the required network segment.
[0094] In a feasible implementation manner, when the routing function of the network segment corresponding to the diagnostic parameter is turned on, after the step of collecting real vehicle data, the step further includes:
[0095] detecting the diagnostic instruction, and when the diagnostic instruction is a fourth diagnostic instruction, determining a diagnostic parameter according to the fourth diagnostic instruction;
[0096] Disable the routing function of the network segment corresponding to the diagnostic parameter.
[0097] In a specific implementation, when a new diagnostic instruction is monitored, the current diagnostic instruction is detected. When the current diagnostic instruction is the fourth diagnostic instruction, wherein the fourth diagnostic instruction is an instruction to shut down the routing function, the diagnostic parameters of the fourth diagnostic instruction can be determined. Specifically, after detecting Requset (request): 0x31 02C5 05 from the fourth diagnostic instruction, the diagnostic parameters can be sent to the gateway controller. At this time, the gateway controller can respond, Response (response): 0x7102C5 05, and shut down the routing function to achieve active shutdown.
[0098] In a feasible implementation manner, when the routing function of the network segment corresponding to the diagnostic parameter is turned on, after the step of collecting real vehicle data, the step further includes:
[0099] Determine the session time of the last session in the session log;
[0100] Obtaining the session waiting time according to the current time and the session time;
[0101] When the session waiting time is greater than the session timeout time, the routing function corresponding to the session is closed.
[0102] In a specific implementation, a timer will exist during the data transmission process to record the duration of the current session behavior after the last session. If a new session behavior is received after the current last session, the current timer will be updated. The time of the timer is determined based on the last session time in the session record and the current time, that is, the session waiting time. When the session waiting time is greater than the session timeout time, the routing function corresponding to the current session is closed to prevent the risk of data leakage due to the routing function not being actively closed.
[0103] The present embodiment provides a method for collecting real vehicle data based on diagnostic CAN. When the test equipment is connected to the real vehicle OBD diagnostic CAN network segment, a first diagnostic instruction is sent to the gateway controller, so that the gateway controller enters the extended session mode, and monitors the session status to obtain the session monitoring result; when the session monitoring result is the target session state, a second diagnostic instruction is sent to the gateway controller, so that the gateway controller performs security access unlocking, and monitors the unlocking status to obtain the security access unlocking result; when the security access unlocking result is successful unlocking, a third diagnostic instruction is sent to the gateway controller, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction, and turns on the routing function of the network segment corresponding to the diagnostic parameter; when the routing function of the network segment corresponding to the diagnostic parameter is turned on, the real vehicle data is collected, and the real vehicle data collection is realized by only performing simple operations, thereby improving the efficiency of problem analysis and avoiding the risks brought by breaking and leading the local wiring harness of the real vehicle.
[0104] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the present application's method for collecting real vehicle data based on diagnostic CAN. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0105] This application also provides a real vehicle data collection device based on diagnostic CAN, please refer to Figure 3 The real vehicle data acquisition device based on the diagnostic CAN includes:
[0106] The extended session module 10 is used to send a first diagnostic instruction to the gateway controller when the test device is connected to the real vehicle OBD diagnostic CAN network segment, so that the gateway controller enters the extended session mode, monitors the session status, and obtains the session monitoring result.
[0107] The security access module 20 is used to send a second diagnostic instruction to the gateway controller to unlock the security access of the gateway controller when the session monitoring result is a target session state, and monitor the unlocking state to obtain a security access unlocking result.
[0108] The function activation module 30 is used to send a third diagnostic instruction to the gateway controller when the security access unlocking result is unlocking success, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and activates the routing function of the network segment corresponding to the diagnostic parameters.
[0109] The data collection module 40 is used to collect real vehicle data when the routing function of the network segment corresponding to the diagnostic parameter is turned on.
[0110] In one embodiment, the function activation module 30 is also used to send a third diagnostic instruction to the gateway controller when the security access unlocking result is a successful unlocking, read the diagnostic request of the third diagnostic instruction; receive response information generated by the gateway controller based on the diagnostic request; and when the response information is a preset response information, enable the routing function of the network segment corresponding to the diagnostic parameter.
[0111] In one embodiment, the function activation module 30 is also used to match the diagnostic parameters with the network segment routing table to obtain a matching result when the response information is a preset response information; when the matching result is a first matching result, the routing function of collecting INFO-CAN network segment data is enabled; when the matching result is a second matching result, the routing function of collecting CH-CAN network segment data is enabled; when the matching result is a third matching result, the routing function of collecting BD-CAN network segment data is enabled; when the matching result is a fourth matching result, the routing function of collecting PT-CAN network segment data is enabled; when the matching result is a fifth matching result, the routing function of collecting COMF-CAN network segment data is enabled.
[0112] In one embodiment, the security access module 20 is also used to send a second diagnostic instruction to the gateway controller when the session monitoring result is a target session state, read the key in the second diagnostic instruction, and unlock the security access based on the key; when the key is a preset key, a result of successful security access unlocking is obtained, otherwise, a result of failed security access unlocking is obtained.
[0113] In one embodiment, the security access module 20 is also used to send a second diagnostic instruction to the gateway controller when the session monitoring result is a target session state, and read the first request information of the second diagnostic instruction; receive a first response information generated by the gateway controller based on the first request information, wherein the first response information includes a seed; determine a key based on the seed, and generate a second request based on the key, and transmit the second request to the gateway controller; receive a second response information generated by the gateway controller based on the second request, and perform security access unlocking based on the key.
[0114] In one embodiment, the data acquisition module 40 is further used to detect the diagnostic instruction, and when the diagnostic instruction is the fourth diagnostic instruction, determine the diagnostic parameters according to the fourth diagnostic instruction; and disable the routing function of the network segment corresponding to the diagnostic parameter.
[0115] In one embodiment, the data collection module 40 is also used to determine the session time of the last session in the session record; obtain the session waiting time according to the current time and the session time; when the session waiting time is greater than the session timeout time, close the routing function corresponding to the session.
[0116] The real vehicle data collection device based on diagnostic CAN provided by the present application adopts the real vehicle data collection method based on diagnostic CAN in the above embodiment, which can solve the technical problems of high cost and low efficiency of vehicle data collection in the prior art. Compared with the prior art, the beneficial effects of the real vehicle data collection device based on diagnostic CAN provided by the present application are the same as the beneficial effects of the real vehicle data collection method based on diagnostic CAN provided by the above embodiment, and the other technical features of the real vehicle data collection device based on diagnostic CAN are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0117] The present application provides a device for collecting real vehicle data based on a diagnostic CAN, and the device for collecting real vehicle data based on a diagnostic CAN includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed 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 method for collecting real vehicle data based on the diagnostic CAN in the above-mentioned embodiment one.
[0118] Reference below Figure 4 , which shows a schematic diagram of the structure of a real vehicle data acquisition device based on diagnostic CAN suitable for implementing the embodiment of the present application. The real vehicle data acquisition device based on diagnostic CAN in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, 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. Figure 4 The real vehicle data acquisition device based on diagnostic CAN is shown as an example only and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0119] like Figure 4As shown, the real vehicle data acquisition device based on the diagnostic CAN 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 the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the real vehicle data acquisition device based on the diagnostic CAN are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the real vehicle data acquisition device based on the diagnostic CAN to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a real vehicle data acquisition device based on the diagnostic CAN with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0120] 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.
[0121] The real vehicle data collection device based on diagnostic CAN provided by the present application adopts the real vehicle data collection method based on diagnostic CAN in the above embodiment, which can solve the technical problems of high cost and low efficiency of vehicle data collection in the prior art. Compared with the prior art, the beneficial effects of the real vehicle data collection device based on diagnostic CAN provided by the present application are the same as the beneficial effects of the real vehicle data collection method based on diagnostic CAN provided by the above embodiment, and the other technical features of the real vehicle data collection device based on diagnostic CAN are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0122] 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.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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.
[0124] 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 method for collecting real vehicle data based on the diagnostic CAN in the above-mentioned embodiment.
[0125] 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.
[0126] The computer-readable storage medium may be included in the device for collecting real vehicle data based on the diagnostic CAN; or may exist independently without being assembled into the device for collecting real vehicle data based on the diagnostic CAN.
[0127] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the real vehicle data collection device based on the diagnostic CAN, the real vehicle data collection device based on the diagnostic CAN:
[0128] When the test device is connected to the real vehicle OBD diagnostic CAN network segment, a first diagnostic instruction is sent to the gateway controller to make the gateway controller enter the extended session mode, and monitor the session state to obtain the session monitoring result;
[0129] When the session monitoring result is the target session state, sending a second diagnostic instruction to the gateway controller to enable the gateway controller to perform security access unlocking, and monitoring the unlocking state to obtain a security access unlocking result;
[0130] When the security access unlocking result is unlocking success, sending a third diagnostic instruction to the gateway controller, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and enables the routing function of the network segment corresponding to the diagnostic parameters;
[0131] When the routing function of the network segment corresponding to the diagnostic parameter is turned on, real vehicle data is collected.
[0132] 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).
[0133] 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 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 box can also occur in a sequence different from that marked in the accompanying drawings. For example, two 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 box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] The modules involved in the embodiments of the present application may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.
[0135] 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 method for collecting real vehicle data based on diagnostic CAN, and can solve the technical problems of high cost and low efficiency in vehicle data collection in the prior art. 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 method for collecting real vehicle data based on diagnostic CAN provided by the above-mentioned embodiment, and will not be repeated here.
[0136] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for collecting real vehicle data based on diagnostic CAN.
[0137] The computer program product provided by the present application can solve the technical problems of high cost and low efficiency in vehicle data collection in the prior art. 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 method for real vehicle data collection based on diagnostic CAN provided in the above embodiment, and will not be elaborated here.
[0138] The above descriptions 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 applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for real vehicle data collection based on diagnostic CAN, characterized in that: The method for collecting real vehicle data based on the diagnostic CAN includes: When the test device is connected to the real vehicle OBD diagnostic CAN network segment, a first diagnostic instruction is sent to the gateway controller to make the gateway controller enter the extended session mode, and monitor the session state to obtain the session monitoring result; When the session monitoring result is the target session state, sending a second diagnostic instruction to the gateway controller to enable the gateway controller to perform security access unlocking, and monitoring the unlocking state to obtain a security access unlocking result; When the security access unlocking result is unlocking success, sending a third diagnostic instruction to the gateway controller, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and enables the routing function of the network segment corresponding to the diagnostic parameters; When the routing function of the network segment corresponding to the diagnostic parameter is turned on, real vehicle data is collected.
2. The method according to claim 1, characterized in that When the result of the security access unlocking is unlocking success, the step of sending a third diagnostic instruction to the gateway controller so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and enables the routing function of the network segment corresponding to the diagnostic parameters includes: When the security access unlocking result is unlocking success, sending a third diagnostic instruction to the gateway controller, and reading a diagnostic request of the third diagnostic instruction; receiving response information generated by the gateway controller based on the diagnostic request; When the response information is preset response information, a routing function of the network segment corresponding to the diagnostic parameter is enabled.
3. The method according to claim 2, characterized in that When the response information is preset response information, the step of enabling the routing function of the network segment corresponding to the diagnostic parameter includes: When the response information is preset response information, matching the diagnostic parameter with the network segment routing table to obtain a matching result; When the matching result is the first matching result, a routing function for collecting INFO-CAN network segment data is enabled; When the matching result is the second matching result, a routing function for collecting CH-CAN network segment data is enabled; When the matching result is the third matching result, starting a routing function for collecting BD-CAN network segment data; When the matching result is the fourth matching result, starting the routing function of collecting PT-CAN network segment data; When the matching result is the fifth matching result, a routing function for collecting COMF-CAN network segment data is enabled.
4. The method according to claim 1, characterized in that When the session monitoring result is the target session state, the step of sending a second diagnostic instruction to the gateway controller to enable the gateway controller to unlock the security access, and monitoring the unlocking state to obtain the security access unlocking result includes: When the session monitoring result is a target session state, sending a second diagnostic instruction to the gateway controller, reading a key in the second diagnostic instruction, and performing security access unlocking based on the key; When the key is a preset key, a result of successful security access unlocking is obtained; otherwise, a result of failed security access unlocking is obtained.
5. The method according to claim 4, characterized in that When the session monitoring result is the target session state, the step of sending a second diagnostic instruction to the gateway controller, reading a key in the second diagnostic instruction, and performing security access unlocking based on the key comprises: When the session monitoring result is a target session state, sending a second diagnostic instruction to the gateway controller, and reading first request information of the second diagnostic instruction; Receiving first response information generated by the gateway controller based on the first request information, wherein the first response information includes a seed; determining a key according to the seed, generating a second request according to the key, and transmitting the second request to the gateway controller; Receive second response information generated by the gateway controller based on the second request, and perform security access unlocking based on the key.
6. The method according to claim 1, characterized in that After the step of collecting real vehicle data when the routing function of the network segment corresponding to the diagnostic parameter is turned on, the method further includes: detecting the diagnostic instruction, and when the diagnostic instruction is a fourth diagnostic instruction, determining a diagnostic parameter according to the fourth diagnostic instruction; Disable the routing function of the network segment corresponding to the diagnostic parameter.
7. The method according to claim 1, characterized in that After the step of collecting real vehicle data when the routing function of the network segment corresponding to the diagnostic parameter is turned on, the method further includes: Determine the session time of the last session in the session log; Obtaining the session waiting time according to the current time and the session time; When the session waiting time is greater than the session timeout time, the routing function corresponding to the session is closed.
8. A real vehicle data collection device based on diagnostic CAN, characterized in that: The device comprises: The extended session module is used to send a first diagnostic instruction to the gateway controller when the test device is connected to the real vehicle OBD diagnostic CAN network segment, so that the gateway controller enters the extended session mode, monitors the session state, and obtains the session monitoring result; A security access module, configured to send a second diagnostic instruction to the gateway controller to enable the gateway controller to unlock security access when the session monitoring result is a target session state, and to monitor the unlocking state to obtain a security access unlocking result; A function activation module, configured to send a third diagnostic instruction to the gateway controller when the security access unlocking result is unlocking success, so that the gateway controller obtains diagnostic parameters according to the third diagnostic instruction and activates the routing function of the network segment corresponding to the diagnostic parameters; The data collection module is used to collect real vehicle data when the routing function of the network segment corresponding to the diagnostic parameter is turned on.
9. A real vehicle data collection device based on diagnostic CAN, characterized in that: The device includes: 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 method for real vehicle data collection based on diagnostic CAN as described in 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 method for collecting real vehicle data based on a diagnostic CAN as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Domain control unit dynamic routing control method and system
CN122420207A
A domain control unit dynamic routing control method and system
CN122420207B