Android Native Application Crash Monitoring Method, Device, Equipment, Vehicle and Storage Medium
By listening to the exception signals of Native program processes in the processor and uploading them to the cloud, the problem of automatic capture and handling of Android Native application crash events is solved, and rapid repair and improvement of user experience is achieved.
Patent Information
- Application Number
- CN202211059313.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-08-31
AI Technical Summary
The existing technology is difficult to automatically capture and handle Android Native application crash events, resulting in the loss of exception information and logs, affecting repair efficiency and user experience.
By listening to the exception signals of the Native program process in the processor, collect exception data and notifying the exception monitoring module, which packages the data to the cloud and promptly notifies the engineers for quick analysis and repair of problems.
It realizes automatic capture and processing of Android Native application crash events, reducing the risk of log loss, improving repair efficiency and user experience.
Smart Images

Figure CN115416680B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vehicle-mounted system application monitoring and management, and specifically relates to an Android Native application crash monitoring method, device, equipment, vehicle and storage medium. Background Art
[0002] The vehicle-mounted system is an important part of an automobile. During the operation of the vehicle-mounted system, Native application crash events may occur. In the prior art, in the face of Native application crash events, the driver and passengers can only contact the engineer for repair afterwards, and the driving and riding experience is not good. At the same time, the crash of the Native application process may also cause the loss of some abnormal information and logs, which also brings certain problems to the repair of Native applications. Summary of the Invention
[0003] The purpose of the present invention is to provide an Android Native application crash monitoring method, device, equipment, vehicle and storage medium, which can automatically capture Native application crash events, discover abnormal signals in advance, capture abnormal site information, reduce the risk of log loss, report to the cloud in time and notify the engineer to quickly analyze and solve the abnormality, and quickly repair it to improve the user experience. To achieve the above technical purpose, the technical solution adopted by the present invention is as follows:
[0004] In a first aspect, an embodiment of the present application provides an Android Native application crash monitoring method, which is applied to an Android Native application crash monitoring device. The device includes a processor and an exception monitoring module, and the exception monitoring module is used to send exception information to the cloud. The method includes:
[0005] The processor listens for abnormal signals of the Native program process. When an abnormality occurs in the Native program process, the processor sends different signals to the Native program process according to the type of abnormality that occurs;
[0006] According to the signals received by the Native program process, a preset signal processing script is run to collect exception information, obtain exception data, and notify the exception data to the exception monitoring module;
[0007] The exception monitoring module packages and uploads the exception data to the cloud, and the cloud sends an email to inform the engineer;
[0008] Return the processing result and terminate the Native program process.
[0009] In combination with the first aspect, in some alternative embodiments, the processor monitors the exception signals of the Native program process. When an exception occurs in the Native program process, the processor sends different signals to the Native program process according to the type of the occurred exception, including:
[0010] The monitored exception signals are SIGABRT, SIGBUS, SIGFPE, SIGKILL, SIGPIPE, SIGSTKFLT, and SIGTRAP. When the ARM in the processor captures the exception signal, the Linux Kernel sends different signals to the Native program process according to the type of the captured signal.
[0011] In combination with the first aspect, in some alternative embodiments, according to the signal received by the Native program process, a preset signal processing script is run to collect exception information, and the exception information is notified to the exception monitoring module, including:
[0012] The Native program process notifies the Debuggerd process, and the Debuggerd process executes a preset ptrace instruction to collect the original exception information;
[0013] The Native program process notifies the Android system system_server process, and the AMS service of the system_server process collects system information. The system information and the original exception information form exception data, and the exception data is notified to the exception monitoring module.
[0014] In combination with the first aspect, in some alternative embodiments, the processing result is returned and the Native program process is terminated, including:
[0015] The system_server process returns the processing result to the Debuggerd process, the Debuggerd process sends an exception signal, and the Native program process terminates.
[0016] In a second aspect, an Android Native application crash monitoring device is further provided in an embodiment of the present application. The device is applied to an Android Native application crash monitoring device, and the device includes a processor and an exception monitoring module. The exception monitoring module is used to send exception information to the cloud. The device includes:
[0017] A monitoring unit: used to monitor the exception signals in the Native program process;
[0018] A feedback unit: used to make a timely feedback when an exception signal appears in the Native program process, collect exception data, and make a feedback to the cloud.
[0019] In a third aspect, the embodiments of the present application further provide an Android Native application crash monitoring device, including a processor, an exception monitoring module, and a memory. The exception monitoring module is used to send exception information to the cloud. A computer program is stored in the memory. When the computer program is executed by the processor, the Android Native application crash monitoring device is caused to execute the above method.
[0020] In a fourth aspect, the embodiments of the present application further provide a vehicle, which includes a vehicle body and the above Android Native application crash monitoring device, and the Android Native application crash monitoring device is arranged on the vehicle.
[0021] In a fifth aspect, the embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer is caused to execute the above method.
[0022] The invention adopting the above technical solution has the following advantages:
[0023] During the running process of the Android Native application process in the in-vehicle system, the processor continuously monitors the exception signals that may occur in the Android Native application process. After the processor monitors the exception signals, it collects the exception data and system information of the Android Native application process at this time and sends them to the exception monitoring module. The exception monitoring module packages and sends the exception data to the cloud, and the cloud notifies the engineer of the exception data in advance. Then, when an exception occurs in the Android Native application process, the Android Native application process terminates. It is possible to detect the exception signal in advance and capture the exception scene information, reducing the risk of log loss, enabling the engineer to quickly and accurately fix the problem based on all the information at the exception scene, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The present invention can be further illustrated by the non-limiting embodiments given in the drawings;
[0025] Figure 1 It is a block diagram of the Android Native application crash monitoring device provided by the embodiment of the present application.
[0026] Figure 2 It is a schematic flowchart of the Android Native application crash monitoring method provided by the embodiment of the present application.
[0027] Figure 3Block diagram of the Android Native application crash monitoring device provided by the embodiment of the present application.
[0028] Icons: 10. Android Native application crash monitoring device; 11. Processor; 12. Exception monitoring module; 13. First braking controller; 14. Second braking controller; 200. Android Native application crash monitoring device; 210. Monitoring unit; 220. Feedback unit. Detailed implementation manner
[0029] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that in the description of the drawings or the specification, similar or identical parts are denoted by the same reference numerals, and the implementation manners not depicted or described in the drawings are forms known to those of ordinary skill in the art. In addition, the directional terms mentioned in the embodiments, such as "upper", "lower", "top", "bottom", "left", "right", "front", "rear", etc., are only references to the directions of the accompanying drawings and are not used to limit the protection scope of the present invention.
[0030] As Figure 1 shown, the embodiment of the present application provides an Android Native application crash monitoring device 10. The Android Native application crash monitoring device 10 may include a processor 11, an exception monitoring module 12, and a memory. The exception monitoring module 12 is configured to send the exception data before the Android Native application process crashes to the cloud.
[0031] In this embodiment, the processor 11 continuously monitors the exception signals that may occur in the Android Native application process. After the processor 11 monitors an exception signal, it collects the exception data and system information of the Android Native application process at this time and sends them to the exception monitoring module 12. The exception monitoring module 12 packages and sends the exception data to the cloud, and the cloud notifies the engineer of the exception data in advance. Only then will this type of Android Native application process crash. Capturing the exception scene information before this type of Android Native application process crashes reduces the risk of log loss and facilitates the engineer to find problems and perform repairs.
[0032] In this embodiment, the Android Native application crash monitoring device 10 may be deployed on a vehicle, making the in-vehicle system of the vehicle more stable.
[0033] The storage module stores a computer program. When the computer program is executed by the processor 11, it enables the Android Native application crash monitoring device 10 to execute the corresponding steps in the following Android Native application crash monitoring method.
[0034] As Figure 2 shown, the present application also provides an Android Native application crash monitoring method. Among them, the Android Native application crash monitoring method may include the following steps:
[0035] Step 110: The processor 11 listens for exception signals of the Native program process. When an exception occurs in the Native program process, the processor 11 sends different signals to the Native program process according to the type of the occurred exception;
[0036] Step 120: According to the signals received by the Native program process, run a preset signal processing script, collect exception information, obtain exception data, and notify the exception monitoring module 12 of the exception data;
[0037] Step 130: The exception monitoring module 12 packages and uploads the exception data to the cloud, and the cloud sends an email to inform the engineer;
[0038] Step 140: Return the processing result and terminate the Native program process.
[0039] In this embodiment, when an exception signal is generated in the Native program process, the processor 11 listens for the exception signal, collects the exception data at this time, and sends it to the exception monitoring module 12. The exception monitoring module 12 packages and uploads the exception data to the cloud, and the cloud promptly notifies the engineer; only then will the Native program process experience an abnormal crash.
[0040] As an alternative implementation, the processor 11 listens for exception signals of the Native program process. When an exception occurs in the Native program process, the processor 11 sends different signals to the Native program process according to the type of the occurred exception, including:
[0041] The exception signals listened for are SIGABRT, SIGBUS, SIGFPE, SIGKILL, SIGPIPE, SIGSTKFLT, and SIGTRAP. When the ARM in the processor 11 captures the exception signal, the Linux Kernel sends different signals to the Native program process according to the type of the captured signal.
[0042] Among them, the SIGABRT signal is generated when the abort function is called. After this signal is generated, the Native program process will terminate the process and generate a core file. The SIGBUS signal is generated when an illegal memory address is accessed or there is a memory alignment error. After this signal is generated, the Native program process will terminate the process and generate a core file. The SIGFPE signal is generated when a fatal arithmetic error occurs, including all algorithmic errors such as floating-point arithmetic errors, overflows, and division by zero. After this signal is generated, the Native program process will terminate the process and generate a core file. The SIGKILL signal will unconditionally terminate the process. This signal cannot be ignored, handled, or blocked. After this signal is generated, the Native program process will terminate the process. The SIGPIPE signal is generated when writing data to a pipe without a read end. After this signal is generated, the Native program process will terminate the process. The SIGSTKFLT signal is a signal that appeared in early versions of Linux and is still retained for backward compatibility. After this signal is generated, the Native program process will terminate the process. The SIGTRAP signal is generated by a breakpoint instruction or other trap instructions. After this signal is generated, the Native program process will terminate the process and generate a core file.
[0043] In this embodiment, after the processor 11 monitors the above abnormal signal, it immediately sends the monitored signal to the Native program process.
[0044] As an optional implementation manner, according to the signal received by the Native program process, a preset signal processing script is run to collect abnormal information and notify the abnormal monitoring module 12, including:
[0045] The Native program process notifies the Debuggerd process, and the Debuggerd process executes a preset ptrace instruction to collect the original abnormal information;
[0046] The Native program process notifies the Android system system_server process, and the AMS service of the system_server process collects system information. The system information and the original abnormal information form abnormal data, and the abnormal data is notified to the abnormal monitoring module 12.
[0047] In this embodiment, the Debuggerd process collects the original abnormal information, which helps engineers understand the abnormal situation. The system_server process collects system information such as stack information and system logs. These detailed information helps engineers analyze the reasons and facilitates the quick solution and repair of Android Native applications.
[0048] As an optional implementation manner, returning the processing result and terminating the Native program process includes:
[0049] The system_server process returns the processing result to the Debuggerd process, an abnormal signal is generated in the Debuggerd process, and the Native program process is terminated.
[0050] In this embodiment, when an abnormal signal is generated, all abnormal data has been collected and notified to the engineer before the Android Native application crashes abnormally. After that, the Debuggerd process generates an abnormal signal and the Native program process terminates. The engineer can respond quickly and repair it in time to improve the user experience.
[0051] like Figure 3 As shown, the present application also provides an Android Native application crash monitoring device 200, which includes at least one software function module that can be stored in the form of software or firmware in a storage module or solidified in the operating system (OS) of the Android Native application crash monitoring device 10. The processor 11 is used to execute the executable modules stored in the storage module, such as the software function modules and computer programs included in the Android Native application crash monitoring device 200.
[0052] The Android Native application crash monitoring device 200 includes a monitoring unit 210 and a feedback unit 220. The functions of each unit may be as follows:
[0053] Monitoring unit 210: used to monitor abnormal signals in the Native program process;
[0054] Feedback unit 220: used to provide timely feedback when an abnormal signal occurs in the Native program process, collect abnormal data, and provide feedback to the cloud.
[0055] In this embodiment, the storage module may be, but is not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc. In this embodiment, the storage module may be used to store preset signal processing scripts and abnormal signal information, etc. Of course, the storage module may also be used to store a program, and the processing module executes the program after receiving the execution instruction.
[0056] Understandably, Figure 1The structure of the Android Native application crash monitoring device 10 shown is only a schematic diagram. The Android Native application crash monitoring device 10 may also include more components than those Figure 1 shown. Figure 1 Each component shown in may be implemented by hardware, software, or a combination thereof.
[0057] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described Android Native application crash monitoring device 10 and Android Native application crash monitoring device 200 can refer to the corresponding processes of each step in the foregoing method, and will not be elaborated herein.
[0058] This application embodiment also provides a vehicle. The vehicle includes a vehicle body and the Android Native application crash monitoring device 10 described in the above embodiment. The Android Native application crash monitoring device 10 is deployed on the vehicle body. The Android Native application crash monitoring device 10 can be used to implement the above-described Android Native application crash monitoring method, and can improve the stability of the application programs of the vehicle in-vehicle system.
[0059] This application embodiment also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, it causes the computer to execute the Android Native application crash monitoring method described in the above embodiment.
[0060] Through the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by hardware or by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes several instructions for causing a computer device (which can be a personal computer or a network device, etc.) to execute the methods described in various implementation scenarios of this application.
[0061] In summary, this application embodiment provides an Android Native application crash monitoring method, device, Android Native application crash monitoring device 10, vehicle, and storage medium. In this solution, when an abnormal signal is detected in the Native program process, abnormal data is immediately collected, uploaded to the cloud, and the engineer is notified. After that, the Native application will have an abnormal crash. The engineer can quickly respond and repair in time, improving the user experience.
[0062] In the embodiments provided in the present application, it should be understood that the disclosed devices, systems, and methods can also be implemented in other ways. The device, system, and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of systems, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the part of the module, program segment, or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions. Additionally, in each embodiment of the present application, the various functional modules can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.
[0063] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An Android Native application crash monitoring method, characterized in that: applied to an Android Native application crash monitoring device, the device includes a processor and an exception monitoring module, and the exception monitoring module is used to send the exception data before the Android Native application process crashes to the cloud. The method includes: The processor listens for the exception signal of the Native program process. When an exception occurs in the Native program process, the processor sends different signals to the Native program process according to the type of the occurred exception; According to the signal received by the Native program process, run a preset signal processing script, collect exception information, obtain exception data, and notify the exception monitoring module of the exception data; The exception monitoring module packages and uploads the exception data to the cloud, and the cloud sends an email to inform the engineer; Return the processing result and terminate the Native program process; According to the signal received by the Native program process, run a preset signal processing script, collect exception information, and notify the exception monitoring module of the exception information, including: The Native program process notifies the Debuggerd process, and the Debuggerd process executes a preset ptrace instruction to collect the original exception information; The Native program process notifies the Android system system_server process, and the AMS service of the system_server process collects system information. The system information and the original exception information form exception data, and the exception data is notified to the exception monitoring module.
2. The method according to claim 1, characterized in that: The processor listens for the exception signal of the Native program process. When an exception occurs in the Native program process, the processor sends different signals to the Native program process according to the type of the occurred exception, including: The monitored exception signals are SIGABRT, SIGBUS, SIGFPE, SIGKILL, SIGPIPE, SIGSTKFLT, and SIGTRAP. When the ARM in the processor captures the exception signal, Linux Kernel sends different signals to the Native program process according to the type of the captured signal.
3. The method according to claim 1, characterized in that: Return the processing result and terminate the Native program process, including: The system_server process returns the processing result to the Debuggerd process, and the Debuggerd process generates an exception signal, and the Native program process terminates.
4. An Android Native application crash monitoring device, characterized in that: Applied to an Android Native application crash monitoring device, the device includes a processor and an exception monitoring module, and the exception monitoring module is used to send the exception data before the Android Native application process crashes to the cloud. The device includes: A listening unit: used to listen for exception signals within the Native program process; A feedback unit: used to make timely feedback when an exception signal appears within the Native program process, collect exception data, and make feedback to the cloud; The device is based on an Android Native application crash monitoring method, and the Android Native application crash monitoring method includes running a preset signal processing script according to the signals received by the Native program process, collecting exception information, and notifying the exception monitoring module of the exception information; The running of the preset signal processing script according to the signals received by the Native program process, collecting exception information, and notifying the exception monitoring module of the exception information includes: The Native program process notifies the Debuggerd process, and the Debuggerd process executes a preset ptrace instruction to collect the original exception information; The Native program process notifies the Android system system_server process, and the AMS service of the system_server process collects system information. The system information and the original exception information form exception data, and the exception data is notified to the exception monitoring module.
5. An Android Native application crash monitoring device, Characterized in that: It includes a processor, an exception monitoring module, and a memory. The exception monitoring module is used to send the exception data before the Android Native application process crashes to the cloud. A computer program is stored in the memory. When the computer program is executed by the processor, the Android Native application crash monitoring device executes the method according to any one of claims 1-3.
6. A vehicle, Characterized in that, The vehicle includes a vehicle body and the Android Native application crash monitoring device according to claim 5, and the Android Native application crash monitoring device is arranged on the vehicle.
7. A computer-readable storage medium, Characterized in that, A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer executes the method according to any one of claims 1-3.
Citation Information
Patent Citations
Program crash information collection method and system
CN106844136A
Crash monitoring method and device, electronic equipment and storage medium
CN114185733A