CN108038198B - Log processing method and device and electronic equipment - Google Patents

Log processing method and device and electronic equipment Download PDF

Info

Publication number
CN108038198B
CN108038198B CN201711319736.5A CN201711319736A CN108038198B CN 108038198 B CN108038198 B CN 108038198B CN 201711319736 A CN201711319736 A CN 201711319736A CN 108038198 B CN108038198 B CN 108038198B
Authority
CN
China
Prior art keywords
file
field
exported
log
generated
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
CN201711319736.5A
Other languages
Chinese (zh)
Other versions
CN108038198A (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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201711319736.5A priority Critical patent/CN108038198B/en
Publication of CN108038198A publication Critical patent/CN108038198A/en
Application granted granted Critical
Publication of CN108038198B publication Critical patent/CN108038198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a log processing method, a log processing device and electronic equipment, wherein the method comprises the following steps: exporting the updating content of the file to be exported in the log into a first temporary file, wherein the first temporary file comprises a first field for representing the updating content of the file to be exported, and the file to be exported comprises a second field for representing the content of the file to be exported; determining a first DDS source code file according to a second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported; according to the first DDS source code file, a file to be generated is constructed, and the file to be generated has a file structure; and copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field. The method can clearly and intuitively determine what updating operation is included in each file to be generated with the field.

Description

Log processing method and device and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a log processing method and apparatus, and an electronic device.
Background
In a business system, important data files generally need to be logged, and then the business system has a plurality of logs, and a plurality of files in the business system share one log, namely, each log stores the content of a plurality of files; the file structure of each file is different. For example, for one log a, the log a includes file 1 and file 2, but the file structures of content 1 and content 2 are different. In practical applications, the updated content in the file needs to be parsed from the log, and the updated content may be, for example, deleted content in the file, added content in the file, modified content in the file, and so on.
In the prior art, a log analysis tool provided in a service system may be used to extract update contents, and then the extracted update contents are placed in a large field, where one large field corresponds to the update contents after one update. For example, if the file a is inserted, the obtained large field 1 includes the insertion time, the operator information, the content of the insertion operation, the specific content in the file a, and the like; when the file a is deleted, the obtained large field 2 includes the deletion time, the operator information, the deleted content, the specific content in the file a, and the like.
However, in the prior art, when the update content is derived from the log, each update content is stored in one large field corresponding to each other, and the large fields display the update content in a fixed format, and an operator cannot clearly and intuitively determine what update operation is included in each large field.
Disclosure of Invention
The invention provides a log processing method, a log processing device and electronic equipment, which are used for solving the problem that an operator cannot clearly and intuitively determine what updating operation is included in each large field.
In one aspect, the present invention provides a log processing method, including:
exporting the updated content of a file to be exported in a log to a first temporary file, wherein the first temporary file comprises a first field representing the updated content of the file to be exported, and the file to be exported comprises at least one second field representing the whole content of the file to be exported;
determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported;
constructing a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure;
and copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field.
Further, the first temporary file further comprises at least one third field of log information for characterizing the log, wherein the log information comprises operation information of the updated content;
after the exporting of the updated content of the file to be exported in the log into the first temporary file, the method further includes:
removing a first field in the first temporary file to obtain a processed first temporary file;
determining a second DDS source code file corresponding to the first temporary file according to at least one third field of the processed first temporary file, wherein the second DDS source code file represents the structure of the processed first temporary file;
according to the first DDS source code file, a file to be generated is constructed, and the method comprises the following steps:
according to the first DDS source code file and the second DDS source code file, a file structure of a file to be generated is constructed;
copying a first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field, wherein the file to be generated comprises:
and copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the fields.
Further, the first temporary file includes N fields, where first N-1 fields of the N fields are the third field, a last field of the N fields is the first field, and N is a positive integer greater than or equal to 2.
Further, the log information further includes at least one of the following information: log code, log type, record number;
the operation information comprises at least one of the following information: operation type, operation date, operator information.
Further, determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, including:
exporting at least one second field in the file to be exported to a second temporary file, wherein the second temporary file comprises the at least one second field;
splicing file structure description information according to the rule information represented by the at least one second field in the second temporary file;
and constructing a first DDS source code file corresponding to the file to be exported according to the file structure description information.
Further, the log comprises a key entry;
the key-related parameter comprises at least one of the following parameters: file name, log selection condition, log entry encoding, export file format, and record length.
Further, after copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field, the method further includes:
receiving a display instruction sent by a user;
and displaying the file to be generated with the field according to the display instruction.
In still another aspect, the present invention provides a log processing apparatus, including:
the export module is used for exporting the updated content of the file to be exported in the log to a first temporary file, wherein the first temporary file comprises a first field for representing the updated content of the file to be exported, and the file to be exported comprises at least one second field for representing all the content of the file to be exported;
the first determining module is configured to determine, according to at least one second field of the file to be exported, a first DDS source code file corresponding to the file to be exported, where the first DDS source code file represents a file structure of the file to be exported;
the building module is used for building a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure;
and the copying module is used for copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field.
Further, the first temporary file further comprises at least one third field of log information for characterizing the log, wherein the log information comprises operation information of the updated content;
the device, still include:
the removing module is used for removing a first field in a first temporary file after the exporting module exports the updated content of the file to be exported in the log into the first temporary file, so as to obtain a processed first temporary file;
a second determining module, configured to determine, according to at least one third field of the processed first temporary file, a second DDS source code file corresponding to the first temporary file, where the second DDS source code file represents a structure of the processed first temporary file;
the building module is specifically configured to:
according to the first DDS source code file and the second DDS source code file, a file structure of a file to be generated is constructed;
the copy module is specifically configured to:
and copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the fields.
Further, the first temporary file includes N fields, where first N-1 fields of the N fields are the third field, a last field of the N fields is the first field, and N is a positive integer greater than or equal to 2.
Further, the log information further includes at least one of the following information: log code, log type, record number;
the operation information comprises at least one of the following information: operation type, operation date, operator information.
Further, the first determining module includes:
the export submodule is used for exporting at least one second field in the file to be exported to a second temporary file, and the second temporary file comprises the at least one second field;
the splicing submodule is used for splicing the file structure description information according to the rule information represented by the at least one second field in the second temporary file;
and the constructing submodule is used for constructing a first DDS source code file corresponding to the file to be exported according to the file structure description information.
Further, the log comprises a key entry;
the key-related parameter comprises at least one of the following parameters: file name, log selection condition, log entry encoding, export file format, and record length.
Further, the apparatus further comprises:
the receiving module is used for copying a first field in the first temporary file to the file to be generated according to the file structure of the file to be generated by the copying module to obtain the file to be generated with the field, and then receiving a display instruction sent by a user;
and the display module is used for displaying the file to be generated with the field according to the display instruction.
In another aspect, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a log processing method as described in any one of the above.
In another aspect, the present invention provides an electronic device, including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the log processing method of any of the above via execution of the executable instructions.
According to the log processing method, the log processing device and the electronic equipment, the updated content of the file to be exported in the log is exported into the first temporary file, wherein the first temporary file comprises a first field representing the updated content of the file to be exported, and the file to be exported comprises at least one second field representing the content of the file to be exported; determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported; constructing a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure; and copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field. Therefore, the file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained file to be generated with the field stores the updated content by the file structure of the file to be exported; therefore, the operator can clearly and intuitively determine what updating operation is included in each file to be generated with the field. And the obtained file to be generated with the fields is stored in the file structure of the file to be exported, so that messy codes can not appear when the file to be generated is displayed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic flowchart of a log processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another log processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a log processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another log processing apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of an entity of an electronic device according to an embodiment of the present invention.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terms to which the present invention relates will be explained first:
a service system: in this application, primarily referred to as a core business system, such as a business system having the IBM iSeries system, where IBM iSeries refers to IBM corporation's iSeries type mini-machines.
Logging: there will be several logs in the business system, and one log stores the contents of several files.
File: in this application reference to a file refers to a table of business systems.
The specific application scenario of the present invention is as follows. After the file of the service system is updated, in practical application, the update content in the file needs to be parsed from the log, where the update content includes, for example, deleted content in the file, added content in the file, modified content in the file, and the like; in the prior art, a log analysis tool is used for extracting update contents, and then the extracted update contents are put into a large field, wherein one large field corresponds to the update contents after one update; however, because the large fields display the update content in a fixed format, and the file formats of different files are different, the operator needs to interpret the update content represented by the large fields according to the file formats of different files, so that the operator cannot clearly and intuitively determine what update operation is included in each large field; moreover, because the log analysis method provided by the service system can only store the updated content in one large field, and does not store the updated content in the data structure type of the original file, in the actual operation process, after the updated content of files with different data types is encoded and compressed, the updated content displayed by a system tool often has messy codes.
The invention provides a log processing method and device and electronic equipment, and aims to solve the technical problems in the prior art.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a log processing method according to an embodiment of the present application. As shown in fig. 1, the method includes:
step 101, exporting the updated content of the file to be exported in the log to a first temporary file, wherein the first temporary file comprises a first field representing the updated content of the file to be exported, and the file to be exported comprises at least one second field representing all the content of the file to be exported.
In an alternative embodiment, the log includes a key-in; the key parameters include at least one of the following parameters: file name, log selection condition, log entry encoding, export file format, and record length.
In this embodiment, specifically, the log includes a plurality of files, and when the update content is exported for each file, the steps of this embodiment may be performed for each file, and the file that needs to export the update content is referred to as a file to be exported.
And performing update processing on one file in the log, wherein the update processing comprises deleting the content in the file, adding the content in the file, modifying the content in the file and the like. At least one key entry parameter and log information are included in a log, wherein the key entry parameter is at least one of the following: file name, log selection condition, log entry coding, export file format, record length and the like; the log selection condition refers to the date of log generation, the number of log entries, job information, and the like, the log entry code is set to "R", the export file format is TYPE3, and the record length is calculated according to the file structure of the file.
When the update content needs to be exported for the updated file, firstly, a Display journal (DSPJRN) command of a service system is called through an Application Programming Interface (API) Interface, the update content in the updated file is exported to a first temporary file, and the DSPJRN command indicates the content in the exported file; the updated file is the file to be exported, the file to be exported has file contents, and the file contents are stored in the file to be exported in the form of fields, so that the file to be exported comprises a plurality of second fields representing the whole contents of the file to be exported. During export, a first field characterizing the updated content of the file to be exported is exported into a first temporary file.
Step 102, determining a first Data Description Specification (DDS) source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents a file structure of the file to be exported.
In this embodiment, specifically, the second field of the file to be exported represents the rule information of the file structure of the file to be exported, so that the file structure description information of the file to be exported can be spliced according to the rule information represented by each second field of the file to be exported; then, the file structure description information is put into a first DDS source code file. And the obtained first DDS source code file represents the file structure of the file to be exported.
Step 103, constructing a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure.
In this embodiment, specifically, since the first DDS source code file represents the file structure of the file to be exported, the file structure of the file to be generated can be constructed according to the first DDS source code file, so as to obtain an empty file to be generated; at this time, the file to be generated has no specific content and is an empty file.
And step 104, copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated, so as to obtain the file to be generated with the field.
In this embodiment, specifically, a Copy File (CPYF) command of the service system is called, and the content of the first field in the first temporary File is copied to the File to be generated constructed in step 103, so as to obtain the File to be generated including the first field. The file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained file to be generated with the field stores the updated content in the file structure of the file to be exported.
In this embodiment, the update content of the file to be exported in the log is exported to a first temporary file, where the first temporary file includes a first field representing the update content of the file to be exported, and the file to be exported includes at least one second field representing the content of the file to be exported; determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported; constructing a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure; and copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field. Therefore, the file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained file to be generated with the field stores the updated content by the file structure of the file to be exported; therefore, the operator can clearly and intuitively determine what updating operation is included in each file to be generated with the field. And the obtained file to be generated with the fields is stored in the file structure of the file to be exported, so that messy codes can not appear when the file to be generated is displayed.
Fig. 2 is a schematic flowchart of another log processing method according to an embodiment of the present application. As shown in fig. 2, the method includes:
step 201, exporting the update content of the file to be exported in the log to a first temporary file, wherein the first temporary file includes a first field representing the update content of the file to be exported and at least one third field representing log information of the log, the log information includes operation information of the update content, and the file to be exported includes at least one second field representing the content of the file to be exported.
In an optional implementation manner, the first temporary file includes N fields, where first N-1 fields of the N fields are third fields, a last field of the N fields is a first field, and N is a positive integer greater than or equal to 2.
In an optional embodiment, the log information further includes at least one of the following information: log code, log type, record number; the operation information comprises at least one of the following information: operation type, operation date, operator information.
In this embodiment, specifically, the execution main body of this embodiment may be an electronic device or other devices that can execute this embodiment. The embodiment is described with the execution main body as the electronic device.
The electronic device performs an update process on a file in the log, where the update process includes deleting content in the file, adding content to the file, modifying content in the file, and so on. At least one key entry reference is included in a log, along with log information, wherein the key entry reference can be seen in step 101 of fig. 1. The log information includes operation information for updating the content, for example, after a file of the log is subjected to an operation for deleting the file content, the log information includes an operation type of deleting the content, an operation date of M months and M days, and an operator is a person A; for another example, after an operation of adding file content is performed on a certain file of the log, the log information includes the operation type of the added content, the operation date is M months and M days, and the operator is a person b; for another example, after an operation of modifying the content of a file is performed on a certain file in the log, the log information includes the operation type of the modified content, the operation date of the modified content is M months and M days, and the operator is staffing.
When the update content needs to be exported for a file subjected to update processing, firstly, the electronic device calls a DSPJRN command of a service system to export a log into a first temporary file, and at the moment, the DSPJRN command indicates the content of the export log; wherein, the updated file is the file to be exported. At the moment, the log information and the updated content in the file to be exported are exported into a first temporary file; in the exporting process, the electronic equipment exports a first field representing the updated content of the file to be exported into a first temporary file; in addition, since the log information is stored in the log in the form of fields, the electronic device can export each third field representing the log information to the first temporary file.
And the file to be exported has file contents which are stored in the file to be exported in the form of fields, so that a plurality of second fields which represent the whole contents of the file to be exported are included in the file to be exported.
The obtained first temporary file comprises N fields, wherein the first N-1 fields in the N fields are third fields, each field in the first N-1 fields is a third field, and the last field in the N fields is a first field.
For example, the log 1 and the file X to be exported in the log 1 are exported into the first temporary file Y, the obtained first temporary file Y includes 22 fields, the first 21 fields of the 22 fields are fields representing log information of the log 1, and the last field of the 22 fields represents updated content of the file X. For example, the 1 st field of the 22 fields represents the log code of the log 1, the 2 nd field represents the log type of the log 1, and the 3 rd field represents the record number of the log 1; the 22 nd field characterizes the deleted content of file X.
Step 202, removing the first field in the first temporary file to obtain the processed first temporary file.
In this embodiment, specifically, the first field in the first temporary file is removed, that is, the last field of the first temporary file is removed.
Step 203, determining a second DDS source code file corresponding to the first temporary file according to at least one third field of the processed first temporary file, wherein the second DDS source code file represents the structure of the processed first temporary file.
In this embodiment, specifically, after step 202, the processed first temporary file includes only third fields, each third field represents log information of the log, and preferably, one third field represents one type of log information.
Each third field in the first temporary file represents a storage structure of log information; the electronic equipment can splice a second DDS source code file according to the new rule represented by each third field table, and the second DDS source code file is in one-to-one correspondence with the first temporary file; at this time, the second DDS source code file represents the structure of the processed first temporary file, which is the storage structure of log information.
And 204, determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported.
In an optional embodiment, step 204 specifically includes the following steps:
step 2041, exporting at least one second field in the file to be exported to a second temporary file, wherein the second temporary file comprises at least one second field;
2042, splicing file structure description information according to the rule information represented by at least one second field in the second temporary file;
step 2043, according to the file structure description information, a first DDS source code file corresponding to the file to be exported is constructed.
In this embodiment, specifically, in step 204, first, the electronic device invokes a Display File Field Description (dspfd) command of the service system, and exports all the second fields in the File to be exported to one second temporary File in the temporary library. Further, all of the second fields are included in the second temporary file.
Then, the electronic equipment calls a program, and the program is used for reading the field in the second temporary file; then, the electronic equipment splices file structure description information according to the rule information represented by each second field; and then the electronic equipment can output the spliced file structure description information to a first DDS source code file, and the obtained first DDS source code file represents the file structure of the file to be exported. The first DDS source code file and the file to be exported are in one-to-one correspondence.
Step 205, according to the first DDS source code file and the second DDS source code file, a file structure of the file to be generated is constructed.
In this embodiment, specifically, the electronic device uses a table structure analysis tool and other processing techniques to join together a first DDS source code file representing a file structure of a file to be exported and a second DDS source code file representing a structure of a processed first temporary file to obtain a new file structure, and at this time, a file structure of a file to be generated can be obtained. At this time, the file to be generated has no field and is empty.
For example, 5 second fields are included in the file to be exported; the obtained first temporary file Y comprises 22 fields, the first 21 fields in the 22 fields are fields representing the log information of the log 1, and the last field in the 22 fields represents the update content of the file X; removing the last field of the first temporary file Y; constructing a first DDS source code file according to the 5 second fields, and constructing a second DDS source code file according to the 21 third fields; then, the first DDS source code file and the second DDS source code file are spliced together to obtain a new file structure; and then calling a Create Physical File (CRTPF) command given by the service system, and creating a new File Z by using the new File structure, wherein the new File Z is a File to be generated at the moment, but the new File Z has no content. The file structure of the new file Z at this time is a structure description of 26 fields.
And step 206, copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated, so as to obtain the file to be generated with the fields.
In this embodiment, specifically, the electronic device calls a CPYF command of the service system, and copies the first field and all the third fields in the first temporary file to the file to be generated constructed in step 205, so as to obtain the file to be generated including the first field and each of the third fields.
The file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained file to be generated with the field stores the updated content in the file structure of the file to be exported. Moreover, since the third field representing the log information is also copied to the file to be generated, the log information can be retained in the file to be generated, for example, information such as an operation type and an operation date of the updated content is retained, wherein the operation type refers to a deletion operation, an addition operation and a modification operation.
For example, the operation of deleting the content is performed on the file X to be exported; in the obtained file Z to be generated, the deleted specific content is saved in the file structure of the file X to be exported, and the deletion operation performed on the specific content is included in the file Z to be generated.
For another example, the content of the file X to be exported is increased; in the obtained file Z to be generated, the added specific content is saved in the file structure of the file X to be exported, and the file Z to be generated includes the adding operation performed on the specific content.
Step 207, receiving a display instruction sent by a user; and displaying the file to be generated with the field according to the display instruction.
In this embodiment, specifically, the user may send a display instruction to the electronic device through a component such as a mouse, a keyboard, or a touch screen, where the display instruction indicates that the electronic device needs to display the content in the file to be generated, which has the field. Then the electronic equipment displays the content in the file to be generated with the field on the screen, at this time, because the file to be generated with the field stores the updating content in the file structure of the file to be exported, the user can clearly and intuitively determine what updating operation is included in the file to be generated with the field.
In this embodiment, the update content of a file to be exported in a log is exported to a first temporary file, where the first temporary file includes a first field representing the update content of the file to be exported and at least one third field representing log information of the log, the log information includes operation information of the update content, and the file to be exported includes at least one second field representing the content of the file to be exported; removing a first field in the first temporary file to obtain a processed first temporary file; determining a second DDS source code file corresponding to the first temporary file according to at least one third field of the processed first temporary file, wherein the second DDS source code file represents the structure of the processed first temporary file; determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported; according to the first DDS source code file and the second DDS source code file, a file structure of a file to be generated is constructed; and copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the fields. Therefore, the file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained files to be generated with the fields store the updating contents according to the file structure of the files to be exported, so that an operator can clearly and intuitively determine what updating operation is included in each file to be generated with the fields. In addition, the third field representing the log information is also copied to the file to be generated, so that the log information can be reserved in the file to be generated. And the obtained file to be generated with the fields is stored in the file structure of the file to be exported, so that messy codes can not appear when the file to be generated is displayed.
Fig. 3 is a schematic structural diagram of a log processing apparatus according to an embodiment of the present invention, and as shown in fig. 3, the apparatus according to the embodiment may include:
the export module 31 is configured to export the updated content of the file to be exported in the log into a first temporary file, where the first temporary file includes a first field representing the updated content of the file to be exported, and the file to be exported includes at least one second field representing all the content of the file to be exported;
the first determining module 32 is configured to determine, according to at least one second field of the file to be exported, a first DDS source code file corresponding to the file to be exported, where the first DDS source code file represents a file structure of the file to be exported;
the building module 33 is configured to build a file to be generated according to the first DDS source code file, where the file to be generated has a file structure;
the copying module 34 is configured to copy the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated, so as to obtain the file to be generated with the field.
The log processing apparatus of this embodiment can execute the log processing method provided by the embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In this embodiment, the update content of the file to be exported in the log is exported to a first temporary file, where the first temporary file includes a first field representing the update content of the file to be exported, and the file to be exported includes at least one second field representing the content of the file to be exported; determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported; constructing a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure; and copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field. Therefore, the file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained file to be generated with the field stores the updated content by the file structure of the file to be exported; therefore, the operator can clearly and intuitively determine what updating operation is included in each file to be generated with the field. And the obtained file to be generated with the fields is stored in the file structure of the file to be exported, so that messy codes can not appear when the file to be generated is displayed.
Fig. 4 is a schematic structural diagram of another log processing apparatus according to an embodiment of the present invention, and based on the embodiment shown in fig. 3, as shown in fig. 4, in the apparatus according to this embodiment, the first temporary file further includes at least one third field of log information representing a log, where the log information includes operation information of update content.
The apparatus provided in this embodiment further includes:
the removing module 41 is configured to remove the first field in the first temporary file after the exporting module 31 exports the updated content of the file to be exported in the log into the first temporary file, so as to obtain the processed first temporary file.
A second determining module 42, configured to determine, according to at least one third field of the processed first temporary file, a second DDS source code file corresponding to the first temporary file, where the second DDS source code file represents a structure of the processed first temporary file.
The building block 33 is specifically configured to: and constructing a file structure of the file to be generated according to the first DDS source code file and the second DDS source code file.
The replication module 34 is specifically configured to: and copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the fields.
The first temporary file comprises N fields, wherein the first N-1 fields in the N fields are third fields, the last field in the N fields is a first field, and N is a positive integer greater than or equal to 2.
The log information further comprises at least one of the following information: log code, log type, record number.
The operation information comprises at least one of the following information: operation type, operation date, operator information.
A first determination module 32 comprising:
the export submodule 321 is configured to export at least one second field in the file to be exported into a second temporary file, where the second temporary file includes at least one second field;
the splicing submodule 322 is configured to splice file structure description information according to rule information represented by at least one second field in the second temporary file;
the constructing submodule 323 is configured to construct, according to the file structure description information, a first DDS source code file corresponding to a file to be derived.
The log comprises key entries; the key parameters include at least one of the following parameters: file name, log selection condition, log entry encoding, export file format, and record length.
The apparatus provided in this embodiment further includes:
the receiving module 43 is configured to, after the copying module 34 copies the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated, and obtains the file to be generated with the field, receive a display instruction sent by a user;
and the display module 44 is configured to display the file to be generated with the field according to the display instruction.
The log processing apparatus of this embodiment can execute another log processing method provided by the embodiment of the present invention, and the implementation principles thereof are similar, and are not described herein again.
In this embodiment, the update content of a file to be exported in a log is exported to a first temporary file, where the first temporary file includes a first field representing the update content of the file to be exported and at least one third field representing log information of the log, the log information includes operation information of the update content, and the file to be exported includes at least one second field representing the content of the file to be exported; removing a first field in the first temporary file to obtain a processed first temporary file; determining a second DDS source code file corresponding to the first temporary file according to at least one third field of the processed first temporary file, wherein the second DDS source code file represents the structure of the processed first temporary file; determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported; according to the first DDS source code file and the second DDS source code file, a file structure of a file to be generated is constructed; and copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the fields. Therefore, the file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained files to be generated with the fields store the updating contents according to the file structure of the files to be exported, so that an operator can clearly and intuitively determine what updating operation is included in each file to be generated with the fields. In addition, the third field representing the log information is also copied to the file to be generated, so that the log information can be reserved in the file to be generated. And the obtained file to be generated with the fields is stored in the file structure of the file to be exported, so that messy codes can not appear when the file to be generated is displayed.
Fig. 5 is a block diagram of an entity of an electronic device according to an embodiment of the present invention. Referring to fig. 5, the electronic device may be embodied as: a processor 51, and a memory 52 configured to store processor-executable instructions;
wherein the processor 51 is configured to: the steps of the method in the embodiment as shown in fig. 1 or fig. 2 are performed.
In the above embodiments, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the aforementioned memory may be a read-only memory (ROM), a Random Access Memory (RAM), a flash memory, a hard disk, or a solid state disk. SIM cards, also known as subscriber identity cards, smart cards, must be installed in a digital mobile phone for use. That is, the information of the digital mobile phone client, the encrypted key and the contents of the user's phone book are stored on the computer chip. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
With regard to the terminal in the above-described embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment related to the method and apparatus, and will not be elaborated herein.
In this embodiment, the update content of the file to be exported in the log is exported to a first temporary file, where the first temporary file includes a first field representing the update content of the file to be exported, and the file to be exported includes at least one second field representing the content of the file to be exported; determining a first DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported; constructing a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure; and copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field. Therefore, the file structure of the file to be generated is the same as that of the file to be exported, so that the first field can be stored in the file to be generated in the form of the file structure of the file to be exported; the first field represents the updating content of the file to be exported, and the updating content of the file to be exported is stored in the file to be generated with the field; therefore, the obtained file to be generated with the field stores the updated content by the file structure of the file to be exported; therefore, the operator can clearly and intuitively determine what updating operation is included in each file to be generated with the field. And the obtained file to be generated with the fields is stored in the file structure of the file to be exported, so that messy codes can not appear when the file to be generated is displayed.
In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided. For example, a non-transitory computer readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a log processing method provided by the embodiment shown in fig. 1 or fig. 2, the method comprising:
exporting the updated content of the file to be exported in the log to a first temporary file, wherein the first temporary file comprises a first field representing the updated content of the file to be exported, and the file to be exported comprises at least one second field representing all the content of the file to be exported;
determining a first data description DDS source code file corresponding to the file to be exported according to at least one second field of the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported;
constructing a file to be generated according to the first DDS source code file, wherein the file to be generated has a file structure;
and copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the field.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (7)

1. A log processing method, comprising:
exporting update contents of a file to be exported in a log to a first temporary file, wherein the first temporary file comprises a first field and at least one third field, the first field represents the update contents of the file to be exported, the at least one third field represents log information of the log, and the log information comprises operation information of the update contents; the first temporary file comprises N fields, wherein the first N-1 fields in the N fields are the third fields, the last field in the N fields is the first field, and N is a positive integer greater than or equal to 2;
the file to be exported comprises at least one second field, and the at least one second field represents the whole content of the file to be exported;
exporting at least one second field in the file to be exported to a second temporary file, wherein the second temporary file comprises the at least one second field;
splicing file structure description information according to the rule information represented by the at least one second field in the second temporary file;
according to the file structure description information, constructing a first DDS source code file corresponding to the file to be exported, wherein the first DDS source code file represents the file structure of the file to be exported;
removing the first field in the first temporary file to obtain a processed first temporary file;
determining a second DDS source code file corresponding to the first temporary file according to at least one third field of the processed first temporary file, wherein the second DDS source code file represents the structure of the processed first temporary file;
according to the first DDS source code file and the second DDS source code file, a file structure of a file to be generated is constructed;
and copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the fields.
2. The method of claim 1, wherein the log information further comprises at least one of the following information: log code, log type, record number;
the operation information comprises at least one of the following information: operation type, operation date, operator information.
3. The method of any of claims 1-2, wherein a key-in argument is included in the log;
the key-related parameter comprises at least one of the following parameters: file name, log selection condition, log entry encoding, export file format, and record length.
4. The method according to any one of claims 1-2, wherein after copying the first field in the first temporary file to the file to be generated according to the file structure of the file to be generated, and obtaining the file to be generated with the field, the method further comprises:
receiving a display instruction sent by a user;
and displaying the file to be generated with the field according to the display instruction.
5. A log processing apparatus, comprising:
the export module is used for exporting the update content of a file to be exported in the log to a first temporary file, wherein the first temporary file comprises a first field and at least one third field, the first field represents the update content of the file to be exported, the at least one third field represents the log information of the log, and the log information comprises the operation information of the update content; the first temporary file comprises N fields, wherein the first N-1 fields in the N fields are the third fields, the last field in the N fields is the first field, and N is a positive integer greater than or equal to 2; the file to be exported comprises at least one second field, and the at least one second field represents the whole content of the file to be exported;
the first determining module is configured to determine, according to at least one second field of the file to be exported, a first DDS source code file corresponding to the file to be exported, where the first DDS source code file represents a file structure of the file to be exported;
the removing module is used for removing the first field in the first temporary file to obtain a processed first temporary file;
a second determining module, configured to determine, according to at least one third field of the processed first temporary file, a second DDS source code file corresponding to the first temporary file, where the second DDS source code file represents a structure of the processed first temporary file;
the building module is used for building a file structure of a file to be generated according to the first DDS source code file and the second DDS source code file;
the copying module is used for copying the first field and the at least one third field in the first temporary file to the file to be generated according to the file structure of the file to be generated to obtain the file to be generated with the fields;
the first determining module includes:
the export submodule is used for exporting the at least one second field in the file to be exported to a second temporary file, and the second temporary file comprises the at least one second field;
the splicing submodule is used for splicing the file structure description information according to the rule information represented by the at least one second field in the second temporary file;
and the constructing submodule is used for constructing a first DDS source code file corresponding to the file to be exported according to the file structure description information.
6. A computer-readable storage medium on which a computer program is stored, the program, when being executed by a processor, implementing the log processing method of any one of claims 1 to 4.
7. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the log processing method of any of claims 1-4 via execution of the executable instructions.
CN201711319736.5A 2017-12-12 2017-12-12 Log processing method and device and electronic equipment Active CN108038198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711319736.5A CN108038198B (en) 2017-12-12 2017-12-12 Log processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711319736.5A CN108038198B (en) 2017-12-12 2017-12-12 Log processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108038198A CN108038198A (en) 2018-05-15
CN108038198B true CN108038198B (en) 2022-01-04

Family

ID=62102023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711319736.5A Active CN108038198B (en) 2017-12-12 2017-12-12 Log processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108038198B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447099A (en) * 2015-11-11 2016-03-30 中国建设银行股份有限公司 Log structured information extraction method and apparatus
CN105701122A (en) * 2014-11-28 2016-06-22 深圳市腾讯计算机系统有限公司 Log collection method, apparatus and system
CN105824744A (en) * 2016-03-21 2016-08-03 焦点科技股份有限公司 Real-time log collection and analysis method on basis of B2B (Business to Business) platform
CN107153695A (en) * 2017-05-05 2017-09-12 恒生电子股份有限公司 Log recording method and device, electronic equipment, storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105701122A (en) * 2014-11-28 2016-06-22 深圳市腾讯计算机系统有限公司 Log collection method, apparatus and system
CN105447099A (en) * 2015-11-11 2016-03-30 中国建设银行股份有限公司 Log structured information extraction method and apparatus
CN105824744A (en) * 2016-03-21 2016-08-03 焦点科技股份有限公司 Real-time log collection and analysis method on basis of B2B (Business to Business) platform
CN107153695A (en) * 2017-05-05 2017-09-12 恒生电子股份有限公司 Log recording method and device, electronic equipment, storage medium

Also Published As

Publication number Publication date
CN108038198A (en) 2018-05-15

Similar Documents

Publication Publication Date Title
CN108268253B (en) Interface code generation method and terminal equipment
CN106843978B (en) SDK access method and system
US9864736B2 (en) Information processing apparatus, control method, and recording medium
CN109711189B (en) Data desensitization method and device, storage medium and terminal
WO2020233014A1 (en) Message sending method and apparatus, and computer device and storage medium
US10067753B2 (en) Application program uninstallation method and apparatus
CN113672204A (en) Interface document generation method, system, electronic equipment and storage medium
CN108255967B (en) Method and device for calling storage process, storage medium and terminal
CN106484779B (en) File operation method and device
CN104077053B (en) Terminal information operating method and device and mobile terminal
CN111273942A (en) Code generation method, storage medium, electronic device and system
CN110674084A (en) Method, apparatus, and computer-readable storage medium for data protection
CN108038198B (en) Log processing method and device and electronic equipment
CN108052842B (en) Signature data storage and verification method and device
CN113301203B (en) Method and device for updating historical information data based on address book
CN115658127A (en) Data processing method and device, electronic equipment and storage medium
CN111736859B (en) Version updating method of operating system, server and terminal
CN110221952B (en) Service data processing method and device and service data processing system
CN113986747A (en) Data generation method and device, electronic equipment and storage medium
CN110795388A (en) Binary file processing method, system, equipment and readable storage medium
CN108628909B (en) Information pushing method and device
CN113704222A (en) Method and device for processing service request
CN111597773B (en) Compression processing method, compression processing device, computer storage medium and terminal
CN117194324A (en) Snapshot-based service continuous operation method, device, medium and equipment
CN113296956A (en) Resource recovery device and method in cloud computing platform

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