Data acquisition method and device, vehicle and storage medium

By integrating the switching chip in the vehicle and using its port to connect with the ECU to obtain and process data, the problem of high collection cost and inability to collect vehicle data in the existing technology is solved, and efficient vehicle data collection is achieved.

CN118540293APending Publication Date: 2024-08-23CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410378864.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-29
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing technology, when the wiring harness between the electronic controller units in the vehicle Ethernet is disconnected to collect data, the entire vehicle wiring harness will be damaged, the entire vehicle data cannot be collected, and the cost of the collection equipment is high.

Method used

By integrating the switching chip in the first electronic controller unit of the vehicle, using the two ports of the switching chip to electrically connect with the second ECU, the collection requirements are obtained, the port to be collected is determined, and the original collection data is obtained through the port, according to the data type Mirror data processing is performed with the port number to realize the collection of vehicle data.

Benefits of technology

It realizes the collection of vehicle data, reduces the cost and difficulty of collection, avoids the addition of additional equipment, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540293A
    Figure CN118540293A
Patent Text Reader

Abstract

The invention discloses a data acquisition method and device, a vehicle and a storage medium, and relates to the technical field of vehicle control. The data acquisition method comprises the following steps: an exchange chip obtains an acquisition demand; determining a to-be-acquired port, and acquiring original acquisition data sent by a second ECU corresponding to the to-be-acquired port through the to-be-acquired port; determining mirror image data according to the original collection data, the data type and the port number; and realizing data acquisition according to the mirror image data and the field names. According to the technical scheme provided by the invention, the original collection data is filtered according to the collection demand, the collection function of the vehicle data is realized, no additional collection equipment is added, the collection cost and the collection difficulty are further reduced, the problems that the collection cost is relatively high and the vehicle data cannot be collected in the prior art are solved, and the collection efficiency is improved. And the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle control technology, and in particular to a data acquisition method, device, vehicle and storage medium. Background Art

[0002] With the evolution of automotive intelligence, the electronic and electrical architecture is also constantly upgrading. In-vehicle Ethernet and service-oriented architecture (SOA) have become the mainstream of in-vehicle communications.

[0003] In the prior art, the wiring harnesses between the electronic control units (ECUs) in the vehicle Ethernet are disconnected, and the collection equipment is connected in series at the disconnection point to realize the vehicle driving data collection function. However, the above method has the following disadvantages: 1. It will damage the wiring harness of the whole vehicle; 2. Due to the point-to-point communication of Ethernet, the above method can only collect one channel of data, which cannot meet the needs of collecting and analyzing the whole vehicle data; 3. The collection equipment is expensive and the cost is high. Summary of the invention

[0004] The embodiments of the present application provide a data collection method, device, vehicle and storage medium to solve the problems of high collection cost and inability to collect whole vehicle data in the prior art.

[0005] In a first aspect, an embodiment of the present application provides a data acquisition method, which is applied to a switching chip, the switching chip is integrated in a first electronic controller unit ECU of a vehicle, the switching chip includes at least two ports, one port is electrically connected to a second ECU of a vehicle, and the method includes:

[0006] Obtaining collection requirements, where the collection requirements include data type, port number, and field name corresponding to the data type;

[0007] Determine the port to be collected, and obtain the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected;

[0008] Determine the mirror data according to the original collected data, data type and port number;

[0009] Data collection is achieved based on mirror data and field names.

[0010] In the technical solution of the embodiment of the present application, the switching chip can obtain the collection requirements; determine the port to be collected, and obtain the original collection data sent by the second ECU corresponding to the port to be collected through the port to be collected; determine the mirror data according to the original collection data, data type and port number; and realize data collection according to the mirror data and field name. In the above technical solution, the user's collection requirements, that is, the data type, port number and field name corresponding to the data type can be obtained, and the port to be collected can be determined according to the user's collection requirements, and then the data sent to the port to be collected by the second ECU corresponding to the port to be collected is obtained to obtain the original collection data, and the original collection data is processed according to the data type and port number in the collection requirements to obtain the mirror data, and finally the mirror data is processed according to the field name in the collection requirements, and the mirror data matching the field name is extracted, so as to realize data collection, realize the collection function of the whole vehicle data, and do not add additional collection equipment, thereby reducing the collection cost and collection difficulty, solving the problems of high collection cost and inability to collect whole vehicle data in the prior art, thereby improving the user experience.

[0011] In a second aspect, an embodiment of the present application provides a data acquisition device, which is applied to a switching chip, the switching chip is integrated in a first electronic controller unit ECU of a vehicle, the switching chip includes at least two ports, one port is electrically connected to a second ECU of a vehicle, and the device includes:

[0012] A first acquisition module is used to acquire collection requirements, wherein the collection requirements include data types, port numbers, and field names corresponding to the data types;

[0013] The second acquisition module is used to determine the port to be collected, and obtain the original collection data sent by the second ECU corresponding to the port to be collected through the port to be collected;

[0014] A data determination module, used to determine the mirror data according to the original collected data, data type and port number;

[0015] The data collection module is used to collect data based on the mirror data and field names.

[0016] In a third aspect, an embodiment of the present application provides a vehicle, the vehicle comprising:

[0017] at least one processor; and a memory communicatively coupled to the at least one processor;

[0018] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the data collection method of any embodiment of the present application.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to implement the data collection method of any embodiment of the present application when executed by a processor.

[0020] The description of the second, third and fourth aspects in this application can refer to the detailed description of the first aspect; and the beneficial effects described in the second, third and fourth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.

[0021] In this application, the name of the above data acquisition device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalent technologies.

[0022] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 It is a flow chart of the data collection method provided in the embodiment of the present application;

[0025] Figure 2 is a structural schematic diagram of a vehicle provided in an embodiment of the present application;

[0026] Figure 3 is another flow chart of the data collection method provided in the embodiment of the present application;

[0027] Figure 4 This is an example diagram of using the CPU of a switching chip to collect data provided by an embodiment of the present application;

[0028] Figure 5 It is another flowchart of the data collection method provided in the embodiment of the present application;

[0029] Figure 6 This is an example diagram of using the CPU of the first ECU to collect data provided by an embodiment of the present application;

[0030] Figure 7 It is a structural schematic diagram of a data acquisition device provided in an embodiment of the present application;

[0031] Figure 8 It is another structural schematic diagram of the vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0033] It should be noted that the terms "first", "second", "target", and "original" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having", and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0034] Figure 1 This is a flow chart of the data acquisition method provided by an embodiment of the present application. This embodiment can be applied to the scenario where the data of each ECU needs to be collected when each ECU of the vehicle communicates data via the vehicle Ethernet. A data acquisition method provided by this embodiment can be executed by a data acquisition device provided by an embodiment of the present application, and the device can be implemented by software and / or hardware. In a specific embodiment, the data acquisition device can be integrated in the vehicle.

[0035] In a specific embodiment, the structure of the vehicle can be as follows Figure 2 As shown, Figure 2 The vehicle shown includes a switching chip 210, a first ECU 220, and a second ECU, wherein the switching chip 210 is integrated in the first ECU 220 and is mainly used for data forwarding, and the switching chip 210 includes at least two ports, one of which is electrically connected to a second ECU; each ECU in the vehicle communicates data via the vehicle Ethernet; each ECU in the vehicle can be divided into two categories, namely, the first ECU 220 and the second ECU, and the second ECU can be one or more, for example, Figure 2The second ECU shown includes a second ECUa 230 , a second ECUb 240 , a second ECUc 250 , and a second ECUd 260 , and each second ECU is electrically connected to a different port.

[0036] It should be noted that, among the various ECUs in the vehicle, any ECU including the switching chip 210 can serve as the first ECU 220 .

[0037] Combine the following Figure 2 The vehicle shown in the figure is used to illustrate a data collection method provided by an embodiment of the present application. The execution subject of the method can be the switching chip 210 of the vehicle. Figure 1 The data collection method of this embodiment includes but is not limited to the following steps:

[0038] S110: Obtain collection requirements.

[0039] The collection requirements include data type, port number and field name corresponding to the data type. The data type is the message type corresponding to the data transmitted by each ECU of the vehicle using the vehicle Ethernet. For example, the data type can be User Datagram Protocol (UDP) or Transmission Control Protocol (TCP); the port number is the port number corresponding to the data type. For example, the port number of UDP can be 30005; the field name corresponding to the data type is the message type (MessageType) corresponding to the data to be collected. For example, the field name can be Request, Response, Error or Notification, etc.

[0040] Specifically, when collecting data from each second ECU in the vehicle, it is necessary to obtain the user's collection requirements. At this time, the switching chip 210 can generate a collection requirement acquisition instruction, and search the pre-stored mapping table to obtain the port corresponding to the vehicle display screen, and then send the collection requirement acquisition instruction to the vehicle display screen through the port corresponding to the vehicle display screen; thereafter, the vehicle display screen can receive the collection requirement acquisition instruction and display the collection prompt information. At this time, the user can enter the collection requirement information on the vehicle display screen according to the collection prompt information, such as the second ECU to be collected, the data type, the port number, and the field name corresponding to the data type.

[0041] Afterwards, the vehicle-mounted display screen can obtain the collection requirements input by the user and send the collection requirements to the switching chip 210 .

[0042] Among them, the acquisition instruction of the collection requirement is an acquisition command generated by the switching chip 210, which is used to obtain the user's collection requirements. The mapping table is a pre-created mapping table, which is used to store the mapping relationship between each second ECU and the port number. The port corresponding to the vehicle display screen is the port of the switching chip 210 that is electrically connected to the vehicle display screen. The collection prompt information is information used to prompt the user to enter the collection requirements, and may include content that the user must enter. Exemplarily, the collection prompt information may be "Please enter the name of the device to be collected, as well as the data type, port number and field name corresponding to the data type corresponding to the data to be collected, etc.", where the device to be collected is the second ECU to be collected. The second ECU to be collected is the device that needs to collect data.

[0043] S120: Determine the port to be collected, and obtain the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected.

[0044] The port to be collected is a port of the switching chip 210 that is electrically connected to the second ECU to be collected, that is, the second ECU to be collected transmits data with another second ECU using the port to be collected.

[0045] The original collected data is the data transmitted by the second ECU to be collected using the port to be collected.

[0046] The second ECU corresponding to the port to be collected is a second ECU electrically connected to the port to be collected, that is, the second ECU to be collected.

[0047] Specifically, after obtaining the collection requirement, the port to be collected can be determined. For example, the second ECU to be collected in the collection requirement can be extracted, and the port electrically connected to the second ECU to be collected is obtained in a pre-stored mapping table, and the port is determined as the port to be collected.

[0048] Afterwards, the data sent by the second ECU corresponding to the port to be collected can be obtained through the port to be collected, that is, the data transmitted by the second ECU to be collected through the port to be collected is obtained to obtain the original collected data.

[0049] It should be noted that when the switching chip 210 collects the data to be collected, it also needs to perform normal data forwarding, that is, forward the original collected data to the corresponding second ECU.

[0050] Optionally, after acquiring the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected, the target port corresponding to the original collected data can be determined; and the original collected data can be sent to the second ECU corresponding to the target port through the target port.

[0051] The target port is a port for receiving the original collected data among the ports of the switching chip 210. The second ECU corresponding to the target port is a second ECU electrically connected to the target port.

[0052] Specifically, after obtaining the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected, the message of the original collected data can be parsed, that is, the original collected data is parsed according to the message format of the original collected data, and then the field content of the destination port (Destination Port) in the original collected data is extracted to obtain the target port corresponding to the original collected data, and then the pre-stored mapping table is searched to obtain the second ECU corresponding to the target port, and the original collected data is sent to the second ECU corresponding to the target port through the target port.

[0053] Exemplarily, if the port to be collected is port 1, the second ECU corresponding to port 1 is the second ECUa230, the field content of the destination port in the original collected data is port 3, and the second ECU corresponding to port 3 is the second ECUc250, then the target port corresponding to the original collected data is port 3, and the second ECU corresponding to the target port is the second ECUc250; after the switching chip 210 receives the original collected data of the second ECUa230 through port 1, it can send the original collected data to the second ECUc250 through port 3, thereby realizing data transmission between the second ECUa230 and the second ECUc250.

[0054] S130: Determine mirror data according to the original collected data, data type and port number.

[0055] The mirror data is the data obtained by filtering the original collected data according to the data type and the port number, that is, the data of the specified data type and the specified port number in the original collected data.

[0056] Specifically, after obtaining the original collected data, the original collected data can be processed according to the data type and port number in the collection requirement. For example, data matching the data type in the collection requirement can be extracted from the original collected data, or data matching the port number in the collection requirement can be extracted from the original collected data to obtain mirror data.

[0057] S140: Data collection is implemented according to the mirror data and field names.

[0058] Specifically, after the mirror data is obtained, the mirror data may be processed according to the field names in the collection requirements. For example, the mirror data matching the field names in the collection requirements may be extracted from the mirror data, thereby realizing data collection.

[0059] In the technical solution of the embodiment of the present application, the switching chip can obtain the collection requirements; determine the port to be collected, and obtain the original collection data sent by the second ECU corresponding to the port to be collected through the port to be collected; determine the mirror data according to the original collection data, data type and port number; and realize data collection according to the mirror data and field name. In the above technical solution, the user's collection requirements, that is, the data type, port number and field name corresponding to the data type can be obtained, and the port to be collected can be determined according to the user's collection requirements, and then the data sent to the port to be collected by the second ECU corresponding to the port to be collected is obtained to obtain the original collection data, and the original collection data is processed according to the data type and port number in the collection requirements to obtain the mirror data, and finally the mirror data is processed according to the field name in the collection requirements, and the mirror data matching the field name is extracted, so as to realize data collection, realize the collection function of the whole vehicle data, and do not add additional collection equipment, thereby reducing the collection cost and collection difficulty, solving the problems of high collection cost and inability to collect whole vehicle data in the prior art, thereby improving the user experience.

[0060] The following further describes a data collection method provided by an embodiment of the present application. Figure 3 1 is another flow chart of the data collection method provided in the embodiment of the present application. The embodiment of the present application is optimized on the basis of the above embodiments.

[0061] See also Figure 3 The data collection method of this embodiment includes but is not limited to the following steps:

[0062] S310: Obtain collection requirements.

[0063] S320: Determine the port to be collected, and obtain the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected.

[0064] The implementation process and technical principle of S310 and S320 are the same as those of S110 and S120, and will not be repeated here.

[0065] It should be noted that when each second ECU transmits data using the vehicle Ethernet, it will sequentially pass through the five-layer model structure of the vehicle Ethernet, namely the physical layer, data link layer, network layer, transport layer and application layer. Therefore, when transmitting data at the physical layer, data link layer and network layer, the message type of the data can be determined by the message structure of the data.

[0066] S330: Filter the original collected data according to the data type and the port number to obtain mirrored data.

[0067] Specifically, after obtaining the original collected data, the original collected data can be filtered according to the data type and port number, that is, during the transmission process, the message of the original collected data can be analyzed at the network layer to determine the message type of the original collected data according to the message structure of the original collected data, and extract the field content of the source port and the field content of the destination port of the original collected data, and then match the data type and port number in the collection requirements with the message type, the field content of the source port and the field content of the destination port of the original collected data respectively, extract the data whose message type is the data type and the field content of the source port is the port number, and the data whose message type is the data type and the field content of the destination port is the port number, and obtain the mirrored data.

[0068] S340: According to the field name, the central processing unit (CPU) of the switching chip is used to filter the mirror data to obtain target collection data.

[0069] The target collection data is the data to be collected in the mirror data, that is, the data after the mirror data is filtered according to the field name, that is, the data whose message type in the mirror data is the field name.

[0070] Specifically, after obtaining the mirror data, the CPU of the switching chip 210 can be used to mirror the mirror data, and then the mirror data can be filtered based on the field name, that is, the CPU of the switching chip 210 can determine the application layer protocol type of the mirror data, and parse the mirror data according to the message format corresponding to the application layer protocol type, extract the field content of the message type of the mirror data, and then match the field name in the collection requirement with the field content of the message type of the mirror data, extract the mirror data whose field content of the message type matches the field name, and obtain the target collection data.

[0071] S350: Generate target log information according to the target collection data and the current time.

[0072] The current time is the time when the target collection data is obtained. The target log information is information generated by the target collection data and the current time.

[0073] Specifically, after obtaining the target collection data, target log information can be generated based on the target collection data and the current time, that is, the field content of important fields can be extracted from the target collection data according to the message format corresponding to the application layer protocol type, and then the extracted field content and the corresponding current time can be combined into log data to obtain the target log information corresponding to the target collection data.

[0074] Exemplarily, when the application layer protocol type is SOME / IP (Scalable service-oriented middleware over IP), important fields may include Service ID, Method ID / Event ID, Payload and other field information; after obtaining the target collection data, the field contents of Service ID, Method ID / Event ID, Payload and other fields may be extracted from the target collection data according to the message format of SOME / IP, and the extracted field contents and the corresponding current time may be combined into the target log information. Among them, SOME / IP is a service-oriented middleware defined on the transport layer (TCP / UDP), which is an important content in the automotive Ethernet service-oriented architecture SOA; the SOME / IP message mainly includes the message header (Header) and the message body (Payload); the message header mainly includes the fields of Service ID, Method ID / Event ID, Length, Client ID, Session ID and Message Type.

[0075] S360: Send the target log information to the second ECU corresponding to the transmission port through the transmission port.

[0076] The second ECU corresponding to the transmission port is communicatively connected with the cloud server. Exemplarily, the second ECU corresponding to the transmission port may be a vehicle-mounted electrical component (Telematics BOX, referred to as vehicle-mounted T-BOX).

[0077] Specifically, after the target log information is obtained, the transmission port may be determined from a pre-stored mapping table, and the target log information may be sent to the second ECU corresponding to the transmission port through the transmission port.

[0078] Afterwards, the second ECU corresponding to the transmission port can receive the target log information and upload the target log information to the cloud server; after receiving the target log information sent by the second ECU corresponding to the transmission port, the cloud server can store the target log information to save the target log information.

[0079] For example, Figure 4 FIG. 1 is an example diagram of using the CPU of a switching chip to collect data according to an embodiment of the present application. Figure 4It includes a switching chip 210, a second ECUa230, a second ECUb240, a second ECUc250 and a second ECUd260; the switching chip 210 includes a CPU and 4 ports, and each port is electrically connected to a second ECU, that is, port 1 is electrically connected to the second ECUa230, port 2 is electrically connected to the second ECUb240, port 3 is electrically connected to the second ECUc250, and port 4 is electrically connected to the second ECUd260.

[0080] Figure 4 It shows the process of data collection using the CPU of the switching chip 210, that is, the data sent from the second ECUa230 to the second ECUc250, the collection data type is UDP, the port number is 30005, the application layer protocol is SOME / IP, and the field name is Request data, wherein port 1 is the port to be collected, the second ECUa230 is the second ECU corresponding to the port to be collected, port 3 is the target port, the second ECUc250 is the second ECU corresponding to the target port, port 4 is the transmission port, and the second ECUd260 is the second ECU corresponding to the transmission port.

[0081] The data collection process is as follows: when the second ECUa230 transmits the original collected data to the second ECUc250 through the switching chip 210, the switching chip 210 performs normal data forwarding and collects the data to be collected at the same time, that is, the switching chip 210 receives the original collected data sent by the second ECUa230 through port 1, and sends the original collected data to the second ECUc250 through port 3; at the same time, the switching chip 210 determines the original collected data with a message type of UDP and a source port of 30005, or a message type of UDP and a destination port of 30005, as mirror data, and then uses the CPU of the switching chip 210 to determine the mirror data with a message type of Request as the target collected data, and then extracts the field content of important fields from the target collected data, such as Service ID, Method ID / Event The field contents of fields such as ID and Payload are extracted, and the extracted field contents and the current time are combined into the target log information, and finally the target log information is sent to the second ECUd260 through port 4; after receiving the target log information, the second ECUd260 uploads the target log information to the cloud server so that the cloud server stores the target log information, thereby realizing the data collection function.

[0082] According to the technical solution of the embodiment of the present application, the switching chip can obtain the user's collection requirements, that is, the data type, port number and field content corresponding to the data type, and determine the port to be collected according to the collection requirements, and then obtain the original collection data sent by the second ECU corresponding to the port to be collected through the port to be collected, and then filter the original collection data according to the data type and port number in the collection requirements, that is, the message type of the original collection data can be determined, and the original collection data is parsed according to the corresponding message format, and the field content of the source port and the field content of the destination port are extracted, and then the data type and port number are matched with the message type of the original collection data, the field content of the source port and the field content of the destination port respectively, and the data matching the data type and port number are extracted to obtain the mirror data, thereby realizing the function of filtering the original collection data according to the data type and port number, reducing the amount of data to be mirrored, saving computing resources, and thus improving the efficiency and accuracy of data collection; the CPU of the switching chip is used to filter the mirror data based on the field name to obtain the target collection data, that is, the mirror data can be determined. According to the application layer protocol type of the data, and according to the message format corresponding to the application layer protocol type, the mirror data is parsed, the field content of the message type is extracted, and then the mirror data whose field content of the message type matches the field name is extracted to obtain the target collection data, realizing the function of filtering the mirror data according to the field name, reducing the amount of data to be collected, saving computing resources, and thus improving the efficiency and accuracy of data collection; then, the target log information is generated according to the target collection data and the current moment, realizing the collection function of the whole vehicle data, improving the management efficiency of the vehicle data through the target log information, facilitating the user to analyze the vehicle data, thereby improving the data analysis efficiency, and at the same time, no additional collection equipment is added, reducing the collection cost, and solving the problem of high collection cost and inability to collect whole vehicle data in the prior art; the target log information is sent to the second ECU corresponding to the transmission port through the transmission port, so that the second ECU corresponding to the transmission port uploads the data to the cloud server, realizing the off-site storage function of the collected data, saving local storage resources, and thereby improving the management efficiency of the collected data.

[0083] The following further describes a data collection method provided by an embodiment of the present application. Figure 5 This is another flow chart of the data collection method provided by the embodiment of the present application. The embodiment of the present application is optimized based on the above embodiments.

[0084] See also Figure 5 The data collection method of this embodiment includes but is not limited to the following steps:

[0085] S510: Obtain collection requirements.

[0086] S520: Determine the port to be collected, and obtain the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected.

[0087] The implementation process and technical principle of S510 and S520 are the same as those of S110 and S120, and will not be repeated here.

[0088] S530: Filter the original collected data according to the data type and the port number to obtain mirrored data.

[0089] The implementation process and technical principles of S530 are the same as those of S330, and will not be described in detail here.

[0090] S540, sending the mirror data and the field name to the CPU of the first ECU, so that the CPU of the first ECU filters the mirror data based on the field name to obtain the target collection data, and generates target log information according to the target collection data and the current time, and stores the target log information in the memory of the first ECU.

[0091] Specifically, after the mirror data is obtained, the mirror data and the field names in the collection requirements may be sent to the CPU of the first ECU 220 to implement data mirroring.

[0092] Afterwards, the CPU of the first ECU 220 can receive the mirror data and field names sent by the switching chip 210, determine the application layer protocol type of the mirror data, and parse the mirror data according to the message format corresponding to the application layer protocol type, extract the field content of the message type of the mirror data, and then match the field name with the field content of the message type of the mirror data, extract the mirror data whose field content of the message type matches the field name, and obtain the target collection data, and finally generate the target log information according to the target collection data and the current time, that is, the field content of important fields can be extracted from the target collection data according to the message format corresponding to the application layer protocol type, and then the extracted field content and the corresponding current time are combined into log data to obtain the target log information corresponding to the target collection data.

[0093] Afterwards, the CPU of the first ECU 220 may store the target log information into the memory of the first ECU 220 to save the target log information.

[0094] Optionally, after generating target log information according to the target collection data and the current moment, the CPU of the first ECU 220 may send the target log information to the switching chip 210 .

[0095] S550: Receive target log information sent by the first ECU.

[0096] Specifically, after the CPU of the first ECU 220 sends the target log information to the switching chip 210 , the switching chip 210 may receive the target log information sent by the first ECU 220 .

[0097] S560: Send the target log information to the second ECU corresponding to the transmission port through the transmission port.

[0098] Specifically, after receiving the target log information sent by the first ECU 220 , a transmission port may be determined from a pre-stored mapping table, and the target log information may be sent to the second ECU corresponding to the transmission port through the transmission port.

[0099] Afterwards, the second ECU corresponding to the transmission port can receive the target log information and upload the target log information to the cloud server; after receiving the target log information sent by the second ECU corresponding to the transmission port, the cloud server can store the target log information to save the target log information.

[0100] For example, Figure 6 FIG. 1 is an example diagram of using the CPU of the first ECU to collect data provided by an embodiment of the present application. Figure 6 It includes a first ECU220, a second ECUa230, a second ECUb240, a second ECUc250 and a second ECUd260; the first ECU220 includes a CPU, a switching chip 210 and a memory, and the switching chip 210 includes 4 ports, namely, port 1 is electrically connected to the second ECUa230, port 2 is electrically connected to the second ECUb240, port 3 is electrically connected to the second ECUc250, and port 4 is electrically connected to the second ECUd260.

[0101] Figure 6 It shows the process of data collection using the CPU of the first ECU220, that is, the data sent from the second ECUa230 to the second ECUc250, the collection data type is UDP, the port number is 20001, the application layer protocol is SOME / IP, and the field name is Response, wherein port 1 is the port to be collected, the second ECUa230 is the second ECU corresponding to the port to be collected, port 3 is the target port, the second ECUc250 is the second ECU corresponding to the target port, port 4 is the transmission port, and the second ECUd260 is the second ECU corresponding to the transmission port.

[0102] The data collection process is as follows: when the second ECUa230 transmits the original collected data to the second ECUc250 through the switching chip 210, the switching chip 210 performs normal data forwarding, and at the same time sends the mirror data and field names to be collected to the CPU of the first ECU220, so that the CPU of the first ECU220 collects the data, that is, the switching chip 210 receives the original collected data sent by the second ECUa230 through port 1, and sends the original collected data to the second ECUc250 through port 3; at the same time, the switching chip 210 determines the original collected data with a message type of UDP and a source port of 20001, or a message type of UDP and a destination port of 20001, as mirror data, and sends the mirror data and field names to the CPU of the first ECU220; then the CPU of the first ECU220 determines the mirror data with a message type of Response as the target collected data, and then extracts the field contents of important fields from the target collected data, such as Service ID, Method ID / Event The field contents of fields such as ID and Payload are extracted, and the extracted field contents and the current time are combined into the target log information, and finally the target log information is saved to the memory, so as to realize the data collection function; or, the target log information is sent to the switching chip 210, and after receiving the target log information, the switching chip 210 sends the target log information to the second ECUd260 through port 4; after receiving the target log information, the second ECUd260 uploads the target log information to the cloud server, so that the cloud server stores the target log information, so as to realize the data collection function.

[0103] According to the technical solution of the embodiment of the present application, the switching chip can obtain the user's collection requirements, that is, the data type, port number and field content corresponding to the data type, and determine the port to be collected according to the collection requirements, then obtain the original collection data sent by the second ECU corresponding to the port to be collected through the port to be collected, and then filter the original collection data according to the data type and port number in the collection requirements to obtain mirror data, thereby realizing the function of filtering the original collection data according to the data type and port number, reducing the amount of data that needs to be mirrored, saving computing resources, and thus improving the efficiency and accuracy of data collection; sending the mirror data and field name to the CPU of the first ECU, so that the CPU of the first ECU can filter the mirror data based on the field name to obtain the target collection data, that is, determine the application layer protocol type of the mirror data, and parse the mirror data according to the message format corresponding to the application layer protocol type, extract the field content of the message type of the mirror data, and then extract the mirror data whose field content of the message type matches the field name to obtain the target collection data. According to the invention, the function of filtering the mirror data based on the field name by using the CPU of the first ECU is realized, the amount of data to be collected is reduced, the computing resources of the first ECU are saved, and the efficiency and accuracy of data collection are improved; thereafter, the CPU of the first ECU can generate the target log data of the target collection data and the current moment, and store the target log information in the memory of the first ECU, thereby realizing the local storage function of the collected data, which is convenient for users to monitor the vehicle data in real time, and then timely understand the vehicle status, thereby improving the data analysis efficiency, and at the same time, no additional collection equipment is added, the collection cost is reduced, and the problems of high collection cost and inability to collect whole vehicle data in the prior art are solved; thereafter, the switching chip can receive the target log information sent by the first ECU, and send the target log information to the second ECU corresponding to the transmission port through the transmission port, so that the second ECU corresponding to the transmission port uploads the target log information to the cloud server, thereby realizing the off-site storage function of the collected data, saving local storage resources, and thus improving the management efficiency of the collected data.

[0104] Figure 7 is a structural diagram of a data acquisition device provided in an embodiment of the present application, referring to Figure 7 , the data acquisition device may include:

[0105] The first acquisition module 710 is used to acquire collection requirements, wherein the collection requirements include data types, port numbers, and field names corresponding to the data types;

[0106] The second acquisition module 720 is used to determine the port to be collected, and obtain the original collection data sent by the second ECU corresponding to the port to be collected through the port to be collected;

[0107] The data determination module 730 is used to determine the mirror data according to the original collected data, the data type and the port number;

[0108] The data collection module 740 is used to collect data according to the mirror data and field names.

[0109] Optionally, the data determination module 730 is specifically used for:

[0110] The original collected data is filtered according to the data type and port number to obtain the mirrored data.

[0111] Optionally, the data acquisition module 740 is specifically used for:

[0112] According to the field name, the central processing unit (CPU) of the switching chip is used to filter the mirror data to obtain the target collection data;

[0113] Generate target log information based on target collection data and current time.

[0114] Optionally, the data acquisition module 740 is further used for:

[0115] The mirror data and the field name are sent to the CPU of the first ECU, so that the CPU of the first ECU filters the mirror data based on the field name to obtain the target collection data, and generates target log information according to the target collection data and the current moment, and stores the target log information in the memory of the first ECU.

[0116] Optionally, the data acquisition device further includes a first storage module, and the first storage module is specifically used for:

[0117] After the target log information is generated according to the target collection data and the current moment, the target log information is sent to the second ECU corresponding to the transmission port through the transmission port.

[0118] Optionally, the data acquisition device further includes a second storage module, and the second storage module is specifically used for:

[0119] After sending the mirror data and the field name to the CPU of the first ECU, receiving the target log information sent by the first ECU;

[0120] The target log information is sent to the second ECU corresponding to the transmission port through the transmission port.

[0121] Optionally, the data acquisition device further includes a data sending module, and the data sending module is specifically used for:

[0122] After acquiring the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected, determining the target port corresponding to the original collected data;

[0123] The original collected data is sent to the second ECU corresponding to the target port through the target port.

[0124] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0125] The data acquisition device provided in this embodiment can be applied to the data acquisition method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0126] Figure 8 It is another structural schematic diagram of the vehicle provided in an embodiment of the present application. Figure 8 A block diagram of an exemplary vehicle 11 suitable for implementing embodiments of the present application is shown. Figure 8 The vehicle 11 shown is merely an example and should not bring any limitation to the function and scope of use of the present embodiment.

[0127] like Figure 8 As shown, the vehicle 11 is embodied in the form of a general purpose computing electronic device. The components of the vehicle 11 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting various system components (including the system memory 28 and the processing unit 16).

[0128] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0129] The vehicle 11 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the vehicle 11, including volatile and non-volatile media, removable and non-removable media.

[0130] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The vehicle 11 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.

[0131] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0132] The vehicle 11 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the vehicle 11, and / or any device that enables the vehicle 11 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the vehicle 11 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20.

[0133] like Figure 8 As shown, the network adapter 20 communicates with other modules of the vehicle 11 via the bus 18. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with the vehicle 11, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0134] The processing unit 16 executes various functional applications and page displays by running the program stored in the system memory 28, for example, a data acquisition method provided in this embodiment is implemented, which is applied to a switching chip, the switching chip is integrated in a first electronic controller unit ECU of a vehicle, the switching chip includes at least two ports, one port is electrically connected to a second ECU of a vehicle, and the method includes:

[0135] Obtaining collection requirements, where the collection requirements include data type, port number, and field name corresponding to the data type;

[0136] Determine the port to be collected, and obtain the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected;

[0137] Determine the mirror data according to the original collected data, data type and port number;

[0138] Data collection is achieved based on mirror data and field names.

[0139] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the data acquisition method provided in any embodiment of the present application.

[0140] The present application provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, a data acquisition method provided by the present application is implemented, for example, and the method is applied to a switching chip, which is integrated in a first electronic controller unit ECU of a vehicle. The switching chip includes at least two ports, one of which is electrically connected to a second ECU of a vehicle. The method includes:

[0141] Obtaining collection requirements, where the collection requirements include data type, port number, and field name corresponding to the data type;

[0142] Determine the port to be collected, and obtain the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected;

[0143] Determine the mirror data according to the original collected data, data type and port number;

[0144] Data collection is achieved based on mirror data and field names.

[0145] The computer storage medium of this embodiment can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing programs, which can be used by instruction execution systems, devices or devices or used in combination with them.

[0146] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0147] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0148] Computer program code for performing the operation of the present application can be written in one or more programming languages ​​or combinations thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).

[0149] It should be understood by those skilled in the art that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0150] In addition, the acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0151] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the inventive concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A data collection method, characterized in that: Applied to a switching chip, the switching chip is integrated in a first electronic controller unit (ECU) of a vehicle, the switching chip comprises at least two ports, one of the ports is electrically connected to a second ECU of the vehicle; the method comprises: Acquire collection requirements, wherein the collection requirements include data type, port number, and field name corresponding to the data type; Determine a port to be collected, and obtain, through the port to be collected, original collected data sent by a second ECU corresponding to the port to be collected; Determining mirror data according to the original collected data, the data type and the port number; Data collection is achieved according to the mirror data and the field names.

2. The data collection method according to claim 1, characterized in that: The determining of the mirror data according to the original collected data, the data type and the port number includes: The original collected data is filtered according to the data type and the port number to obtain the mirror data.

3. The data collection method according to claim 1, characterized in that: The collecting of data according to the mirror data and the field name includes: According to the field name, the central processing unit (CPU) of the switching chip is used to filter the mirror data to obtain target acquisition data; Generate target log information based on the target collection data and the current time.

4. The data collection method according to claim 1, characterized in that: The collecting of data according to the mirror data and the field name includes: The mirror data and the field name are sent to the CPU of the first ECU, so that the CPU of the first ECU filters the mirror data based on the field name to obtain target collection data, generates target log information according to the target collection data and the current moment, and stores the target log information in the memory of the first ECU.

5. The data collection method according to claim 3, characterized in that: After generating target log information according to the target collection data and the current time, it also includes: The target log information is sent to a second ECU corresponding to the transmission port through a transmission port.

6. The data collection method according to claim 4, characterized in that: After sending the mirror data and the field name to the CPU of the first ECU, the method further includes: Receiving the target log information sent by the first ECU; The target log information is sent to a second ECU corresponding to the transmission port through a transmission port.

7. The data collection method according to claim 1, characterized in that: After acquiring the original collected data sent by the second ECU corresponding to the port to be collected through the port to be collected, the method further includes: Determine the target port corresponding to the original collected data; The original collected data is sent to a second ECU corresponding to the target port through the target port.

8. A data acquisition device, characterized in that: Applied to a switching chip, the switching chip is integrated in a first electronic controller unit (ECU) of a vehicle, the switching chip comprises at least two ports, one of the ports is electrically connected to a second ECU of the vehicle; the device comprises: A first acquisition module is used to acquire collection requirements, wherein the collection requirements include a data type, a port number, and a field name corresponding to the data type; A second acquisition module is used to determine a port to be collected, and obtain the original collection data sent by the second ECU corresponding to the port to be collected through the port to be collected; A data determination module, used to determine the mirror data according to the original collected data, the data type and the port number; The data collection module is used to collect data according to the mirror data and the field name.

9. A vehicle, characterized in that: The vehicle comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data collection method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data collection method described in any one of claims 1 to 7 when executed.