Method and apparatus for collecting vehicle sensor data, vehicle, storage medium
By receiving, instantiating, and caching vehicle sensor data, and sending it using an efficient protocol, the problem of embedded devices being unable to transfer data in real time is solved, achieving efficient data acquisition and transmission.
Patent Information
- Application Number
- CN202210735029.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-06-27
Smart Images

Figure CN115218954B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of vehicle sensor data collection, and in particular, to a method and apparatus for collecting vehicle sensor data, a vehicle, and a storage medium. BACKGROUND
[0002] Big data is increasingly changing people's lives, but many embedded devices manufactured according to traditional architecture do not generally have the ability to transfer high-frequency data to cloud servers in real time. The improvement of big data platform computing power and the accuracy of machine learning algorithms have given rise to the demand for big data analysis in vehicles and offline experiments, and thus a large amount of high-quality, high-sampling-frequency data is needed in the process of new energy vehicle big data analysis.
[0003] Therefore, an improved vehicle sensor data collection method needs to be proposed. SUMMARY
[0004] Embodiments of the present application provide a method and apparatus for collecting vehicle sensor data, a vehicle, and a storage medium, for realizing data collection of vehicle sensors.
[0005] According to an aspect of the present application, a method for collecting vehicle sensor data is provided. The method comprises: receiving data collected by at least one sensor; instantiating the received data according to a predetermined format to generate sensor information; caching the sensor information based on configuration information indicating a caching strategy; and packaging and sending the cached sensor information.
[0006] In some embodiments of the present application, optionally, instantiating the received data according to a predetermined format comprises: mapping the received data to a plurality of parsed callable physical quantities in the sensor information.
[0007] In some embodiments of the present application, optionally, caching the sensor information based on configuration information indicating a caching strategy comprises: requesting configuration information from a control unit or a data collection device of the vehicle; comparing the configuration information with current configuration information; in the case where the configuration information is the same as the current configuration information, caching the sensor information with a current caching strategy corresponding to the current configuration information; and in the case where the configuration information is different from the current configuration information, forming an updated caching strategy according to the configuration information, and caching the sensor information with the updated caching strategy.
[0008] In some embodiments of the present application, optionally, the configuration information comprises a specification of a predetermined event triggering a caching operation.
[0009] In some embodiments of the present application, the caching the sensor information based on the configuration information indicative of a caching policy further comprises: receiving registration information for the sensor, wherein the registration information comprises a sampling frequency of the sensor and a sending frequency for the sensor information; and receiving the sensor information according to the sampling frequency and caching; and the packaging and sending the cached sensor information comprises sending the cached sensor information according to the sending frequency.
[0010] In some embodiments of the present application, the receiving the sensor information according to the sampling frequency and caching comprises: in a case that the sampling frequency is equal to or higher than the sending frequency, receiving the sensor information based on the predetermined event at the sampling frequency and performing a first level caching, and forming a second level caching according to addresses of the sensor information in the first level caching; and the packaging and sending the cached sensor information according to the sending frequency comprises: sending the sensor information in the second level caching according to the sending frequency; and in a case that the sampling frequency is lower than the sending frequency, polling the sensor information based on the predetermined event at the sampling frequency and caching.
[0011] In some embodiments of the present application, the sensor comprises at least one of: a motor sensor, a steering sensor, a speed sensor, an acceleration sensor, a throttle pedal opening degree sensor, a brake pedal opening degree sensor, a battery sensor, a temperature sensor.
[0012] In some embodiments of the present application, the packaging and sending the cached sensor information comprises packaging and sending the cached sensor information based on a CANFD protocol, a TCP protocol or a UDP protocol.
[0013] According to another aspect of the present application, there is provided an apparatus for collecting sensor data of a vehicle. The apparatus comprises a first communication unit configured to receive data collected by at least one sensor; a proxy unit configured to instantiate the data received by the first communication unit according to a predetermined format to generate sensor information; a caching unit configured to cache the sensor information based on configuration information indicative of a caching policy; and a second communication unit configured to package and send the cached sensor information.
[0014] In some embodiments of the present application, optionally, the second communication unit is further configured to request the configuration information from a control unit or a data acquisition device of the vehicle; the cache unit is configured to compare the configuration information with current configuration information saved in the cache unit, and in the case that the configuration information is the same as the current configuration information, cache the sensor information with a current cache strategy corresponding to the current configuration information; and in the case that the configuration information is different from the current configuration information, form an updated cache strategy according to the configuration information, and cache the sensor information with the updated cache strategy.
[0015] In some embodiments of the present application, optionally, the second communication unit is configured to receive registration information of the sensor from a control unit or a data acquisition device of the vehicle, wherein the registration information comprises a sampling frequency of the sensor and a sending frequency of the sensor data; the cache unit is configured to receive and cache the sensor information according to the sampling frequency; and the second communication unit is configured to send the cached sensor information according to the sending frequency.
[0016] According to another aspect of the present application, a vehicle is provided. The vehicle comprises any one of the apparatuses for collecting sensor data of a vehicle as described above.
[0017] According to another aspect of the present application, a computer readable storage medium is provided, wherein instructions are stored in the computer readable storage medium, and when the instructions are executed by a processor, the processor performs any one of the methods as described above.
[0018] The method and apparatus for collecting sensor data of a vehicle, the vehicle, and the storage medium according to some aspects of the present application can realize efficient collection of data of sensors of a vehicle, and can send the sensor information to a subsequent processing device for further analysis. This method encapsulates the originally circulated sensor data in the vehicle into externally callable sensor information, thereby providing convenience for data analysis. BRIEF DESCRIPTION OF DRAWINGS
[0019] The above and other objects and advantages of the present application will become more apparent by describing in detail the following embodiments thereof in connection with the accompanying drawings, in which like reference numerals refer to like elements throughout the several views.
[0020] Figure 1 A method for collecting sensor data of a vehicle according to an embodiment of the present application is shown;
[0021] Figure 2 An apparatus for collecting sensor data of a vehicle according to an embodiment of the present application is shown;
[0022] Figure 3 A system for collecting vehicle sensor data is shown in accordance with one embodiment of the present application. DETAILED DESCRIPTION
[0023] For purposes of brevity and clarity, the principles of the present application are described herein primarily in reference to exemplary embodiments thereof. However, those skilled in the art will readily recognize that the same principles are equally applicable to all types of methods and apparatus for collecting vehicle sensor data, vehicles, storage media, and can be implemented therein, any such variations not departing from the true spirit and scope of the present application.
[0024] One aspect of the present application provides a method for collecting vehicle sensor data. As shown in Figure 1 Method 10 for collecting vehicle sensor data (hereinafter method 10) includes the following steps: receiving data collected by at least one sensor in step S102; instantiating the received data from each sensor according to a predetermined format to generate sensor information corresponding to each sensor in step S104; caching the sensor information based on configuration information indicative of a caching policy in step S106; and packaging and sending the cached sensor information in step S108. Method 10 can be implemented by a device for managing various sensors, for example, apparatus 20 for collecting vehicle sensor data as shown in Figure 2 and Figure 3 Method 10 for collecting vehicle sensor data (hereinafter method 10) includes the following steps: receiving data collected by at least one sensor in step S102; instantiating the received data from each sensor according to a predetermined format to generate sensor information corresponding to each sensor in step S104; caching the sensor information based on configuration information indicative of a caching policy in step S106; and packaging and sending the cached sensor information in step S108. Method 10 can be implemented by a device for managing various sensors, for example, apparatus 20 for collecting vehicle sensor data as shown in
[0025] In Figure 3In the illustrated system, the device 20 that collects vehicle sensor data has the ability to communicate with each of the sensors 305-1... 305-4, the control unit 301 of the vehicle (for online data collection during use of the vehicle), and the data collection equipment 302 (for offline data collection, for example, at a 4S shop of the vehicle). Thus, the device 20 can act as a bridge between the sensors 305-1... 305-4 and the control unit 301 (or the data collection equipment 302) of the vehicle. In addition, the device 20 also has the data processing capability that will be described in detail below. The communication between the device 20 and each of the sensors 305-1... 305-4 can be based on the network inside the vehicle (for example, CAN bus), while the communication between the device 20 and the control unit 301 (or the data collection equipment 302) can consider the characteristics of Internet communication, for example, can adapt to the protocol standards prevailing on the Internet, or can use more efficient Internet of Vehicles communication protocols. The control unit 301 (or the data collection equipment 302) of the vehicle can ultimately send the sensor information to the server 303, and the user can retrieve the sensor data in the server 303 through the web server 304 for further analysis. In addition, the server 303 can also include a program for automatically analyzing the sensor information, so that the received sensor information can be used to extract automatic driving rules, etc.
[0026] The method 10 receives data collected by at least one sensor in step S102. In some embodiments of the present application, the sensor can be a motor sensor, a steering sensor, a speed sensor, an acceleration sensor, a throttle pedal opening sensor, a brake pedal opening sensor, a battery sensor (for example, a battery voltage sensor, etc.), a temperature sensor, etc. In some examples below, the principles of the present application will be described with a motor sensor as an example, and those skilled in the art can expect that the principles of the present application are also applicable to other types of sensors. As understood, the data collected here is raw data and cannot be directly read. For example, the motor sensor can form a 13-bit binary value according to the sensed real-world physical quantity to express the motor speed, for example, it can be "1001110001000".
[0027] The method 10 instantiates the received data according to a predetermined format to generate sensor information in step S104. Specifically, the received data can be mapped to a plurality of callable physical quantities in the sensor information in step S104. The instantiation here can be achieved by, for example, establishing an object corresponding to a "class" for each kind of sensor, and the sensor information can be a combination of various members in the "class". For example, a specific rotational speed value can be invoked by "motor sensor.rotational speed". Wherein "motor sensor" is an object instantiated by "motor sensor class", and "rotational speed" is a member in the class. A set of mapping rules is also defined in "motor sensor class" to map the binary value above to a readable rotational speed physical quantity. For example, "1001110001000" above can be mapped to a rotational speed of 5000 r / min.
[0028] As understood, a set of instantiation rules can be defined for each sensor. Considering the analysis of the raw data collected by the sensor, the instantiation by the mechanism of the hardware agent in step S104 can achieve decoupling from the raw data, while also bringing better scalability.
[0029] The method 10 caches the sensor information based on the configuration information indicating the caching strategy in step S106. Generally, the frequency of data collection by the sensor (or the frequency of generating sensor information) and the frequency of sending the sensor information outwards are not always the same, so the generated sensor information needs to be cached first, and then sent out at the appropriate time. For example, the sensor information will be sent to the control unit 301 or the data collection device 302 of the vehicle shown in FIG. 3, and can be forwarded to the server 303 in the cloud via any one of them. Figure 3
[0030] In some embodiments of the present application, it can be determined whether the configuration information indicating the caching strategy has changed before caching the data. Step S106 specifically includes the following sub-steps: requesting the configuration information from the control unit or the data acquisition device of the vehicle; comparing the configuration information with the current configuration information, and determining the caching strategy according to the comparison result. Specifically, in the case where the configuration information is the same as the current configuration information, the sensor information can be cached according to the current caching strategy corresponding to the current configuration information, that is, a new caching strategy is not introduced. In addition, in the case where the configuration information is different from the current configuration information, an updated caching strategy can be formed according to the configuration information, and the sensor information can be cached according to the updated caching strategy. That is, the sensor information can be cached according to the latest caching strategy. The caching strategy can include indication information on how to cache, for example, it can include data for a period of time before and after an event of caching. It should be noted that the above process of detecting whether there is new configuration information can be performed once after the device for acquiring vehicle sensor data is powered on, and it can also be detected cyclically at a fixed period (for example, 1 minute) during operation.
[0031] In some embodiments of the present application, the configuration information includes a specification of a predetermined event triggering the caching operation. For example, for an acceleration sensor, the triggering event can be sudden acceleration (for example, the instantaneous acceleration value exceeds a predetermined value). At this time, the data for several seconds before and after the time of sudden acceleration can be cached.
[0032] Method 10 encapsulates and transmits the cached sensor information in step S108. In some embodiments of the present application, the cached sensor information can be encapsulated and transmitted based on the CANFD protocol, the TCP protocol or the UDP protocol in step S108. Compared with the traditional CAN protocol, CANFD has the following advantages: (1) CANFD improves the bit rate while providing shorter CAN frames, so CANFD has shorter delay time, better real-time performance and higher bandwidth; (2) CANFD can accommodate more data from 8 to 64 bytes in a frame, so it can achieve greater data throughput with relatively less system overhead, and the software is also simpler and more efficient when sending larger data objects; (3) CANFD has a higher performance CRC algorithm, which can reduce the risk of undetected errors. In addition, the commonly used TCP and UDP protocols in the Internet can also be used to carry sensor information.
[0033] In some embodiments of the present application, the step S106 further comprises the following sub-step: receiving registration information of the sensor from the control unit or the data collection device, wherein the registration information comprises a sampling frequency of the sensor and a sending frequency of the sensor information; and receiving the sensor information according to the sampling frequency and caching. In addition, the registration information received in the step S106 can further comprise specific contents of the sensor information to be sent, so as to form a designation of the contents to be sent in the step S108 (for example, selecting part of the information of interest for sending). At this time, the cached sensor information can be sent according to the sending frequency in the step S108. In this way, the specific scheme of caching and sending the sensor information can be determined according to the frequency of the actual generated information of the sensor and the frequency of the receiving party (the control unit or the data collection device) receiving the sensor information. Generally speaking, once the registration information of a certain sensor is established, it will not be changed unless a replacement sensor of a new specification is replaced. Of course, in other examples, the registration information can also be modified for a specific sensor.
[0034] In some embodiments of the present application, the sensor information can be cached in a two-level caching mechanism, so as to facilitate the adaptation of different sensors with different sampling frequencies and sending frequencies. Specifically, receiving the sensor information according to the sampling frequency and caching comprises: in the case that the sampling frequency is equal to or higher than the sending frequency (at this time, the rate of the sensor generating information is higher than or equal to the rate of conveying information outward), receiving the sensor information based on a predetermined event at the sampling frequency and performing a first-level caching, and forming a second-level cache according to the address of the sensor information in the first-level cache. Then, the sensor information in the second-level cache can be sent according to the sending frequency. In this way, when a group of data is sent, only the address of the next group of data stored in the second-level cache needs to be sent outward to send the next group of data.
[0035] In addition, in the case that the sampling frequency is lower than the sending frequency (at this time, the rate of the sensor generating information is lower than the rate of conveying information outward), the sensor is polled based on a predetermined event at the sampling frequency, and the polled sensor information is cached. Then, the sensor information in the cache can be sent according to the sending frequency. It should be known that due to the lower sampling frequency, not necessarily valid sensor information can be obtained every time the sensor is polled.
[0036] Another aspect of the present application provides a device for collecting sensor data of a vehicle. As shown in Figure 2 The device 20 for collecting sensor data of a vehicle (or simply referred to as the device 20) comprises a first communication unit 201, an agent unit 202, a cache unit 203 and a second communication unit 204. Wherein, the introduction of the first communication unit 201 and the second communication unit 204 is only intended to distinguish the subject communicating with the device 20, and the first communication unit 201 and the second communication unit 204 can share part or even all of the software and hardware resources.
[0037] The first communication unit 201 of the device 20 can receive data collected by at least one sensor; the agent unit 202 can instantiate the data received by the first communication unit 201 according to a predetermined format to generate sensor information; the cache unit 203 can cache the sensor information based on configuration information indicating a caching strategy; and the second communication unit 204 can package and send the cached sensor information. The first communication unit 201, the agent unit 202, the cache unit 203 and the second communication unit 204 of the device 20 can work according to the specific steps of the method 10 described above, which will not be repeated here for the sake of brevity. The content of the method 10 described above is incorporated herein.
[0038] In some embodiments of the present application, the second communication unit 204 can further request configuration information from a control unit or a data collection device of the vehicle; the cache unit 203 can compare the configuration information with current configuration information, and in the case that the configuration information is the same as the current configuration information, cache the sensor information with a current caching strategy corresponding to the current configuration information; and in the case that the configuration information is different from the current configuration information, form an updated caching strategy according to the configuration information, and cache the sensor information with the updated caching strategy.
[0039] In some embodiments of the present application, the second communication unit 204 can receive registration information for the sensor from a control unit or a data collection device of the vehicle, wherein the registration information includes a sampling frequency of the sensor and a transmission frequency of the sensor data; the cache unit 203 can receive and cache the sensor information according to the sampling frequency; and the second communication unit 204 can transmit the cached sensor information according to the transmission frequency.
[0040] Another aspect of the present application provides a vehicle. The vehicle includes any one of the devices for collecting sensor data of the vehicle as described above. The present application does not limit the layout of the vehicle (e.g., wheeled vehicle, tracked vehicle, etc.), nor the driving force of the vehicle (e.g., motor drive, gasoline engine drive, etc.), and the vehicle of the present application covers various vehicles currently known in the art and vehicles to be developed in the future.
[0041] According to another aspect of the present application, a computer readable storage medium is provided, wherein instructions are stored, when executed by a processor, cause the processor to perform any one of the methods for collecting sensor data of a vehicle as described above. The computer readable medium referred to in the present application includes various types of computer storage media, which can be any available medium accessible by a general or special purpose computer. For example, the computer readable medium can include RAM, ROM, EPROM, EEPROM, E 2PROM, a register, a hard disk, a removable disk, a CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium of carriage or storage which can be used to carry or store desired program elements in the form of instructions or data structures and that can be accessed by a general purpose or special purpose computer, or a general purpose or special purpose processor. Disk typically magnetically copy data while discs optically copy data using a laser. Combinations such as optical storage in combination with a disk storage device should also be included within the computer readable media. An exemplary storage medium is affixed to a processor so as to read from and / or write to the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC. The ASIC can reside in a user terminal. In the alternative, the processor and the storage medium can reside as discrete components in a user terminal.
[0042] The specific implementation described above can only be a preferable embodiment of the present application, but the protection scope of the present application is not limited to this. Those skilled in the art can think of other feasible changes or replacements according to the technical range disclosed by the present application, and such changes or replacements are all included in the protection scope of the present application. The embodiments and the features in the embodiments of the present application can also be combined with each other without conflict. The protection scope of the present application is defined by the claims.
Claims
1. A method of collecting vehicle sensor data, characterized by, The method comprises: receiving data collected by at least one sensor; instantiating the received data according to a predetermined format to generate sensor information; caching the sensor information based on configuration information indicative of a caching policy, the configuration information comprising a specification of a predetermined event triggering a caching operation; and packaging and transmitting the cached sensor information, wherein caching the sensor information based on the configuration information indicative of a caching policy further comprises: receiving the sensor information according to a sampling frequency of the sensor and caching; and, packaging and transmitting the cached sensor information comprises transmitting the cached sensor information according to a transmission frequency of the sensor, and wherein receiving the sensor information according to the sampling frequency and caching comprises: in case the sampling frequency is equal to or higher than the transmission frequency, receiving the sensor information according to the sampling frequency and first-level caching based on the predetermined event, and forming a second-level cache according to addresses of the sensor information in the first-level cache; and transmitting the cached sensor information according to the transmission frequency comprises transmitting the sensor information in the second-level cache according to the transmission frequency; and in case the sampling frequency is lower than the transmission frequency, polling the sensor information according to the sampling frequency and caching based on the predetermined event.
2. The method of claim 1, wherein, Instantiating the received data according to a predetermined format comprises mapping the received data to a plurality of callable physical quantities in the sensor information.
3. The method of claim 1, wherein, Caching the sensor information based on the configuration information indicative of a caching policy comprises: requesting configuration information from a control unit or a data collection device of the vehicle; comparing the configuration information with current configuration information: in case the configuration information is identical to the current configuration information, caching the sensor information with a current caching policy corresponding to the current configuration information; and in case the configuration information is different from the current configuration information, forming an updated caching policy according to the configuration information, and caching the sensor information with the updated caching policy.
4. The method of claim 1, wherein, Caching the sensor information based on the configuration information indicative of a caching policy further comprises: receiving registration information for the sensor, wherein the registration information comprises a sampling frequency of the sensor and a transmission frequency for the sensor information.
5. The method of claim 1, wherein, The sensor comprises at least one of: a motor sensor, a steering sensor, a speed sensor, an acceleration sensor, a throttle pedal opening sensor, a brake pedal opening sensor, a battery sensor, a temperature sensor.
6. The method of claim 1, wherein, Packaging and transmitting the cached sensor information comprises packaging and transmitting the cached sensor information based on a CANFD protocol, a TCP protocol or a UDP protocol.
7. An apparatus for collecting sensor data of a vehicle, characterized by The apparatus comprises: a first communication unit configured to receive data collected by at least one sensor; a proxy unit configured to instantiate data received by the first communication unit according to a predetermined format to generate sensor information; a second communication unit configured to cache the sensor information based on configuration information indicative of a caching policy, the configuration information comprising a specification of a predetermined event triggering a caching operation; and a cache unit configured to cache the sensor information based on configuration information indicative of a caching policy, the configuration information comprising a specification of a predetermined event triggering a caching operation; and a second communication unit configured to package and send the cached sensor information, the cache unit is configured to receive and cache the sensor information according to a sampling frequency of the sensor; and the second communication unit is configured to send the cached sensor information according to a sending frequency of the sensor, and wherein the cache unit is further configured to: in case the sampling frequency is equal to or higher than the sending frequency, receive the sensor information based on the predetermined event at the sampling frequency and perform a first level caching, and form a second level caching according to addresses of the sensor information in the first level caching; and sending the cached sensor information according to the sending frequency comprises sending the sensor information in the second level caching according to the sending frequency; and in case the sampling frequency is lower than the sending frequency, poll the sensor information based on the predetermined event at the sampling frequency and cache.
8. The apparatus of claim 7, wherein, the second communication unit is further configured to request the configuration information from a control unit or a data acquisition device of the vehicle; the cache unit is configured to compare the configuration information with current configuration information held in the cache unit, and in case the configuration information is identical to the current configuration information, cache the sensor information with a current caching policy corresponding to the current configuration information; and in case the configuration information is different from the current configuration information, form an updated caching policy according to the configuration information, and cache the sensor information with the updated caching policy.
9. The apparatus of claim 7, wherein, the second communication unit is configured to receive registration information for the sensor from a control unit or a data acquisition device of the vehicle, wherein the registration information comprises a sampling frequency of the sensor and a sending frequency of the sensor data.
10. A vehicle characterized by comprising: the vehicle comprises a device for acquiring sensor data of a vehicle as claimed in any one of claims 7-9.
11. A computer-readable storage medium having stored therein instructions, the computer-readable storage medium comprising: the instructions, when executed by a processor, cause the processor to perform a method as claimed in any one of claims 1-6.
Citation Information
Patent Citations
GPS data collection and transmission method and device
CN105450720A
Unmanned vehicle test data acquisition, transmission and processing method
CN113691888A
Systems and methods to manage cache data storage
US9454488B2