Fault diagnosis method and fault diagnosis device
By writing and monitoring phase information codes in the automotive EOL production line, the problem of diagnostic connection failure caused by the failure to start the on-board Linux system is solved, achieving accurate fault diagnosis and improving production efficiency.
Patent Information
- Application Number
- CN202510843037.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-10-03
AI Technical Summary
In automotive EOL production lines, the failure of the on-board Linux system to start up results in a loss of diagnostic connection, affecting production efficiency. Existing technologies are unable to effectively troubleshoot and resolve this problem.
During the operating system startup process, the microprocessor unit writes the stage information code to the static random access memory, and the microcontroller unit monitors the anomaly and reports the fault, thereby achieving accurate diagnosis of system startup failure.
It improves fault diagnosis efficiency, increases production efficiency, and enables rapid problem location and resumption of production.
Smart Images

Figure CN120742841A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automotive electronics technology, and in particular to a fault diagnosis method and a fault diagnosis device. Background Art
[0002] Currently, during the final stage of vehicle EOL (End-of-Line) manufacturing, the vehicle undergoes a series of tests and inspections to ensure that it meets quality standards and is ready for delivery to retailers or customers. During the vehicle EOL process, the following diagnostics and inspections are typically performed: (1) System function check: A comprehensive inspection of the vehicle's various systems and functions, including the engine, transmission, braking system, suspension system, electrical system, etc. (2) Fault code scan: A diagnostic tool is used to scan the vehicle's electronic control unit (ECU) to check for any faults. These fault codes may indicate potential problems in the vehicle that require further diagnosis and repair.
[0003] However, the above-mentioned automated detection or diagnosis depends on the detection equipment of the external production line of the automobile. Secondly, the data acquisition of fault diagnosis depends on the diagnostic application App (Application) running in the internal system of the automobile. However, when the car is powered on, some problems occur during the startup of the on-board Linux system, resulting in system startup failure, such as system freeze or jam, entering emergency mode, etc., then the upper-level diagnostic application App cannot run, and problems such as the failure to connect the diagnostic instrument of the detection equipment will occur, resulting in the diagnosis station of the production line being unable to work, requiring manual troubleshooting, which seriously affects the production rhythm and reduces production efficiency.
[0004] Based on this, the industry is still in urgent need of a new fault diagnosis solution to effectively troubleshoot and solve the problem of Linux system startup failure caused by unknown problems, resulting in the inability to connect to the diagnosis, so as to achieve the purpose of accurate fault diagnosis and problem location. Summary of the Invention
[0005] The embodiments of the present application provide a fault diagnosis method and a fault diagnosis device, which can more comprehensively and accurately perform fault diagnosis in the event of system startup failure, thereby effectively improving the overall fault diagnosis efficiency and improving production efficiency.
[0006] In a first aspect, an embodiment of the present application provides a fault diagnosis method applied to an operating system, the operating system including a microprocessor unit and a microcontroller unit, the fault diagnosis method comprising:
[0007] When the operating system is started and powered on, the microcontroller unit and the microprocessor unit are controlled to start up respectively;
[0008] During the startup of the microprocessor unit, the microprocessor unit writes a phase information code to the static random access memory in the operating system. The phase information code is used to represent the startup phase and running status of the operating system.
[0009] The microcontroller unit monitors the data in the static random access memory and reports a fault when an abnormal phase information code is detected.
[0010] In some possible implementations, during the startup of the microprocessor unit, writing the phase information code to the static random access memory in the operating system by the microprocessor unit includes:
[0011] In each startup phase of the microprocessor unit, the microprocessor unit writes a phase information code corresponding to each startup phase into the static random access memory in the operating system.
[0012] In some possible implementations, during the startup of the microprocessor unit, writing the phase information code to the static random access memory in the operating system by the microprocessor unit includes:
[0013] In a first startup phase when the microprocessor unit is started, a first phase information code corresponding to the first startup phase is written into the static random access memory by the microprocessor unit;
[0014] In the second startup phase of the microprocessor unit, the first phase information code written in the static random access memory is deleted, and the second phase information code corresponding to the second startup phase is written to the static random access memory through the microprocessor unit;
[0015] The first startup phase is a startup phase that precedes the second startup phase, and the first startup phase is connected to the second startup phase.
[0016] In some possible implementations, the microcontroller unit monitors data in the static random access memory and reports a fault when an abnormal phase information code is detected, including:
[0017] Monitor the field contents corresponding to the operating status in the stage information code;
[0018] When the field content indicates that the running state is the first state, determining that the running state in the startup phase is normal;
[0019] When the field content indicates that the running state is the second state, it is determined that the safety check in the startup phase has failed, and a fault report is performed.
[0020] In some possible implementations, the microcontroller unit monitors data in the static random access memory and reports a fault when an abnormal phase information code is detected, including:
[0021] When communication is established between the microcontroller unit and the host computer, the microcontroller receives information monitoring instructions sent by the host computer;
[0022] In response to the information monitoring instruction, the micro control unit monitors the data in the static random access memory, and sends the abnormal phase information code to the host computer when an abnormal phase information code is detected.
[0023] In some possible implementations, after monitoring the data in the static random access memory by the microcontroller in response to the information monitoring instruction and sending the abnormal phase information code to the host computer when an abnormal phase information code is detected, the fault diagnosis method further includes:
[0024] Restarting the operating system in response to a reboot bootloader instruction sent by an external debugging device;
[0025] In the case of restarting the operating system, in response to a stage log acquisition request sent by an external debugging device based on the abnormal stage information code, output operating system log information matching the target abnormal stage;
[0026] The target abnormal phase is the startup phase of the operating system represented by the abnormal phase information code.
[0027] In some possible implementations, when communication is established between the microcontroller unit and the host computer, receiving an information monitoring instruction sent by the host computer includes:
[0028] When communication is established between the microcontroller unit and the host computer via the transmission control protocol, the vehicle Ethernet diagnostic protocol or the controller area network communication protocol, the information monitoring instruction sent by the host computer is received.
[0029] In some possible implementations, in response to an information monitoring instruction, monitoring data in a static random access memory by a microcontroller unit and sending an abnormal phase information code to a host computer when an abnormal phase information code is detected includes:
[0030] In response to an information monitoring instruction, the microcontroller accesses a fixed memory address to monitor data in the static random access memory;
[0031] When the micro control unit detects an abnormal phase information code, it sends the abnormal phase information code to the host computer.
[0032] In some possible implementations, the phase information code occupies a fixed number of bytes;
[0033] The phase information code includes the timestamp represented by the bytes in the first digit range, the startup phase represented by the bytes in the second digit range, the startup phase subdivision represented by the bytes in the third digit range, and the operating status represented by the bytes in the fourth digit range.
[0034] Based on the same inventive concept, in a second aspect, an embodiment of the present application provides a fault diagnosis device applied to an operating system, the operating system including a microprocessor unit and a microcontroller unit, the fault diagnosis device including:
[0035] The first control module is used to control the micro control unit and the microprocessor unit to start up respectively when the operating system is started and powered on;
[0036] The first writing module is used to write a phase information code to the static random access memory in the operating system through the microprocessor unit during the startup process of the microprocessor unit, where the phase information code is used to represent the startup phase and running state of the operating system;
[0037] The first reporting module is used to monitor the data in the static random access memory through the micro control unit and report the fault when an abnormal phase information code is detected.
[0038] In a third aspect, an embodiment of the present application provides a fault diagnosis device, the fault diagnosis device comprising:
[0039] a processor and a memory storing computer program instructions;
[0040] When the processor executes the computer program instructions, it implements the fault diagnosis method provided in any one of the above embodiments of the present application.
[0041] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, a fault diagnosis method as provided in any one of the above embodiments of the present application is implemented.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a fault diagnosis method as provided in any one of the above-mentioned embodiments of the present application.
[0043] As can be seen from the above description, a fault diagnosis method and fault diagnosis device according to an embodiment of the present application are applied to an operating system, which includes a microprocessor unit and a microcontrol unit. The fault diagnosis method controls the microcontrol unit and the microprocessor unit to start up separately when the operating system is started and powered on. During the startup of the microprocessor unit, the microprocessor unit writes a stage information code to the static random access memory in the operating system. The stage information code is used to represent the startup stage and operating status of the operating system. In this way, the microcontrol unit monitors the data in the static random access memory and reports a fault when an abnormal stage information code is detected. The operating system fault diagnosis scheme provided in the embodiment of the present application generates a stage information code corresponding to each startup stage of the microprocessor unit, and then the microcontrol unit performs abnormal monitoring and fault reporting of the above stage information code. This scheme is suitable for troubleshooting situations where production line diagnostic applications cannot operate normally, and can more comprehensively and accurately perform fault diagnosis in the case of system startup failure, thereby effectively improving the overall fault diagnosis efficiency and improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 This is a schematic diagram of the production line EOL detection process provided by an embodiment of the present application;
[0046] Figure 2 This is a flowchart of a fault diagnosis method provided by an embodiment of the present application;
[0047] Figure 3 This is a schematic diagram of the results of the host computer software diagnosing the vehicle system according to the fault diagnosis method provided in one embodiment of the present application;
[0048] Figure 4 This is a scenario flow diagram of a fault diagnosis method provided by an embodiment of the present application;
[0049] Figure 5 This is a schematic diagram of the structure of a fault diagnosis device provided in one embodiment of the present application;
[0050] Figure 6 It is a structural diagram of a fault diagnosis device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0051] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.
[0052] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.
[0053] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0054] As mentioned in the background technology section, currently the above-mentioned automated detection or diagnosis relies on the detection equipment of the automobile external production line. Secondly, the data acquisition of fault diagnosis relies on the diagnostic application App running in the automobile internal system, such as Figure 1 As shown, when the diagnostic application detects data anomalies, it reports the fault code to the production line testing equipment, allowing line workers to perform appropriate error correction. However, when the car is powered on, problems may occur during the onboard Linux system startup process, causing the system to fail to boot. For example, the system may freeze or become stuck, or enter emergency mode. This can prevent the upper-level diagnostic application from running, leading to problems such as disconnection from the testing equipment. This can cause the diagnostic stations on the production line to become inoperable, requiring manual troubleshooting and resolution, severely impacting production time and reducing efficiency.
[0055] In view of the above, in order to troubleshoot and solve the problem of Linux system startup failure caused by unknown problems, resulting in the inability to connect to the diagnosis, the embodiments of the present application provide a fault diagnosis method and a fault diagnosis device. It should be noted that the embodiments provided in this application are not intended to limit the scope of the disclosure of this application.
[0056] The following first introduces the fault diagnosis method provided in the embodiment of the present application.
[0057] Figure 2 A flow chart of a fault diagnosis method provided by an embodiment of the present application is shown. The fault diagnosis method is applied to an operating system, which includes a microprocessor unit and a microcontroller unit.
[0058] like Figure 2 As shown, the fault diagnosis method includes the following steps:
[0059] S210, when the operating system is started and powered on, controlling the microcontroller unit and the microprocessor unit to start respectively;
[0060] S220, during the startup of the microprocessor unit, writing a stage information code into a static random access memory in the operating system through the microprocessor unit, where the stage information code is used to indicate the startup stage and operating status of the operating system;
[0061] S230: Monitor the data in the static random access memory through the micro control unit, and report a fault if an abnormal phase information code is detected.
[0062] It can be seen from the above description that a fault diagnosis method of an embodiment of the present application is applied to an operating system, and the operating system includes a microprocessor unit and a microcontrol unit. The fault diagnosis method controls the microcontrol unit and the microprocessor unit to start up respectively when the operating system is started and powered on. During the startup of the microprocessor unit, a phase information code is written to the static random access memory in the operating system by the microprocessor unit. The phase information code is used to characterize the startup phase and operating status of the operating system. In this way, the data in the static random access memory is monitored by the microcontrol unit, and a fault is reported when an abnormal phase information code is detected.
[0063] The operating system fault diagnosis solution provided in the embodiment of the present application generates stage information codes corresponding to the operation of the microprocessor unit in each startup stage, and then the microcontroller unit performs abnormal monitoring and fault reporting of the above-mentioned stage information codes. This solution is suitable for troubleshooting situations where production line diagnostic applications cannot operate normally, and can more comprehensively and accurately implement fault diagnosis in the event of system startup failure, thereby improving the processing capability of production line problem monitoring, thereby effectively improving the overall fault diagnosis efficiency and improving production efficiency.
[0064] The specific implementation of the above steps 210 to 230 is described in detail below.
[0065] In S210, when the operating system is powered on, the microcontroller unit and the microprocessor unit are controlled to start up respectively. In different systems on a chip (SOC), there are usually two different types of processors: a core microcontroller unit (MCU) and a microprocessor unit (MPU), which have different functions and uses.
[0066] A microcontroller unit (MCU) is a single-chip microcomputer system that integrates a processor core, memory, timers, and other functions. The term "microprocessor unit" refers to the component that contains the central processing unit (CPU), which is responsible for executing program instructions and processing data. In a system-on-chip (SoC), the MCU typically handles complex tasks such as operating systems, network communications, and multimedia processing.
[0067] In this embodiment, starting from the startup of the operating system, the microcontroller unit is responsible for booting and initializing the operating system, and communicating with the microprocessor unit domain to request loading the microprocessor unit MPU domain image. The microprocessor unit is the carrier for the execution of complex applications, so the successful startup of the microprocessor unit is the basic guarantee for the normal operation of the diagnostic application.
[0068] In S220, during the specific implementation, during the startup of the microprocessor unit, the microprocessor unit writes a stage information code to the static random-access memory (SRAM) in the operating system. The stage information code is used to represent the startup stage and operating status of the operating system.
[0069] In this embodiment, the static random access memory uses a static storage method to stably maintain data status. The startup process of a microprocessor unit typically involves multiple startup phases. In conjunction with the loading of applications within an actual operating system, the startup phases of a microcontroller unit include a firmware loading phase, a bootloader phase, and a kernel startup phase.
[0070] The existing technology cannot accurately monitor and troubleshoot faults that occur when the operating system fails to boot. This is because the upper-layer diagnostic application APP cannot operate normally when the operating system is not booted, and the external diagnostic instrument cannot connect properly. To address this problem, this application generates a stage information code corresponding to the boot stage during the MPU boot process.
[0071] Optionally, in some more specific embodiments of the present application, during the startup of the microprocessor unit, writing the phase information code to the static random access memory in the operating system through the microprocessor unit may include:
[0072] In each startup phase of the microprocessor unit, the microprocessor unit writes a phase information code corresponding to each startup phase into the static random access memory in the operating system.
[0073] It should be noted that in the actual operating system process, not every boot phase can be run normally by the MPU. If the MPU fails during a certain boot phase, the operating system may directly freeze or get stuck, resulting in system startup failure.
[0074] Therefore, when the operating system fails to boot, the microprocessor may execute several normal boot phases and one error-incurred boot phase. Alternatively, when the operating system successfully boots, the microprocessor may execute multiple boot phases required for the normal boot of the operating system, without any strict limitation.
[0075] The above-mentioned stage information code can be used in the form of characters, numbers, etc. to identify the startup stage and running status of the operating system.
[0076] Optionally, in some more specific embodiments of the present application, the above-mentioned stage information code occupies a fixed number of bytes;
[0077] The phase information code may include a timestamp represented by bytes in the first digit range, a startup phase represented by bytes in the second digit range, a startup phase subdivision represented by bytes in the third digit range, and an operating status represented by bytes in the fourth digit range.
[0078] To facilitate understanding of the stage information code provided in the embodiment of the present application, please refer to the following Table 1.
[0079] Table 1 Stage information record format
[0080]
[0081]
[0082] As shown in Table 1, the bytes in the 4th to 7th bytes of the phase information code are used to record the timestamp, the bytes in the 8th to 9th bytes are used to record the startup phase, the bytes in the 10th to 11th bytes are used to record the startup phase subdivision, and the bytes in the 12th to 15th bytes are used to record the operating status.
[0083] It should be noted that the bytes within the fifth digit of the information code at this stage can be used to represent the initialization state of the static random access memory. If the initialization state is valid, it means that the data is valid. This initialization state corresponds to the bytes within the 0-3 digit range in Table 1. The initialization state is defined as Magic in Table 1.
[0084] To better understand the stage information code provided by this application, the following examples are given in conjunction with Table 1. For example, if the system runs to the uboot stage, the MPU stores the stage information code 0x040100 corresponding to this running stage in the above-mentioned static random access memory. The specific meaning of the stage information code is:
[0085] 04--The startup phase is in the Uboot phase;
[0086] 01--Boot stage subdivision: board_init, that is, the board_init stage in uboot;
[0087] 00-operation status: 0 means the stage is normal;
[0088] In another example, if the stage information code corresponding to the operation stage stored in the static random access memory by the MPU is 0x040401, then the stage information code 0x040401 indicates:
[0089] 04--The startup phase is in Uboot;
[0090] 04--Boot stage subdivision: boot_avb_init, that is, the boot_avb stage in uboot;
[0091] 01--Running status: 1 indicates avb_verify_failed in this stage, that is, the security verification failed.
[0092] Optionally, in some more specific embodiments of the present application, in order to substantially reduce the complexity of data operations and improve data processing efficiency, during the startup of the microprocessor unit, writing the phase information code to the static random access memory in the operating system by the microprocessor unit may include:
[0093] In a first startup phase when the microprocessor unit is started, a first phase information code corresponding to the first startup phase is written into the static random access memory by the microprocessor unit;
[0094] In the second startup phase of the microprocessor unit, the first phase information code written in the static random access memory is deleted, and the second phase information code corresponding to the second startup phase is written to the static random access memory through the microprocessor unit;
[0095] The first startup phase is a startup phase that precedes the second startup phase, and the first startup phase is connected to the second startup phase.
[0096] Specifically, when writing the phase information code to the static random access memory in different startup phases, the phase information code is written by adopting the above-mentioned single loop overwriting method to reduce redundant data in the static random access memory and ensure data timeliness and data processing efficiency. In addition, this method can also effectively reduce the storage requirements of the database, especially when storage space is limited.
[0097] In this embodiment, by overwriting the stage information code of the previous startup stage each time a new startup stage is entered during the startup process of the operating system, the complexity of data operations can be fully reduced and the data processing efficiency can be improved.
[0098] It should be noted that in the single-loop overwrite writing method in this embodiment, combined with the actual system startup scenario, the stage information code of the normal startup stage will be overwritten by the next startup stage, and since the abnormal startup stage can no longer successfully enter the next startup stage, it can still be guaranteed that the useful abnormal stage information code in the static random access memory will not be overwritten.
[0099] Also, it should be added that, in addition to the above-mentioned single overwriting method for writing the stage information code overwriting, in some other feasible embodiments, the corresponding stage information code can be written one by one in the static random access memory according to the startup stage of the operation, so that the startup data can be completely retained.
[0100] In S230 , in a specific implementation, the micro control unit monitors the data in the static random access memory and reports a fault when an abnormal phase information code is detected.
[0101] Optionally, in some more specific embodiments of the present application, in order to more reasonably implement the MCU's detection of abnormality of the phase information code in the static random access memory, the microcontroller unit monitors the data in the static random access memory and reports a fault when an abnormal phase information code is detected, which may include:
[0102] Monitor the field contents corresponding to the operating status in the stage information code;
[0103] When the field content indicates that the running state is the first state, determining that the running state in the startup phase is normal;
[0104] When the field content indicates that the running state is the second state, it is determined that the safety check in the startup phase has failed, and a fault report is performed.
[0105] In specific implementations, the stage information code contains a field corresponding to the operating state. The MCU specifically detects the field content corresponding to the operating state to determine the operating state of the operating system during the startup phase. The field content corresponding to different operating states varies, and the specific field content corresponding to different operating states can be pre-set based on experience.
[0106] For example, the bytes between 12 and 15 in the stage information code are used to record the running status. If the field corresponding to the running status is 00, it means that the startup phase is normal; if it is 01, it means that the startup phase safety check has failed and needs to be reported by the MCU.
[0107] Optionally, in some more specific embodiments of the present application, monitoring the data in the static random access memory by the micro control unit and reporting a fault when an abnormal phase information code is detected may include:
[0108] When communication is established between the microcontroller unit and the host computer, the microcontroller receives information monitoring instructions sent by the host computer;
[0109] In response to the information monitoring instruction, the micro control unit monitors the data in the static random access memory, and sends the abnormal phase information code to the host computer when an abnormal phase information code is detected.
[0110] In this embodiment, if the production line finds that the diagnostic instrument cannot be connected, the MCU can use the external IP address (Internet Protocol Address) to set the PC (Personal Computer) host computer, which is equipped with software that can communicate with the MCU. In this way, normal communication between the microcontroller and the host computer is achieved.
[0111] When communication is established between the MCU and the host computer, external inspectors can use the software in the host computer to send information monitoring instructions to the MCU. The information monitoring instructions may include relevant information such as the memory address of the static random access memory, so as to ensure that the MCU can effectively monitor the data generated during the startup phase.
[0112] After receiving the information monitoring command from the host computer, the microcontroller monitors the data in the static random access memory (SRAM) in response to the information monitoring command. For example, the microcontroller reads the most recently stored phase information code in the SRAM and determines whether the phase information code is abnormal. The specific abnormality determination method has been exemplified above and will not be further described here.
[0113] When the microcontroller detects an abnormal phase information code in the static random access memory, the MCU can send the abnormal phase information code to the host computer based on the pre-established communication with the host computer. This can quickly and accurately locate the general direction of the problem, allowing engineering personnel to quickly respond and determine a temporary solution to resume production, thereby effectively improving overall fault diagnosis efficiency and improving production efficiency.
[0114] It should be added that, in addition to directly sending the stage information code as described above, the fields related to the startup stage and the operating status in the stage information code may be extracted and output to reduce the amount of data transmitted between the MCU and the host computer.
[0115] Furthermore, the host computer may send the information monitoring instruction to the MCU after the product crashes or the operating system fails to start, so as to avoid redundant detection of the stage information code by the MCU when the operating system is normal.
[0116] Optionally, in some more specific embodiments of the present application, in order to more reasonably establish reliable communication between the microcontroller unit and the host computer, when communication is established between the microcontroller unit and the host computer, receiving an information monitoring instruction sent by the host computer may include:
[0117] When communication is established between the microcontroller unit and the host computer via the transmission control protocol, the vehicle Ethernet diagnostic protocol or the controller area network communication protocol, the information monitoring instruction sent by the host computer is received.
[0118] In this embodiment, in combination with the actual operating system operation scenario and the production line test environment, DOP (Diagnostic Communication over Internet Protocol), CAN (Controller Area Network) or TCP (Transmission Control Protocol) is used to realize the communication between the microcontroller unit and the host computer, which helps to more reliably realize the transmission of instructions to the MCU and more safely and efficiently realize the data transmission from the MCU to the host computer.
[0119] Optionally, in some more specific embodiments of the present application, in order to achieve reliable access of the MCU to the static random access memory and required data monitoring, in response to the information monitoring instruction, the microcontroller unit monitors the data in the static random access memory and sends an abnormal phase information code to the host computer when an abnormal phase information code is detected, which may include:
[0120] In response to an information monitoring instruction, the microcontroller accesses a fixed memory address to monitor data in the static random access memory;
[0121] When the micro control unit detects an abnormal phase information code, it sends the abnormal phase information code to the host computer.
[0122] For example, a fixed memory address is set in the static random access memory to specifically store the phase information code written by the MPU through a single overwrite loop. This fixed memory address, for example, 0x905ff00c-0x905ff010, is used to store the phase information code such as 0x040100.
[0123] This fixed memory address can be determined by the information monitoring command sent by the host computer, or it can be pre-written into the MCU for fixed reading and detection. In this way, after the MCU receives the information monitoring command, it can quickly access data such as the stage information code based on the fixed memory address and judge the current status of the MPU based on the data in the specified address.
[0124] Optionally, in some more specific embodiments of the present application, in combination with actual production line fault detection scenarios, in the aforementioned embodiments, after the MCU sends the stage information code to the host computer, in order to more quickly and accurately locate the general direction of the problem, thereby enabling engineering personnel to quickly respond and determine a temporary solution to resume production, in response to the information monitoring instruction, the microcontroller unit monitors the data in the static random access memory, and sends the abnormal stage information code to the host computer when an abnormal stage information code is detected. The fault diagnosis method may further include:
[0125] Restarting the operating system in response to a reboot bootloader instruction sent by an external debugging device;
[0126] In the case of restarting the operating system, in response to a stage log acquisition request sent by an external debugging device based on the abnormal stage information code, output operating system log information matching the target abnormal stage;
[0127] The target abnormal phase is the startup phase of the operating system represented by the abnormal phase information code.
[0128] In this embodiment, in combination with the stage information code definition content shown in Table 1 above, for example, see Figure 3 , Figure 3 This is a schematic diagram of the results of the host computer software diagnosing the vehicle system according to the fault diagnosis method provided in one embodiment of the present application. Figure 3 As shown, if the stage information code currently read and output by the MCU is 4-3-2, it can be determined that the MPU has entered fastboot mode, so that external engineers can confirm the current status and take appropriate measures to restore normal status.
[0129] For example, if the current operating system is in fastboot mode (Fastboot mode corresponds to a mechanism that communicates with the boot loader through a USB (Universal Serial Bus) connection), the reboot bootloader command can be input through an external debugging device to exit and restart the system, and then after restarting, specific operating system log information matching the target abnormal stage can be exported to analyze the root cause of the startup failure. The target abnormal stage is provided by the abnormal stage information code output by the MCU.
[0130] In general, when troubleshooting a situation where a production line diagnostic application cannot operate normally, compared to the previous existing technology of exporting massive logs after a system startup failure and then performing data analysis and troubleshooting from the massive log data, the method provided in this embodiment of monitoring the abnormalities of the above-mentioned stage information codes and reporting faults for abnormal stage codes through a microcontroller unit can more quickly obtain key operating system log information through the stage information codes.
[0131] In this way, by quickly obtaining the above-mentioned operating system log information, the general direction of the problem can be quickly and accurately located, so that engineering personnel can quickly respond to determine a temporary solution to resume production, which helps to effectively improve the overall fault diagnosis efficiency and improve production efficiency.
[0132] To facilitate understanding of the fault diagnosis method provided by the above embodiment, the above method is described below using a specific scenario embodiment. Figure 4 This is a scenario flow diagram of a fault diagnosis method provided by an embodiment of the present application. This scenario embodiment is described using the Linux operating system as an example. And, Figure 4 The startup phase code in corresponds to the phase information code in the embodiment of the present application.
[0133] This embodiment is applicable to a vehicle-mounted device operating system. If the production line detects a diagnostic device connection failure, the PC host software is configured using the MCU's external IP address. This software then connects to the vehicle-mounted device via the OBD (On-Board Diagnostics) interface, enabling communication between the vehicle's MCU and the host computer.
[0134] In this scenario, starting with the operating system boot and power-up, the MCU domain controller boots up, and the MPU domain operating system boots up. The MCU is responsible for booting and initializing the system and communicating with the MPU domain to request the loading of the MPU domain image. The MPU is the execution engine for complex applications, so successful MPU startup is essential for the normal operation of diagnostic applications.
[0135] During the different startup phases of the MPU, the corresponding phase information code is written to a fixed memory address in the SRAM to identify the startup phase and operating status of the current operating system. To improve data processing efficiency and reduce redundant storage of data in storage space, the phase information code is written to the SRAM by the MPU using a single loop overwrite method. That is, each time the MPU enters a new startup phase during startup, the phase information code corresponding to the previous startup phase is overwritten.
[0136] During the MPU's startup process, the MCU continuously monitors the data at this fixed address. If the phase information code indicates normal operation, no corresponding processing is performed. If an abnormal phase information code is detected, the MCU reports the fault to a pre-established host computer through a specific communication protocol. Specific communication protocols, such as the Automotive Ethernet Diagnostic Protocol, the Controller Area Network Communication Protocol, or the Transmission Control Protocol, are not strictly limited here.
[0137] After the MCU reports the abnormal phase information code to the host computer, external engineers can use this abnormal phase information code to determine the startup phase in which the abnormality occurred, and even the specific type of abnormality that occurred during that phase. This allows them to subsequently locate the problem and take troubleshooting measures. This allows them to specifically export operating system log information from the system during key phases based on the abnormal phase information code, thus avoiding the need to export all system logs and analyze and locate the problem in massive amounts of logs.
[0138] It should be added that, Figure 4 As shown, the startup phases involved in the above-mentioned MPU startup process may specifically be, for example:
[0139] ATF (Arm Trusted Firmware) boot phase: During this boot phase, boot tasks such as firmware loading, storage device initialization, and PSCI (Power State Coordination Interface) power management can be performed.
[0140] Uboot startup phase: In this startup phase, Uboot, as an open source boot loader, can be used to start the boot program, such as the serial port / network device boot loading kernel.
[0141] Kernel startup phase: The kernel is the core of the operating system, responsible for managing hardware resources and providing system services. During this phase, functions such as memory and I / O management and system call control can be enabled.
[0142] Systemd (system daemon) startup phase: During this startup phase, you can start the Systemd operating system, start file system mounting, and start system log collection and other functions.
[0143] AF (Application Framework) startup phase: In this startup phase, by starting the AF middleware application layer, middleware services such as POWERD (Power Management Daemon) and RILD (Radio Interface Layer Daemon) are started.
[0144] Key apps (Key Applications) startup phase: Key applications are launched to enable the corresponding functions of the key applications. Key applications include diagnostic applications and AI (Artificial Intelligence) applications.
[0145] This scenario embodiment is suitable for troubleshooting situations where production line diagnostic applications cannot operate normally. Compared with exporting logs and then troubleshooting problems from massive log data, this method can quickly and accurately locate the general direction of the problem, allowing engineering personnel to quickly respond and determine temporary solutions to resume production. It avoids the failure of the diagnostic station that causes the product to be judged as defective, thereby increasing subsequent processing costs, thereby indirectly improving the processing capabilities of production line problem monitoring and saving the company a certain amount of cost.
[0146] Based on the fault diagnosis method provided in the above embodiment, for the same inventive concept, the present application also provides a fault diagnosis device corresponding to the above fault diagnosis method. Figure 5 The fault diagnosis device is introduced in detail.
[0147] Figure 5 A structural diagram of a fault diagnosis device provided in an embodiment of the present application is shown, which is applied to an operating system including a microprocessor unit and a microcontroller unit. Figure 5 The fault diagnosis device 500 shown includes:
[0148] The first control module 510 is used to control the micro control unit and the microprocessor unit to start up respectively when the operating system is started and powered on;
[0149] The first writing module 520 is used to write a phase information code to the static random access memory in the operating system through the microprocessor unit during the startup process of the microprocessor unit, where the phase information code is used to indicate the startup phase and running status of the operating system;
[0150] The first reporting module 530 is configured to monitor the data in the static random access memory through the micro control unit, and report a fault if an abnormal phase information code is detected.
[0151] A fault diagnosis device provided in an embodiment of the present application, by setting corresponding functional modules, controls the microcontroller unit and the microprocessor unit to start up respectively when the operating system is started and powered on. During the startup of the microprocessor unit, the microprocessor unit writes a stage information code to the static random access memory in the operating system, and the stage information code is used to characterize the startup stage and operating status of the operating system. In this way, the microcontroller monitors the data in the static random access memory and reports a fault when an abnormal stage information code is detected. The operating system fault diagnosis device provided in an embodiment of the present application generates a stage information code corresponding to the operation of the microprocessor unit in each startup stage, and then the microcontroller unit performs abnormal monitoring and fault reporting of the above-mentioned stage information code. The device is suitable for troubleshooting situations where production line diagnostic applications cannot operate normally, and can more comprehensively and accurately implement fault diagnosis in the case of system startup failure, thereby effectively improving the overall fault diagnosis efficiency and improving production efficiency.
[0152] Optionally, in some more specific embodiments of the present application, the first writing module 520 may include:
[0153] In each startup phase of the microprocessor unit, the microprocessor unit writes a phase information code corresponding to each startup phase into the static random access memory in the operating system.
[0154] Optionally, in some more specific embodiments of the present application, the first writing module 520 may include:
[0155] The first writing submodule may be used to write a first stage information code corresponding to the first startup stage into the static random access memory through the microprocessor unit in the first startup stage when the microprocessor unit is started;
[0156] The first overwriting submodule may be configured to delete the first-stage information code written in the static random access memory during the second startup phase of the microprocessor unit, and write the second-stage information code corresponding to the second startup phase into the static random access memory via the microprocessor unit;
[0157] The first startup phase is a startup phase that precedes the second startup phase, and the first startup phase is connected to the second startup phase.
[0158] Optionally, in some more specific embodiments of the present application, the first reporting module 530 monitors the data in the static random access memory through the micro control unit and reports a fault when an abnormal phase information code is detected, which may include:
[0159] The first monitoring submodule can be used to monitor the field content corresponding to the operating status in the stage information code;
[0160] The first determining submodule may be configured to determine that the running state in the startup phase is normal when the field content indicates that the running state is the first state;
[0161] The first reporting submodule may be configured to determine that the safety check in the startup phase has failed and to report the fault when the field content indicates that the running state is the second state.
[0162] Optionally, in some more specific embodiments of the present application, the first reporting module 530 monitors the data in the static random access memory through the micro control unit and reports a fault when an abnormal phase information code is detected, which may include:
[0163] The first receiving submodule can be used to receive the information monitoring instruction sent by the host computer when communication is established between the micro control unit and the host computer;
[0164] The first sending submodule can be used to respond to the information monitoring instruction, monitor the data in the static random access memory through the micro control unit, and send the abnormal phase information code to the host computer when an abnormal phase information code is detected.
[0165] Optionally, in some more specific embodiments of the present application, after monitoring the data in the static random access memory through the microcontroller in response to the information monitoring instruction and sending the abnormal phase information code to the host computer when an abnormal phase information code is detected, the fault diagnosis device may further include:
[0166] A first restart module may be configured to restart the operating system in response to a reboot bootloader instruction sent by an external debugging device;
[0167] The first output module may be configured to output operating system log information matching a target abnormal stage in response to a stage log acquisition request sent by an external debugging device based on an abnormal stage information code when the operating system is restarted;
[0168] The target abnormal phase is the startup phase of the operating system represented by the abnormal phase information code.
[0169] Optionally, in some more specific embodiments of the present application, the first receiving submodule, when communication is established between the micro control unit and the host computer, receives the information monitoring instruction sent by the host computer, which may include:
[0170] When communication is established between the microcontroller unit and the host computer via the transmission control protocol, the vehicle Ethernet diagnostic protocol or the controller area network communication protocol, the information monitoring instruction sent by the host computer is received.
[0171] Optionally, in some more specific embodiments of the present application, the first sending submodule, in response to the information monitoring instruction, monitors the data in the static random access memory through the microcontroller unit, and sends the abnormal stage information code to the host computer when an abnormal stage information code is detected, which may include:
[0172] The first access unit may be configured to monitor data in the static random access memory by accessing a fixed memory address through the microcontroller unit in response to an information monitoring instruction;
[0173] The first sending unit may be configured to send the abnormal phase information code to the host computer when the micro control unit detects an abnormal phase information code.
[0174] Optionally, in some more specific embodiments of the present application, the above-mentioned stage information code occupies a fixed number of bytes;
[0175] The phase information code may include a timestamp represented by bytes in the first digit range, a startup phase represented by bytes in the second digit range, a startup phase subdivision represented by bytes in the third digit range, and an operating status represented by bytes in the fourth digit range.
[0176] Based on the fault diagnosis method provided in the above embodiment, for the same inventive concept, the present application also provides a fault diagnosis device corresponding to the above fault diagnosis method, which is described below. Figure 6 A detailed introduction to fault diagnosis equipment is given.
[0177] See below Figure 6 , Figure 6 It is a structural diagram of a fault diagnosis device provided in one embodiment of the present application.
[0178] The fault diagnosis device may include a processor 601 and a memory 602 storing computer program instructions.
[0179] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0180] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 602 may include removable or non-removable (or fixed) media. Where appropriate, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0181] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0182] The processor 601 implements any one of the fault diagnosis methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .
[0183] In one example, the data fault diagnosis device may further include a communication interface 603 and a bus 610. Figure 6As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.
[0184] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0185] Bus 610 comprises hardware, software or both, and the parts of fault diagnosis equipment are coupled to each other.For example, and not limitation, bus can comprise accelerated graphics port (AGP) or other graphic buses, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations.In suitable cases, bus 610 can comprise one or more buses.Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0186] The fault diagnosis device executes the fault diagnosis method in the embodiment of the present application, thereby realizing the fault diagnosis method described in the embodiment of the present application.
[0187] In addition, in conjunction with the fault diagnosis method in the above embodiments, the present application embodiment may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the fault diagnosis methods in the above embodiments is implemented.
[0188] Based on the fault diagnosis method in the above embodiment, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by the processor of an electronic device, the electronic device executes the fault diagnosis method provided in any one of the above embodiments of the present application.
[0189] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0190] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0191] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0192] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0193] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A fault diagnosis method, characterized in that: Applied to an operating system comprising a microprocessor unit and a microcontroller unit, the method comprises: When the operating system is started and powered on, controlling the microcontroller unit and the microprocessor unit to start up respectively; During the startup of the microprocessor unit, a stage information code is written into the static random access memory in the operating system by the microprocessor unit, wherein the stage information code is used to indicate the startup stage and running state of the operating system; The micro control unit monitors the data in the static random access memory and reports a fault when an abnormal phase information code is detected.
2. The method according to claim 1, characterized in that The step of writing the phase information code into the static random access memory in the operating system by the microprocessor unit during startup of the microprocessor unit includes: In each startup phase of the operation of the microprocessor unit, the microprocessor unit writes the phase information codes corresponding to each startup phase into the static random access memory in the operating system.
3. The method according to claim 2, characterized in that The step of writing the phase information code into the static random access memory in the operating system by the microprocessor unit during startup of the microprocessor unit includes: In a first startup phase of the microprocessor unit, the microprocessor unit writes a first phase information code corresponding to the first startup phase into the static random access memory; In a second startup phase of the microprocessor unit, the first phase information code written in the static random access memory is deleted, and a second phase information code corresponding to the second startup phase is written into the static random access memory through the microprocessor unit; The first startup phase is a startup phase that precedes the second startup phase, and the first startup phase is connected to the second startup phase.
4. The method according to claim 1, wherein The microcontroller unit monitors the data in the static random access memory and reports a fault when an abnormal phase information code is detected, including: monitoring the content of the field corresponding to the operating status in the stage information code; When the field content indicates that the running state is the first state, determining that the running state in the startup phase is normal; When the field content indicates that the running state is the second state, it is determined that the safety check in the startup phase has failed, and a fault report is performed.
5. The method according to claim 1, wherein The microcontroller unit monitors the data in the static random access memory and reports a fault when an abnormal phase information code is detected, including: When communication is established between the microcontroller unit and the host computer, receiving an information monitoring instruction sent by the host computer; In response to the information monitoring instruction, the micro control unit monitors the data in the static random access memory, and sends the abnormal phase information code to the host computer when an abnormal phase information code is detected.
6. The method according to claim 5, characterized in that After monitoring the data in the static random access memory by the microcontroller in response to the information monitoring instruction and sending the abnormal phase information code to the host computer when an abnormal phase information code is detected, the method further includes: Restarting the operating system in response to a reboot bootloader instruction sent by an external debugging device; In the case where the operating system is restarted, in response to a stage log acquisition request sent by the external debugging device based on the stage information code of the exception, outputting operating system log information matching the target abnormal stage; The target abnormal phase is the startup phase of the operating system represented by the abnormal phase information code.
7. The method according to claim 5, characterized in that When communication is established between the microcontroller unit and the host computer, receiving the information monitoring instruction sent by the host computer includes: When communication is established between the micro control unit and the host computer via the transmission control protocol, the vehicle Ethernet diagnostic protocol or the controller area network communication protocol, an information monitoring instruction sent by the host computer is received.
8. The method according to claim 5, characterized in that The step of monitoring the data in the static random access memory by the microcontroller in response to the information monitoring instruction and sending the abnormal phase information code to the host computer when an abnormal phase information code is detected includes: In response to the information monitoring instruction, accessing a fixed memory address through the micro control unit to monitor data in the static random access memory; When the micro control unit detects the abnormal phase information code, the micro control unit sends the abnormal phase information code to the host computer.
9. The method according to any one of claims 1 to 8, characterized in that The stage information code occupies a fixed number of bytes; The stage information code includes a timestamp represented by bytes in the first digit range, a startup stage represented by bytes in the second digit range, a startup stage subdivision represented by bytes in the third digit range, and an operating status represented by bytes in the fourth digit range.
10. A fault diagnosis device, characterized in that: Applied to an operating system, the operating system includes a microprocessor unit and a microcontroller unit, and the device includes: A first control module is configured to control the microcontroller unit and the microprocessor unit to start up respectively when the operating system is started and powered on; a first writing module, configured to write a phase information code into the static random access memory in the operating system via the microprocessor unit during the startup process of the microprocessor unit, wherein the phase information code is used to indicate the startup phase and running state of the operating system; The first reporting module is used to monitor the data in the static random access memory through the micro control unit and report a fault when an abnormal phase information code is detected.
Citation Information
Patent Citations
Mobile terminal reboot positioning method, mobile terminal and computer readable storage medium
CN108197023A
Log information acquisition method and electronic equipment
CN117135263A
Method for monitoring starting state of arm server and arm server
CN119226014A