Log service processing method and device, terminal equipment and storage medium
By turning on the log service when the operating system of the terminal device is abnormal and recording abnormal information is solved, the problem of inability to record abnormal information in the prior art is solved, and efficient intensive measurement of multiple operating system devices is achieved.
Patent Information
- Application Number
- CN202311675975.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2025-06-10
AI Technical Summary
The prior art cannot record abnormal information in time when an abnormality occurs in the device, which affects the maintenance and measurement capabilities of multiple operating systems.
When listening to an operating system of the terminal device that has an operating system running exception, turn on the log service of the corresponding operating system to record the exception information. At the same time, when kernel exceptions, turn on log services for all operating systems to ensure full recording of exception information.
It realizes efficient and accurate recording of abnormal information when device abnormality occurs, avoids the impact of long-term log service on device performance, and improves maintenance and measurement capabilities.
Smart Images

Figure CN120123124A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field, and in particular, to a method, apparatus, terminal device, and storage medium for processing a log service. Background Art
[0002] The security of devices with Android multi-operating systems has strong competitiveness in multiple industry-related fields. However, compared with devices of other operating systems, the Android operating system has always had the problem of high power consumption, and the power consumption problem of multi-operating system devices is particularly obvious.
[0003] In the prior art, most existing device solutions have a built-in log switch that remains open for a period of time after the mobile phone is upgraded and then automatically closes to reduce the impact on the power consumption performance of the device.
[0004] However, this switching strategy has some limitations. When an exception may occur in the device, the log service cannot record the exception, which has a negative impact on the maintenance and testing of multi-operating systems. Summary of the Invention
[0005] This application provides a method, apparatus, terminal device, and storage medium for processing a log service to solve the problems in the prior art that exceptions cannot be recorded in a timely manner when the device has an exception.
[0006] In a first aspect, an embodiment of this application provides a method for processing a log service, which is applied to a terminal device with a multi-operating system. The method includes:
[0007] When it is monitored that at least one operating system of the terminal device has a running exception, the log services respectively corresponding to the at least one operating system are started;
[0008] Based on the log services respectively corresponding to the at least one operating system, the exception information corresponding to the at least one operating system is recorded.
[0009] In a possible design of the first aspect of the embodiment of this application, the method further includes:
[0010] When it is monitored that the kernel of the terminal device has a running exception, the log services respectively corresponding to all operating systems are started;
[0011] Based on the log services respectively corresponding to each operating system, the exception information corresponding to the kernel is recorded.
[0012] In another possible design of the first aspect of the embodiment of this application, the method further includes:
[0013] After detecting that the operating system of the terminal device is upgraded and after the device is powered on, open the log services corresponding to each operating system;
[0014] For each operating system, after meeting the preset conditions, close the log service corresponding to the operating system.
[0015] In a possible design of the first aspect of the embodiments of the present application, the preset condition is any one of the following: the log service continues to serve for a preset duration, the terminal device is restarted a preset number of times.
[0016] In another possible design of the first aspect of the embodiments of the present application, the method further includes:
[0017] After detecting that the log service of any operating system is closed, close the relevant log process corresponding to the log service.
[0018] In a second aspect, an embodiment of the present application provides a processing device for a log service, which is applied to a terminal device with multiple operating systems. The device includes:
[0019] An enabling module, configured to enable the log services corresponding to at least one operating system of the terminal device when it is detected that at least one operating system of the terminal device has an abnormal operation;
[0020] A recording module, configured to record abnormal information corresponding to at least one operating system based on the log services corresponding to at least one operating system.
[0021] In a possible design of the first aspect of the embodiments of the present application, the enabling module is further configured to enable the log services corresponding to all operating systems when it is detected that the kernel of the terminal device has an abnormal operation;
[0022] The recording module is further configured to record abnormal information corresponding to the kernel based on the log services corresponding to each operating system.
[0023] In another possible design of the first aspect of the embodiments of the present application, the enabling module is further configured to open the log services corresponding to each operating system after detecting that the operating system of the terminal device is upgraded and after the device is powered on;
[0024] The device further includes: a closing module, configured to close the log service corresponding to each operating system after meeting the preset conditions.
[0025] In a further possible design of the first aspect of the embodiments of the present application, the preset condition is any one of the following: the log service continues to serve for a preset duration, the terminal device is restarted a preset number of times.
[0026] In still another possible design of the first aspect of the embodiments of the present application, the closing module is further configured to:
[0027] After detecting that the log service of any operating system is closed, close the relevant log processes corresponding to the log service.
[0028] In a third aspect, the present application provides a terminal device, including: a processor, and a memory communicatively connected to the processor;
[0029] The memory stores computer-executable instructions;
[0030] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect or any one of the above manners.
[0031] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect or any one of the above manners.
[0032] The processing method, device, terminal device, and storage medium for the log service provided by the present application are applied to a terminal device with multiple operating systems. The method includes: when detecting that at least one operating system of the terminal device has an abnormal operation, starting the log services respectively corresponding to at least one operating system, and then recording the abnormal information corresponding to at least one operating system based on the log services respectively corresponding to at least one operating system. In this technical solution, by starting a monitoring service in each operating system of the terminal device, and the power consumption of the monitoring service is very low and has little impact on the performance of the terminal device. When an abnormality is detected, the log service is started to achieve efficient and accurate recording of abnormal events. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0034] Figure 1 The flowchart of the exception handling provided for the prior art;
[0035] Figure 2 The flowchart of the exception handling provided for the embodiments of the present application;
[0036] Figure 3 The flowchart of the processing method of the log service provided for the embodiments of the present application Figure 1 ;
[0037] Figure 4 The flowchart of the processing method of the log service provided for the embodiments of the present application Figure 2 ;
[0038] Figure 5 Schematic flowchart of the processing method for the log service provided by the embodiments of the present application Figure 3 ;
[0039] Figure 6 Schematic flowchart of the processing method for the log service provided by the embodiments of the present application Figure 4 ;
[0040] Figure 7 Schematic structural diagram of the processing device for the log service provided by the embodiments of the present application;
[0041] Figure 8 Schematic structural diagram of the terminal device provided by the embodiments of the present application.
[0042] Through the above-mentioned drawings, specific embodiments of the present disclosure have been shown, and more detailed descriptions will be given hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present disclosure in any way, but to illustrate the concept of the present disclosure to those skilled in the art by referring to specific embodiments. Specific Embodiments
[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.
[0044] Before introducing the embodiments of the present application, the application background of the embodiments of the present application will be explained first:
[0045] Since the advent of the Android operating system, major terminal manufacturers and developers have gradually joined this operating system platform. At the same time, Android gives developers more space and freedom, which has further promoted the development of the Android operating system.
[0046] In recent years, dual-operating-system devices based on Android have shown strong competitiveness in many fields such as security. However, compared with other devices, the Android operating system has always had the problem of high power consumption, and the power consumption problem of multi-operating-system devices is particularly obvious. This has led to the need for the device to adopt a large battery solution, resulting in an inevitably thick and heavy body and being unable to achieve thinness and lightness. At the same time, the improvement of the overall power consumption performance is also helpful to improve the product competitiveness of the terminal device.
[0047] Currently, dual-operating-system security devices are favored by a wide range of security scenarios due to their unique confidentiality and security. At the same time, the security issues and overall stability of dual-operating-system devices need to be paid extra attention to. The maintenance and testing of security devices require the support of a logging service. However, keeping the logging switch on for a long time will affect the performance and power consumption of the mobile phone, which has become a difficult-to-balance contradiction point.
[0048] Most existing mobile phone solutions have a built-in logging switch that remains on for a period of time after the mobile phone is upgraded and then automatically turns off to reduce the impact on the power consumption and performance of the mobile phone. This switch strategy has some limitations. For example, if a device anomaly occurs in the future, the logging service will not be able to record the anomaly.
[0049] That is, Figure 1 The flowchart of anomaly handling provided by the prior art is as Figure 1 shown. When the mobile phone is in the running state, when an anomaly occurs, it enters the anomaly handling / recovery state and then re-enters the running state. During this process, no anomaly logs are recorded.
[0050] The problems existing in the prior art that need to be solved by the embodiments of the present application:
[0051] 1. After the logging switch is turned on in the Android operating system, the overall performance and power consumption metrics of the whole machine will decline (that is, the Android operating system logging switch keeps recording the running status of the mobile phone and frequently reads and writes information, which will cause the central processing unit to be frequently occupied, the power consumption cannot be reduced, and the remaining storage space will decrease). After the logging service is turned off, the overall maintenance and testing ability of the whole machine will be reduced;
[0052] 2. When adapting the function of the logging switch to devices such as mobile phones with multiple operating systems, the impacts between multiple operating systems need to be considered simultaneously, that is, the problems of information synchronization and non-synchronization between multiple operating systems need to be solved.
[0053] In view of the technical problems existing in the prior art, the inventors of the present application have the following ideas. For multiple operating systems, a listening service can be run separately on each operating system. Since the power consumption of the listening service during operation is small and the impact on the performance of the mobile phone is small, after an anomaly is detected, the logging switch can be turned on so that the logging service can record the relevant information of the anomaly, thus achieving the goal of not reducing the overall maintenance and testing ability of the whole machine; in addition, if an anomaly occurs within one operating system, in most cases, it will not affect the other operating system, and there is no need to turn on unnecessary logging switches. Therefore, the logging switches between each operating system can be controlled separately. Only when an anomaly occurs in the kernel (multiple operating systems share one kernel), the logging switches in multiple operating systems need to be turned on simultaneously to collect anomaly information.
[0054] Figure 2The flowchart of exception handling provided by the embodiments of this application is as follows. Figure 2 As shown, when the mobile phone is in the running state and an exception occurs, the log switch is turned on for recording. Then, based on this log record, exception handling / recovery state is performed, and then it re-enters the running state.
[0055] Next, the technical solution of this application will be described in detail through specific embodiments. It should be noted that these specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0056] It is worth noting that the application fields of the methods, devices, terminal devices, and storage media involved in this disclosure are not limited.
[0057] Among them, the execution subject of this application is a terminal device, which can specifically be a mobile phone, a computer, a tablet, a computing device, etc.
[0058] Figure 3 The flowchart of the processing method of the log service provided by the embodiments of this application Figure 1 is as follows. Figure 3 As shown, this method is applied to a terminal device with multiple operating systems, and this method may include the following steps:
[0059] Step 31, when it is monitored that at least one operating system of the terminal device has a running exception, turn on the log services respectively corresponding to at least one operating system;
[0060] In this step, in a terminal device with multiple operating systems, when each operating system starts, a monitoring service can be started to monitor whether there is a running exception on the corresponding operating system;
[0061] When the monitoring service monitors that the corresponding operating system has a running exception, the log service is pulled up. Since the power consumption occupied by the monitoring service is extremely low, the impact on the performance of the terminal device is extremely small.
[0062] In one implementation, the monitoring service is "listen_logcat_server", and monitoring whether there is a running exception on the corresponding operating system can be monitoring exception handling functions, such as "panic", "watchdog", "hungtask", "anr", "crash" and other handling functions.
[0063] Furthermore, when it is monitored that a handling function is triggered, "listen_logcat_server" will record relevant information to a specified directory for the triggered handling function, and open the log service "logcat_server", that is, the log switch can be turned on.
[0064] Among them, the panic handler: When the operating system encounters an unrecoverable kernel-level error or exception, it enters the panic state and triggers the panic handler. This function is responsible for recording error information, generating crash logs, and performing necessary cleanup operations;
[0065] The watchdog handler: A monitoring mechanism used to detect whether the system is in a deadlock or stalled state. If the watchdog detects that the system is not running properly, it will trigger the watchdog handler to perform corresponding actions, such as restarting the system or performing other emergency operations;
[0066] The hungtask handler: Refers to a task in the Linux kernel that has executed for more than a set threshold. When the system detects a hungtask, it will trigger the hungtask handler to record relevant information and take corresponding measures, such as terminating the task or performing other processing operations;
[0067] The anr handler: When an Android application performs a time-consuming operation on the main thread and fails to respond to user input in a timely manner, the system will consider that the application has an anr. The anr handler is responsible for recording anr logs and performing exception handling, such as terminating the application or attempting to resume the normal operation of the application.
[0068] The crash handler: When an application encounters an abnormal situation, such as a null pointer reference, segmentation fault, etc., that causes a crash, the system will call the crash handler. This function is responsible for recording crash information, generating crash reports, and performing necessary cleanup operations.
[0069] Step 32: Based on the logging services corresponding to at least one operating system, record the exception information corresponding to at least one operating system.
[0070] In this step, after the logging service corresponding to the operating system with an exception is enabled as described above, the logging service starts to record the detailed information of the exceptions existing on that operating system, that is, the exception information.
[0071] Furthermore, after it is detected that the logging service of any operating system is closed, close the relevant logging processes corresponding to the logging service.
[0072] In this implementation, after the logging service is closed, it actively closes the threads running during logging. That is, relying on the Android rc monitoring mechanism, when the logging switch property is modified, it can actively kill the relevant logging processes.
[0073] In one implementation, when the value of the persist.sys.logcat property is set to 1 (i.e., the log switch is turned off), the terminal device actively kills the started departmental log processes, including kmsglog, sleeplog, chargelog, etc.;
[0074] At this time, the hilogcat service can be retained, and the log printing control can be modified to error to save power to the greatest extent.
[0075] Among them, the hilogcat service provides a convenient way to collect and view the logs generated in real time on the terminal device, including system logs (such as kernel logs, host logs, etc.), application logs, and related event logs. By using the hilogcat service, developers and technical support personnel can more conveniently analyze and debug problems on the device, locate errors and exceptions, and provide corresponding solutions.
[0076] The method for processing the log service provided by the embodiments of the present application is applied to a terminal device with multiple operating systems. The method starts the log services corresponding to at least one operating system respectively when it is monitored that at least one operating system of the terminal device has an abnormal operation, and then records the abnormal information corresponding to at least one operating system based on the log services corresponding to at least one operating system respectively. In this technical solution, by starting a monitoring service in each operating system of the terminal device, and the power consumption of the monitoring service is very low and has little impact on the performance of the terminal device. When an abnormality is detected, the log service is started to achieve efficient and accurate recording of abnormal events.
[0077] Based on the above embodiments, Figure 4 is a flowchart of the method for processing the log service provided by the embodiments of the present application Figure 2 As Figure 4 shown, the method may further include the following steps:
[0078] Step 41, when it is monitored that the kernel of the terminal device has an abnormal operation, start the log services corresponding to all operating systems respectively;
[0079] In this step, since the kernel of the terminal device provides operation support for each operating system, when the kernel of the terminal device has an abnormality, it is necessary to start the log services corresponding to all operating systems respectively to record the corresponding events.
[0080] In one implementation, when listen_logcat_server monitors a kernel abnormality, it will start the logcat_server of all operating systems to record more detailed log information subsequently.
[0081] Step 42: Based on the logging services corresponding to each operating system, record the exception information corresponding to the kernel.
[0082] In this step, after the logging services corresponding to all operating systems are opened respectively, they each start to record the exception information corresponding to the kernel.
[0083] Correspondingly, after the logging service is closed, the relevant logging processes corresponding to the logging service should also be closed. The implementation principle is similar to the embodiments described above and will not be elaborated here.
[0084] The method for processing the logging service provided by the embodiment of the present application, when it is monitored that the kernel of the terminal device has an abnormal operation, starts the logging services corresponding to all operating systems respectively, and then based on the logging services corresponding to each operating system, records the exception information corresponding to the kernel. In this technical solution, based on the monitoring of whether the kernel is abnormal, when an abnormality occurs, the logging services on all operating systems are pulled up to record the information that the kernel may be abnormal, so as to realize the maintenance and testing of the terminal device.
[0085] Based on the above embodiments, Figure 5 is the flow schematic of the method for processing the logging service provided by the embodiment of the present application Figure 3 As Figure 5 shown, the method may further include the following steps:
[0086] Step 51: After monitoring that the terminal device has an operating system upgrade and after booting, open the logging services corresponding to each operating system;
[0087] In this step, after the terminal device has an operating system upgrade and after booting, at this time, it is necessary to detect the performance of the operating system, and the logging services corresponding to each operating system in the terminal device can be opened.
[0088] Optionally, the upper layer of the terminal device turns on the switches of the logging services corresponding to each operating system.
[0089] Step 52: For each operating system, after meeting the preset conditions, close the logging service corresponding to the operating system.
[0090] In this step, after the logging service is opened, for each operating system, during operation, it is judged whether the operating system meets the preset conditions. The preset conditions are used to judge whether the corresponding operating system can be closed. If it meets the conditions, the corresponding logging service is closed; if it does not meet the conditions, the logging service continues to provide services.
[0091] Among them, the preset conditions are any one of the following: the logging service continuously serves for a preset duration, the terminal device is restarted a preset number of times.
[0092] Optionally, two attribute values can be added, corresponding to two of the preset conditions respectively, that is, attribute value 1 is persist.sys.logcat (the log service continues to serve until the preset duration); attribute value 2 is persist.sys.debuglogcat (the terminal device is restarted the preset number of times).
[0093] In a possible implementation, for example, the preset duration is 72h and the preset number of times is 2;
[0094] When the terminal device is upgraded and powered on, the timing starts. After 72h, an active command is sent to set both persist.sys.logcat and persist.sys.debuglogcat to 1; if the user manually turns on the log switch or restarts the device within 72h after the upgrade, only the persist.sys.debuglogcat attribute will be set to 1 for the first time, without changing the value of the persist.sys.logcat attribute. Only when restarted for the second time, the device will modify the value of the persist.sys.logcat attribute to 1 according to the value of persist.sys.debuglogcat being 1, thereby turning off the log switch.
[0095] Correspondingly, after the log service is turned off, the relevant log processes corresponding to the log service should also be turned off. The implementation principle is similar to the embodiments described above and will not be elaborated here.
[0096] The method for processing the log service provided by the embodiments of the present application turns on the log services corresponding to each operating system after detecting that the terminal device has an operating system upgrade and is powered on, and for each operating system, turns off the log service corresponding to the operating system after meeting the preset conditions. In this technical solution, adding conditions to control the log service switch can avoid the occupation of internal resources by the long-term opening of the log service.
[0097] Based on the above embodiments, Figure 6 is a schematic flowchart of the method for processing the log service provided by the embodiments of the present application Figure 4 as Figure 6 shown. One implementation embodiment of this method can be:
[0098] Mobile phone recovery or upgrade; turn on the log switch and start timing for 72 hours; when it exceeds 72 hours and both attribute value 1 and attribute value 2 are 1, directly turn off the log; when it does not exceed 72 hours and both attribute value 1 and attribute value 2 are 0, if it is restarted once and attribute value 1 is 0 and attribute value 2 is 1, actively turn on the log switch with attribute value 1 and attribute value 2 both being 0; if it is restarted again and attribute value 1 is 1 and attribute value 2 is 1, manually turn on the log switch, then attribute value 1 and attribute value 2 are both 0; or the log switch is turned off.
[0099] In the above implementation, for any scenario, the log switch can also be manually turned on without caring about whether the duration is greater than 72 hours or the number of restarts.
[0100] Among them, attribute value 1 is persist.sys.logcat; attribute value 2 is persist.sys.debuglogcat.
[0101] The processing method of the log service provided by the embodiment of the present application has a similar implementation principle and technical effect to those of the above embodiments, and will not be elaborated here.
[0102] The following is an embodiment of the device of the present application, which can be used to execute the method embodiment of the present application. For the details not disclosed in the device embodiment of the present application, please refer to the method embodiment of the present application.
[0103] Figure 7 It is a schematic structural diagram of a processing device for the log service provided by the embodiment of the present application. As Figure 7 shown, the device is applied to a terminal device with multiple operating systems, and the device includes:
[0104] An enabling module 71, configured to enable the log services respectively corresponding to at least one operating system when it is monitored that at least one operating system of the terminal device has an abnormal operation;
[0105] A recording module 72, configured to record the abnormal information corresponding to at least one operating system based on the log services respectively corresponding to at least one operating system.
[0106] In a possible design of the first aspect of the embodiment of the present application, the enabling module 71 is further configured to enable the log services respectively corresponding to all operating systems when it is monitored that the kernel of the terminal device has an abnormal operation;
[0107] The recording module 72 is further configured to record the abnormal information corresponding to the kernel based on the log services respectively corresponding to each operating system.
[0108] In another possible design of the first aspect of the embodiments of the present application, the enabling module 71 is further configured to, after detecting that the operating system of the terminal device is upgraded and after the device is powered on, turn on the log services corresponding to each operating system.
[0109] The device further includes: a closing module 73, configured to, for each operating system, after a preset condition is met, close the log service corresponding to the operating system.
[0110] In another possible design of the first aspect of the embodiments of the present application, the preset condition is any one of the following: the log service continuously serves for a preset duration, or the terminal device is restarted a preset number of times.
[0111] In still another possible design of the first aspect of the embodiments of the present application, the closing module 73 is further configured to:
[0112] After detecting that the log service of any operating system is closed, close the relevant log process corresponding to the log service.
[0113] The log service processing device provided in the embodiments of the present application can be used to execute the log service processing method in any of the above embodiments. The implementation principles and technical effects are similar and will not be elaborated here.
[0114] It should be noted that it should be understood that the division of each module of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by a processing element; they can also all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. In addition, all or part of these modules can be integrated together or independently implemented. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the integrated logic circuit in the processor element or the instructions in the form of software.
[0115] Figure 8 The structural schematic diagram of the terminal device provided in the embodiments of the present application is as Figure 8 shown. The terminal device may include: a processor 81, a memory 82, and computer program instructions stored on the memory 82 and executable on the processor 81. When the processor 81 executes the computer program instructions, the method provided in any of the foregoing embodiments is implemented.
[0116] Optionally, the above-mentioned components of the terminal device can be connected through an operating system bus.
[0117] The memory 82 can be a separate storage unit or a storage unit integrated in the processor 81. The number of processors 81 is one or more.
[0118] It should be understood that the processor 81 can be a Central Processing Unit (CPU), or other general-purpose processors 81, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), etc. The general-purpose processor 81 can be a microprocessor 81 or the processor 81 can also be any conventional processor 81, etc. The steps of the method disclosed in this application can be directly implemented by the execution of the hardware processor 81, or completed by a combination of hardware and software modules in the processor 81.
[0119] The operating system bus can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The operating system bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The memory 82 may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory 82.
[0120] All or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a readable memory 82. When the program is executed, it executes the steps including the above method embodiments; and the foregoing memory 82 (storage medium) includes: Read-Only Memory (ROM), RAM, flash memory 82, hard disk, solid state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.
[0121] The terminal device provided in the embodiments of this application can be used to execute the method provided in any of the above method embodiments. The implementation principle and technical effects are similar and will not be elaborated here.
[0122] An embodiment of the present application provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions run on a computer, the computer is caused to execute the above method.
[0123] The above computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, a magnetic disk or an optical disk. The readable storage medium may be any available medium accessible by a general-purpose or special-purpose computer.
[0124] Optionally, the readable storage medium is coupled to the processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium may also be a component of the processor. The processor and the readable storage medium may be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium may also exist as discrete components in the device.
[0125] An embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, the above method can be implemented.
[0126] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A processing method for a log service, characterized in that, applied to a terminal device with multiple operating systems, the method includes: When it is monitored that at least one operating system of the terminal device has an abnormal operation, the log services respectively corresponding to the at least one operating system are started; Based on the log services respectively corresponding to the at least one operating system, the abnormal information corresponding to the at least one operating system is recorded.
2. The method according to claim 1, characterized in that, the method further includes: When it is monitored that the kernel of the terminal device has an abnormal operation, the log services respectively corresponding to all operating systems are started; Based on the log services respectively corresponding to each operating system, the abnormal information corresponding to the kernel is recorded.
3. The method according to claim 1, characterized in that, the method further includes: After it is monitored that the terminal device performs an operating system upgrade and after booting, the log services respectively corresponding to each operating system are opened; For each operating system, after meeting a preset condition, the log service corresponding to the operating system is closed.
4. The method according to claim 3, characterized in that, the preset condition is any one of the following: the log service continuously serves for a preset duration, the terminal device is restarted a preset number of times.
5. The method according to any one of claims 1-4, characterized in that, the method further includes: After it is monitored that the log service of any operating system is closed, the relevant log process corresponding to the log service is closed.
6. A processing device for a log service, characterized in that, applied to a terminal device with multiple operating systems, the device includes: An opening module, configured to start the log services respectively corresponding to the at least one operating system when it is monitored that at least one operating system of the terminal device has an abnormal operation; A recording module, configured to record the abnormal information corresponding to the at least one operating system based on the log services respectively corresponding to the at least one operating system.
7. The device according to claim 6, characterized in that, the opening module is further configured to start the log services respectively corresponding to all operating systems when it is monitored that the kernel of the terminal device has an abnormal operation; the recording module is further configured to record the abnormal information corresponding to the kernel based on the log services respectively corresponding to each operating system.
8. The device according to claim 6, characterized in that, the opening module is further configured to open the log services respectively corresponding to each operating system after it is monitored that the terminal device performs an operating system upgrade and after booting; The device further includes: a closing module, configured to close the log service corresponding to the operating system after meeting a preset condition for each operating system.
9. A terminal device, characterized in that, includes: A processor, and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1 to 5 above.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 above when executed by a processor.