CN105335434B - Log management method and device and electronic equipment - Google Patents

Log management method and device and electronic equipment Download PDF

Info

Publication number
CN105335434B
CN105335434B CN201410392273.5A CN201410392273A CN105335434B CN 105335434 B CN105335434 B CN 105335434B CN 201410392273 A CN201410392273 A CN 201410392273A CN 105335434 B CN105335434 B CN 105335434B
Authority
CN
China
Prior art keywords
log
back end
intermediate language
language
journal
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
CN201410392273.5A
Other languages
Chinese (zh)
Other versions
CN105335434A (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.)
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Beijing 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 Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN201410392273.5A priority Critical patent/CN105335434B/en
Publication of CN105335434A publication Critical patent/CN105335434A/en
Application granted granted Critical
Publication of CN105335434B publication Critical patent/CN105335434B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a log management method and device and electronic equipment, and belongs to the technical field of computers. The method comprises the following steps: generating a log by using the front end of the log system; converting the log into a log described by an intermediate language; and outputting the log described by the intermediate language to an object corresponding to the log back end by using the log back end corresponding to the log front end in the log system. The method comprises the steps of dividing a log system into a log front end and a log rear end, converting a log generated by the log front end into an intermediate language, and outputting the log described by the intermediate language to a corresponding object by using the corresponding log rear end; the problem that the expansibility of a log output direction is poor because a log system in the prior art usually realizes the generation of logs and the output of the logs as a whole is solved; the effects that a new type of log is added conveniently by a log system, and the output direction of the rear end of the log is more flexible and easier to expand are achieved.

Description

Log management method and device and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a log management method and apparatus, and an electronic device.
Background
The logging system in the client may manage various behaviors (including system behavior, user behavior, network behavior, and the like) generated by the client, for example, the logging system may record and output the behaviors in a specific format to different objects, such as a console, a file, an application interface backend, a network, and the like.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems: for increasingly diversified clients, a new type of log may be output to a new object at any time, and the existing log system is generally implemented as a whole when generating and outputting the log, so that the expansibility of the log output direction is poor.
Disclosure of Invention
In order to solve the problem that the log system in the prior art is generally realized as a whole when generating logs and outputting logs, and the expansibility of a log output direction is poor, embodiments of the present invention provide a log management method, an apparatus, and an electronic device. The technical scheme is as follows:
in a first aspect, a log management method is provided, which is applied to a log system including a log front end and a log back end, and the method includes:
generating a log by using a log front end of the log system;
converting the log into a log described by an intermediate language;
and outputting the log described by the intermediate language to an object corresponding to the log back end by using the log back end corresponding to the log front end in the log system.
In a second aspect, an apparatus for managing logs is provided, where the apparatus is applied in a log system including a front end and a back end of logs, and the apparatus includes:
the log generation module is used for generating a log by using the log front end of the log system;
the language conversion module is used for converting the log generated by the log generation module into a log described by an intermediate language;
and the log output module is used for outputting the log described by the language conversion module by using the intermediate language to an object corresponding to the log back end by using the log back end corresponding to the log front end in the log system.
In a third aspect, an electronic device is provided, in which a log system including a log front end and a log back end is provided, and the electronic device includes:
a touch screen display, one or more processors;
a memory;
and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
generating a log by using a log front end of the log system;
converting the log into a log described by an intermediate language;
and outputting the log described by the intermediate language to an object corresponding to the log back end by using the log back end corresponding to the log front end in the log system.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the method comprises the steps that a log system is divided into a log front end and a log rear end, a log generated by the log front end is converted into an intermediate language, and then the corresponding log rear end is used for outputting the log described by the intermediate language to a corresponding object; because the front end and the back end of the log system are separated, and the generated log can be converted into the intermediate language no matter what language the front end of the log is written, the back end of the log can always identify the log generated by the front end of the log, so that the back end of the log is not limited by the writing language of the front end of the log and the front end of the log is not limited by the back end of the log, and the front end of the log is more convenient to add new types of logs and is not influenced by the back end of the log during expansion, thereby solving the problem that the log system in the prior art is usually realized as a whole during log generation and log output and has poor expansibility on the output direction of the log; the effects that a new type of log can be added conveniently by a log system, the output direction of the rear end of the log is more flexible, and the output direction of the rear end of the log is easier to expand are achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow diagram of a method of log management provided in one embodiment of the invention;
FIG. 2A is a flow chart of a method of log management provided in another embodiment of the invention;
FIG. 2B is a schematic diagram of a log system provided in some embodiments of the invention;
FIG. 3 is a schematic structural diagram of a log management apparatus provided in an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a log management apparatus provided in another embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in some embodiments of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The electronic device related in each embodiment of the present invention is provided with a log system, for example, a log system installed in an application program or a client in the electronic device, a log system corresponding to an operating system of the electronic device, or a log system corresponding to a web client in a browser in the electronic device, where the electronic device may be a smart phone, a tablet computer, a smart television, an electronic book reader, an MP4(Moving Picture expert group Audio Layer IV, Moving Picture expert compressed standard Audio Layer 4) player, a laptop computer, a desktop computer, and the like.
Referring to fig. 1, a flowchart of a method for managing a log provided in an embodiment of the present invention is shown, where the method for managing a log may be applied to a log system in an electronic device or may be applied to a log system in any application program in an electronic device, where the log system may include a log front end and a log back end. The log management method may include:
101, generating a log by using the front end of the log of a log system;
in order to facilitate the expansion of the log types and the expansion of the log output direction in the log system, the log system can be divided into a log front end for generating logs by a user and a log back end for outputting the logs. The front end and the back end of the log are independent.
Correspondingly, the log system can generate logs by using the log front end.
102, converting the log into a log described by an intermediate language;
the intermediate language is a general editing language, so that the logs generated by the front end of the logs can be described by using the intermediate language no matter which language is used for writing, and any one kind of logs can identify the logs described by the intermediate language, so that for the back end of the logs, the language of the front end of the logs does not influence the identification of the back end of the logs.
And 103, outputting the log described by the intermediate language to an object corresponding to the back end of the log by using the back end of the log corresponding to the front end of the log in the log system.
In summary, in the log management method provided in the embodiment of the present invention, the log system is divided into the log front end and the log back end, the log generated by the log front end is converted into the intermediate language, and then the corresponding log back end is used to output the log described by the intermediate language to the corresponding object; because the front end and the back end of the log system are separated, and the generated log can be converted into the intermediate language no matter what language the front end of the log is written, the back end of the log can always identify the log generated by the front end of the log, so that the back end of the log is not limited by the writing language of the front end of the log and the front end of the log is not limited by the back end of the log, and the front end of the log is more convenient to add new types of logs and is not influenced by the back end of the log during expansion, thereby solving the problem that the log system in the prior art is usually realized as a whole during log generation and log output and has poor expansibility on the output direction of the log; the effects that a new type of log can be added conveniently by a log system, the output direction of the rear end of the log is more flexible, and the output direction of the rear end of the log is easier to expand are achieved.
Referring to fig. 2A, a flowchart of a method for managing a log provided in another embodiment of the present invention is shown, where the method for managing a log may be applied to a log system in an electronic device or may be applied to a log system in any application program in an electronic device, where the log system may include a log front end and a log back end. The log management method may include:
201, receiving a log parameter by using a log front end of a log system, wherein the log type corresponding to the log front end is the same as the type of a log to be generated by the log parameter;
in order to facilitate the expansion of the log types and the expansion of the log output direction in the log system, the log system can be divided into a log front end for generating logs by a user and a log back end for outputting the logs. The front end and the back end of the log are independent.
The front end of the log is provided with an independent base class, a standard interface and a development specification, and the back end of the log is also provided with an independent base class, a standard interface and a development specification, namely, the front end and the back end of the log can be independently developed and expanded.
Optionally, the log system may include at least one log front end and at least one log back end, as shown in fig. 2B, which shows a schematic structural diagram of the log system provided in some embodiments of the present invention, where the log system may include a plurality of log front ends (log front end 1 to log front end m) and a plurality of log back ends (log back end 1 to log back end n), where m is a natural number greater than 0, n is a natural number greater than 0, m may be the same as n, and m may also be different from n. For the log system in the application program, the number of the front ends of the log in the log system is determined by the number of the log types of the application program, for example, the number of the front ends of the log in the log system is equal to the number of the log types; the data of the back end of the log in the log system is determined by the object of the application program, for example, the number of the back end of the log in the log system is equal to the number of the objects of the log.
The log parameters are necessary parameters for generating the log, and in order to ensure that the log can be correctly generated, the log system needs to receive the log parameters by using the log front end of the log system.
In order to meet the user requirements and improve the utilization rate of the application program, the types of logs involved in the application program are increased increasingly, so that a new log front end needs to be added to process the newly increased log types.
Generally, each front end of each log in the log system uniquely corresponds to a log type, where the log type is a type of log, and may be, for example, a weblog, a behavior log, and the like. Similarly, each log back end of the log system also uniquely corresponds to one log type.
The log type corresponding to the front end of the log is the same as the type of the log to be generated by the log parameters. That is, the log parameters of a certain log are input to the log front end corresponding to the log type of the log, and the log front end can receive the log parameters of the log according to the standard interface.
202, generating a log at the front end of the log according to the log parameters;
the front end of the log system can generate the log according to the received log parameters after receiving the log parameters according to the standard interface.
203, converting the log into a log described by using an intermediate language;
the intermediate language is a general editing language, so that the logs generated by the front end of the logs can be described by using the intermediate language no matter which language is used for writing, and any one kind of logs can identify the logs described by the intermediate language, so that for the back end of the logs, the language of the front end of the logs does not influence the identification of the back end of the logs.
In order to ensure the separation of the front end and the back end of the log, so as to ensure the independence of the front end of the development log and the independence of the back end of the development log, and further avoid the mutual influence of the front end and the back end of the log on the other side during development, after the front end of the log system generates the log according to the log parameters, the middle layer of the log system can convert the log generated by the front end of the log into the log described by using the middle language.
Still referring to fig. 2B, there is an intermediate layer between the front end and the back end of the log in the log system, and the front end and the back end of the log are connected through the intermediate layer, and the intermediate layer may use an intermediate language to describe the log generated by the front end of the log again.
The intermediate language as taught herein may be a binary stream or the like that can be universally compiled. In practical applications, the intermediate language may also be other languages that can be compiled in a general way, and the embodiment of the present invention does not limit this.
Because the intermediate language is not limited by the writing language of the front end of the log and the writing language of the back end of the log, the log generated by any front end of the log can be converted into the log described by the intermediate language.
204, determining a log back end corresponding to the log front end for generating the log according to a corresponding relation between the log front end and the log back end prestored in the log system, wherein the log front end and the log back end in each group of corresponding relation correspond to the same type of log;
in practical application, the front end of the log system may correspond to the back end of the log in advance, and with respect to the front end of the log and the back end of the log after the front end of the log corresponds to the back end of the log, the log system may output the log generated by the front end of the log to the back end of the log corresponding to the front end of the log after the log is described by using the intermediate language.
Optionally, the log system may be provided with a log configuration management submodule, and a log logger may use the log configuration management submodule and the log type to correspond a log front end and a log back end in the log system to form a corresponding relationship, where the log front end and the log back end in each group of corresponding relationship correspond to a same type of log.
For example, when the log system is initialized, the front end and the back end of the log in the log system may be configured in advance according to the log type, so that the log generated by the configured front end of the log can be output to the back end of the corresponding log and output according to the back end of the log.
For another example, if the corresponding relationship between the front end and the back end of the log is already configured in the log system, and as the log types increase, the front end of the log also increases for the increased log types, and at this time, in order to ensure that the log generated by the newly increased front end of the log can be output, the increased front end of the log needs to be corresponding to one or some back ends of the log, and at this time, the corresponding relationship between the front end and the back end of the log may be configured by using the log configuration management sub-module in the log system.
Therefore, for a front end of a log which is not configured with a corresponding relationship, even if the front end of the log generates the log, the front end of the log is not configured with a corresponding back end of the log, so that the log generated by the front end of the log cannot be output to the back end of the log, and the output of the log is influenced at this moment, and the log output is wrong; it can also be seen that, for the log back end not configured with the correspondence relationship, since the corresponding log front end is not configured, the log generated by the log front end cannot be received, and the log cannot be output, and at this time, the log back end has no output function.
And 205, outputting the log described by the intermediate language to an object corresponding to the back end of the log by using the back end of the log corresponding to the front end of the log in the log system.
The object may provide a representation corresponding to a log type of the log for the log, for example, the object may present the log, print the log, store the log, or the like, for example, the object may be a console, a file, an application interface, a network, or the like.
Optionally, the standard interface at the back end of each log defines at least one function of an object corresponding to the back end of the log, that is, the standard interface at the back end of the log may specify at least one function for an object output corresponding to the back end of the log. Such as may include: synchronously reading the existing log content, asynchronously writing a log, asynchronously deleting one (or all) logs, and the like. Each specific log back-end module implements part or all of the interface separately. For example, the console back end does not implement a synchronous read interface, the file back end implements all interfaces, and the like.
Because the back end of the log is provided with an abstract standard interface and only receives the log described by the intermediate voice, the back end of the log is not influenced by the front end of the log, namely, each back end of the log can be independently developed, and the back end of the log can be arbitrarily expanded.
For example, the log back end and the log back end may have an inheritance relationship, for example, the log back end 1 is a log back end without limiting the file size, the log back end 2 is a file back end for limiting the file size, and the log back end 2 may inherit the log back end 1. Obviously, a dual file back end, a file back end with a memory buffer, a user interface back end for displaying the log on a screen, etc. can also be conveniently made.
Therefore, the log system can utilize the intermediate language to connect the front end of the log with the back end of the log, so that the front end of the log and the back end of the log can be ensured to be independently developed and expanded, and the expansion of newly-added logs and the expansion of output forms are facilitated. When a new type is needed, a new log front end corresponding to the new type can be added, the log front end corresponds to one or some log rear ends (can correspond to the existing log rear end, or can generate a new log rear end when the output mode also needs to be correspondingly updated, and corresponds to the newly generated log rear end), then a corresponding log is generated by using the log front end, the log generated by the log front end is described by using the middle voice by the middle layer, the log described by using the middle voice is output to the log rear end corresponding to the new log front end, and the log rear end corresponding to the log rear end can output the log to a corresponding object.
That is, when the log type is expanded, it may correspond to the front end of the log of the expanded log system, and when the direction of output is expanded, it may correspond to the back end of the log of the expanded log system. When the back end of the log is expanded, the front end of the log can not be expanded simultaneously; when the front end of the log is expanded, whether the back end of the log is expanded or not can be determined according to the actual situation (whether a new output direction is needed or not). Therefore, the log system can be ensured to be more suitable for the increasing update of log types, the output direction of the log can be expanded, the original log front end and the original log rear end do not need to be modified during expansion, the maintenance of the log system is facilitated, and the upgrading cost can be saved.
In summary, in the log management method provided in the embodiment of the present invention, the log system is divided into the log front end and the log back end, the log generated by the log front end is converted into the intermediate language, and then the corresponding log back end is used to output the log described by the intermediate language to the corresponding object; because the front end and the back end of the log system are separated, and the generated log can be converted into the intermediate language no matter what language the front end of the log is written, the back end of the log can always identify the log generated by the front end of the log, so that the back end of the log is not limited by the writing language of the front end of the log and the front end of the log is not limited by the back end of the log, and the front end of the log is more convenient to add new types of logs and is not influenced by the back end of the log during expansion, thereby solving the problem that the log system in the prior art is usually realized as a whole during log generation and log output and has poor expansibility on the output direction of the log; the effects that a new type of log can be added conveniently by a log system, the output direction of the rear end of the log is more flexible, and the output direction of the rear end of the log is easier to expand are achieved.
It should be noted that, in practical applications, the generated logs may be optimized in an intermediate layer system between the front end and the back end of the logs of the log system, that is, after the logs are converted into the logs described by the intermediate language, the logs described by the intermediate language are optimized according to a preset optimization rule. The optimization rule mentioned here may be set preferentially according to the actual situation, for example, a fixed identifier may be added to the log, or the log described in the intermediate language may be compressed. Optionally, the log output by a part of the front end and described by using the intermediate language may be optimized.
Fig. 3 is a schematic structural diagram illustrating a log management apparatus provided in an embodiment of the present invention, where the log management apparatus may be implemented by hardware, software, or a combination of the hardware and the software as all or part of a log system in an electronic device, or may be implemented by hardware, software, or a combination of the hardware and the software as all or part of a log system in any application program in an electronic device, where the log system may include a log front end and a log back end. The log management apparatus may include: a log generation module 302, a language conversion module 304, and a log output module 306.
The log generating module 302 may be configured to generate a log by using a log front end of a log system;
in order to facilitate the expansion of the log types and the expansion of the log output direction in the log system, the log system can be divided into a log front end for generating logs by a user and a log back end for outputting the logs. The front end and the back end of the log are independent.
The language conversion module 304 may be configured to convert the log generated by the log generation module 302 into a log described by an intermediate language;
the intermediate language is a general editing language, so that the logs generated by the front end of the logs can be described by using the intermediate language no matter which language is used for writing, and any one kind of logs can identify the logs described by the intermediate language, so that for the back end of the logs, the language of the front end of the logs does not influence the identification of the back end of the logs.
The log output module 306 may be configured to output, by using a log back end corresponding to a log front end in the log system, the log described by the language conversion module 304 using the intermediate language to an object corresponding to the log back end.
In summary, the log management apparatus provided in the embodiment of the present invention divides the log system into a log front end and a log back end, converts the log generated by the log front end into an intermediate language, and outputs the log described by the intermediate language to a corresponding object by using the corresponding log back end; because the front end and the back end of the log system are separated, and the generated log can be converted into the intermediate language no matter what language the front end of the log is written, the back end of the log can always identify the log generated by the front end of the log, so that the back end of the log is not limited by the writing language of the front end of the log and the front end of the log is not limited by the back end of the log, and the front end of the log is more convenient to add new types of logs and is not influenced by the back end of the log during expansion, thereby solving the problem that the log system in the prior art is usually realized as a whole during log generation and log output and has poor expansibility on the output direction of the log; the effects that a new type of log can be added conveniently by a log system, the output direction of the rear end of the log is more flexible, and the output direction of the rear end of the log is easier to expand are achieved.
Referring to fig. 4, a schematic structural diagram of a log management apparatus provided in another embodiment of the present invention is shown, where the log management apparatus may be implemented by hardware, software, or a combination of the two to be all or part of a log system in an electronic device, or may be implemented by hardware, software, or a combination of the two to be all or part of a log system in any application program in an electronic device, where the log system may include a log front end and a log back end. The log management apparatus may include: a log generation module 402, a language conversion module 404, and a log output module 406.
The log generating module 402 may be configured to generate a log by using a log front end of a log system;
in order to facilitate the expansion of the log types and the expansion of the log output direction in the log system, the log system can be divided into a log front end for generating logs by a user and a log back end for outputting the logs. The front end and the back end of the log are independent.
The language conversion module 404 may be configured to convert the log generated by the log generation module 402 into a log described by an intermediate language;
the intermediate language is a general editing language, so that the logs generated by the front end of the logs can be described by using the intermediate language no matter which language is used for writing, and any one kind of logs can identify the logs described by the intermediate language, so that for the back end of the logs, the language of the front end of the logs does not influence the identification of the back end of the logs.
The log output module 406 may be configured to output, by using a log back end corresponding to a log front end in the log system, the log described by the language conversion module 404 using the intermediate language to an object corresponding to the log back end.
In one embodiment, the log management apparatus may further include: a log back end determination module 408.
The log back-end determining module 408 may be configured to determine, according to a correspondence between a log front end and a log back end pre-stored in the log system, a log back end corresponding to the log front end that generates the log, where the log front end and the log back end in each group of correspondence correspond to the same type of log.
In one embodiment, the log generation module 402 may include: a receiving unit 402a and a generating unit 402 b.
The receiving unit 402a may be configured to receive a log parameter by using a log front end of a log system, where a log type corresponding to the log front end is the same as a type of a log to be generated by the log parameter;
the generating unit 402b may be configured to generate a log according to the log parameters at the front end of the log.
In one embodiment, the log management apparatus may further include: an optimization module 410.
The optimizing module 410 may be configured to optimize the log described by the language conversion module 404 using the intermediate language according to a preset optimizing rule.
In practical application, the generated logs can be optimized in an intermediate layer system between the front end and the back end of the logs of the log system, that is, after the logs are converted into the logs described by the intermediate language, the logs described by the intermediate language are optimized according to a preset optimization rule. The optimization rule mentioned here may be set preferentially according to the actual situation, for example, a fixed identifier may be added to the log, or the log described in the intermediate language may be compressed. Optionally, the log output by a part of the front end and described by using the intermediate language may be optimized.
In one embodiment, each log front end in the log system uniquely corresponds to one log type; each log back end of the log system uniquely corresponds to one log type, and a standard interface of each log back end defines at least one function of an object corresponding to the log back end.
In summary, the log management apparatus provided in the embodiment of the present invention divides the log system into a log front end and a log back end, converts the log generated by the log front end into an intermediate language, and outputs the log described by the intermediate language to a corresponding object by using the corresponding log back end; because the front end and the back end of the log system are separated, and the generated log can be converted into the intermediate language no matter what language the front end of the log is written, the back end of the log can always identify the log generated by the front end of the log, so that the back end of the log is not limited by the writing language of the front end of the log and the front end of the log is not limited by the back end of the log, and the front end of the log is more convenient to add new types of logs and is not influenced by the back end of the log during expansion, thereby solving the problem that the log system in the prior art is usually realized as a whole during log generation and log output and has poor expansibility on the output direction of the log; the effects that a new type of log can be added conveniently by a log system, the output direction of the rear end of the log is more flexible, and the output direction of the rear end of the log is easier to expand are achieved.
It should be noted that: in the log management apparatus provided in the above embodiment, only the division of the functional modules is illustrated when performing log management, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules to complete all or part of the functions described above. In addition, the log management device and the log management method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Referring to fig. 5, a block diagram of an electronic device provided in some embodiments of the invention is shown. The electronic device 500 is configured to implement the service processing method provided by the foregoing embodiment. The electronic device 500 of the present invention may include one or more of the following components: a processor for executing computer program instructions to perform the various processes and methods, Random Access Memory (RAM) and Read Only Memory (ROM) for information and storing program instructions, memory for storing data and information, I/O devices, interfaces, antennas, and the like. Specifically, the method comprises the following steps:
the electronic device 500 may include RF (Radio Frequency) circuitry 510, memory 520, input unit 530, display unit 540, sensor 550, audio circuitry 560, Wi-Fi (Wireless-Fidelity) module 570, processor 580, power supply 582, camera 590, and so on. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 5 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the electronic device 500 in detail with reference to fig. 5:
RF circuit 510 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, for processing downlink information of a base station after receiving the downlink information to processor 580; in addition, the data for designing uplink is transmitted to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, RF circuit 510 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
The memory 520 may be used to store software programs and modules, and the processor 580 may execute various functional applications and data processing of the electronic device 500 by operating the software programs and modules stored in the memory 520. The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device 500, and the like. Further, the memory 520 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 530 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device 500. Specifically, the input unit 530 may include a touch panel 531 and other input devices 532. The touch panel 531, also called a touch screen, can collect touch operations of a user on or near the touch panel 531 (for example, operations of the user on or near the touch panel 531 by using any suitable object or accessory such as a finger or a stylus pen), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 531 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 580, and can receive and execute commands sent by the processor 580. In addition, the touch panel 531 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 530 may include other input devices 532 in addition to the touch panel 531. In particular, other input devices 532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 540 may be used to display information input by the user or information provided to the user and various menus of the electronic device 500. The display unit 540 may include a display panel 541, and optionally, the display panel 541 may be configured in the form of an LCD (Liquid crystal display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch panel 531 may cover the display panel 541, and when the touch panel 531 detects a touch operation on or near the touch panel 531, the touch panel is transmitted to the processor 580 to determine the type of the touch event, and then the processor 580 provides a corresponding visual output on the display panel 541 according to the type of the touch event. Although in fig. 5, the touch panel 531 and the display panel 541 are implemented as two separate components to implement the input and output functions of the electronic device 500, in some embodiments, the touch panel 531 and the display panel 541 may be integrated to implement the input and output functions of the electronic device 500.
The electronic device 500 may also include at least one sensor 550, such as a gyroscope sensor, a magnetic induction sensor, an optical sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 541 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 541 and/or the backlight when the electronic device 500 is moved to the ear. As one type of motion sensor, the acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of electronic equipment, and related functions (such as pedometer and tapping) for vibration recognition; as for other sensors such as barometer, hygrometer, thermometer, infrared sensor, etc. that can be configured in the electronic device 500, they will not be described in detail herein.
The audio circuit 560, speaker 561, microphone 562 may provide an audio interface between a user and the electronic device 500. The audio circuit 560 may transmit the electrical signal converted from the received audio data to the speaker 561, and convert the electrical signal into a sound signal by the speaker 561 for output; on the other hand, the microphone 562 converts the collected sound signal into an electric signal, is received by the audio circuit 560 and converted into audio data, and then outputs the audio data to the processor 580 for processing, and then to the RF circuit 510 for transmission to, for example, another terminal, or outputs the audio data to the memory 520 for further processing.
Wi-Fi is a short-range wireless transmission technology, and the electronic device 500 can help a user send and receive e-mails, browse webpages, access streaming media and the like through the Wi-Fi module 570, and provides wireless broadband Internet access for the user. Although fig. 5 shows the Wi-Fi module 570, it is understood that it does not belong to the essential constitution of the electronic device 500, and may be omitted entirely within a scope that does not change the essence of the disclosure as needed.
The processor 580 is a control center of the electronic device 500, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device 500 and processes data by operating or executing software programs and/or modules stored in the memory 520 and calling data stored in the memory 520, thereby performing overall monitoring of the electronic device. Alternatively, processor 580 may include one or more processing units; preferably, the processor 580 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 580.
The electronic device 500 also includes a power supply 582 (e.g., a battery) that provides power to the various components, and preferably is logically coupled to the processor 582 via a power management system that provides management of charging, discharging, and power consumption.
The camera 590 is generally composed of a lens, an image sensor, an interface, a digital signal processor, a CPU, a display screen, and the like. The lens is fixed above the image sensor, and the focusing can be changed by manually adjusting the lens; the image sensor is equivalent to the 'film' of a traditional camera and is the heart of a camera for acquiring images; the interface is used for connecting the camera with the main board of the electronic equipment by using a flat cable, a board-to-board connector and a spring type connection mode and sending the acquired image to the memory 520; the digital signal processor processes the acquired image through a mathematical operation, converts the acquired analog image into a digital image, and transmits the digital image to the memory 520 through the interface.
Although not shown, the electronic device 500 may further include a bluetooth module or the like, which is not described herein.
The electronic device 500, in addition to comprising the one or more processors 580, may include memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs have the following functions:
generating a log by using the front end of the log system;
converting the log into a log described by an intermediate language;
and outputting the log described by the intermediate language to an object corresponding to the log back end by using the log back end corresponding to the log front end in the log system.
In one embodiment, the one or more programs further have functions of: before outputting the log described by the intermediate language to the object corresponding to the log back end by using the log back end corresponding to the log front end in the log system, the method further comprises the following steps:
and determining the log back end corresponding to the log front end for generating the log according to the corresponding relation between the log front end and the log back end prestored in the log system, wherein the log front end and the log back end in each group of corresponding relation correspond to the same type of log.
In one embodiment, the one or more programs further have functions of: generating a log by using a log front end of a log system, comprising:
receiving log parameters by using a log front end of a log system, wherein the log type corresponding to the log front end is the same as the type of a log to be generated by the log parameters;
and generating a log at the front end of the log according to the log parameters.
In one embodiment, the one or more programs further have functions of: after converting the log into the log described by the intermediate language, the method further comprises the following steps:
and optimizing the log described by the intermediate language according to a preset optimization rule.
In one embodiment, the one or more programs further have functions of: the front end of each log of the log system is uniquely corresponding to one log type;
each log back end of the log system uniquely corresponds to one log type, and a standard interface of each log back end defines at least one function of an object corresponding to the log back end.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (11)

1. A log management method is characterized in that the method is applied to a log system comprising a log front end, a log back end and a log configuration management submodule, wherein the log front end and the log back end in the log system are respectively provided with an independent base class, a standard interface and a development specification and can be independently developed and expanded, and the log configuration management submodule is used for configuring the corresponding relation between the log front end and the log back end, and the method comprises the following steps:
generating a log by using a log front end of the log system;
converting the log into a log described by using an intermediate language, wherein the intermediate language is a general editing language which can be identified by any log back end;
and recording the log described by the intermediate language by using a log back end corresponding to the log front end in the log system, and outputting the log to an object corresponding to the log back end, wherein the object is a console, a file, an application interface or a network, and the log back end corresponding to the log front end is obtained by the configuration of the log configuration management submodule.
2. The method according to claim 1, before the utilizing a log back end corresponding to the log front end in the log system and outputting the log described in the intermediate language into an object corresponding to the log back end, further comprising:
and determining the log back end corresponding to the log front end for generating the log according to the corresponding relation between the log front end and the log back end prestored in the log system, wherein the log front end and the log back end in each group of corresponding relation correspond to the same type of log.
3. The method of claim 1, wherein generating the log with a log front end of a log system comprises:
receiving a log parameter by using a log front end of the log system, wherein the log type corresponding to the log front end is the same as the type of a log to be generated by the log parameter;
and generating the log at the front end of the log according to the log parameters.
4. The method of claim 1, after the converting the log into a log described in an intermediate language, further comprising:
and optimizing the log described by the intermediate language according to a preset optimization rule.
5. The method according to any one of claims 1 to 4,
the front end of each log of the log system is uniquely corresponding to one log type;
each log back end of the log system uniquely corresponds to one log type, and a standard interface of each log back end defines at least one function of the object corresponding to the log back end.
6. A kind of journal management device, characterized by that, apply to the journal system comprising journal front end, journal back end and journal and dispose the management submodule, the front end of journal and journal back end in the said journal system have independent base class, standard interface and development standard, can develop and expand independently, the said journal disposes the management submodule and is used for disposing the corresponding relation of front end and journal back end of the journal, the said apparatus includes:
the log generation module is used for generating a log by using the log front end of the log system;
the language conversion module is used for converting the log generated by the log generation module into a log described by using an intermediate language, wherein the intermediate language is a general editing language which can be identified by any log rear end;
and the log output module is used for recording the log described by the intermediate language by using the log back end corresponding to the log front end in the log system and outputting the log to an object corresponding to the log back end, wherein the object is a console, a file, an application interface or a network, and the log back end corresponding to the log front end is obtained by the configuration of the log configuration management submodule.
7. The apparatus of claim 6, further comprising:
and the log back end determining module is used for determining the log back end corresponding to the log front end for generating the log according to the corresponding relation between the log front end and the log back end prestored in the log system, wherein the log front end and the log back end in each group of corresponding relation correspond to the same type of log.
8. The apparatus of claim 6, wherein the log generation module comprises:
the receiving unit is used for receiving the log parameters by using the log front end of the log system, and the log type corresponding to the log front end is the same as the type of the log to be generated by the log parameters;
and the generating unit is used for generating the log at the front end of the log according to the log parameters.
9. The apparatus of claim 6, further comprising:
and the optimization module is used for optimizing the log described by the language conversion module by using the intermediate language according to a preset optimization rule.
10. The apparatus according to any one of claims 6 to 9,
the front end of each log of the log system is uniquely corresponding to one log type;
each log back end of the log system uniquely corresponds to one log type, and a standard interface of each log back end defines at least one function of the object corresponding to the log back end.
11. An electronic device, wherein a log system including a log front end, a log back end and a log configuration management submodule is provided in the electronic device, the log front end and the log back end in the log system both have independent base classes, standard interfaces and development specifications, and can be independently developed and extended, the log configuration management submodule is configured to configure a corresponding relationship between the log front end and the log back end, and the electronic device includes:
a touch screen display, one or more processors;
a memory;
and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
generating a log by using a log front end of the log system;
converting the log into a log described by using an intermediate language, wherein the intermediate language is a general editing language which can be identified by any log back end;
and recording the log described by the intermediate language by using a log back end corresponding to the log front end in the log system, and outputting the log to an object corresponding to the log back end, wherein the object is a console, a file, an application interface or a network, and the log back end corresponding to the log front end is obtained by the configuration of the log configuration management submodule.
CN201410392273.5A 2014-08-11 2014-08-11 Log management method and device and electronic equipment Active CN105335434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410392273.5A CN105335434B (en) 2014-08-11 2014-08-11 Log management method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410392273.5A CN105335434B (en) 2014-08-11 2014-08-11 Log management method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN105335434A CN105335434A (en) 2016-02-17
CN105335434B true CN105335434B (en) 2020-08-25

Family

ID=55285963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410392273.5A Active CN105335434B (en) 2014-08-11 2014-08-11 Log management method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN105335434B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450689B (en) * 2018-11-19 2022-02-22 郑州云海信息技术有限公司 Log printing method and device, storage medium and computer equipment
CN110825713B (en) * 2019-10-30 2022-05-27 Oppo广东移动通信有限公司 Information processing method and related product
CN113051121B (en) * 2019-12-26 2023-07-28 百度在线网络技术(北京)有限公司 Log information retrieval method, device, electronic equipment and medium
CN114237712B (en) * 2021-12-15 2022-12-27 北京百度网讯科技有限公司 Instruction execution method and device, electronic equipment and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1670708A (en) * 2004-03-17 2005-09-21 联想(北京)有限公司 Management method for computer log
CN101958837A (en) * 2010-09-30 2011-01-26 北京世纪互联工程技术服务有限公司 Log processing system, log processing method, node server and center server
CN102065416A (en) * 2009-11-18 2011-05-18 成都市华为赛门铁克科技有限公司 Method, device and system for formatting logs
CN103825918A (en) * 2012-11-16 2014-05-28 腾讯科技(深圳)有限公司 Data synchronization method, terminal equipment, server and data synchronization system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156786A1 (en) * 2005-12-22 2007-07-05 International Business Machines Corporation Method and apparatus for managing event logs for processes in a digital data processing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1670708A (en) * 2004-03-17 2005-09-21 联想(北京)有限公司 Management method for computer log
CN102065416A (en) * 2009-11-18 2011-05-18 成都市华为赛门铁克科技有限公司 Method, device and system for formatting logs
CN101958837A (en) * 2010-09-30 2011-01-26 北京世纪互联工程技术服务有限公司 Log processing system, log processing method, node server and center server
CN103825918A (en) * 2012-11-16 2014-05-28 腾讯科技(深圳)有限公司 Data synchronization method, terminal equipment, server and data synchronization system

Also Published As

Publication number Publication date
CN105335434A (en) 2016-02-17

Similar Documents

Publication Publication Date Title
CN111142711B (en) Firmware configuration method and device, storage medium and mobile terminal
CN108156508B (en) Barrage information processing method and device, mobile terminal, server and system
CN109614061B (en) Display method and terminal
CN108834132B (en) Data transmission method and equipment and related medium product
WO2018006841A1 (en) Qr code information transmission method, device and apparatus
CN109739402B (en) Fast application processing method and terminal equipment
CN110674662A (en) Scanning method and terminal equipment
CN112084747B (en) Resource management method and device, electronic equipment and storage medium
CN110049187B (en) Display method and terminal equipment
CN111049980A (en) Application sharing method, electronic equipment and computer readable storage medium
CN105335434B (en) Log management method and device and electronic equipment
CN110673770A (en) Message display method and terminal equipment
CN110750368A (en) Copying and pasting method and terminal
CN112749074B (en) Test case recommending method and device
CN109117037B (en) Image processing method and terminal equipment
CN111090529A (en) Method for sharing information and electronic equipment
CN105631059B (en) Data processing method, data processing device and data processing system
CN111142759B (en) Information sending method and electronic equipment
CN111447598B (en) Interaction method and display device
CN111026457B (en) Hardware configuration method and device, storage medium and terminal equipment
CN110245017B (en) Resource identifier allocation method and equipment
CN111399819A (en) Data generation method and device, electronic equipment and storage medium
CN105320532B (en) Method, device and terminal for displaying interactive interface
CN111142998A (en) Sharing method of background application and electronic equipment
CN106230919B (en) File uploading method and device

Legal Events

Date Code Title Description
C06 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