CN110825465B - Log data processing method and device, electronic equipment and storage medium - Google Patents

Log data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110825465B
CN110825465B CN201911075979.8A CN201911075979A CN110825465B CN 110825465 B CN110825465 B CN 110825465B CN 201911075979 A CN201911075979 A CN 201911075979A CN 110825465 B CN110825465 B CN 110825465B
Authority
CN
China
Prior art keywords
log data
log
processing function
interface
program interface
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
CN201911075979.8A
Other languages
Chinese (zh)
Other versions
CN110825465A (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201911075979.8A priority Critical patent/CN110825465B/en
Publication of CN110825465A publication Critical patent/CN110825465A/en
Application granted granted Critical
Publication of CN110825465B publication Critical patent/CN110825465B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to a log data processing method, a log data processing device, electronic equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: when a call instruction to a target program interface in a plurality of program interfaces is triggered, intercepting the call instruction through an interception interface, calling a processing function, generating log data corresponding to the target program interface by adopting the processing function, and storing the log data, wherein the log data is used for recording the operation of calling the target program interface. The calling instructions of other program interfaces are intercepted through the interception interface, and the processing function is called to monitor the other program interfaces to generate the log function, so that the monitoring of a plurality of program interfaces can be realized by calling one processing function, the processing function does not need to be written in each program interface needing to be monitored, the universality of the processing function is improved, the operation is simple and convenient, the manpower and time can be saved, and the operation efficiency is improved.

Description

Log data processing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a log data processing method, a log data processing device, electronic equipment and a storage medium.
Background
With the development of computer technology, various program interfaces are provided in an operating system to implement different functions, and operations corresponding to the program interfaces can be performed by calling the program interfaces. In order to record the execution of the program interface, the program interface needs to be monitored.
In the related art, when monitoring is required for a program interface, a processing function for monitoring is written in the program interface. And subsequently, when the program interface is called, the processing function can be adopted to generate log data, and the log data is stored.
However, when a plurality of program interfaces need to be monitored, processing functions need to be written in each program interface, the operation is complex, more manpower and time are consumed, and the operation efficiency is low.
Disclosure of Invention
The disclosure provides a log data processing method, a log data processing device, an electronic device and a storage medium, which can solve the problem of low operation efficiency caused by the fact that processing functions are required to be written in each program interface in the related art.
According to a first aspect of embodiments of the present disclosure, there is provided a log data processing method, the method including:
Acquiring configuration information, an interception interface and a processing function, wherein the configuration information comprises a plurality of program interfaces;
When a call instruction to a target program interface in the plurality of program interfaces is triggered, intercepting the call instruction through the interception interface, and calling the processing function, wherein the target program interface is any program interface in the plurality of program interfaces;
and generating log data corresponding to the target program interface by adopting the processing function, and storing the log data, wherein the log data is used for recording the operation of calling the target program interface.
In one possible implementation manner, the call instruction carries an interface identifier of the target program interface, and the method further includes:
Calling the processing function according to the interface identifier of the target program interface;
And generating log data corresponding to the interface identifier by adopting the processing function.
In another possible implementation manner, the calling instruction carries user information, the configuration information further includes a record mark of the user identifier, the record mark includes a first mark or a second mark, the first mark is used for indicating that the user identifier is recorded, and the second mark is used for indicating that the user identifier is not recorded;
the generating log data corresponding to the target program interface by adopting the processing function comprises the following steps:
And if the record mark is the first mark, acquiring a user identifier in the user information by adopting the processing function as log data.
In another possible implementation manner, the configuration information further includes an authentication manner, where the authentication manner is a single sign-on manner or a password sign-on manner, and if the record mark is the first mark, the processing function is used to obtain, as log data, a user identifier in the user information, where the log data includes:
if the record mark is the first mark and the identity verification mode is the single sign-on mode, acquiring a user identification from a first field in the user information, wherein the first field is generated by a single sign-on system and is used as log data; or alternatively
And if the record mark is the first mark and the authentication mode is the password login mode, acquiring a user identification from a second field in the user information, wherein the second field is generated by a password login system and is used as log data.
In another possible implementation manner, the processing function includes a storage path of a log file, and the storing the log data includes:
writing the log data into the log file if the log file has been created under the storage path; or alternatively
If the log file is not created under the storage path, creating the log file under the storage path, and writing the log data into the log file.
In another possible implementation manner, the configuration information further includes a recording period, the processing function includes a storage path of a log file, and the storing the log data includes:
acquiring a first log file with latest creation time under the storage path;
writing the log data into the first log file when the difference between the creation time of the first log file and the generation time of the log data is not greater than the recording period;
And when the difference value between the creation time of the first log file and the generation time of the log data is larger than the recording period, creating a second log file under the storage path, and writing the log data into the second log file.
In another possible implementation manner, the configuration information further includes a translation list, where the translation list includes text data of the plurality of program interfaces, the text data is used to describe operations corresponding to the program interfaces, and the generating, with the processing function, log data corresponding to the target program interface includes:
and acquiring text data of the target program interface in the translation list by adopting the processing function as the log data.
According to a second aspect of embodiments of the present disclosure, there is provided a log data processing apparatus, the apparatus comprising:
an acquisition unit configured to acquire configuration information, an interception interface, and a processing function, the configuration information including a plurality of program interfaces;
A function calling unit configured to intercept a call instruction through the interception interface when triggering the call instruction to a target program interface among the plurality of program interfaces, the target program interface being any one of the plurality of program interfaces, and call the processing function;
the data generation unit is configured to generate log data corresponding to the target program interface by adopting the processing function, wherein the log data is used for recording the operation of calling the target program interface.
And a data storage unit configured to store the log data.
In one possible implementation manner, the calling instruction carries an interface identifier of the target program interface, and the function calling unit is further configured to call the processing function according to the interface identifier of the target program interface;
the data generating unit is further configured to generate log data corresponding to the interface identifier by adopting the processing function.
In another possible implementation manner, the calling instruction carries user information, the configuration information further includes a record mark of the user identifier, the record mark includes a first mark or a second mark, the first mark is used for indicating that the user identifier is recorded, and the second mark is used for indicating that the user identifier is not recorded;
the data generation unit includes:
And the identification acquisition subunit is configured to acquire the user identification in the user information as log data by adopting the processing function if the record mark is the first mark.
In another possible implementation manner, the configuration information further includes an authentication mode, where the authentication mode is a single sign-on mode or a password sign-on mode, and the data generating unit includes:
the first acquisition subunit is configured to acquire a user identifier from a first field in the user information as log data if the record mark is the first mark and the identity verification mode is the single sign-on mode, wherein the first field is generated by a single sign-on system; or alternatively
And the second acquisition subunit is configured to acquire the user identification from a second field in the user information as log data when the record mark is the first mark and the authentication mode is the password login mode, wherein the second field is generated by a password login system.
In another possible implementation manner, the processing function includes a storage path of a log file, and the data storage unit includes:
a first storage subunit configured to write the log data into the log file if the log file has been created under the storage path; or alternatively
And a second storage subunit configured to create a log file under the storage path and write the log data into the log file if the log file has not been created under the storage path.
In another possible implementation manner, the configuration information further includes a recording period, the processing function includes a storage path of the log file, and the data storage unit includes:
a file acquisition subunit configured to acquire a first log file with the latest creation time under the storage path;
A third storage subunit configured to write the log data into the first log file when a difference between a creation time of the first log file and a generation time of the log data is not greater than the recording period;
and a fourth storage subunit configured to create a second log file under the storage path and write the log data into the second log file when a difference between the creation time of the first log file and the generation time of the log data is greater than the recording period.
In another possible implementation manner, the configuration information further includes a translation list, where the translation list includes text data of the plurality of program interfaces, the text data is used to describe operations corresponding to the program interfaces, and the data generating unit includes:
And the text acquisition subunit is configured to acquire text data of the target program interface in the translation list as the log data by adopting the processing function.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device for processing log data, the electronic device comprising:
One or more processors;
Volatile or non-volatile memory for storing the one or more processor-executable commands;
Wherein the one or more processors are configured to perform the log data processing method of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, which when executed by a processor of a computer device, causes the computer device to perform the log data processing method of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, which when executed by a processor of a computer device, enables the computer device to perform the log data processing method of the first aspect.
According to the log data processing method, the device, the electronic equipment and the storage medium, when the call instruction of the target program interface in the plurality of program interfaces is triggered, the call instruction is intercepted through the interception interface, the processing function is called, the processing function is adopted, log data corresponding to the target program interface is generated, the log data are stored, and the log data are used for recording the operation of calling the target program interface. The calling instructions of other program interfaces are intercepted through the interception interface, and the processing function is called to monitor the other program interfaces to generate the log function, so that the monitoring of a plurality of program interfaces can be realized by calling one processing function, the processing function does not need to be written in each program interface needing to be monitored, the universality of the processing function is improved, the operation is simple and convenient, the manpower and time can be saved, and the operation efficiency is improved.
And the configuration information also comprises a record mark of the user identifier, and when the record mark is the first mark, the processing function is adopted to acquire the user identifier in the user information as log data. Therefore, each piece of log data of the target program interface corresponds to one user identifier, different users using the target program interface can be distinguished through the user identifier, the information quantity of the log data is improved, and the operation behaviors of different users can be analyzed conveniently.
And the configuration information also comprises a recording period, and the log data is written into the corresponding log file according to the recording period. Therefore, different recording periods can be set according to different application scenes, log data can be conveniently inquired according to the recording periods, and the regularity of log files is enhanced.
The configuration information also comprises text data of a plurality of program interfaces, the text data is used for describing operations corresponding to the program interfaces, and a processing function is adopted to obtain the text data of the target program interfaces in the translation list as log data. The operation of the calling program interface is translated into text data which can intuitively reflect the operation behaviors of the user, so that the text data is used as log data, and the readability of the log data is enhanced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram illustrating an implementation environment according to an example embodiment.
FIG. 2 is a flowchart illustrating a method of log data processing according to an example embodiment.
FIG. 3 is a flowchart illustrating another log data processing method according to an example embodiment.
FIG. 4 is a flowchart illustrating another log data processing method according to an example embodiment.
FIG. 5 is a block diagram illustrating a log data processing apparatus according to an example embodiment.
FIG. 6 is a block diagram of another log data processing apparatus according to an example embodiment.
Fig. 7 is a block diagram of a terminal according to an exemplary embodiment.
Fig. 8 is a block diagram of a server, according to an example embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The embodiment of the disclosure provides a log data processing method, which can be realized by electronic equipment, and the electronic equipment can generate log data through configuration information, an interception interface and a processing function.
FIG. 1 is a schematic diagram of an implementation environment provided in accordance with an exemplary embodiment, the implementation environment comprising: an electronic device 101 and a management device 102. The electronic device 101 and the management device 102 interact through a network connection.
The electronic device 101 and the management device 102 may be a server, or a server cluster formed by a plurality of servers, or a cloud computing service center, or a terminal, such as a mobile phone, a tablet computer, a desktop computer, or the like.
The management device 102 stores configuration information, an interception interface and a processing function, the management device 102 provides the configuration information, the interception interface and the processing function to the electronic device 101, the electronic device 101 can monitor a program interface in the electronic device 101 through the configuration information, the interception interface and the processing function, log data is generated and stored, and the log data can record operations of calling the program interface. The electronic device 101 may also send the log data to the management device 102, where the log data is stored by the management device 102, and a subsequent technician queries the management device 102 for the log data
FIG. 2 is a flowchart illustrating a log data processing method, see FIG. 2, applied to a server, according to an exemplary embodiment, comprising the steps of:
in step 201, configuration information, including a plurality of program interfaces, an interception interface, and a processing function are acquired.
In step 202, when a call instruction to a target program interface of the plurality of program interfaces is triggered, the call instruction is intercepted by the interception interface, a processing function is invoked, and the target program interface is any program interface of the plurality of program interfaces.
In step 203, a processing function is used to generate log data corresponding to the target program interface, and the log data is stored and used to record the operation of calling the target program interface.
According to the method provided by the embodiment of the disclosure, configuration information, the interception interfaces and the processing functions are obtained, when the call instruction of the target program interfaces in the program interfaces is triggered, the call instruction is intercepted through the interception interfaces, the processing functions are called, the processing functions are adopted, log data corresponding to the target program interfaces are generated, the log data are stored, and the log data are used for recording the operation of calling the target program interfaces. The calling instructions of other program interfaces are intercepted through the interception interface, and the processing function is called to monitor the other program interfaces to generate the log function, so that the monitoring of a plurality of program interfaces can be realized by calling one processing function, the processing function does not need to be written in each program interface needing to be monitored, the universality of the processing function is improved, the operation is simple and convenient, the manpower and time can be saved, and the operation efficiency is improved.
In one possible implementation, the calling instruction carries an interface identifier of the target program interface, and the method further includes:
Calling a processing function according to the interface identification of the target program interface;
and generating log data corresponding to the interface identifier by adopting a processing function.
In another possible implementation manner, the calling instruction carries user information, the configuration information further comprises a recording mark of the user identifier, the recording mark comprises a first mark or a second mark, the first mark is used for indicating recording of the user identifier, and the second mark is used for indicating not recording of the user identifier;
Generating log data corresponding to the target program interface by adopting a processing function, wherein the log data comprises:
And if the record mark is the first mark, acquiring a user identifier in the user information by adopting a processing function as log data.
In another possible implementation manner, the configuration information further includes an authentication manner, where the authentication manner is a single sign-on manner or a password sign-on manner, and if the record mark is a first mark, a processing function is used to obtain a user identifier in the user information, and the user identifier is used as log data, and includes:
if the record mark is a first mark and the identity verification mode is a single sign-on mode, acquiring a user identification from a first field in user information, wherein the first field is generated by a single sign-on system and is used as log data; or alternatively
If the record mark is the first mark and the authentication mode is the password login mode, the user identification is obtained from a second field in the user information and used as log data, and the second field is generated by the password login system.
In another possible implementation, the processing function includes a storage path of a log file, stores log data, and includes:
if the log file is created under the storage path, writing the log data into the log file; or alternatively
If the log file is not created under the storage path, creating the log file under the storage path, and writing the log data into the log file.
In another possible implementation, the configuration information further includes a recording period, the processing function includes a storage path of the log file, and storing the log data includes:
Acquiring a first log file with latest creation time under a storage path;
when the difference between the creation time of the first log file and the generation time of the log data is not greater than the recording period, writing the log data into the first log file;
When the difference between the creation time of the first log file and the generation time of the log data is larger than the recording period, creating a second log file under the storage path, and writing the log data into the second log file.
In another possible implementation manner, the configuration information further includes a translation list, where the translation list includes text data of a plurality of program interfaces, the text data is used to describe operations corresponding to the program interfaces, and the processing function is used to generate log data corresponding to the target program interfaces, and the method includes:
and acquiring text data of the target program interface in the translation list as log data by adopting a processing function.
FIG. 3 is a flowchart illustrating another log data processing method, see FIG. 3, for an electronic device, according to an exemplary embodiment, comprising the steps of:
In step 301, the electronic device obtains configuration information, an interception interface, and a processing function.
The operating system provides a program interface, also called an application program interface API (Application Programming Interface), which is a set of definitions, programs and protocols, through which the electronic device programs communicate with each other to provide data sharing for various programs. The programmer requests the operating system to provide services through a program interface in the program, for example, various functions such as uploading pictures, opening cameras, searching keywords, positioning, acquiring address book information, sending messages and the like can be realized by calling different types of program interfaces, and the program interface can also be other types of interfaces without limitation.
In order to know the operation behavior of the user based on the program interface, so that the corresponding program is improved and perfected according to the operation behavior of the user, the program interface can be monitored, and the operation of calling the program interface is recorded. In the embodiment of the disclosure, the electronic device acquires the configuration information, the interception interface and the processing function, and generates log data for recording the operation of calling the program interface through the configuration information, the interception interface and the processing function.
The processing function is used for monitoring any program interface and generating log data.
The interception interface is used for intercepting a calling instruction of any program interface and calling a processing function according to the calling instruction.
The configuration information is used to specify the operations performed by the processing functions. The configuration information comprises a plurality of program interfaces which need to be monitored by the processing function, and the program interfaces can be set by a developer and can be set by default by the electronic equipment. In addition, the configuration information may further set other information to specify an operation performed by the processing function, for example, may also specify a type of data generated by the processing function, a storage manner of the data, and the like.
The processing functions, the configuration information and the interception interface acquired by the electronic device may be uploaded to the electronic device by a developer or sent to the electronic device by other electronic devices.
In step 302, when a call instruction to a target program interface of the plurality of program interfaces is triggered, the electronic device intercepts the call instruction by intercepting the interface, and calls a processing function according to an interface identifier of the target program interface.
The electronic equipment can provide different services through the multiple program interfaces, when the electronic equipment is required to provide a certain service, a call instruction of a target program interface corresponding to the service is triggered, the electronic equipment intercepts the call instruction through the interception interface, and then a processing function is called. The target program interface is any one of a plurality of program interfaces.
In one possible implementation manner, the electronic device intercepts the call instruction through the interception interface, and determines whether the target program interface belongs to any program interface of the plurality of program interfaces in the configuration information. When the target program interface is any one of a plurality of program interfaces, the target program interface is determined to need to be monitored. The electronic device invokes the processing function. When the target program interface is not any program interface in the plurality of program interfaces, the electronic device does not need to call a processing function if the target program interface is determined to be unnecessary to monitor.
In one possible implementation, the configuration information includes a third flag or a fourth flag. When the electronic equipment intercepts the call instruction through the interception interface, judging whether the configuration information comprises a third mark or a fourth mark. If the configuration information includes a third flag, which indicates that any program interface needs to be monitored, that is, the target program interface needs to be monitored, the electronic device invokes the processing function. If the configuration information includes a fourth flag indicating that monitoring is required for a plurality of program interfaces in the configuration information, determining whether the target program interface belongs to any program interface in the plurality of program interfaces in the configuration information according to the interface identifier.
In another possible implementation manner, when the electronic device intercepts a call instruction of the target program interface through the interception interface, the electronic device calls the processing function first, then executes the call instruction, and calls the target program interface. Or when the electronic equipment intercepts the calling instruction of the target program through the interception interface, the calling instruction is executed first, the target program interface is called, and then the processing function is called to generate the log data.
In another possible implementation, each program interface has an interface identification, which may be a name, number, etc. of the program interface. In this embodiment, the call instruction carries an interface identifier of the target program interface, and the electronic device intercepts the call instruction through the interception interface, and transmits the interface identifier of the target program interface to the processing function to call the processing function. And the processing function determines the target program interface according to the interface identification and generates log data of the target program interface. When the processing function receives any interface identifier, log data corresponding to any interface identifier can be generated, that is, the processing function has universality, and the processing function can be adopted to generate log data corresponding to any program interface.
In step 303, when the configuration information further includes a record mark of the user identifier, if the record mark is the first mark, the electronic device acquires the user identifier in the user information as log data by using the processing function.
The call instruction to the target program interface also carries user information, where the user information refers to information of a user who calls the target program interface, and the user information includes a user identifier, where the user identifier is used to represent the identity of the user, and may be a user account number, a phone number, a user nickname, an email box, and so on.
The configuration information includes a record flag of the user identifier, and the record flag is used for specifying the operation executed by the processing function, and specifying whether the processing function records the user identifier in the user information, that is, whether the user triggering the program interface is recorded. The recording mark comprises a first mark or a second mark, wherein the first mark is used for indicating that the user identification is recorded, and the second mark is used for indicating that the user identification is not recorded.
If the record mark is the first mark, the electronic equipment determines that the user mark needs to be recorded, and then a processing function is adopted to acquire the user mark in the user information as log data. If the record mark is the second mark, the electronic equipment determines that the user identification does not need to be recorded, and the electronic equipment does not need to acquire the user identification in the user information by adopting a processing function.
In a possible implementation, the configuration information further includes an authentication means for defining an operation performed by the processing function, and a means for acquiring a user identifier in the user information by using the processing function is defined. The identity verification mode is a single sign-on mode or a password sign-on mode.
If the record mark is the first mark and the identity verification mode is the single sign-on mode, the user identification is obtained from the first field in the user information and used as log data. Wherein the first field is generated by a single sign-on system.
Single sign-on refers to that in multiple application systems, a user only needs to sign-on once to access all mutually trusted application systems. An authentication device is configured in the single sign-on system, and when a user logs in a certain application system, after the user passes the login authentication of the authentication device, the user can access any other application system within the authority range without repeatedly performing the login authentication.
For example, the application system 1 is associated with the application system 2, and performs login by a single sign-on method. When a user logs in for the first time, that is, accesses the application system 1, the user provides login information, which includes a user identifier, a login password, and the like, and according to the user information provided by the user, the authentication device of the single sign-on system performs identity verification on the user, and if the identity of the user passes the verification, the authentication device allows the user to log in to the application system 1 and returns an authenticated Token to the user. When the user logs in for the second time, i.e. accesses the application system 2, the Token is carried in a login request, and after receiving the login request, the application system 2 sends the Token to the authentication device for verification, so as to check the validity of the Token. If verified, the user can access the application system 2 without providing login information.
Therefore, when the authentication mode is a single sign-on mode and the authentication equipment successfully verifies Token in the login request, the user identification is used as a first field according to the login information of the user, user information comprising the first field is generated, and the user information is returned to the user.
If the record mark is the first mark and the authentication mode is the password login mode, the user identification is obtained from the second field in the user information and used as log data. Wherein the second field is generated by the password entry system.
The password login mode is that a user logs in by providing login information such as a user identifier, a user password and the like, and the password login system takes the user identifier as a second field according to the login information provided by the user to generate user information comprising the second field. Therefore, when the authentication mode is the password login mode, the electronic device acquires the user identification from the second field in the user information as log data.
The user password can be a static password set by the user, such as a digital password, a pattern password and the like, can also be a biological password of fingerprints, irises, faces and the like, or can also be a dynamic password issued to the user by the electronic equipment, such as a short message verification code and the like. When the electronic equipment verifies that the password provided by the user is correct, login based on the user identification is allowed, and corresponding login information is stored.
In step 304, when the configuration information further includes a translation list, the electronic device obtains text data of the object program interface in the translation list as log data by using the processing function.
The configuration information also comprises a translation list, wherein the translation list comprises text data of a plurality of program interfaces, and the text data is used for describing operations corresponding to the program interfaces. When the electronic equipment monitors the target program interface by adopting a processing function, text data of the target program interface in the translation list is obtained, and the text data is used as log data corresponding to the target program interface. The operation of the calling program interface is translated into text data capable of intuitively reflecting the operation behaviors of the user, and the text data is used as log data, so that the readability of the log data can be improved.
For example, the program interface 1 is used for performing an operation of uploading a picture, the program interface 2 is used for performing an operation of opening a camera, the program interface 3 is used for performing an operation of retrieving keywords, and the program interface 4 is used for performing an operation of transmitting a message. The translation list may be as shown in table 1 below.
TABLE 1
Program interface 1 Program interface 2 Program interface 3 Program interface 4
Uploading pictures Opening the camera Search key Sending messages
It should be noted that, steps 303 to 304 are all processes of generating log data corresponding to the interface identifier by using the processing function, that is, a process of generating log data corresponding to the target program interface. The embodiment of the present disclosure will be described by taking the example of performing step 303 first and then performing step 304. In another embodiment, step 304 may be performed first, then step 303 may be performed, or step 303 and step 304 may be performed simultaneously, or step 303 and step 304 may not be performed.
In addition, the step 304 illustrates the case where the user identifier is used as the log data, the step 305 illustrates the case where the text data is used as the log data, and in another embodiment, other types of data generated when the program interface is called may be used as the log data, for example, when the program interface performs operations of uploading a picture, searching a keyword, sending a message, etc., a processing function may be used to obtain a picture, a keyword, a message, etc., provided by the user, and the picture, the keyword, the message may be used as the log data.
In step 305, when the configuration information further includes a recording period, the electronic device writes the log data into the corresponding log file according to the recording period.
The configuration information may further include a recording period, where the recording period specifies a storage period of the log data, for example, the recording period may be one day, one week, one month, or the like. The electronic equipment monitors the target program interface by adopting a processing function, generates log data corresponding to the target program interface, determines the recording period of the target program interface in the configuration information, and writes the log data into a log file corresponding to the recording period.
The process of writing the log data into the corresponding log file according to the recording period includes: the electronic equipment acquires a first log file with the latest creation time under the storage path, and writes the log data into the first log file when the difference between the creation time of the first log file and the generation time of the log data is not greater than a recording period. When the difference between the creation time of the first log file and the generation time of the log data is larger than the recording period, creating a second log file under the storage path, and writing the log data into the second log file.
The processing function comprises a storage path of log files, the storage path comprises a plurality of log files, each log file corresponds to a recording period, and only log data generated in the recording period is allowed to be written. The electronic device obtains a first log file with the latest creation time under the storage path, that is, the first log file is the log file which is newly created under the storage path. The electronic equipment acquires the creation time of the first log file and the generation time of the log data, and determines the difference value between the creation time and the generation time. When the difference is not greater than the recording period, the creation time and the generation time are in the same recording period, namely, the log data is in the range that the first log file is allowed to be written, and the log data is written into the first log file. When the difference is greater than the recording period, the creation time and the generation time are not in the same recording period, namely, the log data is not in the range of the first log file allowing writing, a second log file is created under the storage path, the recording period corresponding to the second log file is the same as the recording period corresponding to the log data, and the log data is written into the second log file.
For example, the recording period is one day, that is, one log file corresponds to log data generated within 24 hours. If the creation time of the first log file is 2019, 10, 18, and 6, the generation time of the log data is 2019, 10, 19, and 21 hours or less than 24 hours of the recording period, the log data is written into the first log file. Or the creation time of the first log file is 2019, 10, 18 and 11, and the difference between the creation time and the creation time is 26 hours and is greater than the recording period of 24 hours, so that a second log file needs to be created under the storage path and the log data needs to be written into the second log file.
In one possible implementation, the processing function includes a storage path for the log file, writes the log data to the log file if the log file has been created under the storage path, creates the log file under the storage path if the log file has not been created under the storage path, and writes the log data to the log file.
The electronic equipment uniformly stores the log data generated at different times in a log file. When the processing function is adopted to generate the log data, the electronic equipment queries the log file under the storage path of the log file, and if the log file is queried, the log data is written into the log file after the log file is created under the storage path. If the log file is not queried, the log data corresponding to the target program interface is generated according to the processing function for the first time, so that the log file is not created under the storage path, the electronic equipment creates the log file under the storage path, and the log data is written into the log file.
In another possible implementation, the processing function includes a log folder identifier, where the log folder identifier is used to uniquely identify a log folder, and may be a name of the log folder, etc. The log folder identifier corresponds to a log folder for storing log files.
When the electronic equipment adopts a processing function to generate log data, inquiring whether a log folder corresponding to the log folder identification is created, if so, inquiring a corresponding log file in the log folder, and writing the log data into the log file; if the corresponding log folder of the log folder identification is not queried, creating a log folder according to the log folder identification, creating a corresponding log file in the log folder, and writing the log data into the file still in the day.
The above step 305 illustrates the process of storing the log data by writing the log data into the log file, but other methods may be used to store the log data, which is not limited in this embodiment.
According to the method provided by the embodiment of the disclosure, configuration information, the interception interfaces and the processing functions are obtained, when the call instruction of the target program interfaces in the program interfaces is triggered, the call instruction is intercepted through the interception interfaces, the processing functions are called, the processing functions are adopted, log data corresponding to the target program interfaces are generated, the log data are stored, and the log data are used for recording the operation of calling the target program interfaces. The calling instructions of other program interfaces are intercepted through the interception interface, and the processing function is called to monitor the other program interfaces to generate the log function, so that the monitoring of a plurality of program interfaces can be realized by calling one processing function, the processing function does not need to be written in each program interface needing to be monitored, the universality of the processing function is improved, the operation is simple and convenient, the manpower and time can be saved, and the operation efficiency is improved.
And the configuration information also comprises a record mark of the user identifier, and when the record mark is the first mark, the processing function is adopted to acquire the user identifier in the user information as log data. Therefore, each piece of log data of the target program interface corresponds to one user identifier, different users using the target program interface can be distinguished through the user identifier, the information quantity of the log data is improved, and the operation behaviors of different users can be analyzed conveniently.
And the configuration information also comprises a recording period, and the log data is written into the corresponding log file according to the recording period. Therefore, different recording periods can be set according to different application scenes, log data can be conveniently inquired according to the recording periods, and the regularity of log files is enhanced.
The configuration information also comprises text data of a plurality of program interfaces, the text data is used for describing operations corresponding to the program interfaces, and a processing function is adopted to obtain the text data of the target program interfaces in the translation list as log data. The operation of the calling program interface is translated into text data which can intuitively reflect the operation behaviors of the user, so that the text data is used as log data, and the readability of the log data is enhanced.
Fig. 4 is a flowchart illustrating another log data processing method according to an exemplary embodiment, referring to fig. 4, when it is required to record the execution of a program interface, configuration information, an interception interface, and a processing function are acquired.
1. When a call instruction to a target program interface is intercepted, the electronic equipment inquires configuration information, and if the configuration information comprises a third mark, the next step is executed; if the configuration information includes the fourth mark, it is determined whether the target program interface is a plurality of program interfaces in the configuration information, if so, the next step is executed, and if not, the processing is stopped.
2. The electronic equipment inquires whether a log folder exists, and if the log folder exists, the next step is executed; if no log folder exists, a log folder is created.
3. The electronic equipment inquires an identity verification mode in the configuration information, if the identity verification mode is single sign-on, a user identification in a first field is obtained from the user information, and the user identification is used as log data; if the authentication mode is password login, the user identification in the second field is obtained from the user information, and the user identification is used as log data.
4. The electronic device inquires whether the configuration information comprises a translation list, and if the configuration information does not comprise the translation list, the next step is executed; if the translation list is included, text data of the target program interface in the translation list is acquired as log data.
5. The electronic equipment inquires the recording period in the configuration information, if the recording period is one day, the log data is written into the log file of the current day, and if the recording period is one week, the log data is written into the log file of the current week.
FIG. 5 is a block diagram illustrating a log data processing apparatus according to an example embodiment. Referring to fig. 5, the apparatus includes an acquisition unit 501, a relationship establishment unit 502, a function call unit 503, a data generation unit 504, and a data storage unit 505.
An obtaining unit 501 configured to obtain configuration information, an interception interface, and a processing function, the configuration information including a plurality of program interfaces;
a function calling unit 502 configured to intercept a call instruction through an interception interface when triggering the call instruction to a target program interface among the plurality of program interfaces, call a processing function, the target program interface being any one of the plurality of program interfaces;
the data generating unit 503 is configured to generate log data corresponding to the target program interface by using a processing function, where the log data is used for recording an operation of calling the target program interface.
The data storage unit 504 is configured to store log data.
In one possible implementation, referring to fig. 6, the calling instruction carries an interface identifier of the target program interface, and the function calling unit 502 is further configured to call the processing function according to the interface identifier of the target program interface;
the data generating unit 503 is further configured to generate log data corresponding to the interface identifier by using a processing function.
In one possible implementation manner, the calling instruction carries user information, the configuration information further comprises a recording mark of the user identifier, the recording mark comprises a first mark or a second mark, the first mark is used for indicating recording of the user identifier, and the second mark is used for indicating not recording of the user identifier;
The data generation unit 503 includes:
the identity acquisition subunit 5031 is configured to acquire, as log data, the user identity in the user information using the processing function if the record flag is the first flag.
In another possible implementation manner, the configuration information further includes an authentication manner, where the authentication manner is a single sign-on manner or a password sign-on manner, and the data generating unit 503 includes:
A first obtaining subunit 5032 configured to obtain, if the record flag is the first flag and the authentication mode is the single sign-on mode, the user identifier from a first field in the user information, as log data, the first field being generated by the single sign-on system; or alternatively
The second obtaining subunit 5033 is configured to obtain, if the record flag is the first flag and the authentication mode is the password login mode, the user identifier from a second field in the user information, as log data, the second field being generated by the password login system.
In another possible implementation, the processing function includes a storage path of a log file, and the data storage unit 504 includes:
a first storage subunit 5041 configured to write log data to the log file if the log file has been created under the storage path; or alternatively
The second storage subunit 5042 is configured to create a log file under the storage path and write log data to the log file if the log file has not been created under the storage path.
In another possible implementation, the configuration information further includes a recording period, the processing function includes a storage path of the log file, and the data storage unit 504 includes:
a file acquisition subunit 5043 configured to acquire a first log file having the latest creation time under the storage path;
A third storage subunit 5044 configured to write the log data to the first log file when the difference between the creation time of the first log file and the generation time of the log data is not greater than the recording period;
The fourth storage sub-unit 5045 is configured to create a second log file under the storage path and write log data to the second log file when a difference between the creation time of the first log file and the generation time of the log data is greater than the recording period.
In another possible implementation manner, the configuration information further includes a translation list, where the translation list includes text data of a plurality of program interfaces, the text data is used to describe operations corresponding to the program interfaces, and the data generating unit 503 includes:
the text retrieval subunit 5034 is configured to retrieve text data of the object program interface in the translation list as log data using the processing function.
Fig. 7 shows a block diagram of a terminal 700 provided in an exemplary embodiment of the present disclosure. The terminal 700 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4), a notebook computer, or a desktop computer. Terminal 700 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, etc.
In general, the terminal 700 includes: one or more processors 701, and one or more memories 702.
Processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 701 may be implemented in at least one hardware form of DSP (DIGITAL SIGNAL Processing), FPGA (Field-Programmable gate array), PLA (Programmable Logic Array ). The processor 701 may also include a main processor and a coprocessor, wherein the main processor is a processor for processing data in an awake state, and is also called a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 701 may also include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
Memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include volatile memory or non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 702 is used to store at least one instruction for being possessed by processor 701 to implement the log data processing methods provided by the method embodiments of the present disclosure.
In some embodiments, the terminal 700 may further optionally include: a peripheral interface 703 and at least one peripheral. The processor 701, the memory 702, and the peripheral interface 703 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 703 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 704, touch display 705, camera 706, audio circuitry 707, positioning component 708, and power supply 709.
A peripheral interface 703 may be used to connect I/O (Input/Output) related at least one peripheral device to the processor 701 and memory 702. In some embodiments, the processor 701, memory 702, and peripheral interface 703 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 701, the memory 702, and the peripheral interface 703 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 704 is configured to receive and transmit RF (Radio Frequency) signals, also referred to as electromagnetic signals. The radio frequency circuitry 704 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 704 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 704 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 13G), wireless local area networks, and/or WiFi (WIRELESS FIDELITY ) networks. In some embodiments, the radio frequency circuitry 704 may also include NFC (NEAR FIELD Communication) related circuitry, which is not limited by the present disclosure.
The display screen 705 is used to display a UI (useinterface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 705 is a touch display, the display 705 also has the ability to collect touch signals at or above the surface of the display 705. The touch signal may be input to the processor 701 as a control signal for processing. At this time, the display 705 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 705 may be one, providing a front panel of the terminal 700; in other embodiments, the display 705 may be at least two, respectively disposed on different surfaces of the terminal 700 or in a folded design; in still other embodiments, the display 705 may be a flexible display disposed on a curved surface or a folded surface of the terminal 700. Even more, the display 705 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The display 705 may be made of LCD (Liquid CRYSTAL DISPLAY), OLED (Organic Light-emitting diode) or other materials.
The camera assembly 706 is used to capture images or video. Optionally, the camera assembly 706 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 706 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 707 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 701 for processing, or inputting the electric signals to the radio frequency circuit 704 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 700. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 707 may also include a headphone jack.
The location component 708 is operative to locate the current geographic location of the terminal 700 for navigation or LBS (Location Based Service, location-based services). The positioning component 708 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
A power supply 709 is used to power the various components in the terminal 700. The power supply 709 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 709 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 700 further includes one or more sensors 710. The one or more sensors 710 include, but are not limited to: acceleration sensor 711, gyroscope sensor 712, pressure sensor 713, fingerprint sensor 714, optical sensor 715, and proximity sensor 716.
The acceleration sensor 711 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 700. For example, the acceleration sensor 711 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 701 may control the touch display screen 705 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 711. The acceleration sensor 711 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 712 may detect a body direction and a rotation angle of the terminal 700, and the gyro sensor 712 may collect a 3D motion of the user to the terminal 700 in cooperation with the acceleration sensor 711. The processor 701 may implement the following functions based on the data collected by the gyro sensor 712: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 713 may be disposed at a side frame of the terminal 700 and/or at a lower layer of the touch display screen 705. When the pressure sensor 713 is disposed at a side frame of the terminal 700, a grip signal of the user to the terminal 700 may be detected, and the processor 701 performs left-right hand recognition or quick operation according to the grip signal collected by the pressure sensor 713. When the pressure sensor 713 is disposed at the lower layer of the touch display screen 705, the processor 701 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 714 is used to collect a fingerprint of the user, and the processor 701 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 701 to have associated sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 714 may be provided on the front, back or side of the terminal 700. When a physical key or vendor Logo is provided on the terminal 700, the fingerprint sensor 714 may be integrated with the physical key or vendor Logo.
The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, the processor 701 may control the display brightness of the touch display 705 based on the ambient light intensity collected by the optical sensor 715. Specifically, when the intensity of the ambient light is high, the display brightness of the touch display screen 705 is turned up; when the ambient light intensity is low, the display brightness of the touch display screen 705 is turned down. In another embodiment, the processor 701 may also dynamically adjust the shooting parameters of the camera assembly 706 based on the ambient light intensity collected by the optical sensor 715.
A proximity sensor 716, also referred to as a distance sensor, is typically provided on the front panel of the terminal 700. The proximity sensor 716 is used to collect the distance between the user and the front of the terminal 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front face of the terminal 700 gradually decreases, the processor 701 controls the touch display 705 to switch from the bright screen state to the off screen state; when the proximity sensor 716 detects that the distance between the user and the front surface of the terminal 700 gradually increases, the processor 701 controls the touch display screen 705 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 7 is not limiting of the terminal 700 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 8 is a schematic structural diagram of a server according to an embodiment of the present disclosure, where the server 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 801 and one or more memories 802, where at least one instruction is stored in the memories 802, and the at least one instruction is loaded and executed by the processor 801 to implement the log data processing method provided in the foregoing method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, which when executed by a processor of a computer device, enables the computer device to perform the steps performed by the computer device in the log data processing method described above.
In an exemplary embodiment, a computer program product is also provided, which, when executed by a processor of a computer device, enables the computer device to perform the steps performed by the computer device in the log data processing method described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A method of log data processing, the method comprising:
acquiring configuration information, an interception interface and a processing function, wherein the configuration information comprises a plurality of program interfaces and a translation list, the translation list comprises text data of the program interfaces, and the text data is used for describing operations corresponding to the program interfaces;
When a call instruction to a target program interface is triggered, intercepting the call instruction through the interception interface, wherein the call instruction carries an interface identifier of the target program interface, and the interface identifier is the name or the number of the target program interface;
determining whether the target program interface belongs to any program interface in a plurality of program interfaces in the configuration information;
When the target program interface is any one of the program interfaces, determining that the target program interface needs to be monitored, transmitting an interface identifier of the target program interface to the processing function to call the processing function, wherein the processing function is used for determining the program interface corresponding to the interface identifier according to the interface identifier when receiving any one interface identifier, and generating log data of the program interface;
Acquiring text data of the target program interface in the translation list by adopting the processing function, and taking the text data as log data corresponding to the target program interface, wherein the log data is used for recording the operation of calling the target program interface;
and storing the log data in a storage path included by the processing function by adopting the processing function.
2. The method of claim 1, wherein the call instruction carries user information, the configuration information further comprising a record flag for the user identification, the record flag comprising a first flag for indicating recording the user identification or a second flag for indicating not recording the user identification;
The method for generating the log data corresponding to the target program interface can be replaced by:
And if the record mark is the first mark, acquiring a user identifier in the user information by adopting the processing function as log data.
3. The method of claim 2, wherein the configuration information further includes an authentication mode, the authentication mode being a single sign-on mode or a password sign-on mode, and the obtaining, by using the processing function, the user identifier in the user information as log data if the record flag is the first flag includes:
if the record mark is the first mark and the identity verification mode is the single sign-on mode, acquiring a user identification from a first field in the user information, wherein the first field is generated by a single sign-on system and is used as log data; or alternatively
And if the record mark is the first mark and the authentication mode is the password login mode, acquiring a user identification from a second field in the user information, wherein the second field is generated by a password login system and is used as log data.
4. The method of claim 1, wherein the processing function includes a storage path for a log file, and wherein storing the log data in the storage path included in the processing function includes:
writing the log data into the log file if the log file has been created under the storage path; or alternatively
If the log file is not created under the storage path, creating the log file under the storage path, and writing the log data into the log file.
5. The method of claim 1, wherein the configuration information further includes a recording period, wherein the processing function includes a storage path for a log file, wherein the storing the log data in the storage path included in the processing function includes:
acquiring a first log file with latest creation time under the storage path;
writing the log data into the first log file when the difference between the creation time of the first log file and the generation time of the log data is not greater than the recording period;
And when the difference value between the creation time of the first log file and the generation time of the log data is larger than the recording period, creating a second log file under the storage path, and writing the log data into the second log file.
6. A log data processing apparatus, the apparatus comprising:
An obtaining unit configured to obtain configuration information, an interception interface and a processing function, wherein the configuration information comprises a plurality of program interfaces and a translation list, the translation list comprises text data of the plurality of program interfaces, and the text data is used for describing operations corresponding to the program interfaces;
The function calling unit is configured to intercept a calling instruction of a target program interface through the intercepting interface when the calling instruction of the target program interface is triggered, wherein the calling instruction carries an interface identifier of the target program interface, and the interface identifier is a name or a number of the target program interface;
The function calling unit is further configured to determine whether the target program interface belongs to any one of a plurality of program interfaces in the configuration information;
The function calling unit is further configured to determine that the target program interface needs to be monitored when the target program interface is any one of the plurality of program interfaces, transmit an interface identifier of the target program interface to the processing function to call the processing function, and when the processing function receives any one interface identifier, determine a program interface corresponding to the interface identifier according to the interface identifier, and generate log data of the program interface;
The data generation unit is configured to acquire text data of the target program interface in the translation list by adopting the processing function, and take the text data as log data corresponding to the target program interface, wherein the log data is used for recording the operation of calling the target program interface;
and a data storage unit configured to store the log data in a storage path included in the processing function, using the processing function.
7. The apparatus of claim 6, wherein the call instruction carries user information, the configuration information further comprising a record flag for a user identification, the record flag comprising a first flag for indicating recording of a user identification or a second flag for indicating not recording of a user identification;
the data generation unit includes:
And the identification acquisition subunit is configured to acquire the user identification in the user information as log data by adopting the processing function if the record mark is the first mark.
8. The apparatus of claim 7, wherein the configuration information further includes an authentication mode, the authentication mode being a single sign-on mode or a password sign-on mode, the data generating unit comprising:
the first acquisition subunit is configured to acquire a user identifier from a first field in the user information as log data if the record mark is the first mark and the identity verification mode is the single sign-on mode, wherein the first field is generated by a single sign-on system; or alternatively
And the second acquisition subunit is configured to acquire the user identification from a second field in the user information as log data when the record mark is the first mark and the authentication mode is the password login mode, wherein the second field is generated by a password login system.
9. The apparatus of claim 6, wherein the processing function includes a storage path for a log file, and wherein the data storage unit includes:
a first storage subunit configured to write the log data into the log file if the log file has been created under the storage path; or alternatively
And a second storage subunit configured to create a log file under the storage path and write the log data into the log file if the log file has not been created under the storage path.
10. The apparatus of claim 6, wherein the configuration information further includes a recording period, the processing function includes a storage path of a log file, and the data storage unit includes:
a file acquisition subunit configured to acquire a first log file with the latest creation time under the storage path;
A third storage subunit configured to write the log data into the first log file when a difference between a creation time of the first log file and a generation time of the log data is not greater than the recording period;
and a fourth storage subunit configured to create a second log file under the storage path and write the log data into the second log file when a difference between the creation time of the first log file and the generation time of the log data is greater than the recording period.
11. An electronic device for processing log data, the electronic device comprising:
One or more processors;
Volatile or non-volatile memory for storing the one or more processor-executable commands;
Wherein the one or more processors are configured to perform the log data processing method of any one of claims 1 to 5.
12. A non-transitory computer readable storage medium, which when executed by a processor of a computer device, causes the computer device to perform the log data processing method of any one of claims 1 to 5.
CN201911075979.8A 2019-11-06 2019-11-06 Log data processing method and device, electronic equipment and storage medium Active CN110825465B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911075979.8A CN110825465B (en) 2019-11-06 2019-11-06 Log data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911075979.8A CN110825465B (en) 2019-11-06 2019-11-06 Log data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110825465A CN110825465A (en) 2020-02-21
CN110825465B true CN110825465B (en) 2024-05-07

Family

ID=69552992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911075979.8A Active CN110825465B (en) 2019-11-06 2019-11-06 Log data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110825465B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913847B (en) * 2020-07-21 2021-04-27 上海冰鉴信息科技有限公司 Method and system for acquiring remote task execution progress
CN115033910B (en) * 2021-11-12 2023-04-07 荣耀终端有限公司 Access record display method and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156300A (en) * 2013-05-14 2014-11-19 利德科技发展有限公司 Log management system and log management method
CN104881284A (en) * 2015-05-22 2015-09-02 国云科技股份有限公司 Efficient log operating method
CN106682119A (en) * 2016-12-08 2017-05-17 杭州销冠网络科技有限公司 System and method for asynchronous data synchronization on basis of http service aspect and log system
WO2018201978A1 (en) * 2017-05-04 2018-11-08 平安科技(深圳)有限公司 Interface call data processing method, apparatus, computer device and storage medium
CN108804644A (en) * 2018-06-05 2018-11-13 中国平安人寿保险股份有限公司 Interface log storing method, device, computer equipment and storage medium
CN109271331A (en) * 2018-08-20 2019-01-25 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of log
CN109739735A (en) * 2018-12-04 2019-05-10 东软集团股份有限公司 Log generation method and device
CN110096419A (en) * 2019-04-22 2019-08-06 厦门网宿有限公司 Acquisition methods, interface log management server and the service server of interface log
CN110134615A (en) * 2019-04-10 2019-08-16 百度在线网络技术(北京)有限公司 The method and device of application program acquisition daily record data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014204455A1 (en) * 2013-06-19 2014-12-24 Hewlett-Packard Development Company, L.P. Unifying application log messages using runtime instrumentation

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156300A (en) * 2013-05-14 2014-11-19 利德科技发展有限公司 Log management system and log management method
CN104881284A (en) * 2015-05-22 2015-09-02 国云科技股份有限公司 Efficient log operating method
CN106682119A (en) * 2016-12-08 2017-05-17 杭州销冠网络科技有限公司 System and method for asynchronous data synchronization on basis of http service aspect and log system
WO2018201978A1 (en) * 2017-05-04 2018-11-08 平安科技(深圳)有限公司 Interface call data processing method, apparatus, computer device and storage medium
CN108804644A (en) * 2018-06-05 2018-11-13 中国平安人寿保险股份有限公司 Interface log storing method, device, computer equipment and storage medium
CN109271331A (en) * 2018-08-20 2019-01-25 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of log
CN109739735A (en) * 2018-12-04 2019-05-10 东软集团股份有限公司 Log generation method and device
CN110134615A (en) * 2019-04-10 2019-08-16 百度在线网络技术(北京)有限公司 The method and device of application program acquisition daily record data
CN110096419A (en) * 2019-04-22 2019-08-06 厦门网宿有限公司 Acquisition methods, interface log management server and the service server of interface log

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于SSH2框架的数据日志插件研究;钱艳菊;CNKI优秀硕士学位论文全文库/基于SSH2框架的数据日志插件研究;20180415(第04期);全文 *

Also Published As

Publication number Publication date
CN110825465A (en) 2020-02-21

Similar Documents

Publication Publication Date Title
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN108874496B (en) Application management method, device, terminal, server and storage medium
CN112256320B (en) Version number generation method, device, terminal and storage medium
CN110851823B (en) Data access method, device, terminal and storage medium
CN111125601A (en) File transmission method, device, terminal, server and storage medium
CN110515962B (en) Method and device for caching data, electronic equipment and storage medium
CN110825465B (en) Log data processing method and device, electronic equipment and storage medium
CN110263525B (en) Equipment configuration method and device
CN112612539B (en) Data model unloading method and device, electronic equipment and storage medium
CN111008083B (en) Page communication method and device, electronic equipment and storage medium
CN111198922A (en) Game resource management method and device based on block chain
CN113377647B (en) Page processing method, device, server, terminal and readable storage medium
CN112597417B (en) Page updating method and device, electronic equipment and storage medium
CN114816600B (en) Session message display method, device, terminal and storage medium
CN113051015B (en) Page rendering method and device, electronic equipment and storage medium
CN113099378B (en) Positioning method, device, equipment and storage medium
CN113591090B (en) Program bug reporting method, device, equipment and storage medium
CN111158780B (en) Method, device, electronic equipment and medium for storing application data
CN112765571A (en) Authority management method, system, device, server and storage medium
CN114900559A (en) Management system, terminal, management method, and storage medium
CN110971692B (en) Method and device for opening service and computer storage medium
CN112988254B (en) Method, device and equipment for managing hardware equipment
CN111191254B (en) Access verification method, device, computer equipment and storage medium
CN110545299B (en) Content list information acquisition method, content list information providing method, content list information acquisition device, content list information providing device and content list information equipment
CN107948171B (en) User account management method and device

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