Flow monitoring method and device, vehicle and storage medium

By configuring sniffing, dumping, and forwarding modules to capture and convert Ethernet data, the problem of traffic monitoring in vehicle networks is solved, and comprehensive monitoring and analysis of Ethernet traffic inside vehicle controllers is achieved.

CN120658657APending Publication Date: 2025-09-16GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510942939.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing traffic monitoring methods are difficult to achieve comprehensive analysis and monitoring of vehicle networks, especially when Ethernet communication is applied to vehicle networks, there is a lack of effective traffic monitoring means.

Method used

The monitoring module parses the enable configuration instructions sent by the host computer and configures the sniffing module, dump module and forwarding module. The sniffing module captures the original Ethernet data and accesses the ring buffer through the hook function. The dump module converts the data into a preset format, and the forwarding module sends the data to the host computer for monitoring.

Benefits of technology

It realizes the capture and analysis of Ethernet traffic inside the vehicle controller, solves the problem of traffic monitoring in the vehicle network, and provides a flexible monitoring solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120658657A_ABST
    Figure CN120658657A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a flow monitoring method and device, a vehicle and a storage medium. The method comprises the steps that an enabling configuration instruction sent by an upper computer is analyzed through a monitoring module, the enabling configuration instruction is configured based on system resources of a vehicle-mounted controller, and the enabling configuration instruction at least comprises enabling configuration information of a sniffing module; the sniffing module is enabled based on enabling configuration information of the sniffing module, Ethernet original data in the vehicle-mounted controller is captured through the enabled sniffing module, and the sniffing module directly accesses an annular buffer area to access the Ethernet original data by embedding a hook function in sending or receiving callback; converting the Ethernet original data into Ethernet data in a preset format through a dump module; and the Ethernet data in the preset format is sent to an upper computer through a forwarding module, so that the upper computer carries out flow monitoring on the vehicle-mounted controller based on the Ethernet data. The problem that Ethernet traffic monitoring, capturing and analyzing are difficult to carry out in a vehicle-mounted controller can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of vehicle technology, and specifically relates to a flow monitoring method, device, vehicle and storage medium. Background Art

[0002] With the advancement of in-vehicle communication network bus technology, Ethernet communication is gradually becoming mainstream, joining traditional bus communications such as CAN and LIN. Gigabit / gigabit Ethernet standards have long been used in automotive Ethernet. Since the introduction of concepts and ideas such as service-oriented architecture and service-based communication into automotive ECU software, as well as applications such as Ethernet diagnostics, Ethernet communication has become an essential component. However, existing traffic monitoring methods struggle to fully analyze and monitor traffic across the entire in-vehicle network. Summary of the Invention

[0003] In view of the above problems, the present application proposes a flow monitoring method, device, vehicle and storage medium to improve the above problems.

[0004] In a first aspect, an embodiment of the present application provides a traffic monitoring method, the method comprising: parsing an enable configuration instruction sent by a host computer through a monitoring module, the enable configuration instruction being configured based on system resources of a vehicle-mounted controller, the enable configuration instruction including at least enable configuration information of a sniffing module; enabling the sniffing module based on the enable configuration information of the sniffing module, capturing Ethernet raw data in the vehicle-mounted controller through the enabled sniffing module, the sniffing module directly accessing the Ethernet raw data in a ring buffer by embedding a hook function in a send or receive callback; converting the Ethernet raw data into Ethernet data in a preset format through a dump module; and sending the Ethernet data in the preset format to the host computer through a forwarding module, so that the host computer performs traffic monitoring on the vehicle-mounted controller based on the Ethernet data.

[0005] In the second aspect, an embodiment of the present application provides a traffic monitoring system, which includes: a monitoring module for parsing an enable configuration instruction sent by a host computer, wherein the enable configuration instruction is configured based on the system resources of the vehicle-mounted controller, and the enable configuration instruction includes at least enable configuration information of a sniffing module; a sniffing module for enabling the sniffing module based on the enable configuration information of the sniffing module, and capturing the Ethernet raw data in the vehicle-mounted controller through the enabled sniffing module, and the sniffing module directly accesses the Ethernet raw data in a ring buffer by embedding a hook function in a send or receive callback; a dump module for converting the Ethernet raw data into Ethernet data in a preset format; and a forwarding module for sending the Ethernet data in the preset format to the host computer, so that the host computer performs traffic monitoring on the vehicle-mounted controller based on the Ethernet data.

[0006] In a third aspect, an embodiment of the present application provides a vehicle comprising one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.

[0007] In a fourth aspect, the present application provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0008] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which program code is stored, wherein the above method is executed when the program code is run.

[0009] The embodiment of the present application provides a flow monitoring method, device, vehicle and storage medium. First, the monitoring module parses the enable configuration instruction sent by the host computer, and the enable configuration instruction is configured based on the system resources of the vehicle controller. The enable configuration instruction includes at least the enable configuration information of the sniffing module. Then, the sniffing module is enabled based on the enable configuration information of the sniffing module. Then, the enabled sniffing module captures the Ethernet raw data in the vehicle controller. The sniffing module directly accesses the ring buffer to access the Ethernet raw data by embedding a hook function in the send or receive callback. The Ethernet raw data is converted into Ethernet data in a preset format through the dump module. Finally, the Ethernet data in the preset format is sent to the host computer through the forwarding module, so that the host computer performs flow monitoring on the vehicle controller based on the Ethernet data. Through the above method, the problem of difficulty in performing Ethernet flow monitoring, capture and analysis inside the vehicle controller can be solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A flow chart of a flow monitoring method proposed in one embodiment of the present application is shown; Figure 2 A flow chart of a flow monitoring method proposed in another embodiment of the present application is shown; Figure 3 A flow chart of a flow monitoring method proposed in another embodiment of the present application is shown; Figure 4 The following is a structural block diagram of a flow monitoring system proposed in an embodiment of the present application; Figure 5 A structural block diagram of a vehicle for executing the flow monitoring method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0012] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0013] With the advancement of in-vehicle communication network bus technology, Ethernet communication is gradually becoming mainstream, joining traditional bus communications such as CAN and LIN. Gigabit / gigabit Ethernet standards have long been used in automotive Ethernet. Since the introduction of concepts and ideas such as service-oriented architecture and service-based communication into automotive ECU software, as well as applications such as Ethernet diagnostics, Ethernet communication has become an essential component. However, existing traffic monitoring methods struggle to fully analyze and monitor traffic across the entire in-vehicle network.

[0014] The embodiment of the present application proposes a flow monitoring method, device, vehicle and storage medium. First, the monitoring module parses the enable configuration instruction sent by the host computer, and the enable configuration instruction is configured based on the system resources of the vehicle controller. The enable configuration instruction includes at least the enable configuration information of the sniffing module. Then, the sniffing module is enabled based on the enable configuration information of the sniffing module. Then, the enabled sniffing module captures the Ethernet raw data in the vehicle controller. The sniffing module directly accesses the ring buffer to access the Ethernet raw data by embedding a hook function in the send or receive callback. The Ethernet raw data is converted into Ethernet data in a preset format through the dump module. Finally, the Ethernet data in the preset format is sent to the host computer through the forwarding module, so that the host computer performs flow monitoring on the vehicle controller based on the Ethernet data. Through the above method, the difficult problem of Ethernet flow monitoring, capture and analysis inside the vehicle controller can be solved.

[0015] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0016] See also Figure 1 , an embodiment of the present application provides a flow monitoring method, the method comprising: Step S110: parsing the enabling configuration instruction sent by the host computer through the monitoring module, wherein the enabling configuration instruction is configured based on the system resources of the vehicle controller, and the enabling configuration instruction at least includes enabling configuration information of the sniffing module.

[0017] In the embodiment of the present application, monitoring module, sniffing module, dump module, forwarding module and host computer are all software modules arranged in vehicle-mounted controller (specifically MCU).Wherein, monitoring module is mainly used for completing receiving and parsing the instruction of host computer program, or the UDS diagnostic service message sent by CAN bus tool, controls whether sniffing module enables flow monitoring by changing the state variable in code, controls the selection of flow recording mode of dump module and forwarding module, and also has filter configuration etc.Sniffing module is mainly used for completing the capture of Ethernet data sent and received by vehicle-mounted controller.Dump module is mainly used for completing the raw frame Ethernet data obtained by sniffing module and converting it into a custom format, or converting it into a file format that is easy to read directly with existing mainstream network analysis tools, playback and write in non-volatile memory to be forwarded module and transmitted to host computer.Forwarding module is mainly used for completing communication with host computer, and the flow that sniffing module, dump module monitor and record is transferred to host computer with custom protocol or file format mode. The host computer is mainly used to complete the reception of Ethernet data sent by the forwarding module, establish communication with the forwarding module, send instructions, and parse the transmitted data according to the traffic recording method and finally display it on the host computer interface.

[0018] In the embodiments of the present application, the system resources of the vehicle controller may refer to various scenarios of whether the vehicle controller includes a switch. Specifically, the various scenarios may include a multi-channel scenario where the controller includes a switch, a single-channel scenario where the controller includes a switch, and a scenario where the controller does not have a switch.

[0019] One of the ways is in a multi-channel scenario where the controller includes a switch. If the vehicle-mounted controller includes a switch, and there are multiple physical channels assigned to the MCU (such as through GMII and MDIO) connected to a port of the switch (referring to the inside of the controller chip). When monitoring the traffic of the entire vehicle-mounted controller, it is necessary to enable the port mirroring function of the switch, and configure the switch port connected to the MCU as a mirror port. The forwarding module will forward the Ethernet data sniffed and dumped by the sniffing module and the dump module to the host computer from other channels. In this scenario, the sniffing module, the dump module, and the forwarding module will all be enabled, that is, the enable configuration instruction sent by the host computer can include the enable configuration information of the sniffing module, the enable configuration information of the dump module, and the enable configuration information of the forwarding module.

[0020] Another approach involves a single-channel scenario where the controller includes a switch. If the vehicle controller includes a switch, and only one physical channel assigned to the MCU is connected to a port on the switch, while the other channels are not connected to the switch (e.g., directly to the PHY), in this scenario, the sniffing module, dump module, and forwarding module will all be enabled. This means that the enable configuration instructions sent by the host computer will include the sniffing module, dump module, and forwarding module enable configuration information.

[0021] Optional: Controller without a switch scenario. If the vehicle controller does not include a switch, regardless of the number of physical channels on the MCU, the sniffing module, dump module, and forwarding module will all be enabled. Specifically, the enable configuration command sent by the host computer can include the sniffing module, dump module, and forwarding module enable configuration information.

[0022] In an embodiment of the present application, before sending an enable configuration instruction to the monitoring module, the host computer will first evaluate the system resources of the vehicle control system, and then set the enable configuration instruction according to the system resources of the vehicle controller.

[0023] The enabling configuration instruction is an instruction for instructing a module (at least one of the monitoring module, the sniffing module, the dump module, and the forwarding module) whether to enable the module, configuring the module's traffic recording method, etc. The traffic recording method may include data conversion rules, data forwarding rules, data storage rules, etc., which are not specifically limited here.

[0024] The enabling configuration instruction may be a UDS diagnostic service message sent by a CAN bus tool or a monitoring instruction message received after a TCP connection is established with a host computer.

[0025] When the monitoring module receives the enable configuration instruction sent by the host computer, it parses the instruction to obtain the enable configuration information of each module. The enable configuration information here can include whether the module is enabled, the module's traffic recording method, etc. Of course, it can also include more information, such as the enable start time and data filtering rules.

[0026] Step S120: Enable the sniffing module based on the enable configuration information of the sniffing module, and capture the Ethernet raw data in the vehicle controller through the enabled sniffing module. The sniffing module directly accesses the ring buffer to access the Ethernet raw data by embedding a hook function in the sending or receiving callback.

[0027] In the embodiment of the present application, the Ethernet original data refers to the original Ethernet frame. The enabling configuration information of each module can be defined in the form of a macro declaration.

[0028] After the monitoring module parses the enable configuration instruction to obtain the enable configuration information of the sniffing module, the monitoring module can enable the sniffing module based on the enable configuration information of the sniffing module. Enabling the sniffing module based on the enable configuration information of the sniffing module can be expressed as follows: setting the SNIFFER_ENABLE flag bit through the enable configuration information to determine whether to activate the sniffing module; configuring the MAC physical interface driver to promiscuous mode to ensure that the network card receives all Ethernet frames passing through; dynamically allocating a ring buffer based on the available RAM of the MCU, with a typical size of 4-8 maximum Ethernet frames to balance memory usage and write frequency; and allocating space in the non-volatile storage area based on time windows.

[0029] When the sniffing module is enabled, it can be used to obtain raw Ethernet data from the vehicle controller. Essentially, this involves code embedded within the receive confirmation process and send process of the MAC physical interface driver's receive callback. This code captures the entire raw Ethernet frame from the underlying send and receive buffers and then copies it into the buffer allocated for the dump module. If the buffer is full, the dump module's dump process is called back to save the frame data to non-volatile memory. Specifically, the MAC physical interface driver embeds a hook function within the send / receive callback, directly accessing the DMA buffer to obtain raw frame data. The frame data is then stored in a ring buffer via memory copy, with a timestamp and direction marker appended.

[0030] Buffer full processing: trigger a high priority interrupt, call the SaveToFlash() function of the dump module, write the data in the current buffer to Flash in PCAP format, and switch to the backup buffer at the same time.

[0031] Traffic overload protection: If the dump speed is lower than the capture speed, the frame drop mechanism is activated (recording the frame drop counter) and key protocol frames (such as DoIP and SOME / IP) are retained first.

[0032] Step S130: converting the Ethernet original data into Ethernet data in a preset format through a dump module.

[0033] In an embodiment of the present application, the preset format enables the data format specified by the data conversion rules of the configuration dump module included in the configuration instruction. The preset format can be a custom format or a file format that is easy to directly read and play back using current mainstream network analysis tools (such as PCAP format).

[0034] In an embodiment of the present application, the dump module can be scheduled to run in the system as an operating system task, or triggered by a callback from the sniffing module when the cache is full. The actions of the dump module (data conversion rules, data filtering rules, etc.) are also controlled by the monitoring module. First, it can be directly transmitted to the host computer in real time or dumped into a file such as PCAP format and then wait for transmission. Second, the filter configuration can choose whether to monitor and record the original frame according to the protocol layer header (such as MAC address, IP address, transport layer port, protocol identifier, etc.).

[0035] Step S140: sending the Ethernet data in the preset format to a host computer through a forwarding module, so that the host computer monitors the flow of the vehicle controller based on the Ethernet data.

[0036] In an embodiment of the present application, after the dump module converts the Ethernet raw data into Ethernet data in a preset format, the Ethernet data in the preset format can be sent to the host computer through the forwarding module, so that the host computer can parse the Ethernet data in the preset format and display the parsed Ethernet data in the host computer interface.

[0037] The present application provides a flow monitoring method that can solve the problem of difficulty in monitoring, capturing and analyzing Ethernet flow inside an on-board controller.

[0038] See also Figure 2 , an embodiment of the present application provides a flow monitoring method, the method comprising: Step S210: parsing the enabling configuration instruction sent by the host computer through the monitoring module, wherein the enabling configuration instruction is configured based on the system resources of the vehicle controller, and the enabling configuration instruction at least includes enabling configuration information of the sniffing module.

[0039] Step S220: Enable the sniffing module based on the enable configuration information of the sniffing module, and capture the Ethernet raw data in the vehicle controller through the enabled sniffing module. The sniffing module directly accesses the ring buffer to access the Ethernet raw data by embedding a hook function in the sending or receiving callback.

[0040] Step S230: Based on the enabling configuration information of the dump module, enable the dump module and configure data filtering rules and data conversion rules of the dump module.

[0041] In an embodiment of the present application, the enabling configuration instruction may further include enabling configuration information of the dump module, wherein the enabling configuration information of the dump module may include whether to enable the dump module, data filtering rules and data conversion rules of the dump module, and of course, cache allocation rules.

[0042] Specifically, the DUMP_MODE flag (0 = real-time transmission, 1 = PCAP storage) and filtering rules (such as MAC whitelist) can be set through the dump module enable configuration information; if PCAP mode is selected, the Flash storage area is pre-allocated and the PCAP global header (including metadata such as magic number and version number) is written.

[0043] Cache allocation rules can include real-time mode and PCAP mode. Real-time mode allocates a double-buffer queue that directly connects to the TCP send queue of the forwarding module; PCAP mode uses a circular buffer structure, writes frames to Flash, and maintains a file index table.

[0044] Data conversion rules can include real-time mode and PCAP mode. Real-time mode encapsulates the original frame into a custom protocol (including a 2-byte length header, frame data, and a 2-byte CRC checksum) and stores it in the forwarding cache. PCAP mode adds a PCAP frame header (such as timestamp and truncation length) before writing it to the Flash memory, inserting 4-byte alignment padding between frames.

[0045] Data filtering rules can discard non-matching frames before dumping according to the rules issued by the monitoring module (such as FILTER_IP=192.168.1.100) to reduce invalid frames.

[0046] Step S240: Based on the data filtering rule, the enabled dump module is used to filter the Ethernet original data to obtain filtered Ethernet original data.

[0047] In an embodiment of the present application, the enabled dump module can filter the Ethernet original data captured by the sniffing module according to the set data filtering rules to obtain the required Ethernet original data.

[0048] Step S250: Based on the data conversion rule, the enabled dump module converts the filtered Ethernet raw data into Ethernet data in a preset format.

[0049] In an embodiment of the present application, the enabled dump module can perform format conversion on the filtered Ethernet original data according to the aforementioned data conversion rules to obtain Ethernet data in a preset format.

[0050] Step S260: Based on the enabling configuration information of the forwarding module, enable the forwarding module and configure data forwarding rules of the forwarding module.

[0051] In the embodiment of the present application, the forwarding module will be scheduled to run in the system as a process of an operating system task, regularly establish a TCP connection with the host computer and transmit the captured Ethernet data.

[0052] The enabling configuration instruction may also include enabling configuration information of the forwarding module. The enabling configuration information of the forwarding module may include whether to enable the forwarding module, the data forwarding rules of the enabling module, etc. The data forwarding rules may include a custom protocol mode and a file format (PCAP file transfer) mode. The custom protocol mode refers to reading the packaged frame data from the dump module cache, adding a protocol header (including a sequence number, timestamp, and fragment identifier), and then transmitting the fragments; the file format mode refers to reading the PCAP file block from the Flash, streaming it through TCP, and sending an EOF marker after the file transfer is completed.

[0053] Specifically, the TRANSFER_PROTOCOL flag bit (0=custom protocol, 1=PCAP file transfer) can be set through the enable configuration information of the forwarding module.

[0054] In custom protocol mode, a double-buffered queue (8-16 frames per buffer) is pre-allocated for temporary storage of data packaged by the dump module.

[0055] Optionally, the forwarding module periodically attempts to establish a TCP connection with the host computer, and a timeout triggers a reconnection mechanism.

[0056] Step S270: Based on the data forwarding rule, the Ethernet data in the preset format is sent to the host computer through the enabled forwarding module, so that the host computer monitors the flow of the vehicle controller based on the Ethernet data.

[0057] In an embodiment of the present application, after parsing the data forwarding rules of the forwarding module, the forwarding module can send the Ethernet data in a preset format read from the dump module to the host computer according to the data forwarding rules.

[0058] As a way, based on the data forwarding rule, before sending the Ethernet data in the preset format to the host computer through the enabled forwarding module, it also includes: triggering the enabled forwarding module to establish a TCP connection with the host computer.

[0059] In the embodiment of the present application, the enabled forwarding module can periodically establish a TCP connection with the host computer.

[0060] The present application provides a flow monitoring method that realizes flexible control of the vehicle network monitoring system through multi-protocol compatibility and real-time state switching.

[0061] See also Figure 3 , an embodiment of the present application provides a flow monitoring method, the method comprising: Step S310: parsing the enabling configuration instruction sent by the host computer through the monitoring module, wherein the enabling configuration instruction is configured based on the system resources of the vehicle controller, and the enabling configuration instruction at least includes enabling configuration information of the sniffing module.

[0062] Step S320: Enable the sniffing module based on the enable configuration information of the sniffing module, and capture the Ethernet raw data in the vehicle controller through the enabled sniffing module. The sniffing module directly accesses the ring buffer to access the Ethernet raw data by embedding a hook function in the sending or receiving callback.

[0063] Step S330: The enabled sniffing module copies the Ethernet original data to the cache space of the dump module.

[0064] In an embodiment of the present application, after the enabled sniffing module captures the Ethernet original data, the Ethernet original data can be copied to the cache space of the dump module in real time.

[0065] As a method, when the enabled sniffing module copies the Ethernet original data to the cache space of the dump module, it is detected whether the cache space is full; if it is full, the enabled sniffing module calls back the dump process of the dump module to store the Ethernet original data in a non-volatile memory.

[0066] Step S340: converting the Ethernet original data into Ethernet data in a preset format through a dump module.

[0067] Step S350: sending the Ethernet data in the preset format to a host computer through a forwarding module, so that the host computer monitors the flow of the vehicle controller based on the Ethernet data.

[0068] The present application provides a flow monitoring method that can solve the problem of difficulty in monitoring, capturing and analyzing Ethernet flow inside an on-board controller.

[0069] See also Figure 4 , an embodiment of the present application provides a flow monitoring system 400, the system 400 comprising: The monitoring module 410 is used to parse the enabling configuration instruction sent by the host computer, where the enabling configuration instruction is configured based on the system resources of the vehicle controller, and the enabling configuration instruction at least includes enabling configuration information of the sniffing module.

[0070] As a manner, the monitoring module 410 is further configured to enable the dump module and configure data filtering rules and data conversion rules of the dump module based on the enabling configuration information of the dump module.

[0071] As another approach, the monitoring module 410 is further configured to enable the forwarding module and configure data forwarding rules of the forwarding module based on the enabling configuration information of the forwarding module.

[0072] The sniffing module 420 is used to enable the sniffing module based on the enable configuration information of the sniffing module, and capture the Ethernet raw data in the vehicle controller through the enabled sniffing module. The sniffing module directly accesses the ring buffer to access the Ethernet raw data by embedding a hook function in the sending or receiving callback.

[0073] As a method, the sniffing module 420 is also used to copy the Ethernet original data to the cache space of the dump module.

[0074] As another method, the sniffing module 420 is also used to detect whether the cache space is full during the process of copying the Ethernet original data to the cache space of the dump module; if it is full, the dump process of the dump module is called back to store the Ethernet original data in a non-volatile memory.

[0075] The dump module 430 is configured to convert the original Ethernet data into Ethernet data in a preset format.

[0076] As a method, the dump module 430 is also used to filter the Ethernet original data based on the data filtering rules to obtain filtered Ethernet original data; based on the data conversion rules, convert the filtered Ethernet original data into Ethernet data in a preset format.

[0077] The forwarding module 440 is configured to send the Ethernet data in a preset format to a host computer, so that the host computer can monitor the flow of the vehicle controller based on the Ethernet data.

[0078] As a method, the forwarding module 440 is further configured to send the Ethernet data in the preset format to a host computer based on the data forwarding rule, so that the host computer can monitor the flow of the vehicle controller based on the Ethernet data.

[0079] It should be noted that the device embodiment in this application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.

[0080] The following will be combined Figure 5 A vehicle provided in this application is described.

[0081] See also Figure 5 Based on the aforementioned traffic monitoring method and apparatus, embodiments of the present application also provide another vehicle 800 capable of executing the aforementioned traffic monitoring method. Vehicle 800 includes one or more (only one shown in the figure) coupled processors 802, a memory 804, and a network module 806. The memory 804 stores a program capable of executing the aforementioned embodiments, and the processor 802 can execute the program stored in the memory 804.

[0082] The processor 802 may include one or more processing cores. Using various interfaces and circuits, the processor 802 connects to various components within the vehicle 800. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 804 and accessing data stored in the memory 804, the processor 802 performs various functions and processes data within the vehicle 800. Optionally, the processor 802 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 802 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may also be implemented independently of the processor 802 via a separate communications chip.

[0083] Memory 804 may include random access memory (RAM) or read-only memory (ROM). Memory 804 may be used to store instructions, programs, code, code sets, or instruction sets. Memory 804 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, sound playback function, image playback function, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data generated by the vehicle 800 during use (such as a phone book, audio and video data, and chat log data).

[0084] The network module 806 is used to receive and transmit electromagnetic waves, converting them into electrical signals, thereby communicating with a communications network or other devices, such as a vehicle. The network module 806 may include various existing circuit components for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption / decryption chip, a subscriber identity module (SIM) card, and memory. The network module 806 can communicate with various networks, such as the Internet, an intranet, or a wireless network, or with other devices via a wireless network. These wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. For example, the network module 806 may exchange information with a base station.

[0085] The present application also provides a computer-readable storage medium having program code stored therein, which can be called by a processor to execute the method described in the above method embodiment.

[0086] The computer-readable storage medium may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Alternatively, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program code for executing any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code may be compressed, for example, in a suitable format.

[0087] The present application provides a flow monitoring method, device, vehicle and storage medium. First, the monitoring module parses the enable configuration instruction sent by the host computer. The enable configuration instruction is configured based on the system resources of the vehicle controller. The enable configuration instruction includes at least the enable configuration information of the sniffing module. Then, the sniffing module is enabled based on the enable configuration information of the sniffing module. The enabled sniffing module captures the Ethernet raw data in the vehicle controller. The sniffing module directly accesses the ring buffer to access the Ethernet raw data by embedding a hook function in the send or receive callback. The Ethernet raw data is converted into Ethernet data in a preset format through the dump module. Finally, the Ethernet data in the preset format is sent to the host computer through the forwarding module, so that the host computer performs flow monitoring on the vehicle controller based on the Ethernet data. The above method can solve the problem of difficulty in performing Ethernet flow monitoring, capture and analysis inside the vehicle controller.

[0088] In this application, a plurality refers to two or more.

[0089] In this application, unless otherwise expressly defined, the terms "mounted," "connected," and "connected" should be interpreted broadly. For example, they can refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; and internal communication between two components. A person of ordinary skill in the art will understand the specific meanings of these terms in this application.

[0090] The terms "first," "second," "third," "fourth," etc. (if any) in this application are used to distinguish similar objects and are not necessarily used to describe a particular sequential order.

[0091] The term "and / or" in this application simply describes an association between related objects, indicating that three possible relationships exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this application generally indicates that the related objects are in an "or" relationship.

[0092] Unless otherwise specified, all steps of this application may be performed sequentially or randomly. For example, "the method includes steps A and B" means that the method may include steps A and B performed sequentially, or may include steps B and A performed sequentially. For example, "the method may also include step C" means that step C may be added to the method in any order. For example, the method may include steps A, B, and C, or steps A, C, and B, or steps C, A, and B, etc.

[0093] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A flow monitoring method, characterized in that: The method comprises: Parsing the enabling configuration instruction sent by the host computer through the monitoring module, wherein the enabling configuration instruction is configured based on the system resources of the vehicle controller, and the enabling configuration instruction includes at least enabling configuration information of the sniffing module; Enabling the sniffing module based on the enabling configuration information of the sniffing module, capturing the Ethernet raw data in the vehicle controller through the enabled sniffing module, and directly accessing the Ethernet raw data in the ring buffer by embedding a hook function in a sending or receiving callback; Converting the Ethernet raw data into Ethernet data in a preset format through a dump module; The Ethernet data in the preset format is sent to a host computer through a forwarding module, so that the host computer performs flow monitoring on the vehicle controller based on the Ethernet data.

2. The method according to claim 1, characterized in that The enabling configuration instruction also includes enabling configuration information of a dump module, and the converting of the Ethernet raw data into Ethernet data in a preset format by the dump module includes: Based on the enabling configuration information of the dump module, enabling the dump module and configuring data filtering rules and data conversion rules of the dump module; Based on the data filtering rule, filtering the Ethernet original data by the enabled dump module to obtain filtered Ethernet original data; Based on the data conversion rule, the filtered Ethernet raw data is converted into Ethernet data in a preset format through the enabled dump module.

3. The method according to claim 1 or 2, characterized in that The enabling configuration instruction also includes enabling configuration information of a forwarding module, and the forwarding module sends the Ethernet data in a preset format to a host computer so that the host computer performs flow monitoring on the vehicle controller based on the Ethernet data, including: Based on the enabling configuration information of the forwarding module, enabling the forwarding module and configuring data forwarding rules of the forwarding module; Based on the data forwarding rule, the Ethernet data in the preset format is sent to a host computer through the enabled forwarding module, so that the host computer monitors the flow of the vehicle controller based on the Ethernet data.

4. The method according to claim 3, characterized in that The method further includes: before sending the Ethernet data in the preset format to the host computer through the enabled forwarding module based on the data forwarding rule: The forwarding module after triggering is enabled establishes a TCP connection with the host computer.

5. The method according to claim 1, wherein After the enabled sniffing module captures the Ethernet raw data in the vehicle controller, the method further includes: The Ethernet original data is copied to the cache space of the dump module through the enabled sniffing module.

6. The method according to claim 5, characterized in that The method further comprises: In the process of the enabled sniffing module copying the Ethernet original data to the cache space of the dump module, detecting whether the cache space is full; If it is full, the enabled sniffing module calls back the dump process of the dump module to store the Ethernet raw data in the non-volatile memory.

7. A flow monitoring system, characterized in that: The system comprises: A monitoring module, configured to parse an enabling configuration instruction sent by a host computer, wherein the enabling configuration instruction is configured based on the system resources of the vehicle controller, and the enabling configuration instruction includes at least enabling configuration information of the sniffing module; A sniffing module, configured to enable the sniffing module based on the enabling configuration information of the sniffing module, and capture the Ethernet raw data in the vehicle controller through the enabled sniffing module, wherein the sniffing module directly accesses the Ethernet raw data in the ring buffer by embedding a hook function in a sending or receiving callback; A dump module, configured to convert the Ethernet raw data into Ethernet data in a preset format; The forwarding module is used to send the Ethernet data in the preset format to a host computer, so that the host computer can monitor the flow of the vehicle controller based on the Ethernet data.

8. A vehicle, characterized in that: comprising a processor and a memory, wherein Memory for storing computer programs; A processor, configured to execute a program stored in a memory to implement the method described in any one of claims 1 to 6.

9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.