CN114449628B - Log data processing method, electronic device and medium thereof - Google Patents

Log data processing method, electronic device and medium thereof Download PDF

Info

Publication number
CN114449628B
CN114449628B CN202111680415.4A CN202111680415A CN114449628B CN 114449628 B CN114449628 B CN 114449628B CN 202111680415 A CN202111680415 A CN 202111680415A CN 114449628 B CN114449628 B CN 114449628B
Authority
CN
China
Prior art keywords
log data
deduplication
electronic device
event
mobile phone
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111680415.4A
Other languages
Chinese (zh)
Other versions
CN114449628A (en
Inventor
李淳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202111680415.4A priority Critical patent/CN114449628B/en
Publication of CN114449628A publication Critical patent/CN114449628A/en
Application granted granted Critical
Publication of CN114449628B publication Critical patent/CN114449628B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present application relates to the field of computer technologies, and in particular, to a log data processing method, an electronic device, and a medium thereof. According to the log data processing method, by combining the electric quantity condition of the electronic equipment, under the condition that the electronic equipment is in low electric quantity, log data of some fault events are subjected to duplicate removal within the duplicate removal duration longer than the default duplicate removal duration, and further, under the condition of low electric quantity, the data quantity and frequency of the log data quantity corresponding to the fault events are packaged and uploaded by the electronic equipment, so that the purpose of reducing the power consumption of the electronic equipment is achieved.

Description

Log data processing method, electronic device and medium thereof
Technical Field
The present application relates to the field of computer technologies, and in particular, to a log data processing method, an electronic device, and a medium thereof.
Background
When the electronic device such as the mobile phone 100 runs, the mobile phone 100 records a series of problems occurring in the running process at the same time, generates corresponding log data, and then packages and uploads the log data to the server so that a developer can locate and analyze the time and reason of the fault of the mobile phone 100 by querying the log data, thereby eliminating the fault of the mobile phone 100 and improving the user experience. However, the mobile phone 100 consumes power consumption of the mobile phone 100 in the process of generating the log, packaging the log data, and uploading the log data to the server.
The log data generated by the mobile phone 100 generally includes a large amount of duplicate log data. Therefore, in order to reduce the power consumption of the mobile phone 100 caused by uploading log in a packaged manner, duplicate removal is generally performed after log data is obtained, that is, the same log data is deleted, and then the log data is packaged and uploaded to a server or other electronic devices storing the log data, so that the power consumption of the mobile phone 100 consumed in the process of uploading the log data in a packaged manner is reduced.
Disclosure of Invention
The application provides a log data processing method, electronic equipment and a medium thereof.
In a first aspect, an embodiment of the present application provides a log data processing method, where the method is applied to a first electronic device, and the method includes: acquiring at least one log data of a first event; and then, according to the electric quantity condition of the first electronic device, carrying out deduplication processing on log data of the first event for different time lengths, wherein the deduplication processing is carried out on a plurality of log data of the first event acquired within the first deduplication time length corresponding to the electric quantity of the first electronic device being higher than a preset threshold value, and the deduplication processing is carried out on a plurality of log data of the first event acquired within the second deduplication time length corresponding to the electric quantity of the first electronic device being lower than or equal to the preset threshold value, wherein the second deduplication time length is longer than the first deduplication time length.
In a possible implementation manner, the first event may be a fault event or a statistical event occurring on the first electronic device, and accordingly, the log data of the first event may be a plurality of log data recording the occurrence of the same fault event and a plurality of log data recording the occurrence of the same statistical event.
It can be understood that, because there may be a plurality of log data corresponding to a certain first event, in order to reduce the data amount of the log data corresponding to the event that is uploaded by the first electronic device in a packaged manner, so as to achieve the purpose of reducing the power consumption of the first electronic device, the log data of the certain first event that is acquired within the default duration may be deduplicated.
However, due to the power consumption of the first electronic device, the power consumption of the first electronic device increases rapidly as the power of the first electronic device decreases, and in this case, in order to further reduce the data size of the log data packed and uploaded by the first electronic device, the log data of the event acquired in a longer time period needs to be deduplicated.
Therefore, in the log data processing method of the application, by combining the electric quantity condition of the first electronic device, the log data of a certain first event is deduplicated within different deduplication durations (a first deduplication duration and a second deduplication duration), and the purpose of reducing the power consumption of the first electronic device can be further achieved.
In a possible implementation manner of the first aspect, the method further includes: and determining a second deduplication duration according to a preset factor, wherein the electric quantity corresponding to the first electronic device is lower than or equal to a preset threshold. In a possible implementation manner of the first aspect, the preset factors include, but are not limited to: a power consumption priority of the first event; the service life of the first electronic equipment; the temperature of the environment where the first electronic device is located and/or the temperature of the first electronic device itself when the first electronic device is used; a user type using the first electronic device; a region of use of the first electronic device.
In one possible implementation manner, the longer the processor time required for processing the log data of the first event is, the higher the priority of power consumption of the first event is, and the longer the determined second deduplication duration is. That is, the longer the time consumed by the processor is required to upload the log data of the first event in a packaging manner, the more the log data of the first event needs to be deduplicated, so the log data of the first event is deduplicated within a longer second deduplication duration.
In one possible implementation manner, the longer the usage duration of the first electronic device is, the longer the determined second deduplication duration is. That is, the longer the usage duration of the first electronic device is, the more stable the operating condition of the first electronic device may be, and thus, the operating condition of the first electronic device does not need to be analyzed again through a large amount of log data, so that the second deduplication duration may be increased.
In a possible implementation manner, the higher the temperature of the environment where the first electronic device is located when the first electronic device is used and/or the temperature of the first electronic device itself is, the longer the determined second deduplication duration is. That is, the higher the temperature of the environment in which the first electronic device is located or the higher the temperature of the first electronic device itself, the faster the first electronic device consumes power, so to reduce the power consumption of the first electronic device, the log data of such first event needs to be deduplicated within a longer second deduplication duration.
In one possible implementation, the higher the demand of the user type using the first electronic device for the details of the log data, the shorter the determined second deduplication period. That is, if the user needs to analyze the operation condition of the first electronic device through a large amount of detailed log data, the second deduplication time period may be relatively short, so as to obtain more detailed log data for recording the first event. For example, the detail requirement of the test user on the log data is higher, and the detail requirement of the commercial user on the log data is lower, so that the second deduplication duration corresponding to the test user is longer than the second deduplication duration of the commercial user.
In a possible implementation manner, the higher the requirement of the usage area of the first electronic device for the private data is, the longer the determined second deduplication period is. That is, if the requirement of the first electronic device usage area on the private data is higher, that is, the requirement of the packed uploaded log data is less, the log data of the first event may be deduplicated within a longer second deduplication duration, so as to reduce the data volume of the packed uploaded log data. For example, if the countries where the users are located are different, the related privacy policies are also different, and the second deduplication period may be longer for countries where the privacy policy is strict.
In a possible implementation manner of the first aspect, performing deduplication processing on a plurality of pieces of log data of a first event acquired within a first deduplication duration or a second deduplication duration includes: and performing deduplication processing on log data of which the identification code of the log data is within a preset identification code range (for example, an ID code of a preset legal range hereinafter) in the log data acquired within the first deduplication duration or the second deduplication duration. That is, the log data is legally verified, and only the log data passing the legality verification is subjected to subsequent deduplication processing. It can be understood that, in order to ensure that the log data meets the requirement of validity, whether a certain log data meets the requirement of validity or not is determined through the ID code of the log data and the ID code within the preset legal range. In some embodiments of the present application, the types of log data meeting the validity requirement are log data corresponding to the above-mentioned failure event and statistical event, and correspondingly, the preset valid range ID code includes log data codes corresponding to the two types of events. It is understood that in other embodiments, the log data meeting the validity requirement may also be log data recording other types of first events, and accordingly, the ID code in the preset validity range may also be adaptively changed accordingly.
In a possible implementation manner of the first aspect, the method further includes: and packaging the log data subjected to the deduplication processing of the first event, and sending the packaged log data to the second electronic device. That is, the log data after the deduplication processing is packaged and uploaded to the second electronic device (for example, a cloud server and other devices), so that a user can analyze the operation condition of the first electronic device according to the log data, and find and eliminate a fault or other problems occurring during the operation of the first electronic device. Wherein, in some embodiments, packaging the log data refers to collecting data according to the type of the failure event recorded in the log data, the occurrence time, and the specific location of the involved first electronic device system file.
In a second aspect, an embodiment of the present application further provides an electronic device, which includes a memory storing computer program instructions; a processor, coupled to the memory, wherein the computer program instructions stored in the memory, when executed by the processor, cause the electronic device to implement the log data processing method as described in any one of the possible implementations of the first aspect.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program is configured to, when executed by a processor, implement the log data processing method in any one of the foregoing possible implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer program product, which, when run on an electronic device, causes the electronic device to execute the log data processing method described in any one of the above first aspects.
It is understood that the beneficial effects of the second to fourth aspects can be seen from the description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 illustrates a scenario adaptation diagram of a log processing method;
FIG. 2 illustrates a scenario adaptation diagram for another log processing method;
FIG. 3 (A) is a schematic diagram illustrating concurrence of log data processing by a data partitioning method;
FIG. 3 (B) is a schematic diagram illustrating concurrence of log data processing by a task grouping method;
FIG. 4 is a flow chart diagram illustrating a method for implementing log data processing in the form of a plug-in;
FIG. 5 is a block diagram of a software architecture involved in the log data processing method of the present application;
FIG. 6 is an interaction diagram illustrating the functional modules in the log engine module of FIG. 5 cooperating to implement the method of the present application;
FIG. 7 (A) is a schematic diagram illustrating an example of a human-computer interaction interface involved in the log data processing method of the present application;
FIG. 7 (B) is a schematic diagram of a human-computer interaction interface involved in another log data processing method of the present application;
fig. 8 is a schematic diagram illustrating a hardware structure of an example of an electronic device according to an embodiment of the present application.
Detailed Description
Various aspects of the illustrative embodiments will be described using terms commonly employed by those skilled in the art. The application provides a log data processing method, electronic equipment and a medium.
For ease of understanding, the related contents of the log data in the electronic device will be briefly described. In the electronic device, log data is divided into legitimate log data and illegitimate log data. In the embodiment of the present application, the legal log data includes log data for recording operation failure events of the mobile phone 100, and statistical log data. In some embodiments, the operation failure event of the mobile phone 100 may be a system operation failure of the mobile phone 100, for example, a system failure that the mobile phone 100 crashes during operation or cannot enter a booting interface. In other embodiments, the failure event of the mobile phone 100 may be a failure event of an application running on the mobile phone 100, such as a flash back event when the user opens the chat application 12, or a network jam event when the user watches a video using the video application 11, and so on. This is not limited by the present application.
Generally, the electronic device obtains log data of a certain event and uploads the log data to a server through: the method comprises five stages of validity verification, duplication removal, quota control, packaging and uploading.
As described above, in order to reduce power consumption of the electronic device 100 (e.g., a mobile phone) caused by operations such as packaging and uploading log data, deduplication is generally performed after log data of a certain event is acquired, the amount of the log data packaged and uploaded after deduplication is reduced, and power consumption of the device caused by packaging and uploading the log data can be reduced.
For example, fig. 1 shows a processing method of log data. Specifically, the processing method comprises the following steps: after capturing log data of an event a (101A), the mobile phone 100 performs deduplication processing on the log data of the event a acquired within a default deduplication duration (102A). For example, the default deduplication duration is 5s (seconds), that is, the deduplication is performed on the log data of an event acquired in (t 1, t1+5 s) from the time t1 when the log data of the event is received at the beginning. Then, the mobile phone 100 performs quota control and packaging on the deduplicated log data (103A), and uploads the packaged log data to the server 200 (104A).
It should be noted that, if all log data of the event are acquired in (t 1, t1+5 s), all log data of the event are subjected to deduplication processing, and then log data quota control and packaging are performed on all deduplicated log data and then uploaded to the electronic device 200. If only partial log data of the event is acquired in (t, t +5 s), performing deduplication processing on the acquired partial log data, and then performing log data quota control and packaging on the partial deduplicated log data and partial undeduplicated log data and uploading the partial deduplicated log data to the electronic device 200. Therefore, the data volume of log data packaged by the electronic device 100 and the data volume of log data uploaded can be reduced, the frequency of log data packaging and uploading by the electronic device 100 is reduced, and the power consumption of log data packaging and uploading by the electronic device 100 is further reduced.
The solution shown in fig. 1 can reduce the power consumption of the electronic device 100 to some extent, but when the power of the electronic device 100 is low, the power of the electronic device 100 may be reduced quickly when running various applications. Therefore, when the electric quantity of the electronic device 100 is low, if the log data of an event is continuously acquired, the log data is deduplicated for a default log deduplication duration, and then the deduplicated log data is packaged and uploaded, when the electric quantity of the electronic device 100 is sufficient, the electric quantity of the electronic device is decreased more quickly, and at this time, the effect of effectively reducing the power consumption of the electronic device 100 cannot be achieved.
In order to solve the technical problem, some embodiments of the present application provide a log data processing method, after log data of an event is acquired, remaining power of the electronic device 100 is detected, when the power of the electronic device 100 is sufficient, log data of the event is deduplicated within a default deduplication duration, and when the power of the electronic device 100 is low, log data of the event is deduplicated with another deduplication duration that is greater than the default deduplication duration, so as to further reduce the size of the deduplicated log data, and further reduce power consumption of the mobile phone 100, which is consumed by packaging and uploading the deduplicated log data, when the power of the mobile phone 100 is low.
For convenience of description, the electronic device 100 is taken as the mobile phone 100, and the electronic device 200 is taken as the server, but it should be understood that the log data processing method of the present application is not only applicable to the mobile phone, but also applicable to other electronic devices, such as a tablet computer, a notebook computer, a desktop computer, a smart wearable device, a vehicle-mounted device, and the like, and the present application is not limited thereto.
Specifically, fig. 2 illustrates a log data processing method of the mobile phone 100 according to some embodiments of the present application. As shown in fig. 2, the data processing method includes:
after the mobile phone 100 acquires log data of a certain event a (101B), detecting the current power of the mobile phone 100, determining whether the device (i.e., the mobile phone 100) is currently in a low power state (102B), if the mobile phone 100 is not in the low power state, indicating that the power of the mobile phone 100 is sufficient, and performing log deduplication by using a first deduplication duration T1 by the mobile phone 100 (103B). For example, assuming that the first deduplication period is 5s and the time at which the log data of the event is initially acquired is t2, deduplication processing is performed on the log data acquired in (t 2, t2+5 s).
Correspondingly, if the handset 100 is in a low battery state, the handset 100 log de-duplicates for a second de-duplication duration (e.g., 10 s) that is greater than the first de-duplication duration (104B). For example, assuming that the second deduplication period T2 is 10s, and the time when the mobile phone 100 starts to acquire the log data of the event is T3, the deduplication processing is performed on the log data acquired in (T3, T3+10 s).
Then, the handset 100 performs quota control and packaging on the deduplicated log data (105B), and then uploads the packaged log data to the server 200 (106B).
It should be noted that, in the log generation process, if all log data of an event are acquired in T1 or T2, all log data of the event are subjected to deduplication processing, and then all deduplicated log data are subjected to log data quota control and are packaged and uploaded to the electronic device 200. If only partial log data of the event is acquired in T1 or T2, the acquired partial log data is subjected to deduplication processing, and then the log data subjected to partial deduplication processing and the log data not subjected to partial deduplication processing are subjected to log data quota control and packaging, and then uploaded to the electronic device 200.
The quota control, deduplication method, and the like of the log mentioned above will be described in detail below.
It will be appreciated that in some embodiments, the first deduplication period may be an empirical value or an experimental value.
It will be appreciated that in some embodiments, the second deduplication period may also be an empirical value or an experimental value. In other embodiments, the second deduplication duration may be determined in real time according to the user condition related to the log data, the use condition of the mobile phone 100, and other factors, so that the determined second deduplication duration is more reasonable. For example, the second deduplication period may be determined based on the priority of the event corresponding to the log data, the type of the user, the usage period of the mobile phone 100, the area where the mobile phone 100 is located, and the surrounding environment.
For example, in some embodiments, T2 may be calculated by the following formula:
T2=(a+b+c+d+e)*T1 (1)
wherein, a represents the weight occupied by the priority of the event corresponding to the log data, b represents the weight occupied by the user type, c represents the weight occupied by the equipment use duration, d represents the weight occupied by the equipment use area, e represents the weight occupied by the surrounding environment, the value ranges of a, b, c, d and e are (0,1), and (a + b + c + d + e) is greater than 1.
It will be appreciated that the above considerations are merely exemplary, and that in other embodiments of the present application, other log-related factors may be considered in determining T2. The above factors considered in determining T2 are described below.
1) Event priority
Because processors, such as Central Processing Units (CPUs), which process log transactions during the processes of generation, validity verification, quota control, packaging, uploading and the like, of log data corresponding to different events have different time consumption, a list of event priorities can be generated according to the time consumption of the CPUs of the log data of the events.
For example, the log data corresponding to the system crash event during the operation of the mobile phone 100 may involve more system files, so that the time consumed from the generation to the uploading of the log data of the crash event during the operation of the mobile phone 100 to the CPU is more, and the power consumption of the mobile phone 100 consumed correspondingly is also more; when the mobile phone 100 runs a certain application, the system files of the mobile phone 100 related to the log data corresponding to the time when the application is flashed back are less, so that when the log data flashed back of the application is recorded, the time consumed from generation to uploading of the log data to the CPU is less, and the power consumption of the mobile phone 100 is correspondingly less. Therefore, a higher priority may be set for the log data corresponding to the event that the CPU consumes more time or consumes more power of the mobile phone 100, and a lower priority may be set for the log data corresponding to the event that the CPU consumes less time or consumes less power of the mobile phone 100, for example, the higher priority is set to 1 for the log data corresponding to the crash of the mobile phone 100 during the operation, and the lower priority is set to 5 for the log data corresponding to the application flash back event on the mobile phone 100.
Then, the log data with different priorities correspond to different weight values a, the log data with higher priority consumes more power consumption of the mobile phone 100 than the log data with lower priority, and the log data with higher priority needs to be deduplicated, so the weight value of the log data with higher priority is higher than that of the log data with lower priority. For example, assuming that log data of various events is provided with 5 priorities, a correspondence between each priority and a value of a may be as shown in table 1 below:
TABLE 1
Priority level Value of a
1 0.95
2 0.9
3 0.7
4 0.5
5 0.3
For example, the priority of the log data of the crash event is 1 level, and the weight value a is 0.95, while the priority of the log data corresponding to the application flash back event is 5 levels, and the weight value a is 0.3.
2) Type of user
Some users of the electronic device have a high demand on the details of the log data, so the user type can be taken into consideration in determining the second deduplication period. For example, if the user of the handset 100 is a test development user (e.g., a beta user), a large amount of detailed log data is required to locate problems that occur while the handset 100 is operating, so as to eliminate faults that occur while the handset 100 is operating. Therefore, considering that the test research and development user generally needs to record detailed log data, when the power of the mobile phone 100 is low, the deduplication duration of the log data can be reduced, that is, as much log data as possible is reserved. However, a general commercial user (i.e., a general user) does not need to analyze a large amount of detailed log data, so that when the power of the mobile phone 100 is low, the deduplication duration of the log data can be prolonged in order to prolong the operation duration of the mobile phone 100 as much as possible. Therefore, in determining T2, if it is a test development class user, the weight b related to the user type may be a small value, for example, 0.1, and if it is a commercial user, b may be a large value, for example, 0.6.
For example, the correspondence between the user type and the value of b may be as shown in table 2 below:
TABLE 2
Type of user Value of b
Testing research and development class users 0.1
Commercial user 0.6
3) Length of use
The longer the service life of the electronic equipment is, the more stable the operation condition is, that is, the less possibility of the electronic equipment having a fault event is, so that the service life of the electronic equipment can be taken into consideration of the second deduplication time. For example, in a case where the power of the mobile phone 100 is low, in order to reduce the power reduction speed of the mobile phone 100 and extend the operation time of the mobile phone 100, if the usage time of the mobile phone 100 is long, the deduplication time of the log data may be increased. For example, if the usage duration of the mobile phone 100 is long, the weight c related to the usage duration of the mobile phone 100 may take a large value, for example, 0.4, when determining T2, and if the usage duration of the mobile phone 100 is short, c may take a small value, for example, 0.2.
For example, the correspondence between the usage duration of the mobile phone 100 and the value of c may be as shown in table 3 below:
TABLE 3
Duration of use of the handset 100 Value of c
Less than or equal to 1 year 0.2
More than 1 year and less than or equal to 3 years 0.4
More than 3 years and less than or equal to 5 years 0.6
4) Area of use
The protection of the private data of the user is different in different countries, so that when the electronic device 100 is used in different countries, different weights may be set to adjust T2. For example, country a has a higher protection requirement on the private data than country B, so that less log data can be analyzed in country a, the deduplication duration of the log data is increased, that is, the weight d can take a larger value, for example, 0.8, while more log data can be analyzed in country B, the deduplication duration of the log data can be reduced, that is, the weight d can take a smaller value, for example, 0.4.
For example, the correspondence between the usage area of the mobile phone 100 and the value of d may be as shown in table 4 below:
TABLE 4
Area of use of the mobile phone 100 Value of d
State A 0.8
State B 0.4
5) Ambient temperature when using electronic equipment
When the temperature of the electronic device is high or the ambient temperature is high, if the power consumption is too high, the device of the electronic device is damaged, so that the temperature of the electronic device and the ambient temperature around the electronic device can be taken into consideration in determining the log deduplication duration. For example, when the mobile phone 100 generates heat or the ambient temperature is high, the deduplication duration of the log data may be increased to reduce the power consumption of the mobile phone, i.e., the weight e may be a large value, such as 0.6. When the temperature of the mobile phone 100 is normal or the ambient temperature is not high, the deduplication duration of the log data can be relatively reduced, that is, the weight e can be a smaller value, for example, 0.4.
Illustratively, the correspondence between the ambient temperature (or the temperature of the mobile phone itself) and the value of e when the mobile phone 100 is used is shown in the following table 5:
TABLE 5
Ambient temperature when using the handset 100 Value of e
40 ℃ or higher or less than 10 DEG C 0.8
More than or equal to 30 ℃ and less than 40 DEG C 0.6
At a temperature of 20 ℃ or higher and less than 30 DEG C 0.4
More than or equal to 10 ℃ and less than 20 DEG C 0.2
Based on the above description of the reference factors, the use of equation (1) will now be described. For example, assuming that the first deduplication duration is T1=5s, the priority corresponding to the log data of a certain event is 5, the user type of the mobile phone 100 is a test development user, the usage duration of the mobile phone 100 is 3 years, the usage area of the mobile phone 100 is country a, and the ambient temperature when the mobile phone 100 is used is 23 ℃, then as can be seen from tables 1 to 5 above, a =0.3, b =0.1, c =0.4, d =0.1, e =0.4, and T2= (0.3 +0.1+0.4+0.1+ 5=1.3 + 5.5 s is known from equation (1) above. That is, when the mobile phone 100 is in the low power state, the mobile phone 100 performs deduplication processing on the repeated log data in (t 3, t3+6.5 s) to further reduce the data size of the log data during package uploading after deduplication, and reduce the power consumption of the mobile phone 100.
In addition, it is understood that the calculation of the second deduplication period based on the first deduplication period in the above equation (1) is only an example, and in other embodiments, the second deduplication period may be calculated in other manners, which is not limited in this application.
As mentioned above, the collection of log data in an electronic device typically goes through: the method comprises five stages of validity verification, duplication removal, quota control, packaging and uploading. The following describes each stage in detail.
1. Validity verification
In some embodiments, validating log data generally refers to verifying whether an ID of the log data is legitimate. For example, in some embodiments, the mobile phone 100 presets a legal ID range for log data generated by itself, so before uploading the log data, the mobile phone 100 may perform validity verification based on the ID of the log data, and in a case that the ID of the log data is not in the preset legal ID range, the mobile phone 100 confirms that the log data is illegal log data. For example, assume that the preset legal ID range of the log data is 000000001 to 1000000000, the ID of a certain log data acquired by the mobile phone 100 is 913000003, and since 913000003 is within the preset legal ID range, the log data is legal log data. If the ID of the log data acquired by the mobile phone 100 is 100000000198, the log data does not meet the legitimacy requirement because 100000000198 is not within the preset legal ID range. In some embodiments of the present application, the category of the legality log data includes fault log data that records fault events during operation of the handset 100. In other embodiments, the category of the legal log data may also include other types of log data, such as statistical log data, and the like, which is not limited in this application.
2. Log deduplication
The log deduplication refers to that, when a plurality of identical log data exist for log data of a certain event, only one log data is retained, and other identical or duplicate log data is deleted.
For example, in some embodiments, during the process of continuously generating log data of a certain event, the handset 100 may store the log data after deduplication in the form of a data table shown in table 6 below in the memory of the handset 100:
TABLE 6
Figure GDA0003849072530000081
In this way, after the log data of the event is newly generated subsequently, the mobile phone 100 may determine whether the newly generated log data is overlapped with the already stored log data according to the parameter in the data table of the already stored log data.
For example, for an event, the mobile phone 100 generates 5 pieces of log data recording the event, as shown in table 7 below:
TABLE 7
Figure GDA0003849072530000082
Figure GDA0003849072530000091
As can be seen from the above table, since the log data 1 and the log data 3 have the same parameters, such as the log ID, the parameter 1, and the parameter 2, except for the timestamp, the log data 1 and the log data 3 belong to duplicate or identical logs, and the mobile phone 100 can delete the later log data 3 according to the timestamps of the log data 1 and the log data 3 when the duplicate is removed.
It should be noted that, because some log data do not have the parameter 1 and the parameter 2, in order to prevent the log data from being determined as duplicate log data, and thus the log data deduplication module 3013 is mistakenly deduplicated, in the actual deduplication process, for the log data without the parameter 1 and the parameter 2, the log data deduplication module 3013 defaults that these data are not duplicate log data with any other log data. For example, continuing with the log data shown in table 7 above, if neither log data 4 nor log data 5 has parameter 1 or parameter 2, then the log data deduplication module 3013 determines that log data 4 and log data 5 do not belong to duplicate log data, and the log data deduplication module 3013 determines that log data 4 and log data 1, log data 2, or log data 3 are not duplicate log data, and that log data 5 and log data 1, log data 2, or log data 3 are also not duplicate log data.
In some embodiments, the parameter 1 and the parameter 2 may represent the name of the failure event, the occurrence location, or the type of the failure event, which is not limited in this application.
3. Quota control
It can be understood that the power consumption and processing resources of the mobile phone 100 are limited, so in general, before the mobile phone 100 generates the log data, the total amount of the log data generated in the preset time period is set, and when the log data generated in the preset time period exceeds the total amount, the mobile phone 100 discards the log data and stops generating the log data, that is, the log data quota control. The preset time period is an empirical value or an experimental value, and may be, for example, a time period of 24 hours, a month, and the like, which is not limited in the present application.
4. Log data packaging
In some embodiments of the present application, the log data is substantially character string data recording a fault event occurring when the mobile phone 100 operates, where the character string includes a time when the fault event occurs, a type of the fault event, a log data ID, and parameters 1 and 2 in table 7 above, and analysis of the fault event also requires other data such as a system file related to the fault event, so that the packing of the log data refers to collecting data such as a system file of the mobile phone 100 related to the log data corresponding to the fault event.
The above-mentioned failure events are only exemplary, and in other embodiments, other types of events, such as statistical events, may also be packaged, and the present application does not limit this.
Specifically, each event corresponds to a plurality of pieces of log data, where the time point of generation of each piece of log data is different, for example, the mobile phone 100: 00, the cell phone 100 generates a runtime crash event in the following cases: 02 and 9. Therefore, when the crash event is packaged in the mobile phone 100, the log data a/the log data b obtained after the log data a and the log data b corresponding to the crash event are subjected to the reprocessing are packaged.
5. Log data upload
The log data uploading refers to uploading the packaged log data to the server 200, so that a developer can locate and analyze a fault event occurring on the mobile phone 100 according to the log data collected by the server 200 to remove a fault of the mobile phone 100.
It should be noted that, in general, in order to improve the efficiency of uploading log data in a packaging manner and avoid the waiting time consumed in uploading different log data in a packaging manner, the mobile phone 100 generally has a plurality of threads that can respectively complete functions of log validity verification, log data deduplication, log data packaging, log file uploading, and the like, and the efficiency of uploading log data is improved by concurrence among the threads.
Generally, the concurrency of the threads is divided into two types, one type is data partitioning, namely, the log data of different events are distributed to different threads, and the processing required by the log data of each event, such as validity verification, log data deduplication, log data packaging, log data uploading and the like, is realized in the same thread. For example, as shown in (a) in fig. 3, the log data of the first event completes validity verification, log data deduplication, log quota control, log data packaging, and log data uploading in the thread 1, the log data of the second event completes validity verification, log data deduplication, log quota control, log data packaging, and log data uploading in the thread 2, and the log data of the third event completes validity verification, log data deduplication, log quota control, log data packaging, and log data uploading in the thread 3.
When the log data is processed by using the data partitioning method in fig. 3 (a), at a certain time, the log data of multiple events still needs to be processed identically, and at this time, because the processing resource corresponding to the processing is occupied by the log data of a certain event, the log data of other events still needs to wait for the completion of the processing of the log data of the event, and then the corresponding processing resource can be used, and in this case, the concurrency of the log data processing may be reduced, which further reduces the efficiency of the log data processing. For example, in (a) in fig. 3, when the first log data is subjected to validity verification in thread 1, the second log data is also subjected to validity verification in thread 2, and thread 1 and thread 2 compete for processing resources corresponding to validity verification processing, so that the second log data can be subjected to validity verification only after the first log data is subjected to validity verification, which reduces the processing efficiency of the second log data.
The other is task grouping, namely, a series of processing tasks required by the log data of an event are distributed into a plurality of threads to be completed in sequence, and the concurrence of the log data processing is realized through a task pipeline. For example, as shown in (B) in fig. 3, the validity verification of the log data of each event is completed by the thread 1, the log data deduplication is completed by the thread 2, the log data quota control is completed by the thread 3, the log data packing is completed by the thread 4, and the log data upload is completed by the thread 5. Then, after the log data of the first event is subjected to validity verification and log data deduplication, and enters a log data quota control stage, the log data of the second event can be subjected to validity verification and enter a log data deduplication stage, and the log data at the third time can be subjected to validity verification. Compared with the method (a) in fig. 3, the method for processing log data by using the task grouping shown in (B) in fig. 3 is more beneficial to improving the concurrency of log data processing, and thus improving the efficiency of log data processing.
Therefore, some embodiments of the present application implement concurrent processing of log data by using a task grouping manner, so as to improve efficiency of log data processing. Specifically, in some embodiments of the present application, a plug-in (plugin) is used to implement a function corresponding to each processing in the log data processing process, and the plug-ins can form a pipelined ordered set, that is, after a previous plug-in completes processing the log data, a parameter indicating that the current processing is completed is passed to a next plug-in, so that the next plug-in continues to process the log data.
Specifically, as shown in fig. 4, the plug-in processing flow includes:
plug-in platform 410 generates 401 plug-ins, determining an ordered set of plug-ins.
Among other things, in some embodiments, plug-in platform 410 is used to uniformly manage the generation of plug-ins and determine an ordered set of plug-ins, i.e., determine the construction of a pipeline. It can be understood that each event processing includes a corresponding process, for example, the log data processing process in this application includes steps of validity verification, power consumption filtering, log data deduplication, log data packaging, log data uploading, and the like. The plug-in platform 410 is used for generating corresponding plug-ins for the steps involved in each event processing process, then arranging the plug-ins corresponding to the steps of the event into an ordered plug-in set, namely a pipeline, according to the processing flow of the event, and then processing the event by using the ordered plug-in set.
In some embodiments, the plug-in platform 410 starts generating corresponding plug-ins for the processing steps of each event on the handset 100 and determines the ordered set of plug-ins corresponding to each event when the system of the handset 100 starts running.
402, the plug-in platform 410 sends an instruction to the event source 411 to begin processing the event.
In some embodiments, after the ordered set corresponding to a certain event is constructed, the plug-in platform 410 sends an instruction that can start processing a certain event to the event source 411, so that the event source 411 can capture the corresponding event according to the instruction. For example, in some embodiments of the present application, after the plug-in platform 410 generates the plug-in ordered set corresponding to log data processing, an instruction that can start processing log data is sent to the event source 411, and the event source 411 captures or acquires the log data according to the instruction.
403, the event source 411 acquires an event.
In some embodiments, the event source 411 captures data corresponding to each event from the mobile phone 100 according to the above instructions. For example, in the embodiment of the present application, the event source 411 captures log data corresponding to a fault event occurring in the mobile phone 100.
404, event source 411 sends an event to plug-in 1.
It is understood that when the event source 411 grabs an event, it sends the event to the first plug-in the plug-in ordered set, so that the plug-in 1 processes the event accordingly.
At 405, plug-in 1 processes the event using the oneevent () function.
It is understood that the plug-in 1 is a functional code program itself, and in some embodiments, when the plug-in 1 processes an event, the corresponding function is implemented through an onEvent () function to process the event. For example, in the embodiment of the present application, when the plug-in 1 performs validity verification on log data, the function of performing validity verification on the log data is implemented by using an onEvent () function.
At 406, plug-in 1 sends the processed event to plug-in 2.
In some embodiments, after the plugin 1 completes processing the event, the plugin 1 is sent to the next plugin 2, and the plugin 2 performs the next processing on the event.
Plug-in 2 processes the event using the oneevent () function 407.
It is understood that the oneevent () function herein is merely exemplary, and the function employed by the plug-in 2 to process events may be other functions. For example, the plug-in 2 may be used to detect the power of the handset 100 during log data processing.
Plug-in 2 sends 408 the processed event to plug-in 3.
At 409, plug-in 3 processes the event using the oneevent () function.
At 410, plug-in 3 sends the processed event to plug-in 4.
……
40N, plug-in N processes the event using the oneEvent () function.
By the method, a complete processing flow of a certain event is realized in the ordered set of the plug-ins. It is understood that the functions used by the plug-ins are oneevent () functions, which are shown here only for illustrative purposes, and in different technical solutions, different plug-ins may use different functions or algorithms to implement the related processing on data, and are not limited to using the same function.
As mentioned above, a plug-in is a program that follows certain application programming rules, and a certain function can be implemented by the plug-in. For example, taking processing of log data as an example, a plurality of plug-ins may be respectively provided to sequentially implement functions such as validity verification of log data, log data deduplication, log data quota control, log data packaging, and log data upload. In some embodiments, the plug-in may be implemented in the form of a software module, or may be implemented by a hardware device having a function corresponding to the plug-in, which is not limited in this application.
The following describes an implementation process of the log processing method in the mobile phone 100 by taking the pipeline execution mode of the plug-in as an example.
Fig. 5 shows a system structure diagram of the mobile phone 100 implementing the log processing method of the present application. Specifically, as shown in fig. 5, the system architecture 500 includes: an application layer 10, an application framework layer 20, a system layer 30, and a kernel layer 40.
The application layer 510 may include a series of application packages, such as packages for the video application 11, the chat application 12, and so on. In some embodiments of the present application, when the mobile phone 100 runs the aforementioned application, the occurring fault event may generate log data, for example, when the user uses the chat application 12, an application flash back situation occurs, and the mobile phone 100 may generate log data corresponding to a "chat application flash back" event. So that the developer can locate and troubleshoot the fault according to the log data to improve the experience of the user when using the applications.
The application framework layer 20 includes a Wi-Fi communication module 201.
The Wi-Fi communication module 201 is configured to provide a Wi-Fi Aware Service (Wi-Fi Aware Service), a Wi-Fi Service (Wi-Fi Service), a Wi-Fi scanning Service (Wi-Fi Scanner Service), and the like for the mobile phone 100. The mobile phone 100 can sense devices in the same local area network, perform internet surfing activities through Wi-Fi, or scan Wi-Fi nearby through the Wi-Fi communication module 201. In some embodiments, wi-Fi communication module 201 may implement the functions via wireless communication module 160 in fig. 8 below. In some embodiments of the present application, the Wi-Fi communication module 201 is mainly used for the mobile phone 100 to perform communication connection with the server 200, so that the mobile phone 100 can upload the packaged log data.
The system layer 30 includes a log engine module 301, where the log engine module 301 is a functional module implemented based on C language, and implements various processing on log data through a log data obtaining module 3011, a log data validity verifying module 3012, a log data deduplication module 3013, a log data quota control module 3014, a log data packing module 3015, a log data uploading module 3016, and a function filtering module 3017. Specifically, the log data obtaining module 3011 is configured to obtain (or grab) log data, and send the log data to the log data validity verifying module 3012.
The log data validity verification module 3012 is configured to verify validity of the received log data. The validity verification mainly refers to verifying whether the ID range of the log data is within a preset valid ID range, and the specific verification process may refer to the above description, which is not described herein again.
After the log data is validated, the log data is usually subjected to deduplication processing by the log data deduplication module 3013. In this embodiment of the application, in order to reduce the power consumption of the mobile phone 100 under the condition of low power, after the validity of the log data is verified, the power consumption filtering module 3017 immediately obtains and determines whether the current power of the mobile phone 100 is low power, and when the mobile phone 100 is in the low power state, the log data is deduplicated within a longer deduplication duration in some embodiments, the power consumption filtering module 3017 may obtain and determine whether the power of the mobile phone 100 is in the low power state through the power management module 141 shown in fig. 8.
The kernel layer 540 is a layer between hardware and software. The core layer 540 includes at least a display driver 540a, a camera driver 540b, an audio driver 540c, and a sensor driver 540d.
It should be understood that the functional modules included in the software architecture are only exemplary and do not constitute a specific limitation to the software architecture of the mobile phone 100, and in other embodiments, the functional modules included in the software architecture may be more or less, and the present application does not limit the present application.
Fig. 6 shows a process in which the log engine module 301 generates a log in a pipeline execution manner.
Specifically, the process includes:
601, the log data obtaining module 3011 obtains the log data of the event a.
For example, event a may be a flash back event of the video application 11 in the handset 100.
602, the log data obtaining module 3011 sends the log data of the event a to the log data validity verifying module 3012.
603, the log data validity verification module 3012 verifies the validity of the log data of the event a according to the ID of the log data.
As described above, the log data validity verification module 3012 determines whether the log data corresponding to the event a is valid log data by determining whether the ID of the log data corresponding to the event a is within a preset valid ID range. It is understood that only log data whose ID is within a preset legal ID range is transmitted to the power consumption filtering module 3017.
604, the log data validity verification module 3012 sends the log data of the event a that meets the validity requirement to the power consumption filtering module 3017.
605, the power consumption filtering module 3017 obtains the power of the mobile phone 100, and determines whether the mobile phone 100 is in a low power state. If the mobile phone 100 is not in the low power state, the process proceeds to 606, that is, the log data deduplication module 3013 deduplicates the log data corresponding to the event a received from the power consumption filtering module 3017 within the first deduplication duration. If the mobile phone 100 is in the low power state, it indicates that the mobile phone 100 needs to delete more repeated log data to further reduce the data amount during subsequent log data packaging and uploading, and further reduce the power consumption of the mobile phone 100, so the method enters 607, that is, the log data deduplication module 3013 deduplicates the log data corresponding to the event a in a second deduplication duration that is longer than the first duration.
It is understood that the power state of the mobile phone 100 can be determined by a preset threshold. The threshold may be an empirical value or an experimental value, for example, assuming that the preset threshold is 10%, the power consumption filtering module 3017 determines that the mobile phone 100 is in the low power state when the power of the mobile phone 100 decreases to 10%.
In some embodiments, as mentioned above, the power consumption filtering module 3017 may obtain the current power of the mobile phone 100 in real time, so that the power consumption filtering module 3017 can more timely and accurately determine the current power condition of the mobile phone 100, in other embodiments, in order to reduce the power consumption of the mobile phone 100 as much as possible, the power consumption filtering module 3017 may also obtain the current power of the mobile phone 100 at preset intervals, for example, obtain the current power of the mobile phone 100 at 5s intervals, which is not limited in this application.
606, the log data deduplication module 3013 performs deduplication on the log data of the event a acquired within the first deduplication duration T1.
The manner in which the log data deduplication module 3013 deduplicates the log data of the event a in the first deduplication duration T1 may refer to the above related description, and is not described herein again.
607, the log data deduplication module 3013 performs deduplication on the log data of the event a acquired within the second deduplication duration T2.
The manner and the deduplication manner for determining the second deduplication duration T2 by the log data deduplication module 3013 may refer to the above related description, and are not described herein again.
It can be understood that if all log data of the recorded event a are generated or acquired by the mobile phone 100 within the first deduplication duration, all log data of the event a can be deduplicated regardless of the first deduplication duration or the second deduplication duration, and if part of log data of the recorded event a is generated or acquired by the mobile phone 100 within the first deduplication duration, more log data of the event a can be deduplicated when the second deduplication duration is used for deduplication.
608, the log data deduplication module 3013 records the deduplicated log data in a database table.
In order to facilitate the log data deduplication module 3013 to determine whether the current log data is duplicate log data, in some embodiments, the log data deduplication module 3013 records the deduplicated log data in a database table in the memory of the mobile phone 100, so as to facilitate comparison between the currently obtained log data and the log data in the database table.
It should be noted that, when the obtained log data is the first log data, since other log data may not be stored in the database table at this time, the log data deduplication module 3013 records the first log data in the database table, so as to determine, based on the first log data, whether the subsequently obtained log data is the log data that is duplicated with the first log data.
Meanwhile, 609, the log data deduplication module 3013 sends the deduplicated log data to the log data quota control module 3014.
610, the log data quota control module 3014 determines whether the current amount of log data exceeds a preset amount. If yes, it indicates that the current amount of log data has exceeded the preset amount of generated log data of the mobile phone 100, and then proceeds to 609, and discards the log data. If not, the process proceeds to 610, that is, whether the current log data quantity meets the log data packing condition is continuously judged.
In addition, in some embodiments, when the log data quota control module 3014 determines that the current amount of log data exceeds the preset first amount, the mobile phone 100 will stop generating log data.
611, the log data quota control module 3014 discards the log data.
612, the log data packaging module 3015 packages the deduplicated log data.
The specific log data packaging manner can refer to the foregoing description, and is not described herein again.
613, the log data packaging module 3015 sends the packaged log data to the log data uploading module 3016.
614, the log data uploading module 3016 uploads the packaged log data to the server 200.
The above describes a process of implementing the log data processing method of the embodiment on the mobile phone 100. To enhance the user experience, in some embodiments, the user may turn on the "power down" function by turning on a corresponding function button in the system settings of the mobile phone 100, so that the mobile phone 100 can implement the method 600 described above.
Specifically, as shown in fig. 7 (a), when the user uses the mobile phone 100 to watch the video 101, when the power 103 of the mobile phone 100 is low, the mobile phone 100 displays a prompt message 102 "whether the current device power is low and the power saving mode needs to be entered" to the user in a pop-up window form, and when the user selects "yes", the mobile phone 100 enters the power saving mode, and in the power saving mode, the mobile phone 100 uses the method 600 to perform deduplication on the log data. It is understood that in some embodiments, the mobile phone 100 may also display the prompt message 102 in other manners, for example, the mobile phone 100 displays the prompt message 102 in a floating window manner, and the display manner of the prompt message is not limited in this application.
It is understood that in other embodiments, the user may also enter the setting interface 105 of the mobile phone 100 shown in fig. 7 (B) in advance through the setting application on the desktop of the mobile phone 100, turn on the "power consumption reduction" option button 105, and after the option is selected, when the mobile phone 100 is in the low power state, the mobile phone 100 may automatically perform the deduplication on the log data by using the method 600 described above.
It should be noted that, when the user does not open the button of the power consumption reduction option and the mobile phone 100 is in a state of sufficient power, the mobile phone 100 may use an original log deduplication scheme, that is, the method 500 deduplicates log data or does not deduplicate log data, which is not limited in this application.
An exemplary structural diagram of the mobile phone 100 implementing the above-described log data processing method is described below. Specifically, as shown in fig. 8, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a microphone 170B, a microphone 170C, a sensor module 180, a button 190, a display screen 194, a log engine 190, and the like. The log engine 190 includes the log data obtaining module 11, the log data validity verifying module 12, the power consumption filtering module 17, the log data deduplication module 13, the log data quota controlling module 14, the log data packaging module 15, the log data uploading module 16, and the like in the method 600.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the mobile phone 100. In other embodiments of the present application, the handset 100 may include more or fewer components than shown, or some components may be combined, some components may be separated, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system. In some embodiments, the processor 110 is configured to implement specific data processing procedures in the modules. For example, the processor 110 may determine whether the current power of the mobile phone 100 is in a low power state by the power consumption of the mobile phone 100 obtained by the power consumption filtering module 17. In other embodiments, the log data deduplication processing in the log data deduplication module 13 also needs to utilize the processing resources of the processor 110.
In some embodiments, processor 110 may include one or more interfaces. The external memory interface 120 may be used to connect an external memory, such as a Micro SD card, to extend the storage capability of the mobile phone 100. The external memory communicates with the processor 110 through the external memory interface 120 to implement data storage functions.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store a program code corresponding to the network switching method, so that when the program code is executed, the mobile phone 100 can execute the log data processing method of the present application. In some embodiments, the data storage area may be divided into several logical partitions to store some data related to the log data processing method of the present application, such as information such as IDs and parameters of some log data.
The wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to the handset 100.
The wireless communication module 160 may provide solutions for wireless communication applied to the mobile phone 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like.
In the embodiment of the present application, the mobile phone 100 may perform data communication with the server 200 through the wireless communication module 160 to upload log data packaged by the mobile phone 100.
An embodiment of the present application further provides an electronic device, including: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be implemented by a computer program, which can be stored in a computer readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer memory, read-only memory (ROM), random Access Memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In some jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and proprietary practices.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In the description above, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (12)

1. A log data processing method is applied to first electronic equipment and is characterized by comprising the following steps:
acquiring at least one log data of a first event;
according to the electric quantity condition of the first electronic equipment, carrying out deduplication processing on the log data of the first event for different durations, wherein,
performing deduplication processing on a plurality of log data of the first event acquired within a first deduplication duration corresponding to the electric quantity of the first electronic device being higher than a preset threshold,
and performing deduplication processing on the plurality of log data of the first event acquired within a second deduplication duration corresponding to the electric quantity of the first electronic device being lower than or equal to the preset threshold, wherein the second deduplication duration is longer than the first deduplication duration.
2. The method of claim 1, further comprising:
and determining the second duplicate removal duration according to a preset factor when the electric quantity corresponding to the first electronic equipment is lower than or equal to the preset threshold.
3. The method according to claim 2, wherein the second deduplication period is determined based on at least one of the following preset factors:
a power consumption priority of the first event;
the service life of the first electronic equipment;
the temperature of the environment in which the first electronic device is located and/or the temperature of the first electronic device itself when the first electronic device is used;
a user type using the first electronic device;
a region of use of the first electronic device.
4. The method of claim 3, wherein the longer the processor elapsed time required to process the log data of the first event, the higher the priority of power consumption of the first event, and the longer the determined second deduplication period.
5. The method of claim 3, wherein the determined second deduplication time period is longer the usage time period of the first electronic device is.
6. The method of claim 3, wherein the determined length of the second deduplication time is longer the higher the temperature of the environment in which the first electronic device is located when the first electronic device is used and/or the temperature of the first electronic device itself.
7. The method according to claim 3, wherein the determined second deduplication period is shorter the higher the demand for log data detail by the user type using the first electronic device is.
8. The method according to claim 3, wherein the determined second deduplication period is longer the higher the requirement for privacy data by the use area of the first electronic device is.
9. The method according to claim 1, wherein performing deduplication processing on the plurality of log data of the first event acquired within a first deduplication duration or a second deduplication duration includes:
and performing duplicate removal processing on the log data of which the identification code is within the preset identification code range in the log data acquired within the first duplicate removal duration or the second duplicate removal duration.
10. The method of claim 1, further comprising:
and packaging the log data subjected to the deduplication processing of the first event, and sending the packaged log data to the second electronic device.
11. A computer-readable medium having stored thereon instructions that, when executed on an electronic device, cause the electronic device to perform the log data processing method of any one of claims 1 to 10.
12. An electronic device, characterized in that the electronic device comprises:
a memory for storing instructions for execution by one or more processors of the electronic device, an
A processor, which is one of processors of an electronic device, for performing the log data processing method of any one of claims 1 to 10.
CN202111680415.4A 2021-12-30 2021-12-30 Log data processing method, electronic device and medium thereof Active CN114449628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111680415.4A CN114449628B (en) 2021-12-30 2021-12-30 Log data processing method, electronic device and medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111680415.4A CN114449628B (en) 2021-12-30 2021-12-30 Log data processing method, electronic device and medium thereof

Publications (2)

Publication Number Publication Date
CN114449628A CN114449628A (en) 2022-05-06
CN114449628B true CN114449628B (en) 2023-01-06

Family

ID=81366063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111680415.4A Active CN114449628B (en) 2021-12-30 2021-12-30 Log data processing method, electronic device and medium thereof

Country Status (1)

Country Link
CN (1) CN114449628B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844143A (en) * 2016-12-27 2017-06-13 微梦创科网络科技(中国)有限公司 A kind of daily record duplicate removal treatment method and device
CN110413478A (en) * 2019-06-28 2019-11-05 苏州浪潮智能科技有限公司 A kind of method, equipment and medium monitoring log processing
CN110908589A (en) * 2018-09-14 2020-03-24 阿里巴巴集团控股有限公司 Data file processing method, device and system and storage medium
CN112069034A (en) * 2020-09-22 2020-12-11 深圳市欢太科技有限公司 Fast application exception handling method and device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10756757B2 (en) * 2016-06-03 2020-08-25 Dell Products L.P. Maintaining data deduplication reference information
CN111552609B (en) * 2020-04-12 2022-03-11 西安电子科技大学 Abnormal state detection method, system, storage medium, program and server
CN112306981A (en) * 2020-11-03 2021-02-02 广州科泽云天智能科技有限公司 Fault prediction method for fault log of high-performance computing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844143A (en) * 2016-12-27 2017-06-13 微梦创科网络科技(中国)有限公司 A kind of daily record duplicate removal treatment method and device
CN110908589A (en) * 2018-09-14 2020-03-24 阿里巴巴集团控股有限公司 Data file processing method, device and system and storage medium
CN110413478A (en) * 2019-06-28 2019-11-05 苏州浪潮智能科技有限公司 A kind of method, equipment and medium monitoring log processing
CN112069034A (en) * 2020-09-22 2020-12-11 深圳市欢太科技有限公司 Fast application exception handling method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114449628A (en) 2022-05-06

Similar Documents

Publication Publication Date Title
US20160048682A1 (en) Method and Apparatus for Clearing Malicious Power-Consuming Application, and User Terminal
US9537957B2 (en) Seamless application session reconstruction between devices
WO2017185616A1 (en) File storage method and electronic equipment
CN107832100B (en) APK plug-in loading method and terminal thereof
CN108153647B (en) Log processing method and device, terminal equipment and storage medium
CN105763602A (en) Data request processing method, server and cloud interactive system
WO2021227677A1 (en) Scene pushing method, scene executing method, scene pushing device, scene executing device, terminal, server, and system
CN104602131A (en) Barrage processing method and system
CN110471749B (en) Task processing method, device, computer readable storage medium and computer equipment
CN110825694A (en) Data processing method, device, equipment and storage medium
CN111191777A (en) Neural network processor and control method thereof
WO2015090099A1 (en) Algorithm configuration method and system
CN112532885B (en) Anti-shake method and device and electronic equipment
WO2019024646A1 (en) Application management and control method, apparatus, and electronic device
CN112953753A (en) Data acquisition method and device, terminal equipment and storage medium
US20160173532A1 (en) Electronic device and method for suggesting response manual in occurrence of denial
US10284614B2 (en) Method for downloading contents of electronic device and electronic device thereof
CN111324576B (en) Recording data storage method and device, storage medium and terminal equipment
CN112363841B (en) Application process searching and killing method and device, electronic equipment and storage medium
WO2020000742A1 (en) Deduplication traffic recording method, device, server and storage medium
CN114449628B (en) Log data processing method, electronic device and medium thereof
CN115694699A (en) Time delay parameter acquisition method and device, electronic equipment and storage medium
CN109240790B (en) Multi-window management method and system and android terminal
CN113885969A (en) Embedded device, embedded software loading method and storage medium
CN108197013B (en) Log processing method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant