Data reading method based on interrupt signal, terminal, equipment and storage medium
Through the data reading method based on interrupt signal, the problem of the frequency of MCU acquisition of IMU data update is solved, and high real-time and robust data interaction is achieved, high frequency sampling needs are met, and new energy vehicle control is improved Real-time response capability.
Patent Information
- Application Number
- CN202411248356.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-06
AI Technical Summary
In the prior art, the MCU acquires IMU data through periodic tasks, resulting in limited data update frequency, which cannot meet high real-time requirements. Especially in applications such as CDC suspension damping control, the delay of sensor data cannot respond to high frequency on the road in a timely manner. Incentive, affects control accuracy.
Using the data reading method based on the interrupt signal, the inertial measurement chip sends out the signal and triggers the interrupt processing process, so as to obtain the acceleration and angular velocity data in real time in the interrupt processing process, and send the instructions again after the interrupt status register is cleared to ensure the data The robustness of interaction.
It improves the real-time and robustness of data acquisition, ensures timely acquisition of inertial measurement chip data with high-frequency sampling characteristics, meets real-time control needs, and avoids data delay problems.
Smart Images

Figure CN119201801A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of new energy vehicle control technology, and in particular to a data reading method, terminal, device and storage medium based on an interrupt signal. Background Art
[0002] IMU (Inertial Measurement Unit) is a PCB-mounted MEMS sensor, which is mainly used to measure and feedback the basic linear motion (acceleration) in three directions and the basic angular motion (angular velocity) in three directions of an object. Compared with traditional non-board acceleration sensors or angle sensors, IMU has the advantages of light weight, small board area, accurate measurement, and low cost. At present, IMU is widely used in various fields such as automobiles, drones, VR, etc. In automotive controllers, automotive-grade IMU chips are widely used in various new controllers including suspension controllers, domain controllers, and car computers with the increasing popularity of electric vehicles and the leap forward in autonomous driving technology.
[0003] At present, MCU (Microcontroller Unit) mainly obtains data in IMU by sending communication signals in periodic tasks to access ASIC data registers in IMU.
[0004] However, the method of collecting data from the IMU through periodic tasks has the following disadvantages: 1. The frequency of data updates is limited by the type of periodic tasks configured by the MCU. When the application layer accesses the driver layer data, it needs to use a slower periodic task for data collection, otherwise there will be a risk of data update lag. 2. For applications with high data real-time requirements, the sensor data is updated slowly and the data is delayed due to the upper limit of the task cycle. Especially for applications with high real-time requirements such as the booming CDC suspension damping control, the time from sensor data acquisition to actuator response must be controlled within 10ms, otherwise it will not be able to accurately identify and respond to high-frequency excitations from the road surface. If the sensor data has a large delay, the overall control goal cannot be achieved. Summary of the invention
[0005] In order to solve the above problems, the present application provides a data reading method, terminal, device and storage medium based on an interrupt signal.
[0006] In a first aspect, an embodiment of the present application provides a data reading method based on an interrupt signal, comprising: After receiving the preparation completion signal sent by the inertial measurement chip, the on-board controller executes a preset interrupt processing flow, wherein the preparation completion signal is an interrupt signal for triggering the interrupt processing flow; The interrupt processing flow includes: Sending a data reading instruction to the inertial measurement chip, so that the inertial measurement chip feeds back the currently stored synchronous measurement data; Receiving the synchronous measurement data; Parsing the received synchronous measurement data to obtain motion state data and store the data; A read clear instruction is sent to the inertial measurement chip, so that an interrupt status register in the inertial measurement chip is cleared.
[0007] In some embodiments, after the vehicle controller receives the preparation completion signal sent by the inertial measurement chip, before executing the preset interrupt processing flow, the process includes: The inertial measurement chip measures acceleration data and angular velocity data through internal sensors; The inertial measurement chip synchronously processes the acceleration data and the angular velocity data to obtain synchronous measurement data; After the synchronous measurement data is stored and the internal interrupt status register is in a cleared state, the inertial measurement chip sends a preparation completion signal to the vehicle controller; The inertial measurement chip sets a flag bit of the interrupt status register.
[0008] In some embodiments, before the inertial measurement chip acquires acceleration data and angular velocity data, the method includes: The on-board controller sends an initialization message to the inertial measurement chip, wherein the initialization message records configuration data; The inertial measurement chip writes the configuration data into internal registers in sequence to complete the initialization setting of the inertial measurement chip.
[0009] In some embodiments, after parsing the received synchronous measurement data to obtain and store the motion state data, the method further includes: After receiving the data retrieval signal sent by the application layer software, the vehicle controller uploads the motion state data to the application layer software so that the application layer software can update the data.
[0010] In some embodiments, the interrupt handling process further includes: After executing the action of sending the target instruction, the on-board controller queries the sending status of the target instruction, where the target instruction is any instruction sent by the on-board controller to the inertial measurement chip, including a data reading instruction and a clear reading instruction; When the sending status of the target instruction is not successfully sent, the vehicle controller stops sending the target instruction and sets an enable flag; When the enable flag is present, the vehicle controller executes a preset periodic task to periodically query the state of the internal communication interface driver, and the periodic task is not included in the interrupt processing flow; When the state of the communication interface driving is normal, the on-board controller sends the target instruction to the inertial measurement chip again.
[0011] In some embodiments, when the sending status of the target instruction is not successfully sent, the vehicle controller further performs the following operations: A fault notification is sent to the application layer software, so that the application layer software cancels updating of the motion state data acquired in the current interrupt processing flow.
[0012] In some embodiments, the communication interface driver is a SPI driver.
[0013] In a second aspect, an embodiment of the present application provides a vehicle-mounted control terminal, wherein the vehicle-mounted control terminal signal is connected to an inertial measurement chip, and the vehicle-mounted control terminal includes an interrupt signal receiving module, an interrupt processing trigger module, a chip communication module, a data parsing module, and a data storage module, wherein: The interrupt processing trigger module is used to trigger the execution of the interrupt processing flow after the interrupt signal receiving module receives the preparation completion signal sent by the inertial measurement chip, and the preparation completion signal is an interrupt signal used to trigger the interrupt processing flow; In the interrupt processing flow, the chip communication module is used for the inertial measurement chip to send a data reading instruction, so that the inertial measurement chip feeds back the currently stored synchronous measurement data; The chip communication module is also used to receive the synchronous measurement data; The data analysis module is used to analyze the received synchronous measurement data to obtain motion state data for storage by the data storage module; The chip communication module is further used to send a clear read instruction to the inertial measurement chip, so that an interrupt status register in the inertial measurement chip is cleared.
[0014] In some embodiments, after the interrupt signal receiving module receives the preparation completion signal sent by the inertial measurement chip, before the interrupt processing triggering module triggers the execution of the interrupt processing flow, the inertial measurement chip is used to perform the following processing: Get the acceleration and angular velocity data measured by the internal sensor Synchronously processing the acceleration data and the angular velocity data to obtain synchronous measurement data; After the synchronous measurement data is stored and the internal interrupt status register is in a cleared state, sending a preparation completion signal to the interrupt signal receiving module; Set the flag bit of the interrupt status register.
[0015] In some embodiments, before the inertial measurement chip acquires the acceleration data and the angular velocity data, the chip communication module is further used to send an initialization message to the inertial measurement chip, wherein the initialization message records the configuration data; The inertial measurement chip is also used to write the configuration data into internal registers in sequence to complete the initialization setting of the inertial measurement chip.
[0016] In some embodiments, the vehicle control terminal further includes a data uploading module for uploading the motion status data to the application layer software after receiving a data retrieval signal sent by the application layer software, so that the application layer software can perform data update.
[0017] In some embodiments, the vehicle-mounted control terminal further includes an information status detection module and a periodic task processing module; After the chip communication module executes the action of sending the target instruction, the information status detection module is used to query the sending status of the target instruction, and the target instruction is any instruction sent by the chip communication module to the inertial measurement chip, including a data reading instruction and a clear reading instruction; The information status detection module is also used to stop sending the target instruction and set an enable flag when the sending status of the target instruction is not successfully sent; The periodic task processing module is used to execute a preset periodic task when the enable flag is present, so as to periodically query the state of the internal communication interface driver, and the periodic task is not included in the interrupt processing flow; The chip communication module is also used to send the target instruction to the inertial measurement chip again when the state of the communication interface driving is normal.
[0018] In some embodiments, the vehicle control terminal also includes a fault notification module, which is used to send a fault notification to the application layer software when the sending status of the target instruction is unsuccessful, so that the application layer software cancels the update of the motion status data obtained in the current interrupt processing process.
[0019] In some embodiments, the communication interface driver is a SPI driver.
[0020] In a third aspect, an embodiment of the present application provides an on-board intelligent device, which is applied to new energy vehicles and is characterized in that the on-board intelligent device includes a processor and a memory, the memory stores a computer program, and when the processor executes the computer program, it implements the data reading method based on the interrupt signal as described in the first aspect.
[0021] In a fourth aspect, an embodiment of the present application provides a storage medium having a program stored thereon, and when the program is executed by a processor, it is used to implement the data reading method based on the interrupt signal as described in the first aspect.
[0022] The technical solution of this application has at least the following advantages: 1. The inertial measurement chip sends a preparation completion signal of the interrupt signal type, triggering the vehicle controller to execute the preset interrupt processing flow, and obtain real-time acceleration data and angular velocity data from the inertial measurement chip during the interrupt processing flow, so that the frequency of data collection for the inertial measurement chip is no longer limited to periodic tasks. In combination with the inertial measurement chip with high-frequency sampling characteristics, the real-time performance of data acquisition can be greatly improved; 2. By querying the sending status of the target command in the interrupt processing process and setting a periodic task after the target command fails to be sent to ensure the successful re-sending of the target command, the robustness of the interaction process between the vehicle controller and the inertial measurement chip is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 is a schematic diagram of an interactive system of a vehicle controller and an inertial measurement chip provided by an exemplary embodiment of the present application; Figure 2 is a flow chart of a data reading method based on an interrupt signal provided by an exemplary embodiment of the present application; Figure 3 is a waveform diagram of multiple signals when the trigger frequency of the preparation completion signal is 1000 Hz provided by an exemplary embodiment of the present application; Figure 4 is a flow chart for reflecting a data preparation process of an inertial measurement chip provided by an exemplary embodiment of the present application; Figure 5is a flowchart for reflecting a redundancy solution in an interrupt processing process provided by an exemplary embodiment of the present application; Figure 6 is a system block diagram of a vehicle-mounted control terminal provided by an exemplary embodiment of the present application; Figure 7 It is a structural block diagram of an in-vehicle intelligent device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0027] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0028] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0029] The present application provides a data reading method based on an interrupt signal, which is mainly used in an interactive system between a vehicle controller and an inertial measurement chip. Figure 1The inertial measurement chip is equipped with an acceleration sensor for detecting the linear acceleration of the three axes x, y, and z, an angular velocity sensor for detecting the angular velocity of the three axes x, y, and z, and an application-specific integrated circuit (ASIC) for controlling the above two. The application-specific integrated circuit is also equipped with a first register for storing acceleration data, a second register for storing angular velocity data, and an interrupt status register for recording the interrupt status. The on-board controller includes a processor (i.e. Figure 1 CPU in), memory (i.e. Figure 1 RAM in), an external request unit (ERU) and a serial communication interface, wherein the external request unit generates an external interrupt request and notifies the processor after receiving an interrupt signal from the inertial measurement chip, thereby triggering an internal software interrupt of the vehicle controller. The serial communication interface is used for serial communication with the inertial measurement chip, and can use an SPI interface, a UART interface, an I2C interface, etc. In the embodiment of the present application, Figure 1 As shown, the serial communication interface adopts the SPI interface.
[0030] Reference Figure 2 The data reading method based on the interrupt signal provided in this application includes the following contents: S10: After receiving the preparation completion signal sent by the inertial measurement chip, the vehicle controller executes a preset interrupt processing flow.
[0031] The preparation completion signal is an interrupt signal used to trigger an interrupt processing flow.
[0032] Exemplarily, during the operation of the vehicle, the inertial measurement chip will collect acceleration data and angular velocity data in real time. When the data preparation is completed and the internal interrupt status register is cleared, the inertial measurement chip will send a preparation completion signal to the external request unit of the vehicle controller. In order to achieve the above functions, an interrupt pin of the inertial measurement chip can be connected to the external request unit, and a rising edge can be triggered on the interrupt pin to send a preparation completion signal to the external request unit. Since the model type of the preparation completion signal is an interrupt signal, the external request unit will generate an external interrupt request and notify the processor, thereby triggering the vehicle controller to execute a preset interrupt processing flow. Among them, the inertial measurement chip can be configured to have a high-frequency sampling characteristic, for example, supporting data transmission rates such as 400Hz, 1000Hz, and 2000Hz. The specific data transmission rate can be selected and set according to user needs and the performance of the vehicle controller, so that the inertial measurement chip can collect acceleration data and angular velocity data at high frequency, and then send a preparation completion signal at high frequency, thereby improving the real-time performance of the vehicle controller data acquisition. After receiving the preparation completion signal from the inertial measurement chip, the on-board controller will execute the preset interrupt processing flow, which includes: S20: Sending a data reading instruction to the inertial measurement chip, so that the inertial measurement chip feeds back the currently stored synchronous measurement data.
[0033] The synchronous measurement data includes acceleration data and angular velocity data that have been synchronously processed.
[0034] Exemplarily, the on-board controller sends a data reading instruction to the inertial measurement chip, so that the inertial measurement chip feeds back the currently stored synchronous measurement data.
[0035] In this embodiment, since the serial communication interface uses an SPI interface, in order to reduce the number of SPI sequences sent during the communication process and reduce the load rate of the SPI interface, the inertial measurement chip can use an inertial measurement chip that supports the SPI burst mode, and the addresses of the first register and the second register are continuous. On this basis, when sending a data read instruction, the read frames of the first register and the second register can be placed in the same SPI sequence for sending, that is, by sending a data read instruction, the data in the first register and the second register can be read at the same time.
[0036] S30: receiving synchronous measurement data.
[0037] Exemplarily, the on-board controller receives the synchronous measurement data fed back by the inertial measurement chip through a serial communication interface.
[0038] S40: Analyze the received synchronous measurement data, obtain motion state data and store it.
[0039] The motion state data includes acceleration data and angular velocity data with the same timestamp.
[0040] Exemplarily, the processor in the on-board controller parses the synchronous measurement data to obtain the latest motion state data and stores it in the memory.
[0041] S50: Send a read clear instruction to the inertial measurement chip to clear the interrupt status register in the inertial measurement chip.
[0042] For example, after completing the data analysis, the vehicle controller may send a clear read instruction to the inertial measurement chip, thereby clearing the interrupt status register in the inertial measurement chip to ensure the triggering of the next interrupt.
[0043] By executing the interrupt processing flow mentioned above, the vehicle controller can obtain real-time acceleration data and angular velocity data from the inertial measurement chip, and the frequency of data acquisition is no longer limited to periodic tasks. In combination with the inertial measurement chip with high-frequency sampling characteristics, the real-time performance of data acquisition can be greatly improved. Figure 3 , which shows the waveforms of multiple signals when the trigger frequency of the preparation completion signal is 1000Hz, where, from bottom to top, are the waveform of the preparation completion signal (interrupt signal), the waveform of the serial communication interface clock signal, the waveform of the instructions (including data reading instructions and clear reading instructions) sent by the vehicle controller to the inertial measurement chip through the serial communication interface, and the waveform of the CS signal (Chip Select signal) sent to the inertial measurement chip through the serial communication interface. It can be found that when the trigger frequency of the preparation completion signal is 1000Hz, the vehicle controller can stably interact with the inertial measurement chip.
[0044] Furthermore, before step S10 in the above, the inertial measurement chip will perform data preparation, such as Figure 4 As shown, the data preparation process can be as follows: S01: Obtain acceleration data and angular velocity data through internal sensors.
[0045] Exemplarily, the acceleration sensor and angular velocity sensor in the inertial measurement chip respectively measure acceleration data and angular velocity data in real time.
[0046] S02: Synchronously process the acceleration data and the angular velocity data to obtain synchronous measurement data.
[0047] Exemplarily, the ASIC of the inertial measurement chip will obtain different timestamps of the acceleration sensor and the angular velocity sensor after the analog-to-digital conversion process. Since the sampling frequency of the angular velocity data is generally higher than that of the acceleration data, the ASIC can perform interpolation operations on the acceleration data, align the timestamps of the acceleration data and the timestamps of the angular velocity data, and obtain synchronized acceleration data and angular velocity data, that is, synchronized measurement data. The synchronized acceleration data and angular velocity data can be binary data. In order to achieve the above function, the acceleration interrupt pin and the angular velocity interrupt pin of the inertial measurement chip can be connected, so that after the angular velocity data is prepared, the ASIC can be quickly notified to perform synchronous processing of the acceleration signal.
[0048] S03: After the synchronous measurement data is stored and the internal interrupt status register is in the cleared state, the inertial measurement chip sends a ready signal to the vehicle controller.
[0049] Exemplarily, the acceleration data and angular velocity data after synchronization processing are stored in the first register and the second register, respectively. After the synchronous measurement data is stored, the inertial measurement chip identifies the state of the internal interrupt status register, and when the interrupt status register is in a cleared state, the inertial measurement chip sends a ready completion signal to the vehicle controller.
[0050] S04: Set the flag bit of the interrupt status register.
[0051] After the ready signal is sent, the inertial measurement chip will set the flag bit of the interrupt status register to avoid repeated sending of the ready signal.
[0052] Furthermore, before the above step S01, the following processing is also included: The on-board controller sends an initialization message to the inertial measurement chip, and the initialization message records the configuration data.
[0053] For example, after the inertial measurement chip is powered on, it needs to be initialized. The vehicle controller sends an initialization message to the inertial measurement chip through a serial communication interface, and the initialization message records configuration data such as range, bandwidth, and pin configuration.
[0054] The inertial measurement chip writes the configuration data into the internal registers in sequence to complete the initialization setting of the inertial measurement chip.
[0055] Exemplarily, the inertial measurement chip writes the received configuration data into the internal register in sequence, and completes its own initialization settings according to the configuration data. Generally speaking, the initialization process is configured in the periodic task of the first 1.5 seconds or so after the inertial measurement chip is powered on. Under the premise that the serial communication interface load rate is not high, the above periodic task can be mounted to the fastest task supported by the on-board processor OS (operating system task) to shorten the initialization process time. In addition, since the initialization message contains a large number of SPI frames, in order to shorten the processing time, the binary data in the bin format configuration file can be sent continuously as 32 bytes per SPI frame.
[0056] Furthermore, after the above step S40, the following steps may also be included: S41: After receiving the data retrieval signal sent by the application layer software, the vehicle controller uploads the motion status data to the application layer software so that the application layer software can update the data.
[0057] Exemplarily, the motion state data is stored in the basic software layer (BSW) of the vehicle controller. In order to facilitate user viewing, the corresponding application layer software can be configured in the application software layer (ASW), and the application software layer can obtain the data in the basic software layer by calling the underlying interface. The application layer software sends a data retrieval signal to the vehicle controller, so that the vehicle controller uploads the stored motion state data to the application layer software for data update by the application layer software.
[0058] Furthermore, due to the use of a technical solution of sending instructions through a high-frequency interrupt to trigger a serial communication interface, in actual application, there may be a problem of missing instructions, especially for clear read instructions. When a clear read instruction is sent, the interrupt status register in the inertial measurement chip will not be cleared, and the inertial measurement chip will not send a new preparation completion signal to the on-board controller, resulting in a serious failure of data reading loss. Therefore, in order to improve robustness, a redundant solution is also provided in the above interrupt processing flow, referring to Figure 5 , the redundancy scheme may include the following processing: S51: After executing the action of sending the target instruction, the on-board controller queries the sending status of the target instruction.
[0059] Among them, the target instruction is any instruction sent by the vehicle controller to the inertial measurement chip through the serial communication interface, including data reading instructions and clear reading instructions. In the vehicle controller, a communication interface driver for calling the serial communication interface is configured. The serial communication interface adopts an asynchronous transmission mode. Therefore, after the vehicle controller executes the action of sending the target instruction, the target instruction sent through the serial communication interface will first queue in the communication interface driver and wait for sending. When the serial communication interface works normally, the target instruction will be issued in a very short time. In the embodiment of the present application, the target instruction is a clear reading instruction as an example for subsequent explanation.
[0060] Exemplarily, after executing the action of sending the clear read instruction, the on-board controller will call the communication interface driver to execute a preset status readback function, thereby querying the sending status of the clear read instruction in the communication interface driver.
[0061] S52: When the sending status of the target instruction is not successfully sent, the vehicle controller stops sending the target instruction and sets the enable flag.
[0062] Exemplarily, when the serial communication interface is working normally, after calling the communication interface driver to execute the preset status readback function, the sending status of the queried target instruction will be displayed as successfully sent. When the read clear instruction is not successfully sent, for example due to the high load rate of the serial communication interface, the query result will be displayed as a non-zero value, which means that the sending status of the read clear instruction is unsuccessful. In this case, if you try to force the read clear instruction to be sent again, the communication interface driver will directly reject the request to send again, resulting in the failure of the request to send again. Therefore, when the query result shows a non-zero value, the vehicle controller will stop sending the read clear instruction and set an enable flag.
[0063] S53: When the enable flag is present, the vehicle controller executes a preset periodic task to periodically query the status of the internal communication interface driver.
[0064] The periodic task is not included in the interrupt processing flow.
[0065] For example, when the enable flag is present, the vehicle controller will execute a preset periodic task to periodically query the status of the internal communication interface driver. The period of the preset periodic task can be as close as possible to the inherent data transmission period of the inertial measurement chip to ensure that the normal data update frequency can be restored as soon as possible after the instruction is missed.
[0066] S54: When the state of the communication interface drive is normal, the vehicle controller sends a target instruction to the inertial measurement chip again.
[0067] For example, when the serial communication interface no longer has abnormalities such as excessive load rate, the state of the communication interface driver will be displayed as normal. When the state of the communication interface driver is normal, the vehicle controller will send a read clear instruction to the inertial measurement chip through the serial communication interface again. After that, the vehicle controller will stop executing the periodic task in step S53 and cancel the enable flag bit mentioned above.
[0068] Furthermore, when executing step S52 above, if the target sending status is found to be unsuccessful, the vehicle controller may further perform the following processing: Send a fault notification to the application layer software, so that the application layer software cancels the update of the motion state data obtained in the current interrupt processing flow.
[0069] For example, when the target sending status is not successfully sent, it means that a frame missing fault has occurred. At this time, the motion state data obtained in this interrupt processing flow may be abnormal. Therefore, the vehicle controller can send a fault notification to the application layer software, so that the application layer software cancels the update of the motion state data obtained in the current interrupt processing flow.
[0070] Furthermore, since in the embodiment of the present application, the serial communication interface adopts the SPI interface, the communication interface driver is also an SPI driver.
[0071] The data reading method based on interrupt signal provided in the embodiment of the present application, on the one hand, triggers the vehicle controller to execute the preset interrupt processing flow by sending a preparation completion signal of the interrupt signal type through the inertial measurement chip, and obtains real-time acceleration data and angular velocity data from the inertial measurement chip in the interrupt processing flow, so that the frequency of data acquisition for the inertial measurement chip is no longer limited by periodic tasks, and the real-time performance of data acquisition can be greatly improved by cooperating with the inertial measurement chip with high-frequency sampling characteristics. On the other hand, by querying the sending status of the target instruction in the interrupt processing flow, and setting a periodic task after the target instruction fails to send to ensure the successful re-sending of the target instruction, the robustness of the interaction process between the vehicle controller and the inertial measurement chip is improved.
[0072] refer to Figure 6 The present application also provides a vehicle-mounted control terminal, the vehicle-mounted control terminal signal is connected to an inertial measurement chip, and the vehicle-mounted control terminal includes an interrupt signal receiving module 610, an interrupt processing trigger module 620, a chip communication module 630, a data parsing module 640, and a data storage module, wherein: The interrupt processing trigger module 620 is used to trigger the execution of the interrupt processing flow after the interrupt signal receiving module 610 receives the preparation completion signal sent by the inertial measurement chip. The preparation completion signal is an interrupt signal used to trigger the interrupt processing flow.
[0073] In the interrupt processing flow, the chip communication module 630 is used for the inertial measurement chip to send a data reading instruction, so that the inertial measurement chip feeds back the currently stored synchronous measurement data.
[0074] The chip communication module 630 is also used to receive synchronous measurement data.
[0075] The data analysis module 640 is used to analyze the received synchronous measurement data, obtain motion state data and provide the data storage module with the data.
[0076] The chip communication module 630 is also used to send a read clear instruction to the inertial measurement chip, so that the interrupt status register in the inertial measurement chip is cleared.
[0077] In some embodiments, before the interrupt signal receiving module 610 receives the preparation completion signal sent by the inertial measurement chip and the interrupt processing triggering module 620 triggers the execution of the interrupt processing flow, the inertial measurement chip is used to perform the following processing: Acquire acceleration data and angular velocity data through internal sensors.
[0078] The acceleration data and the angular velocity data are processed synchronously to obtain synchronous measurement data.
[0079] When the synchronous measurement data is stored and the internal interrupt status register is in a cleared state, a preparation completion signal is sent to the interrupt signal receiving module 610 .
[0080] Set the flag bit in the interrupt status register.
[0081] In some embodiments, before the inertial measurement chip acquires acceleration data and angular velocity data through internal sensors, the chip communication module 630 is further configured to send an initialization message to the inertial measurement chip, wherein the configuration data is recorded in the initialization message.
[0082] The inertial measurement chip is also used to write configuration data into internal registers in sequence to complete the initialization setting of the inertial measurement chip.
[0083] In some embodiments, the vehicle control terminal also includes a data upload module, which is used to upload the motion status data to the application layer software after receiving a data retrieval signal sent by the application layer software, so that the application layer software can update the data.
[0084] In some embodiments, the vehicle-mounted control terminal also includes an information status detection module and a periodic task processing module.
[0085] After the chip communication module executes the action of sending the target instruction, the information status detection module is used to query the sending status of the target instruction. The target instruction is any instruction sent by the chip communication module to the inertial measurement chip, including a data reading instruction and a clear reading instruction.
[0086] The information status detection module is also used to stop sending the target instruction and set an enable flag when the sending status of the target instruction is not successfully sent.
[0087] The periodic task processing module is used to execute a preset periodic task when an enable flag is present to periodically query the status of the internal communication interface driver. The periodic task is not included in the interrupt processing flow.
[0088] The chip communication module 630 is further configured to send a target instruction to the inertial measurement chip again when the communication interface driving state is normal.
[0089] In some embodiments, the vehicle control terminal also includes a fault notification module, which is used to send a fault notification to the application layer software when the sending status of the target instruction is not successfully sent, so that the application layer software cancels the update of the motion status data obtained in the current interrupt processing process.
[0090] In some embodiments, the communication interface driver is a SPI driver.
[0091] refer to Figure 7 The present application also provides an in-vehicle intelligent device, which includes a processor 710 and a memory 720 .
[0092] The processor 710 may include one or more processing cores. The processor 710 uses various interfaces and lines to connect various parts of the entire device, and executes various functions of the device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 720, and calling data stored in the memory 720. Optionally, the processor 710 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 710 can integrate one or a combination of a central processing unit (CPU) and a modem. Among them, the CPU mainly processes the operating system and application programs; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 710, but implemented separately through a chip.
[0093] Optionally, when the processor 710 executes the program instructions in the memory 720 , the data reading method based on the interrupt signal provided by the above-mentioned various method embodiments is implemented.
[0094] The memory 720 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 720 includes a non-transitory computer-readable storage medium. The memory 720 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data created according to the use of the device, etc.
[0095] Optionally, the present application also provides a storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the data reading method based on the interrupt signal provided in the above method embodiment.
[0096] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection created by this application.
Claims
1. A data reading method based on an interrupt signal, characterized in that: include: After receiving the preparation completion signal sent by the inertial measurement chip, the on-board controller executes a preset interrupt processing flow, wherein the preparation completion signal is an interrupt signal for triggering the interrupt processing flow; The interrupt processing flow includes: Sending a data reading instruction to the inertial measurement chip, so that the inertial measurement chip feeds back the currently stored synchronous measurement data; Receiving the synchronous measurement data; Parsing the received synchronous measurement data to obtain motion state data and store the data; A read clear instruction is sent to the inertial measurement chip, so that an interrupt status register in the inertial measurement chip is cleared.
2. The data reading method based on interrupt signal according to claim 1, characterized in that: After the vehicle-mounted controller receives the preparation completion signal sent by the inertial measurement chip, before executing the preset interrupt processing flow, the process includes: The inertial measurement chip measures acceleration data and angular velocity data through internal sensors; The inertial measurement chip synchronously processes the acceleration data and the angular velocity data to obtain synchronous measurement data; After the synchronous measurement data is stored and the internal interrupt status register is in a cleared state, the inertial measurement chip sends a preparation completion signal to the vehicle controller; The inertial measurement chip sets a flag bit of the interrupt status register.
3. The data reading method based on interrupt signal according to claim 2, characterized in that: Before acquiring the acceleration data and the angular velocity data through the internal sensor, the method includes: The on-board controller sends an initialization message to the inertial measurement chip, wherein the initialization message records configuration data; The inertial measurement chip writes the configuration data into internal registers in sequence to complete the initialization setting of the inertial measurement chip.
4. The data reading method based on interrupt signal according to claim 1, characterized in that: After parsing the received synchronous measurement data to obtain and store the motion state data, the method further includes: After receiving the data retrieval signal sent by the application layer software, the vehicle controller uploads the motion state data to the application layer software so that the application layer software can update the data.
5. The data reading method based on interrupt signal according to claim 1, characterized in that: The interrupt processing process also includes: After executing the action of sending the target instruction, the on-board controller queries the sending status of the target instruction, where the target instruction is any instruction sent by the on-board controller to the inertial measurement chip, including a data reading instruction and a clear reading instruction; When the sending status of the target instruction is not successfully sent, the vehicle controller stops sending the target instruction and sets an enable flag; When the enable flag is present, the vehicle controller executes a preset periodic task to periodically query the state of the internal communication interface driver, and the periodic task is not included in the interrupt processing flow; When the state of the communication interface driving is normal, the on-board controller sends the target instruction to the inertial measurement chip again.
6. The data reading method based on interrupt signal according to claim 5, characterized in that: When the sending status of the target instruction is not successfully sent, the vehicle controller further performs the following operations: A fault notification is sent to the application layer software, so that the application layer software cancels updating of the motion state data acquired in the current interrupt processing flow.
7. The data reading method based on interrupt signal according to claim 5, characterized in that: The communication interface driver is a SPI driver.
8. A vehicle-mounted control terminal, characterized in that: The vehicle-mounted control terminal signal is connected to an inertial measurement chip, and the vehicle-mounted control terminal includes an interrupt signal receiving module, an interrupt processing trigger module, a chip communication module, a data parsing module, and a data storage module, wherein: The interrupt processing trigger module is used to trigger the execution of the interrupt processing flow after the interrupt signal receiving module receives the preparation completion signal sent by the inertial measurement chip, and the preparation completion signal is an interrupt signal used to trigger the interrupt processing flow; In the interrupt processing flow, the chip communication module is used for the inertial measurement chip to send a data reading instruction, so that the inertial measurement chip feeds back the currently stored synchronous measurement data; The chip communication module is also used to receive the synchronous measurement data; The data analysis module is used to analyze the received synchronous measurement data to obtain motion state data for storage by the data storage module; The chip communication module is further used to send a clear read instruction to the inertial measurement chip, so that an interrupt status register in the inertial measurement chip is cleared.
9. The vehicle-mounted control terminal according to claim 8, characterized in that: Before the interrupt signal receiving module receives the preparation completion signal sent by the inertial measurement chip and the interrupt processing triggering module triggers the execution of the interrupt processing flow, the inertial measurement chip is used to perform the following processing: Acquire acceleration data and angular velocity data through internal sensors; Synchronously processing the acceleration data and the angular velocity data to obtain synchronous measurement data; After the synchronous measurement data is stored and the internal interrupt status register is in a cleared state, sending a preparation completion signal to the interrupt signal receiving module; Set the flag bit of the interrupt status register.
10. The vehicle-mounted control terminal according to claim 9, characterized in that: Before the inertial measurement chip acquires acceleration data and angular velocity data through an internal sensor, the chip communication module is further used to send an initialization message to the inertial measurement chip, wherein the initialization message records configuration data; The inertial measurement chip is also used to write the configuration data into internal registers in sequence to complete the initialization setting of the inertial measurement chip.
11. The vehicle-mounted control terminal according to claim 8, characterized in that: The vehicle-mounted control terminal also includes a data uploading module, which is used to upload the motion state data to the application layer software after receiving a data retrieval signal sent by the application layer software, so that the application layer software can update the data.
12. The vehicle-mounted control terminal according to claim 8, characterized in that: The vehicle-mounted control terminal also includes an information status detection module and a periodic task processing module; After the chip communication module executes the action of sending the target instruction, the information status detection module is used to query the sending status of the target instruction, and the target instruction is any instruction sent by the chip communication module to the inertial measurement chip, including a data reading instruction and a clear reading instruction; The information status detection module is also used to stop sending the target instruction and set an enable flag when the sending status of the target instruction is not successfully sent; The periodic task processing module is used to execute a preset periodic task when the enable flag is present, so as to periodically query the state of the internal communication interface driver, and the periodic task is not included in the interrupt processing flow; The chip communication module is also used to send the target instruction to the inertial measurement chip again when the state of the communication interface driving is normal.
13. The vehicle-mounted control terminal according to claim 12, characterized in that: The vehicle-mounted control terminal also includes a fault notification module, which is used to send a fault notification to the application layer software when the sending status of the target instruction is unsuccessful, so that the application layer software cancels the update of the motion status data obtained in the current interrupt processing process.
14. The vehicle-mounted control terminal according to claim 12, characterized in that: The communication interface driver is a SPI driver.
15. An in-vehicle intelligent device, which is applied to new energy vehicles, characterized in that: The in-vehicle intelligent device includes a processor and a memory, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
16. A storage medium having a program stored thereon, wherein when the program is executed by a processor, the program is used to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data reading method and device, electronic equipment and readable storage medium
CN116560727A
Inertial measurement signal acquisition method and device, computer equipment and storage medium
CN116572975A
Methods and Systems for Synchronizing Data Received from Multiple Sensors of a Device
US20150185054A1
Method and apparatus for interrupt coalescing
US20160124874A1
Sampling and control circuit board for an inertial measurement unit
US9423426B1
Cited By
Data reading method and device, electronic equipment and readable storage medium
CN116560727A
Data reading method and device, electronic equipment and readable storage medium
CN116560727B