Data acquisition methods, devices, equipment and storage media
By setting up a data acquisition device between the vehicle communication interface device and the vehicle electronic control unit, and using a network card and a network bridge to acquire and save data packets, the problem of difficulty in analyzing communication faults between the vehicle communication interface device and the vehicle electronic control unit in the prior art is solved, and the efficiency of fault analysis is improved.
Patent Information
- Application Number
- CN202211530706.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-12-01
AI Technical Summary
Existing technologies make it difficult to directly obtain communication data packets between vehicle communication interface devices and vehicle electronic control units, leading to difficulties in fault analysis during vehicle diagnostic software development.
A data acquisition device is set up between the vehicle communication interface device and the vehicle electronic control unit. Data packets are directly acquired and saved through network cards and network bridges, and packet capture tools are used to capture and analyze the data packets.
It enables direct recording and analysis of communication between vehicle communication interface devices and vehicle electronic control units, improving the efficiency of analyzing faults in vehicle diagnostic software development.
Smart Images

Figure CN116095102B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle communication, and in particular to a data acquisition method, apparatus, data acquisition device, and computer-readable storage medium. Background Technology
[0002] Vehicle diagnostic software is used to diagnose vehicle faults. Vehicle repair personnel can connect diagnostic equipment equipped with the software to the vehicle's electronic control unit (ECU) via a vehicle communication interface (VCI). The diagnostic software then interacts with the ECU through network communication to diagnose vehicle faults. During the development of vehicle diagnostic software, network communication between the diagnostic equipment, the VCI, and the ECU is prone to problems. Therefore, it is necessary to analyze development faults by capturing data packets transmitted between the diagnostic equipment and the ECU. However, existing data capture methods can only be executed on the diagnostic equipment, making it difficult to analyze communication problems between the VCI and the ECU, thus hindering the analysis of development faults. Summary of the Invention
[0003] The purpose of this application is to provide a data acquisition method, apparatus, device, and computer-readable storage medium, which can acquire and save data packets transmitted between the vehicle communication interface device and the vehicle electronic control unit by means of a data acquisition device installed between the vehicle communication interface device and the vehicle electronic control unit, so as to facilitate the analysis of development faults in vehicle diagnostic software.
[0004] To address the aforementioned technical problems, this application provides a data acquisition method applied to a data acquisition device. A vehicle communication interface device communicates with a vehicle electronic control unit through the data acquisition device. The method includes:
[0005] Acquire the data packets transmitted between the vehicle communication interface device and the vehicle electronic control unit;
[0006] When the data packet is obtained, the data packet is saved.
[0007] Optionally, the data acquisition device includes a first network card connected to the vehicle electronic control unit and a second network card connected to the vehicle communication interface device. Before acquiring the data packets transmitted between the vehicle communication interface device and the vehicle electronic control unit, it further includes:
[0008] A bridge is created between the first network card and the second network card to enable the vehicle communication interface device to communicate with the vehicle electronic control unit through the bridge.
[0009] Optionally, saving the data packet includes:
[0010] The data packets are obtained from the first network card or the second network card using a preset packet capture tool and saved.
[0011] Optionally, the data acquisition device includes an activation pin and an I / O interface connected to the activation pin, the activation pin being used to activate the communication connection between the vehicle communication interface device and the vehicle electronic control unit, and the method further includes:
[0012] The communication connection status between the vehicle communication interface device and the vehicle electronic control unit is detected using the first network card, the second network card, and the IO interface.
[0013] When it is determined that the communication connection state has changed, the changed communication connection state is saved.
[0014] Optionally, the step of detecting the communication connection status between the vehicle communication interface device and the vehicle electronic control unit using the first network card, the second network card, and the I / O interface includes:
[0015] The system detects the first communication connection status between the first network card and the vehicle electronic control unit, the second communication connection status between the second network card and the vehicle communication interface device, and the level status of the activation pin read by the IO interface.
[0016] When it is determined that any one of the first communication connection state, the second communication connection state, and the level state has changed, it is determined that the communication connection state has changed.
[0017] Optionally, saving the changed communication connection state includes:
[0018] Obtain the system time, and save the status information of the first communication connection status, the second communication connection status, and the changed level status along with the system time to the same status file.
[0019] Optionally, detecting the communication connection status between the vehicle communication interface device and the vehicle electronic control unit includes:
[0020] The communication connection status between the vehicle communication interface device and the vehicle electronic control unit is periodically detected at a preset time interval.
[0021] This application also provides a data acquisition device, applied to a data acquisition equipment, wherein a vehicle communication interface device communicates with a vehicle electronic control unit through the data acquisition equipment, and the device includes:
[0022] A data packet acquisition module is used to acquire data packets transmitted between the vehicle communication interface device and the vehicle electronic control unit;
[0023] A data packet saving module is used to save the data packet when it is acquired.
[0024] This application also provides a data acquisition device, including:
[0025] Memory, used to store computer programs;
[0026] A processor for executing the computer program to implement the data acquisition method described above.
[0027] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the data acquisition method described above.
[0028] This application provides a data acquisition method applied to a data acquisition device, wherein a vehicle communication interface device communicates with a vehicle electronic control unit through the data acquisition device. The method includes: acquiring data packets transmitted between the vehicle communication interface device and the vehicle electronic control unit; and saving the data packets when they are acquired.
[0029] Therefore, this application allows the data acquisition device to be positioned between the vehicle communication interface device and the vehicle electronic control unit (ECU), enabling the vehicle communication interface device to communicate with the ECU through the data acquisition device. The data acquisition device can directly acquire the data packets transmitted between the vehicle communication interface device and the ECU, effectively recording the communication status between them to facilitate the analysis of development faults in vehicle diagnostic software. This application also provides a data acquisition apparatus, a data acquisition device, and a computer-readable storage medium, which possess the aforementioned beneficial effects. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0031] Figure 1 This is a structural block diagram of a conventional detection system provided in an embodiment of this application;
[0032] Figure 2This is a structural block diagram of a detection system provided in an embodiment of this application;
[0033] Figure 3 A flowchart illustrating a data acquisition method provided in an embodiment of this application;
[0034] Figure 4 This is a structural block diagram of a data acquisition device provided in an embodiment of this application;
[0035] Figure 5 This is a structural block diagram of a data acquisition device provided in an embodiment of this application;
[0036] Figure 6 This is a structural block diagram of another data acquisition device provided in an embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] Please refer to Figure 1 , Figure 1This is a structural block diagram of a conventional detection system provided in an embodiment of this application. In related technologies, vehicle diagnostic software is prone to development failures during development. For example, a diagnostic device 100 with deployed vehicle diagnostic software may be unable to establish a network connection with the vehicle electronic control unit 300, or may be unable to complete diagnostic interaction with the vehicle electronic control unit 300 via the network, thus preventing the diagnosis of vehicle components. In this case, it is necessary to capture the data packets transmitted on the communication link between the diagnostic device 100, the vehicle communication interface device 200, and the vehicle electronic control unit 300 to analyze the faults in the vehicle diagnostic software. For example, abnormal data packets transmitted on this link can be analyzed, or data packets that can normally diagnose vehicle components and data packets that cannot normally diagnose vehicle components can be obtained on this link, and these two types of data packets can be compared and analyzed to determine the cause of the fault. In existing solutions, packet capture tools installed in diagnostic equipment 100 are typically used to capture the aforementioned data packets. However, this method can only obtain data packets transmitted between diagnostic equipment 100 and vehicle communication interface device 200, and can only perform fault analysis on the diagnostic equipment 100 side. It cannot obtain the original data packets transmitted between vehicle communication interface device 200 and vehicle electronic control unit 300, making it difficult to analyze communication faults between vehicle communication interface device 200 and vehicle electronic control unit 300, and significantly affecting the reliability of fault analysis results. For example, since data between the diagnostic device 100 and the vehicle electronic control unit 300 needs to be relayed through the vehicle communication interface device 200, and some vehicle communication interface devices 200 may convert or encrypt the original data packets sent by the vehicle electronic control unit 300, the diagnostic device 100 may be unable to obtain the original data packets sent by the vehicle electronic control unit 300. Furthermore, since the diagnostic device 100 is not directly connected to the vehicle electronic control unit 300, it cannot determine when the vehicle electronic control unit 300 disconnects from the network. Data packets transmitted by the unit during network connection, disconnection, and reconnection that cannot be received by the diagnostic device 100 (such as IP allocation-related data packets) may also play a crucial role in analyzing communication faults. Therefore, existing solutions struggle to analyze communication faults between the vehicle communication interface device 200 and the vehicle electronic control unit 300. In view of this, this application provides a data acquisition method applicable to situations such as... Figure 2 In the detection system shown, a data acquisition device 400 can be installed between the vehicle communication interface device 200 and the vehicle electronic control unit 300. This data acquisition device 400 directly acquires and saves the data packets transmitted between the two devices, improving the ease of analyzing communication problems and facilitating the analysis of development faults in vehicle diagnostic software.
[0039] The following will describe the system architecture to which the embodiments of this application apply (i.e., Figure 2 The system structure shown is described below. The vehicle communication interface device 200 is directly connected to both the diagnostic device 100 and the data acquisition device 400, and the data acquisition device 400 is directly connected to the vehicle electronic control unit 300. Therefore, diagnostic data sent from the diagnostic device 100 to the vehicle electronic control unit 300 is first received and protocol-converted by the vehicle communication interface device 200, and then sent to the data acquisition device 400. The data acquisition device 400 saves the received data and sends it to the vehicle electronic control unit 300, thus completing the communication between the diagnostic device 100 and the vehicle electronic control unit 300. Conversely, data sent from the vehicle electronic control unit 300 to the diagnostic device 100 is first received and saved by the data acquisition device 400; subsequently, the data acquisition device 400 can send the received data to the vehicle communication interface device 200 for protocol conversion, and then the vehicle communication interface device 200 sends the converted data to the diagnostic device 100, thus completing the communication between the vehicle electronic control unit 300 and the diagnostic device 100. It should be noted that the embodiments of this application do not change the way the diagnostic device 100, vehicle communication interface device 200, and vehicle electronic control unit 300 interact with each other. Related technologies of vehicle diagnostics, VCI devices, and ECU devices can be referenced. Furthermore, the embodiments of this application do not change the way the vehicle communication interface device 200 performs protocol conversion. For example, for data sent using the DoIP protocol (Diagnostic Communication over Internet Protocol, Vehicle Ethernet Diagnostic Protocol), the device can perform data conversion based on the relevant provisions of the DoIP protocol. Therefore, regarding the data conversion methods of the vehicle communication interface device 200, related technologies of vehicle communication and VCI devices can be referenced. The embodiments of this application do not limit the specific device type of the diagnostic device 100; it can be a personal computer, mobile terminal, etc. The embodiments of this application also do not limit the specific device type of the data acquisition device 400, as long as it can meet the relevant application requirements in subsequent embodiments of this application; it can also be a personal computer, mobile terminal, etc.
[0040] Based on the above description of the detection system applicable to the embodiments of this application, the data acquisition method provided in the embodiments of this application will be described in detail below. Please refer to... Figure 3 , Figure 3This application provides a flowchart of a data acquisition method, which is applied to a data acquisition device 400. A vehicle communication interface device 200 communicates with a vehicle electronic control unit 300 through the data acquisition device 400. The method may include:
[0041] S301. Obtain the data packets transmitted between the vehicle communication interface device 200 and the vehicle electronic control unit 300.
[0042] In this embodiment, since the data acquisition device 400 is directly positioned between the vehicle communication interface device 200 and the vehicle electronic control unit 300, it can directly acquire any data packets transmitted between the two devices. This allows for analysis of communication faults between the two devices based on these data packets, effectively avoiding the limitations of existing methods that cannot capture raw data packets sent by the vehicle electronic control unit 300 or acquire data packets transmitted when the network is disconnected and reconnected. This significantly improves fault analysis efficiency. Of course, it is understood that to ensure normal communication between the vehicle communication interface device 200 and the vehicle electronic control unit 300, the data acquisition device 400, upon receiving a data packet, should forward it to the corresponding device or unit according to the destination information (such as destination IP address and destination MAC address) in the data packet. For example, when acquiring a data packet sent by the vehicle communication interface device 200 to the vehicle electronic control unit 300, this data packet should be further forwarded to the vehicle electronic control unit 300.
[0043] To achieve the data packet acquisition function, this embodiment of the application can configure two network cards in the data acquisition device 400 to acquire data packets transmitted between the vehicle electronic control unit 300 and the vehicle communication interface device 200. It is understood that the network cards need to be connected to the vehicle electronic control unit 300 and the vehicle communication interface device 200 via network cables. Specifically, the network cable can be connected to the OBD interface (On-Board Diagnostics), and then connected to the vehicle electronic control unit 300 and the vehicle communication interface device 200 through the OBD interface. For ease of understanding, please also refer to... Figure 2 and Figure 4 , Figure 4This is a structural block diagram of a data acquisition device 400 provided in an embodiment of this application. The data acquisition device 400 may first include a first OBD interface 401, a second OBD interface 402, a first network card 406, a second network card 407, and a processor 408. The first OBD interface 401 is used to connect to the vehicle electronic control unit 300 and can be connected to the first network card 406 via a network cable 405. The second OBD interface 402 is used to connect to the vehicle communication interface device 200 and can be connected to the second network card 407 via a network cable 405. Since both OBD interfaces 401 and 402 and the network cable 405 can be regarded as transmission lines, the first network card 406 is actually directly connected to the vehicle electronic control unit 300, and the second network card 407 is actually directly connected to the vehicle communication interface device 200. The network cards can be connected to each other via a network bridge, which can be set by the processor 408. Thus, when the first network interface card (NIC) 406 receives a data packet sent by the vehicle electronic control unit (ECU) 300, it can forward it to the second NIC 407 via a bridge, and the second NIC 407 forwards it to the vehicle communication interface device 200. Similarly, when the second NIC 407 receives a data packet sent by the vehicle communication interface device 200, it can forward it to the first NIC 406 via a bridge, and the first NIC 406 forwards it to the vehicle ECU 300. In short, the vehicle communication interface device 200 can communicate with the vehicle ECU 300 via the aforementioned bridge. It should be noted that "first" and "second" are only used to distinguish NICs and are not used to define the correspondence between NICs and the vehicle ECU 300 and the vehicle communication interface device 200.
[0044] In one possible scenario, the data acquisition device 400 includes a first network interface card 406 connected to the vehicle electronic control unit 300 and a second network interface card 407 connected to the vehicle communication interface device 200. Before acquiring data packets transmitted between the vehicle communication interface device 200 and the vehicle electronic control unit 300, it may further include:
[0045] Step 11: Create a bridge between the first network card 406 and the second network card 407 so that the vehicle communication interface device 200 can communicate with the vehicle electronic control unit 300 through the bridge.
[0046] It should be noted that the embodiments of this application do not limit the way the bridge is created, and relevant network technologies can be referenced.
[0047] S302. When a data packet is acquired, save the data packet.
[0048] Specifically, in this embodiment, a packet capture tool can be preset in the data acquisition device 400, and this tool can be used to capture data packets from the first network card 406 or the second network card 407. It should be noted that the data acquisition device 400 can acquire any data packets transmitted between the vehicle communication interface device 200 and the vehicle electronic control unit 300. These data packets can be transmitted using the DoIP protocol or other protocols. This embodiment does not limit the specific preset packet capture tool; it can be set according to actual application requirements. Preferably, the preset packet capture tool can be tcpdump. Furthermore, it is understood that after the data packets are acquired, they can be saved in the data acquisition device 400 for review and analysis.
[0049] In one possible scenario, saving data packets may include:
[0050] Step 51: Use a preset packet capture tool to obtain and save data packets from the first network card 406 or the second network card 407.
[0051] Furthermore, to facilitate differentiation and retrieval, data packets can also be saved along with other information that helps distinguish them, such as the system time. Specifically, the system time can be retrieved and a folder can be created with the system time as the filename. Alternatively, the system time information and data packets can be saved directly in the same folder for easy access.
[0052] Based on the above embodiments, this application can place the data acquisition device 400 between the vehicle communication interface device 200 and the vehicle electronic control unit 300, so that the vehicle communication interface device 200 can communicate with the vehicle electronic control unit 300 through the data acquisition device 400, and can directly acquire the data packets transmitted between the vehicle communication interface device 200 and the vehicle electronic control unit 300, thereby effectively recording the communication status between the vehicle communication interface device 200 and the vehicle electronic control unit 300, so as to facilitate the analysis of development faults in vehicle diagnostic software.
[0053] Based on the above embodiments, the data acquisition device 400 can further be used to detect the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300, so as to further improve the analysis efficiency of vehicle diagnostic software development faults. The specific process of using the data acquisition device 400 to detect the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 is described below. In one possible case, please refer to... Figure 4 The data acquisition device 400 further includes an activation pin 404 and an I / O interface 409 connected to the activation pin 404. The activation pin 404 is used to activate the communication connection between the vehicle communication interface device 200 and the vehicle electronic control unit 300. The method may also include:
[0054] S401. Detect the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 using the first network card 406, the second network card 407 and the IO interface 409.
[0055] For easier understanding, please also refer to Figure 2 and Figure 4 As described above, in this embodiment of the application, two network interface cards (NICs) can be configured in the data acquisition device 400 to achieve the function of acquiring data packets. Furthermore, since the first NIC 406 is directly connected to the vehicle electronic control unit 300, it can be determined that the network of the vehicle electronic control unit 300 is normal as long as the first NIC 406 can establish a network connection with the vehicle electronic control unit 300. Similarly, since the second NIC 407 is directly connected to the vehicle communication interface device 200, it can be determined that the network of the vehicle communication interface device 200 is normal as long as the second NIC 407 can establish a network connection with the vehicle communication interface device 200. Furthermore, if it can be confirmed through the first network card 406 and the second network card 407 that the vehicle electronic control unit 300 and the vehicle communication interface device 200 can establish a normal network connection, it indicates that the network between the vehicle electronic control unit 300 and the vehicle communication interface device 200 is normal; conversely, if it is confirmed that the first network card 406 cannot establish a network connection with the vehicle electronic control unit 300, or that the second network card 407 cannot establish a network connection with the vehicle communication interface device 200, it indicates that the network between the vehicle electronic control unit 300 and the vehicle communication interface device 200 is interrupted.
[0056] Furthermore, considering that when communicating using the DoIP protocol, the vehicle electronic control unit 300 and the vehicle communication interface device 200 need to initiate communication via an activation level signal, specifically, when the activation pin of the vehicle electronic control unit 300 and the activation pin of the vehicle communication interface device 200 are not connected to the activation line (the activation pin of the vehicle communication interface device 200, the activation pin of the vehicle electronic control unit 300, and the activation line are not connected to the activation line), the activation line is activated. Figure 1 , 2When the level in the activation line (shown separately) is pulled high, the vehicle electronic control unit 300 and the vehicle communication interface device 200 will transmit data via the DoIP protocol. Conversely, when the level in the activation line is pulled low, the vehicle electronic control unit 300 and the vehicle communication interface device 200 will stop using the DoIP protocol for data transmission. That is, the activation level signal is also an important signal for determining whether communication exists between the vehicle electronic control unit 300 and the vehicle communication interface device 200. Therefore, in this embodiment, an activation pin 404 and an I / O interface 409 can be added to the data acquisition device 400. The activation pin 404 is used to activate the communication connection between the vehicle communication interface device 200 and the vehicle electronic control unit 300, while the I / O interface 409 is dedicated to reading the level signal in the activation pin 404, and can also detect and record changes in this level signal.
[0057] In one possible scenario, the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 is detected using the first network card 406, the second network card 407, and the I / O interface 409, including:
[0058] Step 21: Detect the first communication connection status between the first network card 406 and the vehicle electronic control unit 300, the second communication connection status between the second network card 407 and the vehicle communication interface device 200, and the level status of the activation pin 404 read by the IO interface 409;
[0059] Step 22: When it is determined that any one of the first communication connection state, the second communication connection state, and the level state has changed, it is determined that the communication connection state has changed.
[0060] Furthermore, for other pins in the OBD interface that are not related to network communication, the data acquisition device 400 will directly enable them to conduct, such as... Figure 4 Pins in the first OBD interface 401 and the second OBD interface 402 that are not related to network communication can be directly connected through the connection line 403. The processor 408 will not acquire the signals transmitted through the connection line 403.
[0061] S402. When it is determined that the communication connection status has changed, save the changed communication connection status.
[0062] Furthermore, after detecting changes in the first communication connection state, the second communication connection state, and the level state, the data acquisition device 400 can save the changed state information. Of course, for ease of differentiation and retrieval, the changed state information can also be saved along with other easily distinguishable information, such as the system time. Specifically, the system time can be acquired, and a state file can be created with the system time as the filename. The changed state information can then be saved in this state file for easy retrieval.
[0063] In one possible scenario, saving the changed communication connection state may include:
[0064] Step 31: Obtain the system time and save the changed status information of the first communication connection status, the second communication connection status, and the level status, along with the system time, to the same status file.
[0065] Furthermore, to save computing resources, the data acquisition device 400 can periodically detect the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300. This embodiment does not limit the specific detection cycle time; it can be selected according to actual application needs, for example, it can be 50 milliseconds.
[0066] In one possible scenario, detecting the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 may include:
[0067] Step 41: Periodically check the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 with a preset time period.
[0068] Based on the above embodiments, the data acquisition device 400 can also effectively and completely detect the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 through the first network card 406, the second network card 407 and the IO interface 409 connected to the activation pin 404, so as to further analyze the cause of communication failure between the vehicle communication interface device 200 and the vehicle electronic control unit 300, and improve the efficiency of analyzing the cause of failure in vehicle diagnostic software development.
[0069] The data acquisition apparatus, data acquisition device 400, and computer-readable storage medium provided in the embodiments of this application are described below. The data acquisition apparatus, data acquisition device 400, and computer-readable storage medium described below can be referred to in correspondence with the data acquisition method described above.
[0070] Please refer to Figure 2 , Figure 4 and Figure 5 , Figure 5This is a structural block diagram of a data acquisition device provided in an embodiment of this application. The device is applied to a data acquisition equipment 400, and a vehicle communication interface device 200 communicates with a vehicle electronic control unit 300 through the data acquisition equipment 400. The device may include:
[0071] The data packet acquisition module 501 is used to acquire data packets transmitted between the vehicle communication interface device 200 and the vehicle electronic control unit 300;
[0072] The data packet storage module 502 is used to save the data packet when it is acquired.
[0073] Optionally, the data acquisition device 400 includes a first network card 406 connected to the vehicle electronic control unit 300 and a second network card 407 connected to the vehicle communication interface device 200. The device may further include:
[0074] The bridge creation module is used to create a bridge between the first network card 406 and the second network card 407, so that the vehicle communication interface device 200 can communicate with the vehicle electronic control unit 300 through the bridge.
[0075] Optionally, the data packet storage module 502 may include:
[0076] The packet capture module is used to capture and save data packets from the first network card 406 or the second network card 407 using a preset packet capture tool.
[0077] Optionally, the data acquisition device 400 includes an activation pin 404 and an I / O interface 409 connected to the activation pin 404. The activation pin 404 is used to activate the communication connection between the vehicle communication interface device 200 and the vehicle electronic control unit 300. The device may further include:
[0078] The communication connection status detection module is used to detect the communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 using the first network card 406, the second network card 407 and the IO interface 409.
[0079] The communication connection state saving module is used to save the changed communication connection state when it is determined that the communication connection state has changed.
[0080] Optionally, the communication connection status detection module may include:
[0081] The detection submodule is used to detect the first communication connection status between the first network card 406 and the vehicle electronic control unit 300, the second communication connection status between the second network card 407 and the vehicle communication interface device 200, and the level status of the activation pin 404 read by the IO interface 409.
[0082] The determination submodule is used to determine that the communication connection state has changed when any one of the first communication connection state, the second communication connection state, and the level state changes.
[0083] Optionally, the communication connection state saving module is specifically used for:
[0084] Obtain the system time and save the status information after changes in the first communication connection status, the second communication connection status, and the level status, along with the system time, to the same status file.
[0085] Optionally, the communication connection status detection module is specifically used for:
[0086] The communication connection status between the vehicle communication interface device 200 and the vehicle electronic control unit 300 is periodically checked with a preset time period as the detection cycle.
[0087] Please refer to Figure 6 , Figure 6 This is a structural block diagram of another data acquisition device provided in an embodiment of this application. This embodiment of the application provides a data acquisition device 400, including a processor 408 and a memory 410; wherein, the memory 410 is used to store a computer program; the processor 408 is used to execute the data acquisition method provided in the foregoing embodiment when executing the computer program.
[0088] For details regarding the specific process of the above data acquisition method, please refer to the relevant content provided in the foregoing embodiments, which will not be repeated here.
[0089] Furthermore, the memory 410, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary storage or permanent storage.
[0090] In addition, the data acquisition device 400 also includes a power supply 411, a communication interface 412, an input / output interface (IO interface) 409, and a communication bus 413; wherein, the power supply 411 is used to provide operating voltage for each hardware device on the data acquisition device 400; the communication interface 412 can create a data transmission channel between the data acquisition device 400 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 409 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0091] In addition, the data acquisition device 400 may also include, for example: Figure 4The two network cards shown (first network card 406 and second network card 407) are used to connect to the vehicle communication interface device 200 and the vehicle electronic control unit 300, respectively.
[0092] In addition, the data acquisition device 400 may also include, for example: Figure 4 The activation pin 404 shown is connected to the IO interface 409, the vehicle communication interface device 200, and the vehicle electronic control unit 300, respectively. The IO interface 409 is used to detect the level change on the activation pin 404 of the data acquisition device 400.
[0093] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the data acquisition method provided in the foregoing embodiments.
[0094] For details regarding the specific process of the above data acquisition method, please refer to the relevant content provided in the foregoing embodiments, which will not be repeated here.
[0095] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0096] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0097] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0098] The foregoing has provided a detailed description of a data acquisition method, apparatus, device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A data acquisition method, characterized in that, The method is applied to a data acquisition device. A vehicle communication interface device communicates with a vehicle electronic control unit (ECU) through the data acquisition device. The data acquisition device includes a first network interface card (NIC) connected to the ECU, a second NIC connected to the vehicle communication interface device, an activation pin, and an I / O interface connected to the activation pin. The activation pin is used to activate the communication connection between the vehicle communication interface device and the ECU. The I / O interface is used to read the voltage level of the activation pin. The method includes: A bridge is created between the first network card and the second network card so that the vehicle communication interface device can communicate with the vehicle electronic control unit through the bridge; The communication connection status between the vehicle communication interface device and the vehicle electronic control unit is detected using the first network card, the second network card, and the IO interface. When it is determined that the communication connection state has changed, the changed communication connection state is saved; Acquire the data packets transmitted between the vehicle communication interface device and the vehicle electronic control unit; When the data packet is obtained from the first network card or the second network card, the data packet is saved.
2. The data acquisition method according to claim 1, characterized in that, Saving the data packet includes: The data packets are obtained from the first network card or the second network card using a preset packet capture tool and saved.
3. The data acquisition method according to claim 1, characterized in that, The step of detecting the communication connection status between the vehicle communication interface device and the vehicle electronic control unit using the first network card, the second network card, and the I / O interface includes: The system detects the first communication connection status between the first network card and the vehicle electronic control unit, the second communication connection status between the second network card and the vehicle communication interface device, and the level status of the activation pin read by the IO interface. When it is determined that any one of the first communication connection state, the second communication connection state, and the level state has changed, it is determined that the communication connection state has changed.
4. The data acquisition method according to claim 3, characterized in that, The process of saving the changed communication connection state includes: Obtain the system time, and save the status information of the first communication connection status, the second communication connection status, and the changed level status along with the system time to the same status file.
5. The data acquisition method according to claim 1, characterized in that, The detection of the communication connection status between the vehicle communication interface device and the vehicle electronic control unit includes: The communication connection status between the vehicle communication interface device and the vehicle electronic control unit is periodically detected at a preset time interval.
6. A data acquisition device, characterized in that, A vehicle communication interface device is applied to a data acquisition device. The data acquisition device communicates with a vehicle electronic control unit (ECU) through the data acquisition device. The data acquisition device includes a first network interface card (NIC) connected to the ECU, a second NIC connected to the vehicle communication interface device, an activation pin, and an I / O interface connected to the activation pin. The activation pin is used to activate the communication connection between the vehicle communication interface device and the ECU. The device includes: A bridge creation module is used to create a bridge between the first network card and the second network card, so that the vehicle communication interface device can communicate with the vehicle electronic control unit through the bridge; A communication connection status detection module is used to detect the communication connection status between the vehicle communication interface device and the vehicle electronic control unit using the first network card, the second network card and the IO interface; A communication connection state saving module is used to save the changed communication connection state when it is determined that the communication connection state has changed. A data packet acquisition module is used to acquire data packets transmitted between the vehicle communication interface device and the vehicle electronic control unit; A data packet saving module is used to save the data packet when it is obtained from the first network card or the second network card.
7. A data acquisition device, characterized in that, include: The first network card connected to the vehicle's electronic control unit; A second network interface card (NIC) that connects to the vehicle communication interface device; Activate the feet; Used to activate the communication connection between the vehicle communication interface device and the vehicle electronic control unit. The IO interface connected to the activation pin is used to read the voltage level of the activation pin; Memory, used to store computer programs; A processor for executing the computer program to implement the data acquisition method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the data acquisition method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Vehicle remote diagnosis connecting device
CN111273641A