Air pressure sensor signal MPU acquisition method, device and equipment and storage medium
By modifying the ADC drive and judging the sampling scenario of the vehicle microprocessor MPU, the problem of unstable MCU supply is solved, and the MPU independently collects air pressure sensor signals, reducing production costs and improving acquisition efficiency.
Patent Information
- Application Number
- CN202411742930.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, in-vehicle LCD instruments adopt a dual-chip solution. Due to the unstable supply of MCUs and the price is prone to increase, it leads to high production costs and low production efficiency of automobile companies.
Modify the ADC driver of the current vehicle's microprocessor MPU through preset modification rules to obtain the modified target ADC driver; obtain the instrument service application and actual application scenario of the current vehicle; determine whether the single-thread sampling of the air pressure sensor signal is performed based on this information.
All signals are collected independently by the MPU, which reduces the production cost of on-board instruments, ensures the stability of vehicle production, improves product competitiveness, and improves the speed and efficiency of MPU acquisition of air pressure sensor signals.
Smart Images

Figure CN119689933A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile intelligent technology, and in particular to an air pressure sensor signal MPU acquisition method, device, equipment and storage medium. Background Art
[0002] The barometer is an important component of automobile instruments. It reflects the pressure values of components such as the front and rear axles of the car and is related to driving safety. Its importance is self-evident.
[0003] Currently, most of the gas pressure signals in the industry are converted into electrical signals through pressure sensors. After the internal components of the instrument collect the air pressure level signal, the air pressure value is calculated and displayed on the instrument panel.
[0004] With the development of science and technology, the instrument has been upgraded from the early mechanical meter to the LCD instrument, the screen size is getting bigger and bigger, the image is getting clearer and clearer; of course, the internal circuit of the instrument is getting more and more complicated, and the computing power of the control chip used is getting stronger and stronger; currently, the 7-inch and 12-inch LCD instruments on the market mostly use the dual-chip MCU+MPU solution, the microprocessor unit (MicroProcessor Unit, MPU) is mainly responsible for the LCD image display, and the microcontroller unit (MicroControllerUnit, MCU) is responsible for signal acquisition and power consumption control. However, due to the large usage of MCU, the price increases every other day and the shortage of supply often occur, which will cause the production cost of this type of instrument to be higher, and the vehicle production process often lacks key chips, resulting in low production efficiency of automobile companies. Summary of the invention
[0005] The main purpose of the present invention is to provide a pressure sensor signal MPU acquisition method, device, equipment and storage medium, aiming to solve the technical problem that the vehicle-mounted LCD instrument adopts dual chips in the prior art, and the production cost of the vehicle-mounted instrument is high due to the defects of unstable MCU supply and easy price increase, resulting in low production efficiency of automobile companies.
[0006] In a first aspect, the present invention provides a pressure sensor signal MPU acquisition method, the pressure sensor signal MPU acquisition method comprising the following steps:
[0007] Modify the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC driver;
[0008] Acquire the instrument service application program and the actual application scenario of the instrument of the current vehicle;
[0009] According to the instrument service application and the actual application scenario of the instrument, it is determined whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC.
[0010] Optionally, modifying the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC drive includes:
[0011] Obtain the circuit structure of the on-board instrument of the current vehicle;
[0012] The analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle is modified according to the circuit structure and the preset modification rule to obtain a modified target ADC drive.
[0013] Optionally, the modifying the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rule to obtain the modified target ADC drive includes:
[0014] Adopting the Linux general device driver model, modifying the device tree source file DTS configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules;
[0015] Generate a platform device according to the DTS configuration file, modify the analog-to-digital converter ADC driver of the MPU according to the platform device, and obtain a modified target ADC driver.
[0016] Optionally, generating a platform device according to the DTS configuration file, modifying an analog-to-digital converter ADC driver of the MPU according to the platform device, and obtaining a modified target ADC driver includes:
[0017] Generate a platform device according to the DTS configuration file, and obtain a platform driver corresponding to the platform device;
[0018] Loading the platform driver, and matching the on-board instrument of the current vehicle through a device and driver matching function;
[0019] Provide an interface for reading the conversion result of the analog-to-digital converter ADC for the upper layer application, or enable the read and write functions of the Linux general device driver model to obtain the modified target ADC driver.
[0020] Optionally, providing an interface for reading conversion results of an analog-to-digital converter ADC for an upper layer application, or enabling the read and write functions of the Linux general device driver model, to obtain a modified target ADC driver, includes:
[0021] A property file is created by a preset function for creating a device property file, and an interface for reading the conversion result of an analog-to-digital converter ADC is provided for an upper-layer application according to the written file, or the read and write functions in the file operation structure in the Linux general device driver model are enabled by initializing a character device function to perform ADC sampling conversion, so as to obtain a modified target ADC driver.
[0022] Optionally, after modifying the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to the preset modification rule and obtaining the modified target ADC drive, the air pressure sensor signal MPU acquisition method further includes:
[0023] When it is detected that the pressure sensor signal is read by the target ADC driver, the current process is hung up;
[0024] After detecting that the target ADC driving acquisition is completed, the current process is awakened again by a preset interrupt signal.
[0025] Optionally, judging whether to drive a single thread to sample the air pressure sensor signal of the current vehicle according to the target ADC according to the instrument service application and the actual application scenario of the instrument includes:
[0026] Determine whether the current scenario is suitable for single-threaded acquisition according to the instrument business application and the actual application scenario of the instrument;
[0027] When the current scene is adapted for single-threaded acquisition, determining whether to perform anti-interference processing;
[0028] When anti-interference processing is required, anti-interference processing is performed on the air pressure sensor signal collected by the target ADC driving single thread, and the processed signal is displayed on the on-board instrument screen of the current vehicle.
[0029] In a second aspect, in order to achieve the above-mentioned purpose, the present invention further proposes an air pressure sensor signal MPU acquisition device, the air pressure sensor signal MPU acquisition device comprising:
[0030] A driver modification module, used for modifying the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC driver;
[0031] A scene acquisition module, used to acquire the instrument business application program and the actual application scene of the instrument of the current vehicle;
[0032] The judgment collection module is used to judge whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC according to the instrument business application program and the actual application scenario of the instrument.
[0033] In the third aspect, to achieve the above-mentioned purpose, the present invention also proposes an air pressure sensor signal MPU acquisition device, which includes: a memory, a processor, and an air pressure sensor signal MPU acquisition program stored in the memory and executable on the processor, and the air pressure sensor signal MPU acquisition program is configured to implement the steps of the air pressure sensor signal MPU acquisition method as described above.
[0034] In a fourth aspect, in order to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a pressure sensor signal MPU acquisition program is stored. When the pressure sensor signal MPU acquisition program is executed by a processor, the steps of the pressure sensor signal MPU acquisition method described above are implemented.
[0035] The MPU acquisition method for air pressure sensor signals proposed in the present invention modifies the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle through preset modification rules to obtain a modified target ADC driver; obtains the instrument business application program and the actual application scenario of the instrument of the current vehicle; and determines whether to single-thread sample the air pressure sensor signal of the current vehicle according to the target ADC driver based on the instrument business application program and the actual application scenario of the instrument, so that all signals can be independently acquired by the MPU, reducing the production cost of vehicle-mounted instruments, ensuring the stability of vehicle production, improving product competitiveness, and improving the speed and efficiency of MPU acquisition of air pressure sensor signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0037] Figure 2 It is a flowchart of the first embodiment of the MPU acquisition method of the air pressure sensor signal of the present invention;
[0038] Figure 3 It is a flow chart of the second embodiment of the air pressure sensor signal MPU acquisition method of the present invention;
[0039] Figure 4 It is a flowchart of a third embodiment of the air pressure sensor signal MPU acquisition method of the present invention;
[0040] Figure 5 It is a flowchart of a fourth embodiment of the air pressure sensor signal MPU acquisition method of the present invention;
[0041] Figure 6 It is a flowchart of a fifth embodiment of the MPU acquisition method of air pressure sensor signals of the present invention;
[0042] Figure 7This is a functional module diagram of the first embodiment of the air pressure sensor signal MPU acquisition device of the present invention.
[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] The solution of the embodiment of the present invention is mainly: modifying the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle through preset modification rules to obtain the modified target ADC driver; obtaining the instrument business application program and the actual application scenario of the instrument of the current vehicle; judging whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC driver according to the instrument business application program and the actual application scenario of the instrument, so that all signals can be collected independently by the MPU, reducing the production cost of vehicle-mounted instruments, ensuring the stability of vehicle production, improving product competitiveness, and improving the speed and efficiency of the MPU collection of air pressure sensor signals, and solving the technical problem that the vehicle-mounted LCD instrument in the prior art adopts dual chips, and the defect of unstable MCU supply and easy price increase leads to high production cost of vehicle-mounted instruments, resulting in low production efficiency of automobile companies.
[0046] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0047] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (Non-Volatile Memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0048] Those skilled in the art will understand that Figure 1The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0049] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating device, a network communication module, a user interface module, and an air pressure sensor signal MPU acquisition program.
[0050] The device of the present invention calls the air pressure sensor signal MPU acquisition program stored in the memory 1005 through the processor 1001, and performs the following operations:
[0051] Modify the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC driver;
[0052] Acquire the instrument service application program and the actual application scenario of the instrument of the current vehicle;
[0053] According to the instrument service application and the actual application scenario of the instrument, it is determined whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC.
[0054] The device of the present invention calls the air pressure sensor signal MPU acquisition program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0055] Obtain the circuit structure of the on-board instrument of the current vehicle;
[0056] The analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle is modified according to the circuit structure and the preset modification rule to obtain a modified target ADC drive.
[0057] The device of the present invention calls the air pressure sensor signal MPU acquisition program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0058] Adopting the Linux general device driver model, modifying the device tree source file DTS configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules;
[0059] Generate a platform device according to the DTS configuration file, modify the analog-to-digital converter ADC driver of the MPU according to the platform device, and obtain a modified target ADC driver.
[0060] The device of the present invention calls the air pressure sensor signal MPU acquisition program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0061] Generate a platform device according to the DTS configuration file, and obtain a platform driver corresponding to the platform device;
[0062] Loading the platform driver, and matching the on-board instrument of the current vehicle through a device and driver matching function;
[0063] Provide an interface for reading the conversion result of the analog-to-digital converter ADC for the upper layer application, or enable the read and write functions of the Linux general device driver model to obtain the modified target ADC driver.
[0064] The device of the present invention calls the air pressure sensor signal MPU acquisition program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0065] A property file is created by a preset function for creating a device property file, and an interface for reading the conversion result of an analog-to-digital converter ADC is provided for an upper-layer application according to the written file, or the read and write functions in the file operation structure in the Linux general device driver model are enabled by initializing a character device function to perform ADC sampling conversion, so as to obtain a modified target ADC driver.
[0066] The device of the present invention calls the air pressure sensor signal MPU acquisition program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0067] When it is detected that the pressure sensor signal is read by the target ADC driver, the current process is hung up;
[0068] After detecting that the target ADC driving acquisition is completed, the current process is awakened again by a preset interrupt signal.
[0069] The device of the present invention calls the air pressure sensor signal MPU acquisition program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0070] Determine whether the current scenario is suitable for single-threaded acquisition according to the instrument business application and the actual application scenario of the instrument;
[0071] When the current scene is adapted for single-threaded acquisition, determining whether to perform anti-interference processing;
[0072] When anti-interference processing is required, anti-interference processing is performed on the air pressure sensor signal collected by the target ADC driving single thread, and the processed signal is displayed on the on-board instrument screen of the current vehicle.
[0073] Through the above scheme, this embodiment modifies the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle through preset modification rules to obtain a modified target ADC driver; obtains the instrument business application and the actual application scenario of the instrument of the current vehicle; and determines whether to sample the air pressure sensor signal of the current vehicle by single-thread according to the target ADC driver based on the instrument business application and the actual application scenario of the instrument, so that all signals can be collected independently by the MPU, reducing the production cost of on-board instruments, ensuring the stability of vehicle production, improving product competitiveness, and improving the speed and efficiency of the MPU collection of air pressure sensor signals.
[0074] Based on the above hardware structure, an embodiment of the air pressure sensor signal MPU acquisition method of the present invention is proposed.
[0075] Reference Figure 2 , Figure 2 Schematic diagram of the flow of the first embodiment of the air pressure sensor signal MPU acquisition method of the present invention.
[0076] In the first embodiment, the air pressure sensor signal MPU acquisition method includes the following steps:
[0077] Step S10: modify the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC drive.
[0078] It should be noted that, by modifying the analog-to-digital converter (ADC) driver of the microprocessor MPU of the current vehicle according to a preset modification rule, the modified ADC driver can be obtained as the target ADC driver.
[0079] Step S20: Acquire the instrument service application program and the actual application scenario of the instrument of the current vehicle.
[0080] It should be understood that the instrument business application of the on-board instrument of the current vehicle and the actual application scenario of the instrument in which the on-board instrument is currently located are obtained. The instrument business application is a business application built into the on-board instrument. Different types of on-board instruments have different business applications built in. This embodiment does not limit this; the actual application scenario of the instrument is the application scenario in which the on-board instrument is currently located.
[0081] Step S30: determining, according to the instrument service application and the actual application scenario of the instrument, whether to drive a single thread to sample the air pressure sensor signal of the current vehicle according to the target ADC.
[0082] It is understandable that whether to adopt a separate thread can be determined according to the instrument service application and the actual application scenario of the instrument, that is, driving a single thread to sample the air pressure sensor signal of the current vehicle according to the target ADC.
[0083] Through the above scheme, this embodiment modifies the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle through preset modification rules to obtain a modified target ADC driver; obtains the instrument business application and the actual application scenario of the instrument of the current vehicle; and determines whether to sample the air pressure sensor signal of the current vehicle by single-thread according to the target ADC driver based on the instrument business application and the actual application scenario of the instrument, so that all signals can be collected independently by the MPU, reducing the production cost of on-board instruments, ensuring the stability of vehicle production, improving product competitiveness, and improving the speed and efficiency of the MPU collection of air pressure sensor signals.
[0084] Further, Figure 3 FIG. 1 is a flow chart of a second embodiment of the air pressure sensor signal MPU acquisition method of the present invention. Figure 3 As shown, a second embodiment of the air pressure sensor signal MPU acquisition method of the present invention is proposed based on the first embodiment. In this embodiment, the step S10 specifically includes the following steps:
[0085] Step S11, obtaining the circuit structure of the on-board instrument of the current vehicle.
[0086] It should be noted that different types of vehicle-mounted instruments have different hardware circuits and circuit structures. Understanding the circuit structure can provide a reference for subsequent modifications to the ADC driver.
[0087] Step S12: modify the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rule to obtain a modified target ADC drive.
[0088] It can be understood that the preset modification rules are pre-set modification rules, and different circuit structures correspond to different ADC drive modification methods. According to the circuit structure and the preset modification rules, the analog-to-digital converter ADC drive of the current vehicle's microprocessor MPU can be modified to obtain the modified target ADC drive.
[0089] This embodiment adopts the above scheme, through the circuit structure of the on-board instrument of the current vehicle; according to the circuit structure and the preset modification rules, the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle is modified to obtain the modified target ADC drive, and the ADC drive can be modified quickly, thereby improving the speed and efficiency of the MPU acquisition of the air pressure sensor signal.
[0090] Further, Figure 4 FIG. 1 is a flow chart of a third embodiment of the air pressure sensor signal MPU acquisition method of the present invention. Figure 4 As shown, a third embodiment of the air pressure sensor signal MPU acquisition method of the present invention is proposed based on the second embodiment. In this embodiment, the step S12 specifically includes the following steps:
[0091] Step S121: adopt the Linux general device driver model to modify the device tree source file DTS configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules.
[0092] It should be noted that the Linux universal device driver model is adopted to modify the DTS configuration file according to the hardware circuit and the MPU chip manual, that is, the Linux universal device driver model is adopted to modify the device tree source file Device Tree Source (DTS) configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules. The DTS file is a text file used to describe hardware information.
[0093] Step S122: Generate a platform device according to the DTS configuration file, modify the analog-to-digital converter ADC driver of the MPU according to the platform device, and obtain a modified target ADC driver.
[0094] It can be understood that a platform device is generated according to the DTS configuration file, and then the analog-to-digital converter ADC driver of the MPU is modified according to the platform device to obtain a modified target ADC driver.
[0095] Furthermore, the step S122 specifically includes the following steps:
[0096] Generate a platform device according to the DTS configuration file, and obtain a platform driver corresponding to the platform device;
[0097] Loading the platform driver, and matching the on-board instrument of the current vehicle through a device and driver matching function;
[0098] Provide an interface for reading the conversion result of the analog-to-digital converter ADC for the upper layer application, or enable the read and write functions of the Linux general device driver model to obtain the modified target ADC driver.
[0099] It should be understood that the platform_device platform device is generated through dts, the corresponding platform_driver platform driver is written, and after the driver is loaded, the device is matched through the device and driver matching function of_driver_match_device, that is, the on-board instrument of the current vehicle is matched. After the match is successful, an interface for reading the analog-to-digital converter ADC conversion result is provided to the upper-level application, or the read and write functions of the Linux general device driver model are enabled, thereby obtaining the modified target ADC driver.
[0100] Further, the step provides an interface for reading the conversion result of the analog-to-digital converter ADC for the upper layer application, or enables the read and write functions of the Linux general device driver model to obtain the modified target ADC driver, specifically including the following steps:
[0101] A property file is created by a preset function for creating a device property file, and an interface for reading the conversion result of an analog-to-digital converter ADC is provided for an upper-layer application according to the written file, or the read and write functions in the file operation structure in the Linux general device driver model are enabled by initializing a character device function to perform ADC sampling conversion, so as to obtain a modified target ADC driver.
[0102] It can be understood that by creating a property file by presetting the device property file creation function device_create_file, an interface for reading ADC conversion results is provided to the upper-layer application, or by initializing the character device function cdev_init to implement the corresponding read and write functions in the file_operations file operation structure, so as to perform ADC sampling conversion and obtain the modified target ADC driver.
[0103] Through the above scheme, this embodiment adopts the Linux general device driver model to modify the device tree source file DTS configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules; generates a platform device according to the DTS configuration file, modifies the analog-to-digital converter ADC driver of the MPU according to the platform device, obtains the modified target ADC driver, and can quickly modify the ADC driver, thereby improving the speed and efficiency of the MPU acquisition of the air pressure sensor signal.
[0104] Further, Figure 5 FIG. 4 is a flow chart of a fourth embodiment of the air pressure sensor signal MPU acquisition method of the present invention. Figure 5 As shown, a fourth embodiment of the air pressure sensor signal MPU acquisition method of the present invention is proposed based on the first embodiment. In this embodiment, after step S10, the air pressure sensor signal MPU acquisition method further includes the following steps:
[0105] Step S101: When it is detected that the pressure sensor signal is read by the target ADC driver, the current process is hung up.
[0106] It should be noted that, since ADC sampling conversion takes a period of processing time, wait_for_completion can hang up the current process during the reading wait, that is, when it is detected that the pressure sensor signal is read through the target ADC driver, the current process can be hung up.
[0107] Step S102: After detecting that the target ADC driving acquisition is completed, the current process is woken up again by a preset interrupt signal.
[0108] It can be understood that after the ADC acquisition is completed, the interrupt signal set by request_irq will complete wake up the waiting process again, so as to save chip computing resources. request_irq is a function in the Linux kernel, and its main function is to register an interrupt handler, that is, after detecting that the target ADC driver acquisition is completed, the preset interrupt signal can wake up the current process again.
[0109] Through the above scheme, this embodiment hangs up the current process when it is detected that the pressure sensor signal is read by the target ADC driver; after detecting that the target ADC driver has completed the acquisition, the current process is woken up again by a preset interrupt signal, which can save chip computing resources and improve the speed and efficiency of the pressure sensor signal MPU acquisition.
[0110] Further, Figure 6 FIG. 5 is a flow chart of a fifth embodiment of the air pressure sensor signal MPU acquisition method of the present invention. Figure 6 As shown, a fifth embodiment of the air pressure sensor signal MPU acquisition method of the present invention is proposed based on the first embodiment. In this embodiment, step S30 includes the following steps:
[0111] Step S31: judging whether the current scenario is suitable for single-threaded collection according to the instrument business application program and the actual application scenario of the instrument.
[0112] It should be noted that whether to perform ADC reading in a separate thread is selected according to the actual application scenario of the instrument, that is, whether the current scenario is suitable for single-threaded acquisition can be determined according to the instrument business application and the actual application scenario of the instrument.
[0113] Step S32: When the current scene is adapted for single-threaded acquisition, determine whether to perform anti-interference processing.
[0114] It can be understood that after determining whether a separate thread performs ADC reading, it is further determined whether to perform anti-interference processing. When the current scene is adapted to single-thread acquisition, it can be determined whether to perform anti-interference processing.
[0115] Step S33: When anti-interference processing is required, anti-interference processing is performed on the air pressure sensor signal collected by the target ADC driving single thread, and the processed signal is displayed on the on-board instrument screen of the current vehicle.
[0116] It should be understood that when anti-interference processing is required, the air pressure sensor signal collected by the target ADC driving single thread can be subjected to anti-interference processing, and the processed signal can be displayed on the on-board instrument screen of the current vehicle.
[0117] Through the above scheme, this embodiment determines whether the current scene is suitable for single-threaded acquisition according to the instrument business application and the actual application scenario of the instrument; when the current scene is suitable for single-threaded acquisition, determines whether to perform anti-interference processing; when anti-interference processing is required, anti-interference processing is performed on the air pressure sensor signal collected by the single thread driven by the target ADC, and the processed signal is displayed on the on-board instrument screen of the current vehicle, so that all signals can be independently collected by the MPU, reducing the production cost of on-board instruments, ensuring the stability of vehicle production, improving product competitiveness, and improving the speed and efficiency of MPU acquisition of air pressure sensor signals.
[0118] Correspondingly, the present invention further provides an air pressure sensor signal MPU acquisition device.
[0119] Reference Figure 7 , Figure 7 This is a functional module diagram of the first embodiment of the air pressure sensor signal MPU acquisition device of the present invention.
[0120] In the first embodiment of the air pressure sensor signal MPU acquisition device of the present invention, the air pressure sensor signal MPU acquisition device comprises:
[0121] The drive modification module 10 is used to modify the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC drive.
[0122] The scene acquisition module 20 is used to acquire the instrument service application program and the actual application scene of the instrument of the current vehicle.
[0123] The judging and collecting module 30 is used to judge whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the instrument business application program and the actual application scenario of the instrument.
[0124] The drive modification module 10 is also used to obtain the circuit structure of the on-board instrument of the current vehicle; modify the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rule to obtain the modified target ADC drive.
[0125] The driver modification module 10 is also used to adopt the Linux general device driver model to modify the device tree source file DTS configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules; generate a platform device according to the DTS configuration file, modify the analog-to-digital converter ADC driver of the MPU according to the platform device, and obtain the modified target ADC driver.
[0126] The driver modification module 10 is also used to generate a platform device according to the DTS configuration file, obtain the platform driver corresponding to the platform device; load the platform driver, match the on-board instrument of the current vehicle through the device and driver matching function; provide an interface for reading the conversion result of the analog-to-digital converter ADC for the upper-layer application, or enable the read and write functions of the Linux general device driver model to obtain the modified target ADC driver.
[0127] The driver modification module 10 is also used to create a property file through a preset device property file creation function, provide an interface for reading analog-to-digital converter ADC conversion results for the upper-layer application according to the written file, or enable the read and write functions in the file operation structure in the Linux general device driver model through an initialization character device function to perform ADC sampling conversion, and obtain a modified target ADC driver.
[0128] The driver modification module 10 is also used to hang up the current process when it is detected that the pressure sensor signal is read by the target ADC driver; after detecting that the target ADC driver has completed the acquisition, the current process is woken up again by a preset interrupt signal.
[0129] The judgment and acquisition module 30 is also used to judge whether the current scene is suitable for single-thread acquisition based on the instrument business application and the actual application scenario of the instrument; when the current scene is adapted to single-thread acquisition, judge whether to perform anti-interference processing; when anti-interference processing is required, perform anti-interference processing on the air pressure sensor signal collected by the single thread driven by the target ADC, and display the processed signal on the on-board instrument screen of the current vehicle.
[0130] Among them, the steps implemented by each functional module of the air pressure sensor signal MPU acquisition device can refer to the various embodiments of the air pressure sensor signal MPU acquisition method of the present invention, and will not be repeated here.
[0131] In addition, an embodiment of the present invention further provides a storage medium, on which an air pressure sensor signal MPU acquisition program is stored. When the air pressure sensor signal MPU acquisition program is executed by a processor, the following operations are implemented:
[0132] Modify the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC driver;
[0133] Acquire the instrument service application program and the actual application scenario of the instrument of the current vehicle;
[0134] According to the instrument service application and the actual application scenario of the instrument, it is determined whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC.
[0135] Furthermore, when the air pressure sensor signal MPU acquisition program is executed by the processor, the following operations are also implemented:
[0136] Obtain the circuit structure of the on-board instrument of the current vehicle;
[0137] The analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle is modified according to the circuit structure and the preset modification rule to obtain a modified target ADC drive.
[0138] Furthermore, when the air pressure sensor signal MPU acquisition program is executed by the processor, the following operations are also implemented:
[0139] Adopting the Linux general device driver model, modifying the device tree source file DTS configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules;
[0140] Generate a platform device according to the DTS configuration file, modify the analog-to-digital converter ADC driver of the MPU according to the platform device, and obtain a modified target ADC driver.
[0141] Furthermore, when the air pressure sensor signal MPU acquisition program is executed by the processor, the following operations are also implemented:
[0142] Generate a platform device according to the DTS configuration file, and obtain a platform driver corresponding to the platform device;
[0143] Loading the platform driver, and matching the on-board instrument of the current vehicle through a device and driver matching function;
[0144] Provide an interface for reading the conversion result of the analog-to-digital converter ADC for the upper layer application, or enable the read and write functions of the Linux general device driver model to obtain the modified target ADC driver.
[0145] Furthermore, when the air pressure sensor signal MPU acquisition program is executed by the processor, the following operations are also implemented:
[0146] A property file is created by a preset function for creating a device property file, and an interface for reading the conversion result of an analog-to-digital converter ADC is provided for an upper-layer application according to the written file, or the read and write functions in the file operation structure in the Linux general device driver model are enabled by initializing a character device function to perform ADC sampling conversion, so as to obtain a modified target ADC driver.
[0147] Furthermore, when the air pressure sensor signal MPU acquisition program is executed by the processor, the following operations are also implemented:
[0148] When it is detected that the pressure sensor signal is read by the target ADC driver, the current process is hung up;
[0149] After detecting that the target ADC driving acquisition is completed, the current process is awakened again by a preset interrupt signal.
[0150] Furthermore, when the air pressure sensor signal MPU acquisition program is executed by the processor, the following operations are also implemented:
[0151] Determine whether the current scenario is suitable for single-threaded acquisition according to the instrument business application and the actual application scenario of the instrument;
[0152] When the current scene is adapted for single-threaded acquisition, determining whether to perform anti-interference processing;
[0153] When anti-interference processing is required, anti-interference processing is performed on the air pressure sensor signal collected by the target ADC driving single thread, and the processed signal is displayed on the on-board instrument screen of the current vehicle.
[0154] Those skilled in the art will appreciate that all or part of the steps in the above-mentioned implementation method can be accomplished by instructing related hardware through a program, and the program is stored in a storage medium, including a number of instructions for enabling a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each implementation method of the present application; and the aforementioned storage medium is a computer-readable storage medium, including: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0156] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0157] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A pressure sensor signal MPU acquisition method, characterized in that: The air pressure sensor signal MPU acquisition method includes: Modify the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC driver; Acquire the instrument service application program and the actual application scenario of the instrument of the current vehicle; According to the instrument service application and the actual application scenario of the instrument, it is determined whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC.
2. The air pressure sensor signal MPU acquisition method according to claim 1, characterized in that: The step of modifying the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to the preset modification rule to obtain the modified target ADC drive includes: Obtain the circuit structure of the on-board instrument of the current vehicle; The analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle is modified according to the circuit structure and the preset modification rule to obtain a modified target ADC drive.
3. The air pressure sensor signal MPU acquisition method according to claim 2, characterized in that: The step of modifying the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rule to obtain the modified target ADC drive includes: Adopting the Linux general device driver model, modifying the device tree source file DTS configuration file of the microprocessor MPU of the current vehicle according to the circuit structure and the preset modification rules; Generate a platform device according to the DTS configuration file, modify the analog-to-digital converter ADC driver of the MPU according to the platform device, and obtain a modified target ADC driver.
4. The air pressure sensor signal MPU acquisition method according to claim 3, characterized in that: The generating a platform device according to the DTS configuration file, modifying the analog-to-digital converter ADC driver of the MPU according to the platform device, and obtaining the modified target ADC driver includes: Generate a platform device according to the DTS configuration file, and obtain a platform driver corresponding to the platform device; Loading the platform driver, and matching the on-board instrument of the current vehicle through a device and driver matching function; Provide an interface for reading the conversion result of the analog-to-digital converter ADC for the upper layer application, or enable the read and write functions of the Linux general device driver model to obtain the modified target ADC driver.
5. The air pressure sensor signal MPU acquisition method according to claim 4, characterized in that: The method provides an interface for reading the conversion result of the analog-to-digital converter ADC for the upper layer application, or enables the read and write functions of the Linux general device driver model to obtain the modified target ADC driver, including: A property file is created by a preset function for creating a device property file, and an interface for reading the conversion result of an analog-to-digital converter ADC is provided for an upper-layer application according to the written file, or the read and write functions in the file operation structure in the Linux general device driver model are enabled by initializing a character device function to perform ADC sampling conversion, so as to obtain a modified target ADC driver.
6. The air pressure sensor signal MPU acquisition method according to claim 1, characterized in that: After the analog-to-digital converter ADC drive of the microprocessor MPU of the current vehicle is modified according to the preset modification rule and the modified target ADC drive is obtained, the air pressure sensor signal MPU acquisition method further includes: When it is detected that the pressure sensor signal is read by the target ADC driver, the current process is hung up; After detecting that the target ADC driving acquisition is completed, the current process is awakened again by a preset interrupt signal.
7. The air pressure sensor signal MPU acquisition method according to claim 1, characterized in that: The determining, according to the instrument service application and the actual application scenario of the instrument, whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC includes: Determine whether the current scenario is suitable for single-threaded acquisition according to the instrument business application and the actual application scenario of the instrument; When the current scene is adapted for single-threaded acquisition, determining whether to perform anti-interference processing; When anti-interference processing is required, anti-interference processing is performed on the air pressure sensor signal collected by the target ADC driving single thread, and the processed signal is displayed on the on-board instrument screen of the current vehicle.
8. An MPU acquisition device for air pressure sensor signals, characterized in that: The air pressure sensor signal MPU acquisition device comprises: A driver modification module, used for modifying the analog-to-digital converter ADC driver of the microprocessor MPU of the current vehicle according to a preset modification rule to obtain a modified target ADC driver; A scene acquisition module, used to acquire the instrument business application program and the actual application scene of the instrument of the current vehicle; The judgment collection module is used to judge whether to drive the single-thread sampling of the air pressure sensor signal of the current vehicle according to the target ADC according to the instrument business application program and the actual application scenario of the instrument.
9. An MPU acquisition device for air pressure sensor signals, characterized in that: The air pressure sensor signal MPU acquisition device includes: a memory, a processor, and an air pressure sensor signal MPU acquisition program stored in the memory and executable on the processor, wherein the air pressure sensor signal MPU acquisition program is configured to implement the steps of the air pressure sensor signal MPU acquisition method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores an air pressure sensor signal MPU acquisition program, and when the air pressure sensor signal MPU acquisition program is executed by the processor, the steps of the air pressure sensor signal MPU acquisition method according to any one of claims 1 to 7 are implemented.