Software debugging method and device of vehicle, electronic equipment and storage medium
By detecting and debugging function switches and module types, and compressing and transmitting debugging data to calibrate and debug autonomous driving software modules, the problem of high debugging costs in existing technologies is solved, development efficiency is improved and resources are saved.
Patent Information
- Application Number
- CN202210709340.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-06-21
Smart Images

Figure CN115221042B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle software debugging technology, and in particular to a vehicle software debugging method, apparatus, electronic device and storage medium. Background Technology
[0002] Currently, autonomous driving technology is developing rapidly, and OEMs, internet companies, and startups are all investing in the field. Improving development and testing efficiency is a crucial aspect of the mass production development process in this emerging field.
[0003] In related technologies, the collection of internal application information of the controller is often not considered during application software development and extensive road testing, which fails to meet the needs of application software development and debugging. Furthermore, when developing and debugging application software, especially when real-time online parameter adjustment is required, calibration protocols such as CCP (CAN Calibration Protocol) and XCP (Universal Calibration Protocol) can only be purchased at an additional cost, resulting in high costs that urgently need to be addressed. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for debugging vehicle software, in order to solve the problem that the related technologies cannot meet the needs of application software development and debugging or that the cost of application software development and debugging is high. Without adding additional hardware, the calibration and debugging of autonomous driving software modules can be realized through the developed application, thereby improving the efficiency of autonomous driving software development.
[0005] A first aspect of this application provides a software debugging method for a vehicle, the vehicle including a debugging function switch, the method comprising the following steps: detecting the actual state of the debugging function switch and the type of the module to be debugged; when the debugging function switch is detected to be in the on state, compressing the debugging data of the module to be debugged according to a preset compression rule to obtain the current compressed data of the module to be debugged; determining the target transmission mode of the current compressed data based on the type of the module to be debugged, and transmitting the current compressed data to a target debugging device according to the target transmission mode, so that the target debugging device re-debugs the module to be debugged based on the current compressed data.
[0006] Based on the above technical means, this application embodiment can compress the debugging data of the module to be debugged according to a preset compression rule to obtain the current compressed data when the debugging function switch is on. Based on the type of the module to be debugged, the target transmission method of the current compressed data is determined, and the current compressed data is transmitted to the target debugging device according to the target transmission method. This allows the target debugging device to re-debug the module to be debugged based on the current compressed data. Without adding additional hardware, the calibration and debugging of autonomous driving software modules can be realized through the developed application, thereby improving the efficiency of autonomous driving software development.
[0007] Furthermore, determining the target transmission method of the current compressed data based on the type of the module to be debugged includes: when the module to be debugged is a microcontroller unit (MCU) module, the target transmission method of the current compressed data is periodic transmission; when the module to be debugged is a system-on-chip (SOC) module, the target transmission method is determined according to the comparison result between the current compressed data and the previous compressed data, wherein when the comparison result between the current compressed data and the previous compressed data is inconsistent, the target transmission method is to directly transmit the current compressed data.
[0008] Based on the above technical means, different data transmission methods can be set according to the type of the module to be debugged, which can facilitate signal debugging and troubleshooting of software modules.
[0009] Furthermore, detecting the actual state of the debugging function switch includes: when the debugging function switch is in the off state, detecting the current gear of the vehicle, the state of the brake pedal, and the braking duration of the parking brake; if the current gear is neutral, the brake pedal is in the triggered state, and the braking duration is greater than a preset duration, then controlling the debugging function switch to switch from the off state to the on state.
[0010] Based on the above technical means, the debugging function switch is used to control the opening and closing of the entire debugging function, thereby improving the safety of debugging.
[0011] Furthermore, when the module to be debugged is the microcontroller unit (MCU) module, the above-mentioned vehicle software debugging method further includes: calculating a first offset of the position of the first calibration parameter in the MCU module relative to the first initial position based on a first initial position of a pre-set first calibration parameter in a parameter list; sending a first calibration value, the first offset, and preset verification information to the MCU module, so that after the MCU module queries the memory address to be calibrated based on the first offset and the preset verification information, it modifies the value in the memory address to be calibrated to the first calibration value.
[0012] Based on the above technical means, during actual testing, different data are sent and debugged according to the different functional test requirements, so as to save the CPU resource consumption of the controller sending data and reduce the impact on the system.
[0013] Furthermore, when the module to be debugged is the system-on-a-chip (SOC) module, the above-mentioned vehicle software debugging method further includes: sending the second calibration parameter and the second calibration value to the SOC module, so that the SOC module calculates the second offset of the parameter to be calibrated according to the type of the parameter to be calibrated and the second initial position of the parameter to be calibrated in the calibration list, and obtains the memory address of the second calibration parameter based on the second offset and the second initial position, and modifies the value in the memory address of the second calibration parameter to the second calibration value.
[0014] Based on the above technical means, during actual testing, different data are sent and debugged according to the different functional test requirements, so as to save the CPU resource consumption of the controller sending data and reduce the impact on the system.
[0015] Furthermore, the above-mentioned vehicle software debugging method also includes: determining whether feedback information indicating successful calibration has been received from the MCU module and / or the SOC module; if no feedback information indicating successful calibration has been received from the MCU module and / or the SOC module, then controlling the target debugging device to display information indicating that the MCU module and / or the SOC module has failed calibration.
[0016] Based on the above technical means, by providing feedback on the calibration status, those skilled in the art can obtain the actual calibration situation in a timely manner.
[0017] A second aspect of this application provides a software debugging device for a vehicle. The vehicle includes a debugging function switch. The device includes: a detection module for detecting the actual state of the debugging function switch and the type of the module to be debugged; a compression module for compressing the debugging data of the module to be debugged according to a preset compression rule when the debugging function switch is detected to be in the on state, to obtain the current compressed data of the module to be debugged; and a debugging module for determining the target transmission method of the current compressed data based on the type of the module to be debugged, and transmitting the current compressed data to a target debugging device according to the target transmission method, so that the target debugging device re-debugs the module to be debugged based on the current compressed data.
[0018] Furthermore, the debugging module is specifically used for: when the module to be debugged is a microcontroller unit (MCU) module, the target transmission method of the current compressed data is periodic transmission; when the module to be debugged is a system-on-a-chip (SOC) module, determining the target transmission method based on the comparison result of the current compressed data and the previous compressed data, wherein, when the comparison result of the current compressed data and the previous compressed data is inconsistent, the target transmission method is to directly transmit the current compressed data.
[0019] Furthermore, the detection module is specifically used to: detect the vehicle's current gear, the state of the brake pedal, and the braking duration of the parking brake when the debugging function switch is in the off state; if the current gear is neutral, the brake pedal is in the triggered state, and the braking duration is greater than a preset duration, then control the debugging function switch to switch from the off state to the on state.
[0020] Furthermore, when the module to be debugged is a microcontroller unit (MCU) module, the aforementioned vehicle software debugging device further includes: a calculation module, used to calculate a first offset of the position of the first calibration parameter in the MCU module relative to the first initial position based on a first initial position of a pre-set first calibration parameter in a parameter list; and a first calibration module, used to send a first calibration value, the first offset, and preset verification information to the MCU module, so that after the MCU module queries the memory address to be calibrated based on the first offset and the preset verification information, it modifies the value in the memory address to be calibrated to the first calibration value.
[0021] Furthermore, when the module to be debugged is the system-on-a-chip (SOC) module, the aforementioned vehicle software debugging device further includes: a second calibration module, used to send a second calibration parameter and a second calibration value to the SOC module, so that the SOC module calculates a second offset of the parameter to be calibrated according to the type of the parameter to be calibrated and the second initial position of the parameter to be calibrated in the calibration list, and obtains the memory address of the second calibration parameter based on the second offset and the second initial position, and modifies the value in the memory address of the second calibration parameter to the second calibration value.
[0022] Furthermore, the aforementioned vehicle software debugging device further includes: a judgment module, used to determine whether feedback information indicating successful calibration has been received from the MCU module and / or the SOC module; and a control module, used to control the target debugging device to display information indicating that the MCU module and / or the SOC module has failed calibration if feedback information indicating successful calibration has not been received from the MCU module and / or the SOC module.
[0023] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the software debugging method for a vehicle as described in the above embodiments.
[0024] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the software debugging method for a vehicle as described in the above embodiments.
[0025] This application embodiment can detect the actual state of the debugging function switch and the type of the module to be debugged. When the debugging function switch is detected to be on, the debugging data of the module to be debugged is compressed according to a preset compression rule to obtain the current compressed data of the module to be debugged. Based on the type of the module to be debugged, the target transmission method of the current compressed data is determined, and the current compressed data is transmitted to the target debugging device according to the target transmission method, so that the target debugging device can re-debug the module to be debugged based on the current compressed data. Therefore, without adding additional hardware, the calibration and debugging of autonomous driving software modules can be realized through the developed application, thereby improving the efficiency of autonomous driving software development.
[0026] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0027] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0028] Figure 1 This is a flowchart illustrating a software debugging method for a vehicle according to an embodiment of this application;
[0029] Figure 2 This is a schematic diagram of a controller debugging and calibration system involved in a vehicle software debugging method according to an embodiment of this application;
[0030] Figure 3 This is a block diagram of the debugging portion in a vehicle software debugging method according to an embodiment of this application;
[0031] Figure 4 This is a flowchart of the debugging portion of a vehicle software debugging method according to an embodiment of this application;
[0032] Figure 5 This is a block diagram of the calibration portion in a vehicle software debugging method according to an embodiment of this application;
[0033] Figure 6 This is a flowchart illustrating the calibration portion of a vehicle software debugging method according to an embodiment of this application.
[0034] Figure 7 This is a flowchart illustrating the internal calibration process of an SOC module according to an embodiment of this application.
[0035] Figure 8 This is a flowchart illustrating the internal calibration process of an MCU module according to an embodiment of this application.
[0036] Figure 9 This is a block diagram of a software debugging apparatus for a vehicle according to an embodiment of the present application;
[0037] Figure 10 A schematic diagram of the structure of an electronic device provided in the embodiments of this application.
[0038] Among them, 1-SOC, 2-Ethernet data acquisition device, 3-First communication node, 4-Autonomous driving controller, 5-Second communication node, 6-Algorithm module, 7-MCU, 8-Application function, 9-Host computer, 10-Vehicle software debugging device, 100-Detection module, 200-Compression module, 300-Debugging module. Detailed Implementation
[0039] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0040] The following description, with reference to the accompanying drawings, describes a vehicle software debugging method, apparatus, electronic device, and storage medium according to embodiments of this application. Addressing the issues mentioned in the background section regarding the inability to meet the debugging needs of application software development or the high cost of application software development and debugging, this application provides a vehicle software debugging method. This method detects the actual state of a debugging function switch and the type of the module to be debugged. When the debugging function switch is detected to be on, the debugging data of the module to be debugged is compressed according to a preset compression rule to obtain the current compressed data of the module to be debugged. Based on the type of the module to be debugged, the target transmission method of the current compressed data is determined, and the current compressed data is transmitted to a target debugging device according to the target transmission method, enabling the target debugging device to re-debug the module to be debugged based on the current compressed data. Therefore, without adding additional hardware, the calibration and debugging of autonomous driving software modules can be achieved through a developed application, thereby improving the efficiency of autonomous driving software development.
[0041] Specifically, Figure 1This is a flowchart illustrating a software debugging method for a vehicle provided in an embodiment of this application.
[0042] Before introducing the vehicle software debugging method of this application embodiment, let's briefly introduce the controller debugging and calibration system involved in the vehicle software debugging method of this application embodiment. Specifically, as... Figure 2 As shown, the system includes: an autonomous driving controller 4, a host computer 9, and an Ethernet data acquisition device 2. The autonomous driving controller 4 consists of two main chips: SOC1 and MCU7. Information exchange between SOC1 and MCU7 can be achieved via a bus (such as SPI (Serial Peripheral Interface), Ethernet, or CAN (Controller Area Network) bus). The interfaces of the autonomous driving controller 4 include CANFD, ETH (EtherNet), image input, and ADB (Android Debug Bridge) interfaces for external communication. CANFD mainly receives vehicle information and sensor information (Radar, Lidar). The Ethernet interface is used to send and receive Ethernet information for external communication. The image input is used for the SOC's internal recognition algorithm, and ADB is used for communication with the host computer 9. SOC1 deploys application functions 8, calibration nodes, and communication nodes 3. MCU7 deploys algorithm modules 6, calibration data reception, debug data transmission, and debug function switches.
[0043] It should be noted that the vehicle software debugging method in this application embodiment mainly includes two parts: debugging and calibration. Debugging primarily involves recording the input, output, and intermediate signals of different software modules in the controller into files or sending them in real-time to external communication devices to achieve signal acquisition for troubleshooting software module issues and software iteration. Calibration mainly involves modifying the parameters in the software online according to test matching needs to adjust the parameters and quickly verify the software's effectiveness.
[0044] To facilitate understanding, a detailed explanation is provided below with reference to specific embodiments.
[0045] like Figure 1 As shown, the software debugging method for this vehicle includes the following steps:
[0046] In step S101, the actual state of the debug function switch and the type of the module to be debugged are detected.
[0047] Furthermore, in some embodiments, detecting the actual state of the debugging function switch includes: when the debugging function switch is in the off state, detecting the current gear of the vehicle, the state of the brake pedal, and the braking duration of the parking brake; if the current gear is neutral, the brake pedal is in the triggered state, and the braking duration is greater than a preset duration, then controlling the debugging function switch to switch from the off state to the on state.
[0048] It should be understood that the debugging function switch is responsible for turning the entire debugging function on and off. In this application embodiment, the function switch state change can be achieved by using a combination of vehicle operations. For example, the current gear position, brake pedal state, and parking brake duration can be detected. If the current gear is neutral, the brake pedal is in the triggered state, and the braking duration is longer than the preset duration, such as pressing the brake, shifting to N gear, and engaging the handbrake switch for more than 5 seconds, the function switch state changes once. If the debugging function switch is currently in the off state, when pressing the brake, shifting to N gear, and engaging the handbrake switch for more than 5 seconds, this application embodiment can change the debugging function switch from the off state to the on state. After the function is enabled, the on state is sent to each software module.
[0049] In step S102, when the debugging function switch is detected to be in the on state, the debugging data of the module to be debugged is compressed according to the preset compression rules to obtain the current compressed data of the module to be debugged.
[0050] Among them, the preset compression rule can be to perform formula conversion processing on different signals according to the accuracy and range of each signal value, so as to reduce the amount of transmission.
[0051] It should be understood that when the debugging function switch is detected to be in the on state, the embodiments of this application can perform formula conversion processing on different signals according to the accuracy and range of each signal value to obtain the current compressed data of the module to be debugged, so as to reduce the amount of transmission.
[0052] In step S103, based on the type of the module to be debugged, the target transmission method of the current compressed data is determined, and the current compressed data is transmitted to the target debugging device according to the target transmission method, so that the target debugging device can re-debug the module to be debugged according to the current compressed data.
[0053] Furthermore, in some embodiments, the target transmission method of the current compressed data is determined based on the type of the module to be debugged, including: when the module to be debugged is a microcontroller unit (MCU) module, the target transmission method of the current compressed data is periodic transmission; when the module to be debugged is a system-on-a-chip (SOC) module, the target transmission method is determined according to the comparison result between the current compressed data and the previous compressed data, wherein when the comparison result between the current compressed data and the previous compressed data is inconsistent, the target transmission method is to directly transmit the current compressed data.
[0054] The target debugging device can be a host computer.
[0055] Specifically, for the current compressed data of the SOC application, this embodiment can compare the current compressed data with the previous compressed data. If there is a change between the current compressed data and the previous compressed data, the current compressed data is sent via Ethernet while the previous debug data is updated. If there is no change between the current compressed data and the previous compressed data, it is not sent. For the current compressed data of the MCU, it is sent periodically. After the data is sent, the system calls the underlying Ethernet Socket communication interface and sends it to the set IP (Internet Protocol) address and port using the UDP (User Datagram Protocol) protocol.
[0056] Furthermore, the target debugging device (such as a host computer) is connected to the controller via Ethernet and can receive debugging data using a standard Ethernet socket. In this embodiment, a dedicated device VN5640 can be used to achieve general Ethernet data acquisition and recording.
[0057] To facilitate those skilled in the art to further understand the debugging portion of the vehicle software debugging method in the embodiments of this application, the following is combined with... Figure 3 and Figure 4 Provide detailed explanation
[0058] like Figure 3 As shown, Figure 3 This is a block diagram illustrating the debugging function of a specific embodiment of this application. The debugging function consists of three parts: debugging function switch judgment, algorithm module compression of debugging data, and transmission of compressed data. The debugging function switch judgment module uses vehicle information or configuration information to control the function's on / off state. When the driver operates or external configuration information changes, it outputs a debugging on / off signal. Upon receiving the debugging function on signal, the MCU algorithm module compresses the data to be compressed according to predefined compression rules, loads the compressed data into a defined Ethernet data frame, and sends the Ethernet data to the SOC. The SOC, upon receiving the data frame, forwards it to an external Ethernet device. Similarly, upon receiving the debugging function on signal, the SOC algorithm module compresses the data to be compressed according to predefined compression rules, loads the compressed data into a defined Ethernet data frame, and directly sends it to the external Ethernet device.
[0059] To differentiate between different algorithm modules, each software module deployed in the controller is assigned a manually defined ID (IdentityDocument), as shown in Table 1. This embodiment includes eight modules: fusion, state machine, parking space fusion, parking space conversion, path planning, ASP planning, ASP control, and vehicle control. During actual testing, different data is sent and debugged according to the needs of different functional tests to conserve CPU (central processing unit) resources and reduce system impact.
[0060] Table 1
[0061]
[0062] Furthermore, the data compression format can be as shown in Table 2. The data packet contains an ID that distinguishes data sent by different modules and a rolling counter for data packet transmission to distinguish whether frames are lost or missing. The data to be debugged is compressed into 32-bit values and placed in the Data area of the table below.
[0063] Table 2
[0064]
[0065] Furthermore, such as Figure 4 As shown, Figure 4 This is a flowchart of the debugging section in a vehicle software debugging method according to an embodiment of this application. The debugging function switch can determine whether a function needs to be enabled or disabled based on external CAN information. When the state of the debugging function switch changes, the switch state is sent to different software modules. The MCU can directly read the switch state. When the function is enabled, different algorithm modules of the MCU compress and package the pre-defined signals, and then periodically send the packaged data to the SOC software module. After receiving the data packet, the SOC's forwarding module calls the data forwarding interface to send the packaged data to an external data acquisition device. The SOC needs to obtain the function switch state through the MCU. When the function is enabled, different algorithm modules of the SOC compress and package the pre-defined signals, and then determine whether the current packaged data differs from the packaged data of the previous cycle. If there is a change, the packaged data is sent to the external data acquisition device.
[0066] In summary, once the debugging function is enabled, each software module packages its debugging data. If the debugging data differs from historical data, the data sending module is invoked to send the debugging data to an external host computer. The host computer then parses the received data online or offline via Ethernet and Ethernet devices, thus enabling signal debugging and troubleshooting of the software modules.
[0067] The calibration portion of the vehicle software debugging method according to embodiments of this application is described in detail below.
[0068] Furthermore, when the module to be debugged is a microcontroller unit (MCU) module, the above-mentioned vehicle software debugging method further includes: calculating a first offset of the position of the first calibration parameter in the MCU module relative to the first initial position based on the first initial position of the first calibration parameter in the parameter list; sending the first calibration value, the first offset, and the preset verification information to the MCU module, so that after the MCU module queries the memory address to be calibrated according to the first offset and the preset verification information, it modifies the value in the memory address to be calibrated to the first calibration value.
[0069] Furthermore, when the module to be debugged is a system-on-a-chip (SOC) module, the above-mentioned vehicle software debugging method further includes: sending the second calibration parameter and the second calibration value to the SOC module, so that the SOC module calculates the second offset of the parameter to be calibrated according to the type of the parameter to be calibrated and the second initial position of the parameter to be calibrated in the calibration list, and obtains the memory address of the second calibration parameter based on the second offset and the second initial position, and modifies the value in the memory address of the second calibration parameter to the second calibration value.
[0070] Specifically, the calibration process in this embodiment mainly includes three parts: calibration parameter input and transmission, calibration parameter transmission, and calibration parameter updating. In practical applications, the module to be calibrated, calibration parameters, and calibration values are input through the terminal of the host computer, and the calibration program is started simultaneously. After receiving the calibration parameters and calibration values, the calibration program finds the position of the pre-set calibration parameters in the parameter list, calculates the offset of the calibration parameters relative to the start position of the list, and then transmits the calibration values and offsets to the input module to be calibrated. After each module to be calibrated receives the calibration values and offsets through the transmission protocol, it can modify the values at the pre-set positions of the calibration parameters in the parameter list in memory to complete the calibration.
[0071] Specifically, parameter input and transmission is an application program of the SOC. When the SOC starts this program, the calibration program is initiated from the command terminal, and the software module to be calibrated, the parameters to be calibrated, and the parameter values are input. The MCU has a corresponding parameter list for the parameters to be calibrated, stored in YAML format. This parameter list is categorized according to different software modules, with each MCU module having its own corresponding parameter list. The MCU's parameter list describes the order and data types of different parameters. The calibration program is started and executes different calibration strategies based on the received software module to be calibrated. If the module to be calibrated is an SOC software module, the calibration parameters and values are directly sent to it. If the module to be calibrated is an MCU software module, the corresponding calibration parameter needs to be located in the calibration list for different software modules, and then the position of the calibration parameter in the list is found based on the parameter list and the calibration parameter itself. Combining the data type of the calibration parameter and its position in the parameter list, the initial offset of the calibration parameter relative to the calibration list is calculated, and the calibration value and offset are sent to the corresponding MCU software module according to the specific MCU software module.
[0072] It's important to note that calibration parameter updates are handled by two different software modules: SOC and MCU. In the MCU, the parameters to be calibrated for different software modules reside in a contiguous memory space. The order and data types of these parameters match those in the MCU calibration parameter list stored in the SOC. The SOC calibration module has a list of calibrable parameters, stored in YAML format and loaded once during program execution. Upon receiving the parameters and calibration values, the SOC calibration module matches the configuration parameter list (YAML file) with the calibration parameters to determine the necessary modifications and then adjusts the corresponding parameter values in the program. If the calibration is applied to an MCU software module, the MCU, based on the received calibration module, calibration values, and offset, can locate the parameters to be calibrated using their memory addresses and offsets. Finally, it places the calibration values at those memory addresses, completing the MCU parameter calibration.
[0073] Furthermore, the aforementioned vehicle software debugging method also includes: determining whether feedback information indicating successful calibration has been received from the MCU module and / or SOC module; if no feedback information indicating successful calibration has been received from the MCU module and / or SOC module, then controlling the target debugging device to display information indicating that the MCU module and / or SOC module calibration has failed.
[0074] In other words, if the calibrated module completes the calibration within a specified time according to the embodiments of this application, it will reply that the calibration was successful and indicate that the calibration was successful; otherwise, it will indicate that the calibration failed.
[0075] The following is combined with Figures 5-7 The calibration portion of the vehicle software debugging method described in this application embodiment will be explained in detail.
[0076] like Figure 5 As shown, the calibration process in this embodiment is divided into four parts: an external calibration host computer, a calibration node, a calibration data receiver, and a calibrated module. In practical applications, the calibrated module, calibration parameters, and calibration values are input through the host computer's terminal. Simultaneously, the calibration node is started. After startup, the calibration node can determine and execute different processing strategies based on the input calibrated module. If the calibrated module is an MCU module, the pre-set calibration parameters are located in the parameter list, the offset of the calibration parameters relative to the start position of the list is calculated, and then the calibration value and offset are transmitted to the input calibrated module. Each calibrated module receives the calibration value and offset via the transmission protocol and modifies the value at the pre-set location of the calibration parameters in the parameter list in memory to complete the calibration. If the calibrated module is an SOC software module, the calibration parameters and calibration values are sent to the corresponding calibrated module. After receiving the calibration parameters and calibration values, the calibration module finds the position of the calibration parameter in the parameter list, calculates the offset of the calibration parameter relative to the starting position of the list, and obtains the address of the calibration parameter in memory by combining the starting position of the calibration parameter. Then, the value in that memory is modified to the calibration value to complete the parameter calibration.
[0077] like Figure 6 As shown, Figure 6 The flowchart of the calibration section in a vehicle software debugging method according to a specific embodiment of this application includes the following steps:
[0078] S601, Start calibration, input module, calibration parameters and calibration values.
[0079] S602, determine whether it is an MCU module. If it is, proceed to step S603; otherwise, proceed to step S607.
[0080] S603, read the parameter list of the calibrated module.
[0081] S604, calculate the offset of the calibration parameters relative to the start position of the list.
[0082] S605 sends the calibration value, offset, and verification information to the MCU, and then waits for the calibration completion status reply from the module being calibrated.
[0083] S606, determine whether a calibration success flag has been received. If yes, proceed to step 609; otherwise, proceed to step S610.
[0084] S607 sends the calibration parameters and calibration values to the SOC module and waits for the calibration completion status reply from the calibrated module.
[0085] S608, determine whether a calibration success flag has been received. If yes, proceed to step S609; otherwise, proceed to step S610.
[0086] S609: When the calibrated module completes calibration within the specified time and replies that calibration is successful, a calibration success message will be displayed.
[0087] S610 indicates that calibration was unsuccessful.
[0088] Furthermore, such as Figure 7 As shown, Figure 7 This is a flowchart of the internal calibration process of an SOC module according to an embodiment of this application, which mainly includes the following steps:
[0089] S701, after receiving the calibration parameters and calibration values, the SOC software module reads the parameter list of this module.
[0090] S702, determine whether the calibration parameter exists. If yes, proceed to step S703; otherwise, proceed to step S706.
[0091] S703 calculates the memory address offset of the calibration parameter based on the calibration parameter type and the position of the calibration parameter in the calibration list.
[0092] S704 obtains the memory address of the calibration parameter based on the starting position and offset of the calibration parameter.
[0093] S705, replace the calibration quantity with the address where the calibration quantity is located.
[0094] S706 returns whether the calibration was successful.
[0095] Furthermore, such as Figure 8 As shown, Figure 8 This is a flowchart of the internal calibration process of an MCU module according to an embodiment of this application, which mainly includes the following steps:
[0096] S801, the MCU software module receives the calibrated address offset and checksum (module distinguishing ID).
[0097] S802, determine whether the module and verification result exist. If yes, proceed to step S803; otherwise, proceed to step S804.
[0098] S803, replace the calibration value with the address where the calibration value is located.
[0099] S804 returns whether the calibration was successful.
[0100] According to the vehicle software debugging method proposed in this application, the actual state of the debugging function switch and the type of the module to be debugged can be detected. When the debugging function switch is detected to be in the on state, the debugging data of the module to be debugged is compressed according to a preset compression rule to obtain the current compressed data of the module to be debugged. Based on the type of the module to be debugged, the target transmission method of the current compressed data is determined, and the current compressed data is transmitted to the target debugging device according to the target transmission method, so that the target debugging device can re-debug the module to be debugged based on the current compressed data. Thus, without adding additional hardware, the calibration and debugging of autonomous driving software modules can be realized through the developed application, thereby improving the efficiency of autonomous driving software development.
[0101] Next, the software debugging apparatus for a vehicle according to an embodiment of this application is described with reference to the accompanying drawings.
[0102] Figure 9 This is a block diagram of a vehicle software debugging device according to an embodiment of this application. In this embodiment, the vehicle includes a debugging function switch.
[0103] like Figure 9 As shown, the software debugging device 10 of the vehicle includes: a detection module 100, a compression module 200 and a debugging module 300.
[0104] Specifically, the detection module 100 is used to detect the actual state of the debugging function switch and the type of the module to be debugged;
[0105] The compression module 200 is used to compress the debugging data of the module to be debugged according to a preset compression rule when the debugging function switch is detected to be in the on state, so as to obtain the current compressed data of the module to be debugged.
[0106] The debugging module 300 is used to determine the target transmission method of the current compressed data based on the type of the module to be debugged, and transmit the current compressed data to the target debugging device according to the target transmission method, so that the target debugging device can re-debug the module to be debugged based on the current compressed data.
[0107] Furthermore, the debugging module is specifically used for: when the module to be debugged is a microcontroller unit (MCU) module, the target transmission method for the current compressed data is periodic transmission; when the module to be debugged is a system-on-a-chip (SOC) module, the target transmission method is determined based on the comparison result between the current compressed data and the previous compressed data, wherein, when the comparison result between the current compressed data and the previous compressed data is inconsistent, the target transmission method is to directly transmit the current compressed data.
[0108] Furthermore, the detection module 100 is specifically used to: detect the vehicle's current gear, the state of the brake pedal, and the braking duration of the parking brake when the debugging function switch is in the off state; if the current gear is neutral, the brake pedal is in the triggered state, and the braking duration is longer than the preset duration, then control the debugging function switch to switch from the off state to the on state.
[0109] Furthermore, when the module to be debugged is a microcontroller unit (MCU) module, the aforementioned vehicle software debugging device 10 further includes a calculation module and a first calibration module. The calculation module is used to calculate a first offset of the position of the first calibration parameter in the MCU module relative to the first initial position, based on a pre-set first calibration parameter's first initial position in the parameter list. The first calibration module is used to send a first calibration value, the first offset, and preset verification information to the MCU module, so that the MCU module, after querying the memory address to be calibrated based on the first offset and the preset verification information, modifies the value in the memory address to be calibrated to the first calibration value.
[0110] Furthermore, when the module to be debugged is a system-on-a-chip (SOC) module, the aforementioned vehicle software debugging device 10 further includes a second calibration module. The second calibration module sends a second calibration parameter and a second calibration value to the SOC module, causing the SOC module to calculate a second offset of the parameter to be calibrated based on its type and second initial position in the calibration list, and obtain the memory address of the second calibration parameter based on the second offset and the second initial position, then modifying the value at the memory address of the second calibration parameter to the second calibration value.
[0111] Furthermore, the aforementioned vehicle software debugging device 10 also includes a judgment module and a control module. The judgment module is used to determine whether it has received feedback information indicating successful calibration from the MCU module and / or SOC module; the control module is used to control the target debugging device to display information indicating MCU module and / or SOC module calibration failure if it has not received feedback information indicating successful calibration from the MCU module and / or SOC module.
[0112] It should be noted that the explanation of the above-described embodiment of the vehicle software debugging method also applies to the vehicle software debugging device of this embodiment, and will not be repeated here.
[0113] The vehicle software debugging device proposed in this application can detect the actual state of the debugging function switch and the type of the module to be debugged. When the debugging function switch is detected to be on, the debugging data of the module to be debugged is compressed according to a preset compression rule to obtain the current compressed data of the module to be debugged. Based on the type of the module to be debugged, the target transmission method of the current compressed data is determined, and the current compressed data is transmitted to the target debugging device according to the target transmission method, so that the target debugging device can re-debug the module to be debugged based on the current compressed data. Therefore, without adding additional hardware, the calibration and debugging of autonomous driving software modules can be achieved through a developed application, thereby improving the efficiency of autonomous driving software development.
[0114] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:
[0115] The memory 1001, the processor 1002, and the computer program stored on the memory 1001 and capable of running on the processor 1002.
[0116] When the processor 1002 executes the program, it implements the pedestrian target crossing prediction method provided in the above embodiments.
[0117] Furthermore, electronic devices also include:
[0118] Communication interface 1003 is used for communication between memory 1001 and processor 1002.
[0119] The memory 1001 is used to store computer programs that can run on the processor 1002.
[0120] The memory 1001 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0121] If the memory 1001, processor 1002, and communication interface 1003 are implemented independently, then the communication interface 1003, memory 1001, and processor 1002 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized into address buses, data buses, control buses, etc. For ease of representation, Figure 10The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0122] Optionally, in a specific implementation, if the memory 1001, processor 1002, and communication interface 1003 are integrated on a single chip, then the memory 1001, processor 1002, and communication interface 1003 can communicate with each other through an internal interface.
[0123] The processor 1002 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0124] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described vehicle software debugging method.
[0125] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0126] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0127] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0128] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0129] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0130] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0131] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0132] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A software debugging method for a vehicle, characterized in that, The vehicle includes a debugging function switch, and the method includes the following steps: Detect the actual state of the debugging function switch and the type of the module to be debugged; When the debug function switch is detected to be in the "on" state, the debug data of the module to be debugged is compressed according to a preset compression rule to obtain the current compressed data of the module to be debugged; and Based on the type of the module to be debugged, the target transmission method of the current compressed data is determined, and the current compressed data is transmitted to the target debugging device according to the target transmission method, so that the target debugging device can re-debug the module to be debugged based on the current compressed data; When the module to be debugged is a microcontroller unit (MCU) module, it also includes: Based on the first initial position of the first calibration parameter in the parameter list, calculate the first offset of the position of the first calibration parameter in the MCU module relative to the first initial position; The first calibration value, the first offset, and the preset verification information are sent to the MCU module, so that the MCU module can find the memory address to be calibrated based on the first offset and the preset verification information, and then modify the value in the memory address to be calibrated to the first calibration value.
2. The method according to claim 1, characterized in that, Determining the target transmission method of the current compressed data based on the type of the module to be debugged includes: When the module to be debugged is a microcontroller unit (MCU) module, the target transmission method for the current compressed data is periodic transmission; When the module to be debugged is a system-on-a-chip (SOC) module, the target transmission method is determined based on the comparison result between the current compressed data and the previous compressed data. When the comparison result between the current compressed data and the previous compressed data is inconsistent, the target transmission method is to directly transmit the current compressed data.
3. The method according to claim 1, characterized in that, The detection of the actual state of the debugging function switch includes: When the debugging function switch is in the off state, the vehicle's current gear, the status of the brake pedal, and the braking duration of the parking brake are detected; If the current gear is neutral, the brake pedal is in the triggered state, and the braking duration is greater than the preset duration, then the debugging function switch is controlled to switch from the off state to the on state.
4. The method according to claim 1, characterized in that, When the module to be debugged is a system-on-a-chip (SOC) module, it also includes: The second calibration parameter and the second calibration value are sent to the SOC module, so that the SOC module calculates the second offset of the parameter to be calibrated according to the type of the parameter to be calibrated and the second initial position of the parameter to be calibrated in the calibration list, and obtains the memory address of the second calibration parameter based on the second offset and the second initial position, and modifies the value in the memory address of the second calibration parameter to the second calibration value.
5. The method according to claim 4, characterized in that, Also includes: Determine whether a calibration success feedback message has been received from the MCU module and / or the SOC module; If no successful calibration feedback is received from the MCU module and / or the SOC module, the target debugging device is controlled to display a calibration failure message for the MCU module and / or the SOC module.
6. A software debugging device for a vehicle, characterized in that, The vehicle includes a debugging function switch, and the device includes: The detection module is used to detect the actual state of the debugging function switch and the type of the module to be debugged; A compression module is used to compress the debugging data of the module to be debugged according to a preset compression rule when the debugging function switch is detected to be in the "on" state, thereby obtaining the current compressed data of the module to be debugged; and The debugging module is used to determine the target transmission method of the current compressed data based on the type of the module to be debugged, and transmit the current compressed data to the target debugging device according to the target transmission method, so that the target debugging device can re-debug the module to be debugged based on the current compressed data; The calculation module, when the module to be debugged is a microcontroller unit (MCU) module, is used to calculate the first offset of the position of the first calibration parameter in the MCU module relative to the first initial position based on the first initial position of the first calibration parameter in the parameter list. The first calibration module is used to send the first calibration value, the first offset, and the preset verification information to the MCU module, so that the MCU module can find the memory address to be calibrated based on the first offset and the preset verification information, and then modify the value in the memory address to be calibrated to the first calibration value.
7. The apparatus according to claim 6, characterized in that, The debugging module is specifically used for: When the module to be debugged is a microcontroller unit (MCU) module, the target transmission method for the current compressed data is periodic transmission; When the module to be debugged is a system-on-a-chip (SOC) module, the target transmission method is determined based on the comparison result between the current compressed data and the previous compressed data. When the comparison result between the current compressed data and the previous compressed data is inconsistent, the target transmission method is to directly transmit the current compressed data.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the software debugging method for a vehicle as described in any one of claims 1-5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the software debugging method for the vehicle as described in any one of claims 1-5.
Citation Information
Patent Citations
Real-time remote debugging and OTA high-speed downloading system and method for intelligent driving area controller
CN112367235A
Device for debugging vehicle-mounted electronic equipment
CN212965208U