System log uploading method and device, computer equipment and storage medium
By obtaining and classifying the storing of operating system logs, detecting user needs and performing upload operations, the problems of untimely log uploads and waste of resources in the existing technology are solved, and efficient and accurate log uploads and user privacy protection are achieved.
Patent Information
- Application Number
- CN202411994744.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing operating system log upload method is difficult to cover comprehensively when dealing with special circumstances, resulting in information omission, and problems such as waste of resources, lag in operation and privacy risks.
By obtaining the system logs generated by the current operating system, identifying the data source and classifying storage according to the function type, detecting user upload needs, determining the target storage space, and performing corresponding upload operations.
It realizes timely capture of operating system operation information, improves the accuracy and efficiency of log uploads, avoids resource waste and privacy risks, ensures that users actively trigger log uploads, and protects user privacy.
Smart Images

Figure CN119917463A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for uploading a system log, a computer device and a storage medium. Background Art
[0002] During the operation of the operating system, the system log serves as an important reference, recording the current status of the operating system and related information. By viewing these logs, R&D personnel can quickly understand and confirm the operation and status of the operating system. Therefore, transmitting the operating system log to R&D personnel is crucial for the maintenance and optimization of the operating system.
[0003] At present, the commonly used method of uploading operating system logs to the cloud platform for R&D personnel to view has many shortcomings. When using rule-based triggering, the rules are fixed and it is difficult to cover situations outside the rules. Once a vulnerability occurs in the operating system, the logs cannot be uploaded in time, which can easily lead to information omissions; under the periodic triggering method, the log volume is huge, and when the operating system is running normally, a large amount of log content is invalid, resulting in a waste of resources; remote command triggering has the problem of delayed operation by R&D personnel, which can easily lead to the loss of logs and the inability to obtain them in a timely and accurate manner. In addition, remote operations involve user privacy and require user consent before they can be performed. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a system log uploading method, apparatus, computer equipment and storage medium to solve the problem that the existing upload trigger method is difficult to cover comprehensively when dealing with special situations, thereby causing information omissions, resource waste, operation delays and privacy risks.
[0005] In a first aspect, an embodiment of the present invention provides a method for uploading a system log, the method comprising:
[0006] Get the system logs generated by the current operating system;
[0007] Identify the data source of the system log, and store the system log in a corresponding storage space according to the functional type of the data source;
[0008] Detecting a user's upload requirement for the function type, and determining a corresponding target storage space based on the upload requirement;
[0009] A corresponding upload operation is performed on at least one system log in the target storage space.
[0010] Furthermore, storing the system log to a corresponding storage space according to the functional type of the data source includes:
[0011] Extracting data features from the system log;
[0012] Obtaining a node structure in a storage space corresponding to the function type, and searching the node structure for an original node matching the data feature;
[0013] The system log is stored in an original node that matches the data feature.
[0014] Furthermore, the detecting of the user's upload requirement for the function type includes:
[0015] Detect click operations on the preset interactive interface;
[0016] Identify the virtual key triggered by the click operation, and determine the target function type corresponding to the virtual key according to the association relationship between the virtual key and the function type;
[0017] The upload requirement of the user is determined based on the target function type.
[0018] Furthermore, before detecting a click operation on a preset interactive interface, the method further includes:
[0019] Acquiring operation data of the current operating system;
[0020] Determining whether there is an abnormal event in the current operating system according to the operating data;
[0021] If an abnormal event occurs in the current operating system, the display state of the virtual key in the preset interactive interface is adjusted to a prominent state according to the function type corresponding to the abnormal event.
[0022] Further, performing a corresponding upload operation on at least one system log in the target storage space includes:
[0023] Obtaining historical upload data for the target storage space;
[0024] Determine a plurality of target nodes in the target storage space according to the historical uploaded data;
[0025] A corresponding data packet is generated using the system log under the target node, and an upload operation of the data packet is performed.
[0026] Further, the generating a corresponding data packet by using the system log under the target node includes:
[0027] Analyze the connection relationship between each of the target nodes to obtain an analysis result;
[0028] According to the analysis result, the system logs under the target node are layered to obtain an initial sequence framework;
[0029] Sorting the system logs at each level in the initial sequence framework according to a preset sorting rule to obtain a target log sequence;
[0030] The target log sequence is encrypted and encapsulated to obtain a data packet.
[0031] Further, after performing the upload operation of the data packet, the method further includes:
[0032] Monitoring the upload progress of the system log in the data packet;
[0033] When the upload progress reaches a preset interval, predicting the upload time of the remaining logs in the data packet;
[0034] Feedback information is generated based on the upload time, and the feedback information is displayed on a preset interactive interface.
[0035] In a second aspect, an embodiment of the present invention provides a system log uploading device, the device comprising:
[0036] The acquisition module is used to obtain the system logs generated by the current operating system;
[0037] A storage module, used for identifying the data source of the system log, and storing the system log in a corresponding storage space according to the functional type of the data source;
[0038] A detection module, used to detect a user's upload requirement for the function type, and determine a corresponding target storage space based on the upload requirement;
[0039] The execution module is used to perform a corresponding upload operation on at least one system log in the target storage space.
[0040] In a third aspect, an embodiment of the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0042] The method provided in the embodiment of the present application has the following beneficial effects:
[0043] The method provided by the embodiment of the present application provides data for subsequent classified storage, responding to user upload requirements and performing upload operations by obtaining system logs, ensuring timely capture of operating system operation information, and providing original data for R&D personnel to analyze. Logs are stored by function type, which is convenient for classified management, so that logs of different sources and functions are stored in order, which is conducive to subsequent rapid positioning and searching. This method facilitates users to quickly select and upload specific logs by function type, improves the accuracy of upload, makes the logs obtained by R&D personnel more targeted, avoids the waste of resources caused by disordered storage, and improves the efficiency of storage resource utilization. By detecting user needs and determining the target storage space, the function of user actively triggering log upload is realized, ensuring that the information uploaded by the log is permitted by the user, and fully respecting user privacy. Performing an upload operation on the log of the target storage space can accurately transmit the user-specified log to the R&D personnel, so that the R&D personnel can obtain log information closely related to the user's concerns, which helps to quickly locate and solve problems in the operating system. At the same time, by optimizing the upload operation, such as determining the target node and generating data packets based on historical upload data, the accuracy and efficiency of log upload are further improved, the amount of data transmission is reduced, and the waste of network resources is avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 is a flow chart of a method for uploading a system log according to an embodiment of the present invention;
[0046] Figure 2 is a flow chart of another method for uploading a system log according to an embodiment of the present invention;
[0047] Figure 3 is a structural block diagram of a device for uploading a system log according to an embodiment of the present invention;
[0048] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0050] According to an embodiment of the present invention, a method, apparatus, computer device and storage medium for uploading a system log are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] In this embodiment, a method for uploading a system log is provided. Figure 1 is a flow chart of a method for uploading a system log according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0052] Step S11, obtaining the system log generated by the current operating system.
[0053] In an embodiment of the present application, the system captures various types of log data generated by the operating system during operation in real time through a specific collection mechanism. During the collection process, in combination with distributed storage technologies, such as distributed file systems such as Ceph or HDFS, the collected log data is initially dispersed and stored in multiple nodes to ensure the reliability and scalability of the data. At the same time, using edge computing technology, on the edge device close to the operating system that generates logs, the collected original log data is preliminarily cleaned to remove obviously erroneous or duplicated data, thereby reducing the burden of subsequent processing. In addition, the autoencoder algorithm in deep learning is introduced to analyze the collected log data in real time, learn the normal log data pattern, mark the log data with abnormalities, and provide a more accurate data basis for subsequent classified storage, so that the logs can be classified and stored more efficiently, respond to user upload requirements, and perform upload operations.
[0054] Step S12, identifying the data source of the system log, and storing the system log into a corresponding storage space according to the functional type of the data source.
[0055] In an embodiment of the present application, after the log has completed the matching correspondence with specific functions such as Bluetooth, Wi-Fi, music, navigation map, DVR (digital video recorder), DMS (data management system), etc., the log is displayed according to the priority level and indexed by the function name based on the priority sorting result of artificial intelligence. For the logs with abnormalities detected by the deep learning autoencoder, they are highlighted during display so that users can quickly locate them. In addition, the log data stored in a distributed file system (Ceph or HDFS) will be quickly collected and integrated from each node before display to ensure that the log information displayed to the user is comprehensive and accurate. In this way, users can intuitively see the logs of different functions, and according to the highlighted abnormal logs and priority sorting, more efficiently select the log content they want to view, and provide clear guidance for subsequent selection to upload specific logs.
[0056] It should be noted that if Figure 2 As shown in the figure, the processing flow of system logs specifically includes: collecting and storing various system logs; matching and corresponding the collected logs with specific functions, such as Bluetooth, Wi-Fi, music, navigation maps, DVR (digital video recorder) and DMS (data management system); users can select the system logs they want to upload; the operating system will upload the system logs selected by the user. This log processing flow is usually used for fault diagnosis, user behavior analysis and system optimization. By analyzing the log data related to user operations, developers can better understand the user's usage habits and the operation of the system, so as to make targeted improvements and optimizations.
[0057] In the embodiment of the present application, storing the system log in the corresponding storage space according to the functional type of the data source includes the following steps A1-A3:
[0058] Step A1, extracting data features from the system log.
[0059] Specifically, the system log contains rich information, recording various events and operations in the operation of the operating system. In order to accurately store logs by function type, it is necessary to extract representative data features, that is, through time feature extraction, using the timestamps accurate to seconds and milliseconds in the system log, analyze the order of log generation and the operation status of different time periods, and understand the usage rules and potential problems of specific functions; through operation instruction feature extraction, identify operation instructions such as system calls, file reading and writing, and network requests. Because different functional modules correspond to specific instruction sets, such as pairing and connection instructions in Bluetooth function logs, the function to which the log belongs can be located; through parameter feature extraction, obtain the parameters carried by the operation instruction, such as the file name and path of file reading and writing, the URL of the network request, etc., to fully understand the operation context and provide information for log classification storage. These key data features are extracted using text parsing, regular expression matching and other technologies, laying the foundation for subsequent log management.
[0060] Step A2, obtaining the node structure in the storage space corresponding to the function type, and searching the node structure for the original node matching the data feature.
[0061] Specifically, each function type organizes and stores log data in a corresponding storage space using a specific node structure similar to an indexing mechanism. The node structure is pre-built based on functional characteristics and storage requirements. For example, the Bluetooth function divides nodes according to device connection status and data transmission type, and the navigation map function builds nodes based on operations such as map loading. The system will regularly maintain and update to adapt to functional changes and new log features. After obtaining the system log data features, use this as the query condition and search according to the preset matching rules of the node structure, similar to a database query. For example, the Bluetooth connection failure record is found in the node structure by matching the connection status, error code and other features. This process requires efficient algorithms and data structure support to ensure fast and accurate matching with large amounts of data and complex structures.
[0062] Step A3: storing the system log to an original node that matches the data feature.
[0063] Specifically, the storage content includes not only the original text of the system log, but also data features and other related metadata, such as log generation time, source device, etc. This information helps to fully understand the log situation, which meets the requirements of the proposal for log management for fault diagnosis, user behavior analysis and other purposes. Storage methods can be in the form of file storage, database records, etc., depending on the system architecture and storage requirements. At the same time, to ensure data consistency and reliability, a transaction mechanism can be used to ensure the complete storage of logs to prevent partial data loss or incomplete storage. Data backup and redundant storage can also be performed to deal with abnormal situations such as hardware failures to ensure the availability of log data.
[0064] Step S13, detecting the user's upload requirement for the function type, and determining the corresponding target storage space based on the upload requirement.
[0065] In the embodiment of the present application, detecting the user's upload demand for the function type includes the following steps B1-B3:
[0066] Step B1, detecting a click operation on a preset interactive interface.
[0067] Specifically, the preset interactive interface is a visual interface designed specifically for users to select log functions. Through specific interactive detection technology, user operations on the preset interactive interface are monitored, with a focus on click operations, which may specifically include an event monitoring mechanism for a graphical user interface (GUI), similar to the response monitoring of button clicks in common applications. Whether on a touch screen of a mobile device or a mouse click operation on a desktop, the click action on the preset interactive interface is captured to prepare for the subsequent determination of the type of log function the user wants to upload.
[0068] Step B2, identifying the virtual key triggered by the click operation, and determining the target function type corresponding to the virtual key according to the association relationship between the virtual key and the function type.
[0069] Specifically, when the system detects a click operation, it is necessary to further clarify which virtual button the user clicked. Virtual buttons are presented to users in intuitive graphics or text on the preset interactive interface, and each virtual button is associated with a specific function type. The virtual button triggered by the click operation is identified through a preset mapping table or logic algorithm. For example, when designing the interface, the virtual button representing the Bluetooth function is associated with the Bluetooth function type. When the user clicks the button, the click is quickly determined to correspond to the Bluetooth function by looking up the mapping table or executing the relevant logic algorithm. The establishment of this association is based on the principle of classifying logs by function in the proposal, ensuring that the virtual button selected by the user can accurately correspond to the corresponding function type, thereby providing an accurate basis for determining the user's upload needs.
[0070] Step B3: determining the user's upload requirement based on the target function type.
[0071] Specifically, after clarifying the target function type corresponding to the click operation, the user's upload needs can be determined accordingly. Because in the log processing process, when the user clicks a virtual button of a specific function type, it means that he wants to upload logs related to that function. The target function type is used as a key identifier, combined with the method of storing logs according to the function type, to determine which function the user wants to upload the logs in the storage space corresponding to. For example, if the determined target function type is a navigation map, it means that the user wants to upload the logs in the storage space corresponding to the navigation map function.
[0072] In the embodiment of the present application, before detecting a click operation on a preset interactive interface, the method further includes the following steps C1-C3:
[0073] Step C1, obtaining the operating data of the current operating system.
[0074] Specifically, the operation data includes system resource usage (such as obtaining CPU usage, memory usage, disk I / O rate and network bandwidth utilization regularly through the operating system's built-in performance monitoring tools or specific system call interfaces to reflect the overall load. Excessive CPU usage or memory usage may indicate abnormalities), process activity information (recording the start time, running time, dependencies between processes, etc. of each running process, monitoring process activities to discover abnormal process startup or behavior), and various device status feedback (collecting status information of devices connected to the operating system such as Bluetooth, Wi-Fi modules, storage devices, etc., such as Bluetooth connection status, Wi-Fi signal strength, storage device read and write errors, etc., to determine whether there are problems in the interaction between the system and external devices). Integrating data from these different sources can build a comprehensive snapshot of the operating status of the operating system, providing a rich data foundation for determining whether there are abnormal events.
[0075] Step C2, determining whether there is any abnormal event in the current operating system according to the operating data.
[0076] Specifically, after obtaining the current operating system operation data, it is compared with the preset normal range or mode to determine whether there are abnormal events. Set a normal range threshold for system resource usage data, such as CPU usage is normally between 0% and 80%. If it exceeds 80%, there may be performance problems. The memory usage should not exceed 90% of the total system memory, otherwise it may cause the system to be slow or memory overflow. Disk I / O rate, network bandwidth utilization and other indicators also set corresponding thresholds according to hardware configuration and expected use; analyze process behavior patterns, and determine whether its startup, termination mode, resource usage and inter-process dependencies are normal through process activity information. If a process is started at an unexpected time or continues to occupy a large amount of resources and does not meet normal functional requirements, it is considered abnormal; detect device abnormal status, and determine whether the device is working normally based on the device status feedback data, such as frequent Bluetooth disconnection and continuous weak Wi-Fi signal. It is considered a device abnormality. Comprehensive analysis of these data can determine whether there are abnormal events in the operating system and provide a decision-making basis for subsequent operations.
[0077] Step C3: if an abnormal event occurs in the current operating system, the display state of the virtual key in the preset interactive interface is adjusted to a prominent state according to the function type corresponding to the abnormal event.
[0078] Specifically, after determining that an abnormal event exists in the operating system, it is necessary to clarify the corresponding function type so that prompts can be made in the preset interactive interface to guide users to pay attention to related log functions. Through the pre-established mapping relationship, based on an in-depth analysis of the relationship between each functional module and common abnormal events, the detected abnormal events are associated with specific function types, such as abnormal Bluetooth device connection associated with Bluetooth function, and unstable network connection corresponding to Wi-Fi or network-related functions. Then find the virtual button associated with the corresponding function type in the preset interactive interface, and adjust its display status to highlight by changing the color (such as gray to red), increasing the size, or adding a flashing effect, so that users can easily notice it when viewing the interface. When choosing to upload logs, they can give priority to function logs that may be related to abnormalities, improve the efficiency of troubleshooting and resolution, and meet the purpose of log processing flow for fault diagnosis and system optimization.
[0079] Step S14: performing a corresponding upload operation on at least one system log in the target storage space.
[0080] In the embodiment of the present application, step S14 includes the following steps D1-D3:
[0081] Step D1, obtaining historical upload data for the target storage space.
[0082] Specifically, the target storage space is determined based on the user's upload requirements for a specific function type log. All historical upload records related to the target storage space are retrieved from the database or medium that stores historical upload data. These records contain information such as the time of each upload, log range, quantity, and related data characteristics. Using the index mechanism, the relevant historical upload data records are located through the unique identifier of the target storage space (such as the function type code, specific storage path identifier). For example, for the target storage space for Bluetooth function log storage, the Bluetooth function specific identifier is used to find its related log upload records to understand the past upload patterns and characteristics of the function type log, providing a reference for determining the target node.
[0083] Step D2: determining a plurality of target nodes in the target storage space according to the historical upload data.
[0084] Specifically, after obtaining the historical upload data of the target storage space, the target node is determined based on the analysis. Analyze a variety of key factors, such as checking the distribution of log data at different times in the target storage space. The node corresponding to the frequently uploaded area can be the target node; pay attention to the type of functional operation involved in each uploaded log. The specific node where the frequently uploaded operation-related log is located can also be the target node. In addition, combined with the correspondence between logs and functions and data characteristics, determine which nodes store logs that are similar to the log characteristics uploaded by the current user. For example, in the upload of Bluetooth device connection operation logs, a specific node containing key content such as device connection status and error information. If the current user is preparing to upload the Bluetooth function log, this node can be determined as the target node. Through comprehensive analysis of these aspects, multiple target nodes of the target storage space are determined, and the system logs under them are used to generate subsequent uploaded data packets.
[0085] Step D3, using the system log under the target node to generate a corresponding data packet, and performing an upload operation of the data packet.
[0086] In the embodiment of the present application, the corresponding data packet is generated using the system log under the target node, including the following steps D31-D34:
[0087] Step D31, analyzing the connection relationship between each of the target nodes to obtain an analysis result.
[0088] Specifically, when preparing to upload log data, it is necessary to sort out the relationships between multiple target nodes determined from the target storage space. Each target node stores system logs related to a specific function, and they have logical connections. For example, some nodes are related to specific operation processes, and different process nodes have sequential or parallel relationships. Utilize specific algorithms and data structure analysis, such as graph theory algorithms, to regard target nodes as graph vertices, and logical connections as edges. By traversing vertices and edges, combined with checking the order of node log timestamps, the order of operations can be determined, or based on log event correlation information, nodes around the same event or functional module can be determined. Finally, detailed analysis results are obtained, providing an important basis for the reasonable stratification of subsequent logs.
[0089] Step D32, stratifying the system logs under the target node according to the analysis result to obtain an initial sequence framework.
[0090] Specifically, based on the analysis results of the target node connection relationship, the system logs under each target node are layered, aiming to organize the log data in a more orderly manner and facilitate subsequent sorting according to rules. The layering method is determined based on factors such as the degree of connection and the order of operations. For example, for the process log from the start to the completion of a function, the start-related node logs are divided into the upper layer, and the end or subsequent processing is divided into the lower layer; the parallel operation-related node logs are layered according to importance or data volume. When layering, the system sets an identifier for each level, groups the logs of the same level into a group, constructs an initial sequence framework, and preliminarily determines the hierarchical relationship between logs, providing a basic structure for subsequent sorting and organization.
[0091] Step D33, sorting the system logs at each level in the initial sequence framework according to a preset sorting rule to obtain a target log sequence.
[0092] Specifically, after obtaining the initial sequence framework, the system logs in each level are sorted according to the preset sorting rules to generate a target log sequence that better meets the needs. The sorting rules are based on a variety of factors, such as placing earlier generated logs in the order of log timestamps to present the development context of events, or combining machine learning algorithms to sort the log priority results by importance, or sorting by specific process order based on the operation type. These rules are applied to logs at each level in turn, such as sorting by timestamp at a certain level first, and then sorting by importance again if the timestamps are the same, to fully complete the sorting of logs at each level of the initial sequence framework, and obtain an ordered target log sequence, making the arrangement of log data more logical and organized.
[0093] Step D34, encrypt and encapsulate the target log sequence to obtain a data packet.
[0094] Specifically, in order to ensure the security and integrity of log data during transmission, it is encrypted and encapsulated to generate uploadable data packets. Encryption often uses symmetric encryption algorithms (such as AES) or asymmetric encryption algorithms (such as RSA). The appropriate algorithm is selected according to performance requirements to encrypt each log data into ciphertext. Encapsulation is to package the encrypted log data and add necessary metadata such as data packet identification, log source, encryption algorithm type, etc., which helps the recipient to correctly unpack and process it. After encryption and encapsulation, the target log sequence is transformed into a complete data packet, which can be safely uploaded to the designated destination through the network and other channels for subsequent analysis and processing.
[0095] In the embodiment of the present application, after step S14, the method further includes the following steps E1-E3:
[0096] Step E1, monitoring the upload progress of the system log in the data packet.
[0097] Specifically, during the log upload process, the transmission status of the system log in the data packet is continuously monitored to understand the upload progress in real time. This process is achieved by interacting with the network transmission module, which continuously feeds back the amount of data transmitted and the overall size of the data packet. Based on these feedback data, the proportion of the uploaded log data to the entire data packet is calculated, which is used as a measure of the upload progress. For example, if the total size of the data packet is 10MB and 3MB of data has been successfully transmitted, the upload progress is 30%. This progress information is updated at certain time intervals (such as every second or every few seconds) to ensure that changes in the upload process can be captured in a timely manner, providing an accurate data basis for subsequent predictions of the remaining upload time.
[0098] Step E2, when the upload progress reaches a preset interval, predicting the upload time of the remaining logs in the data packet.
[0099] Specifically, when the upload progress reaches a preset interval (this preset interval is determined in advance based on factors such as system performance and network conditions, such as when the upload progress reaches the range of 60%-80%), the prediction mechanism for the remaining log upload time is started. First, the amount of data uploaded and the time spent are analyzed, and the upload time of the remaining data is estimated by calculating the average upload speed. For example, in the process of uploading the first 60% of the data, it took 30 seconds, then the average upload speed is the amount of data uploaded (assuming 6MB) divided by the time (30 seconds), which is 0.2MB / second. Then, according to the amount of data remaining to be uploaded (assuming the total size of the data packet is 10MB, 6MB has been uploaded, and 4MB remains), the remaining data is divided by the average upload speed, that is, 4MB÷0.2MB / second=20 seconds, so it is predicted that the upload time of the remaining log is about 20 seconds. This prediction method takes into account the actual situation of the previous upload, and can more accurately estimate the remaining upload time, helping users have a clearer time expectation for the upload process.
[0100] Step E3, generating feedback information based on the upload time, and displaying the feedback information on a preset interactive interface.
[0101] Specifically, based on the predicted remaining upload time, corresponding feedback information is generated. The content of the feedback information may include the specific value of the estimated remaining time, as well as some prompt text. In order to allow users to obtain this information intuitively, the generated feedback information is displayed on the preset interactive interface. The preset interactive interface is a visual platform for users to interact with the system. On this interface, feedback information can be displayed in the form of pop-ups, text descriptions next to the progress bar, etc. For example, "It is estimated that it will take 20 seconds to complete the upload" is displayed below the progress bar, so that users can understand the remaining time of log upload at any time during the operation, improve the user experience, and also conform to the user-centered design concept of the entire log processing process, so that users can reasonably arrange subsequent operations.
[0102] In this embodiment, a system log upload device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0103] This embodiment provides a system log upload device, such as Figure 3 As shown, including:
[0104] The acquisition module 31 is used to acquire the system log generated by the current operating system;
[0105] A storage module 32, used to identify the data source of the system log and store the system log into a corresponding storage space according to the functional type of the data source;
[0106] A detection module 33, used to detect a user's upload requirement for the function type, and determine a corresponding target storage space based on the upload requirement;
[0107] The execution module 34 is used to perform a corresponding upload operation on at least one system log in the target storage space.
[0108] In an optional embodiment of the present application, the storage module 32 is used to extract data features in the system log; obtain the node structure in the storage space corresponding to the function type, and query the original node matching the data features in the node structure; and store the system log to the original node matching the data features.
[0109] In an optional embodiment of the present application, the detection module 33 is used to detect a click operation on a preset interactive interface; identify the virtual key triggered by the click operation, and determine the target function type corresponding to the virtual key based on the association between the virtual key and the function type; and determine the user's upload requirements based on the target function type.
[0110] In an optional embodiment of the present application, the device also includes: an adjustment module, used to obtain the operating data of the current operating system; determine whether there is an abnormal event in the current operating system based on the operating data; if there is an abnormal event in the current operating system, then according to the function type corresponding to the abnormal event, adjust the display state of the virtual button in the preset interactive interface to a prominent state.
[0111] In an optional embodiment of the present application, an execution module 34 is used to obtain historical upload data for the target storage space; determine multiple target nodes in the target storage space based on the historical upload data; use the system log under the target node to generate a corresponding data packet, and perform an upload operation of the data packet.
[0112] In an optional implementation of the present application, an execution module 34 is used to analyze the connection relationship between each of the target nodes to obtain an analysis result; the system logs under the target nodes are layered according to the analysis result to obtain an initial sequence framework; the system logs of each level in the initial sequence framework are sorted according to a preset sorting rule to obtain a target log sequence; the target log sequence is encrypted and encapsulated to obtain a data packet.
[0113] In an optional embodiment of the present application, the device also includes: a monitoring module for monitoring the upload progress of the system log in the data packet; when the upload progress reaches a preset interval, predicting the upload time of the remaining logs in the data packet; generating feedback information based on the upload time, and displaying the feedback information on a preset interactive interface.
[0114] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0115] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0116] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0117] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0118] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0119] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0120] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0121] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for uploading a system log, characterized in that: The method comprises: Get the system logs generated by the current operating system; Identify the data source of the system log, and store the system log in a corresponding storage space according to the functional type of the data source; Detecting a user's upload requirement for the function type, and determining a corresponding target storage space based on the upload requirement; A corresponding upload operation is performed on at least one system log in the target storage space.
2. The method according to claim 1, characterized in that The storing the system log to a corresponding storage space according to the functional type of the data source includes: Extracting data features from the system log; Obtaining a node structure in a storage space corresponding to the function type, and searching the node structure for an original node matching the data feature; The system log is stored in an original node that matches the data feature.
3. The method according to claim 1, characterized in that The detecting the user's upload requirement for the function type includes: Detect click operations on the preset interactive interface; Identify the virtual key triggered by the click operation, and determine the target function type corresponding to the virtual key according to the association relationship between the virtual key and the function type; The upload requirement of the user is determined based on the target function type.
4. The method according to claim 2, characterized in that: Before detecting a click operation on a preset interactive interface, the method further includes: Acquiring operation data of the current operating system; Determining whether there is an abnormal event in the current operating system according to the operating data; If an abnormal event occurs in the current operating system, the display state of the virtual key in the preset interactive interface is adjusted to a prominent state according to the function type corresponding to the abnormal event.
5. The method according to claim 1, characterized in that The performing a corresponding upload operation on at least one system log in the target storage space includes: Obtaining historical upload data for the target storage space; Determine a plurality of target nodes in the target storage space according to the historical uploaded data; A corresponding data packet is generated using the system log under the target node, and an upload operation of the data packet is performed.
6. The method according to claim 5, characterized in that The generating a corresponding data packet by using the system log under the target node includes: Analyze the connection relationship between each of the target nodes to obtain an analysis result; According to the analysis result, the system logs under the target node are layered to obtain an initial sequence framework; Sorting the system logs at each level in the initial sequence framework according to a preset sorting rule to obtain a target log sequence; The target log sequence is encrypted and encapsulated to obtain a data packet.
7. The method according to claim 5, characterized in that After performing the upload operation of the data packet, the method further includes: Monitoring the upload progress of the system log in the data packet; When the upload progress reaches a preset interval, predicting the upload time of the remaining logs in the data packet; Feedback information is generated based on the upload time, and the feedback information is displayed on a preset interactive interface.
8. A system log uploading device, characterized in that: The device comprises: The acquisition module is used to obtain the system logs generated by the current operating system; A storage module, used for identifying the data source of the system log, and storing the system log in a corresponding storage space according to the functional type of the data source; A detection module, used to detect a user's upload requirement for the function type, and determine a corresponding target storage space based on the upload requirement; The execution module is used to perform a corresponding upload operation on at least one system log in the target storage space.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.