CN109857716B - System interaction log recording method and device, storage medium and server - Google Patents

System interaction log recording method and device, storage medium and server Download PDF

Info

Publication number
CN109857716B
CN109857716B CN201910078963.6A CN201910078963A CN109857716B CN 109857716 B CN109857716 B CN 109857716B CN 201910078963 A CN201910078963 A CN 201910078963A CN 109857716 B CN109857716 B CN 109857716B
Authority
CN
China
Prior art keywords
log
information
system interaction
record
annotation
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
CN201910078963.6A
Other languages
Chinese (zh)
Other versions
CN109857716A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910078963.6A priority Critical patent/CN109857716B/en
Publication of CN109857716A publication Critical patent/CN109857716A/en
Application granted granted Critical
Publication of CN109857716B publication Critical patent/CN109857716B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of development, development assistance and code quality tools, and provides a system interaction log recording method, which comprises the following steps: acquiring a log annotation of the current system interactive program code, and determining a record identifier and a main key identifier for positioning the current system interactive information according to the log annotation; extracting system interaction information with the record identifier from the system interaction information with the record identifier, and extracting primary key information corresponding to the primary key identifier from the system interaction information with the record identifier; and adding the primary key information and the system interaction information with the record identifier into a preset log table. In the method, the main key information of the interactive data of the positioning system and the record identification of the corresponding data in the log list are obtained through the annotation in the system, so that the writing amount of log record codes is reduced, the code amount irrelevant to service codes is reduced, the developer can conveniently check and quickly position the interactive data, and the difficulty of code maintenance and expansion is reduced.

Description

System interaction log recording method and device, storage medium and server
Technical Field
The invention relates to the technical field of development and development assistance, in particular to a system interaction log recording method and device, a storage medium and a server.
Background
In the field of computer technology, journals may be used to monitor and record information about activities of particular events in a system. With the increasing number of business systems, more and more log code information needs to be output. When developing multiple systems, each system can only define the log code information of the system by itself, and in addition, for the method requiring log output, contents such as method call information, module information and the like need to be added, in this case, repeated development of codes may be caused and larger resource waste may be caused. In addition, in the actual project development process, because the interaction between the systems is not single, but one system can interact with a plurality of systems, the interaction between the systems is very frequent, and in order to ensure the rapidity of the later positioning problem, the related entries and entries are recorded in a log table, but frequent assembly parameters can cause a plurality of redundant codes which are irrelevant to service codes in the systems, so that the later code maintenance and expansion have great difficulty.
Disclosure of Invention
In order to solve the technical problems, particularly the problems that a plurality of redundant codes irrelevant to service codes are generated in the process of frequently assembling parameters and the subsequent codes are difficult to maintain and expand, the following technical scheme is provided:
the embodiment of the invention provides a system interaction log recording method, which comprises the following steps:
acquiring a log annotation of the current system interactive program code, and determining a record identifier and a main key identifier for positioning the current system interactive information according to the log annotation;
extracting system interaction information with the record identifier from the system interaction information with the record identifier, and extracting primary key information corresponding to the primary key identifier from the system interaction information with the record identifier;
and adding the primary key information and the system interaction information with the record identifier into a preset log table.
Optionally, before the log annotation of the current system interaction program code is obtained, determining the record identifier and the primary key identifier for locating the current system interaction information according to the log annotation, the method further includes:
and establishing the log annotation, and associating the log annotation with a record identifier in the preset log table.
Optionally, before the log annotation of the current system interaction program code is obtained, determining the record identifier and the primary key identifier for locating the current system interaction information according to the log annotation, the method further includes:
establishing business logic of the log annotation according to the log annotation;
acquiring an interaction starting node of a current system;
if the service logic corresponds to the system interaction information which does not comprise data interaction, inserting the service logic before the interaction initiation node;
and if the service logic corresponds to the system interaction information comprising the data interaction, inserting the service logic before the adjacent node of the interaction starting node.
Optionally, the extracting system interaction information with the record identifier from the system interaction information with the record identifier extracts primary key information corresponding to the primary key identifier, including:
and operating the business logic of the log annotation, and extracting the primary key information in the system interaction information and the system interaction information with the record identifier according to the business logic of the log annotation.
Optionally, after determining the record identifier and the primary key identifier for locating the current system interaction information according to the log annotation, the method further includes:
the record identifier comprises an access parameter and a feedback parameter of the current system interaction interface;
and extracting the access parameters and the feedback parameters from the system interaction information according to the record identification.
Optionally, after extracting the access parameter and the feedback parameter from the system interaction information, the method further includes:
and adding the access parameters and the feedback parameters to corresponding record identifiers in the preset log table.
The embodiment of the invention also provides a system interaction log recording device, which comprises:
the record identification determining module is used for acquiring the log annotation of the current system interaction program code, and determining a record identification and a main key identification for positioning the current system interaction information according to the log annotation;
the first extraction module is used for extracting system interaction information with the record identifier from the system interaction information with the record identifier and extracting main key information corresponding to the main key identifier;
and the first adding module is used for adding the primary key information and the system interaction information with the record identifier into a preset log table.
Optionally, the method further comprises:
the establishing module is used for establishing the log annotation and associating the log annotation with a record mark in the preset log table.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium is stored with a computer program, and the program realizes the system interaction log recording method according to any technical scheme when being executed by a processor.
The embodiment of the invention also provides a server, which comprises:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the steps of the system interaction logging method according to any of the claims.
Compared with the prior art, the invention has the following beneficial effects:
1. the method for recording the system interaction log provided by the embodiment of the application comprises the following steps: acquiring a log annotation of the current system interactive program code, and determining a record identifier and a main key identifier for positioning the current system interactive information according to the log annotation; extracting system interaction information with the record identifier from the system interaction information with the record identifier, and extracting primary key information corresponding to the primary key identifier from the system interaction information with the record identifier; and adding the primary key information and the system interaction information with the record identifier into a preset log table. The method is convenient for later stage to rapidly locate the corresponding data interaction condition and later stage to find the abnormal condition according to the primary key information, and is convenient for developers to solve the abnormal condition. In the process, the log record of the interaction information between the systems is realized through the related record identifications, other personnel are not required to manually add records, the code of one line of log record is not required to be watched when a developer can quickly position data according to the primary key information in the later period, the workload of the developer is reduced, in the process of log record, the log record is realized according to the corresponding record identifications, further, the record parameters of corresponding data are not required to be assembled in each log record process, redundant codes irrelevant to service codes in the frequent assembly parameter process are avoided, and the difficulty of maintaining and expanding the later period codes is reduced.
2. The method for recording the system interaction log provided by the embodiment of the application, wherein the method for extracting the system interaction information with the record identifier from the system interaction information with the record identifier, extracting the primary key information corresponding to the primary key identifier, comprises the following steps: and operating the business logic of the log annotation, and extracting the primary key information in the system interaction information and the system interaction information with the record identifier according to the business logic of the log annotation. The information extraction is realized through the same record identification without refining to specific parameters, and the code quantity of log records is reduced. Meanwhile, the record mark in the annotation and the record mark in the log list are combined to have a mapping relation, when the annotation code is operated, corresponding information can be added into the log list, so that the writing of each parameter code in the log record is not required at the bottom layer of the system, the quantity of the codes at the bottom layer of the system is reduced, the annotation business logic code is simpler than the log record logic code, and further, a developer can clearly see related codes in the later maintenance or expansion process, and the later maintenance and expansion difficulty of the codes is reduced.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of an exemplary embodiment of a system interaction logging method of the present invention;
FIG. 2 is a schematic diagram of an exemplary embodiment of a system interaction logging apparatus of the present invention;
fig. 3 is a schematic structural diagram of an embodiment of a server according to the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, but do not preclude the presence or addition of one or more other features, integers, steps, operations.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
It will be appreciated by those skilled in the art that references to "application," "application program," "application software," and similar concepts herein are intended to be equivalent concepts well known to those skilled in the art, and refer to computer software, organically constructed from a series of computer instructions and related data resources, suitable for electronic execution. Unless specifically specified, such naming is not limited by the type, level of programming language, nor by the operating system or platform on which it operates. Of course, such concepts are not limited by any form of terminal.
In one embodiment, as shown in fig. 1, a method for recording a system interaction log includes: s100, S200, S300.
S100: acquiring a log annotation of the current system interactive program code, and determining a record identifier and a main key identifier for positioning the current system interactive information according to the log annotation;
s200: extracting system interaction information with the record identifier from the system interaction information with the record identifier, and extracting primary key information corresponding to the primary key identifier from the system interaction information with the record identifier;
s300: and adding the primary key information and the system interaction information with the record identifier into a preset log table.
When the log searching or positioning is carried out, the program and the code in the current system interaction process are acquired, the code annotation mainly explains a section of program code, wherein the log annotation of the access point can be defined, so that the information of starting and ending more detailed system interaction can be recorded in a log table, and the method comprises the following steps: ID. The user name, content, time, anomaly information, etc. may also include access parameters and feedback parameters of the counter interface as in the subsequent steps, so that the interaction interface, etc. can be quickly determined by annotation. In order to successfully extract the related information or data to be recorded in the log record table, a log annotation determination record identifier is needed. Because the log annotation comprises the identification which needs to be recorded in the log table, when the log annotation of the current system interactive program code is obtained, the record identification can be determined from the log annotation. After the log record identifier is determined, the interaction information with the record identifier in the log annotation is extracted from the interaction information of the system, and the interaction information also comprises the interaction data of the system. Since interactions between systems are often data interactions between systems and information interactions between systems in a business scenario, data transfer between systems is achieved. The main key identification is mainly used for acquiring identification of main key information in the system interaction information, and the main key information is mainly used for positioning data in the current interaction process of the system, so that corresponding data interaction conditions can be conveniently positioned according to the main key information in the later stage, and abnormal conditions can be conveniently searched in the later stage, so that the abnormal conditions can be conveniently solved. And adding the primary key information and the system interaction information with the record identifier into a preset log table, and further positioning the system interaction information based on the primary key information in the log table and other information corresponding to the primary key information in the later period. In the process, the log record of the interaction information between the systems is realized through the related record identifications, other personnel are not required to manually add records, the code of one line of log record is not required to be watched when a developer can quickly position data according to the primary key information in the later period, the workload of the developer is reduced, in the process of log record, the log record is realized according to the corresponding record identifications, further, the record parameters of corresponding data are not required to be assembled in each log record process, redundant codes irrelevant to service codes in the frequent assembly parameter process are avoided, and the difficulty of maintaining and expanding the later period codes is reduced. For example, A, B system interaction, key values which can identify a piece of data such as serial numbers, application numbers and the like are included in the incoming parameters of the A system, so that the key values can be used as a main key, and interaction conditions (such as incoming parameters and outgoing parameters) of the piece of data can be positioned according to the main key in the later period. Different primary keys are provided in different traffic scenarios.
Optionally, before the log annotation of the current system interaction program code is obtained, determining the record identifier and the primary key identifier for locating the current system interaction information according to the log annotation, the method further includes:
and establishing the log annotation, and associating the log annotation with a record identifier in the preset log table.
In order to successfully determine the record mark, the log mark is required to be established in the system interaction code when the log mark of the current system interaction program code is acquired, and the log mark is associated with the record mark in a preset log table, so that the record mark determined in the log mark can be smoothly added into a corresponding item in the log table, and the inquiry of system interaction data and information can be conveniently carried out according to the data in the log table in the later period.
Optionally, before the log annotation of the current system interaction program code is obtained, determining the record identifier and the primary key identifier for locating the current system interaction information according to the log annotation, the method further includes:
establishing business logic of the log annotation according to the log annotation;
acquiring an interaction starting node of a current system;
if the service logic corresponds to the system interaction information which does not comprise data interaction, inserting the service logic before the interaction initiation node;
and if the service logic corresponds to the system interaction information comprising the data interaction, inserting the service logic before the adjacent node of the interaction starting node.
Optionally, the extracting system interaction information with the record identifier from the system interaction information with the record identifier extracts primary key information corresponding to the primary key identifier, including:
and operating the business logic of the log annotation, and extracting the primary key information in the system interaction information and the system interaction information with the record identifier according to the business logic of the log annotation.
Because the conventional log annotation is only an explanation effect, in order to realize that the system interaction information with record identification and the main key information corresponding to the main key identification can be extracted from the system interaction information through the log annotation, wherein the record identification and the main key identification are both included in the log annotation, the business logic of the log annotation is built, and meanwhile, the interaction starting node of the current system is acquired, so that the business logic of the log annotation is conveniently inserted before the starting node of the system interaction, the business logic of the log annotation is conveniently operated before the system interaction, and the system interaction information with record identification and the main key information with the main key identification can be extracted according to the business logic of the log annotation when the system is operated, and the extracted system interaction information and the main key information can be conveniently added into a log table. If the service logic corresponds to the system interaction information which does not comprise data interaction, inserting the service logic before the interaction initiation node; the first type of system interaction information is a situation that two systems do not perform data interaction, and at the moment, before the business logic is inserted into the interaction starting node, only the system interaction information and the primary key information can be obtained; if the service logic corresponds to the system interaction information comprising data interaction, inserting the service logic before the adjacent node of the interaction initiation node; when the second type of system interaction information is system interaction information with data interaction, the service logic is inserted before the adjacent node of the interaction initiation node, and then primary key information of the current system interaction, access parameters and feedback parameters described later can be obtained. Based on different types of system interaction information, business logic is inserted into different interaction starting nodes, so that an developer can use higher efficiency to carry out later data verification, and the phenomenon that the system interaction information which does not carry out data interaction takes more time to carry out verification and verification of the abnormal situation is avoided. In the embodiment provided by the application, the annotation mainly comprises a record identifier, the annotation service logic mainly extracts the system interaction information with the record identifier and the main key information with the main key identifier based on the record identifier and the main key identifier, in the process, specific parameter information to be recorded is not involved, when the data required by the log table are the same, the corresponding record identifiers are the same, and in the system interaction process, the system interaction information and the main key information can be extracted based on the same annotation and the same annotation service logic each time. Through the process, the information extraction is realized through the same record identification without refining to specific parameters, and the code quantity of log records is reduced. Meanwhile, the record mark in the annotation and the record mark in the log list are combined to have a mapping relation, when the annotation code is operated, corresponding information can be added into the log list, so that the writing of each parameter code in the log record is not required at the bottom layer of the system, the quantity of the codes at the bottom layer of the system is reduced, the annotation business logic code is simpler than the log record logic code, and further, a developer can clearly see related codes in the later maintenance or expansion process, and the later maintenance and expansion difficulty of the codes is reduced.
Optionally, after determining the record identifier and the primary key identifier for locating the current system interaction information according to the log annotation, the method further includes:
the record identifier comprises an access parameter and a feedback parameter of the current system interaction interface;
and extracting the access parameters and the feedback parameters from the system interaction information according to the record identification.
Optionally, after extracting the access parameter and the feedback parameter from the system interaction information, the method further includes:
and adding the access parameters and the feedback parameters to corresponding record identifiers in the preset log table.
In the embodiment provided by the application, the record identifier includes an access parameter and a feedback parameter of the current system interaction interface, wherein the access parameter is a parameter when the interface is accessed at the beginning, the feedback parameter is a last feedback parameter when the interface is called to execute, and the feedback parameter can be a parameter fed back when an abnormal condition exists, so that an outlet and an inlet of the log record are more uniform, and the log record is more convenient to find and locate. The inclusion is generally uncertain and determined by the interactive system. Typically, the feedback parameters (referred to herein as out parameters) include these parameters, resultCode, resultMsg and busidtata, and resultMsg represents the interface interaction state, and resultMsg represents the call description, such as call success, or error message. Busidata is specific business data, and can be list or map. And adding the access parameters and the feedback parameters under corresponding record identifications in a plurality of preset log tables, thereby completing log record. The main key information is used as a unique identifier of one data, positioning inquiry is conveniently carried out in the later stage by recording the main key information, the calling condition of one data in the system interaction process is determined, and whether the input of the data is problematic or the output of the data is problematic is determined. Correspondingly, the entry and exit references are decoupled from the annotation, and the annotation comprises record identifiers of the entry and exit references, so that the annotation can fetch the corresponding entry and exit references according to the dynamic proxy and reflection according to the identifiers, the purpose of saving logs is achieved, and excessive writing of the annotation is avoided.
In the embodiment provided in the application, the log table may also record the data addition time and the main fields of the corresponding basic information, i.e. the log table may record the data addition time and the corresponding basic information fields, such as: out_param-out, server return data, group_id-interface type, representing interface name or type, time when start_time-received in-call, time when end_time-returned out-call, time spent by duration-one call, and later can also be used to monitor response time and even performance of interface call. The main key identification, the parameter entering identification and the parameter exiting identification are identified in a log table, such as: the log_id is a primary key of data and represents the unique identification of the data and the parameters transmitted by an opposite system by in_param-entry.
The embodiment of the invention also provides a system interaction log recording device, in one implementation manner, as shown in fig. 2, the device comprises: record identification determination module 100, first extraction module 200, first addition module 300:
the record identification determining module 100 is used for acquiring the log annotation of the current system interaction program code, and determining a record identification and a main key identification for positioning the current system interaction information according to the log annotation;
a first extraction module 200, configured to extract system interaction information having the record identifier from the system interaction information having the record identifier, and extract primary key information corresponding to the primary key identifier from the system interaction information having the record identifier;
the first adding module 300 is configured to add the primary key information and the system interaction information with the record identifier to a preset log table.
Further, as shown in fig. 2, the system interaction log recording device provided in the embodiment of the present invention further includes: and the association module 102 is used for establishing the log annotation and associating the log annotation with the record identifier in the preset log table. The establishing module 102 is configured to establish business logic of the log annotation according to the log annotation; the node obtaining module 103 is configured to obtain an interaction initiation node of a current system, and the first inserting module 104 is configured to insert the service logic before the interaction initiation node if the service logic corresponds to system interaction information that does not include data interaction; and the second inserting module 105 is configured to insert the service logic before the adjacent node of the interaction initiation node if the service logic corresponds to the system interaction information including the data interaction. And the operation unit 210 is configured to operate the business logic of the log annotation, and extract the primary key information and the system interaction information with the record identifier according to the business logic of the log annotation. And the second extraction module 110 is configured to extract the access parameter and the feedback parameter from the system interaction information according to the record identifier. And the second adding module 120 is configured to add the access parameter and the feedback parameter to a record identifier corresponding to the preset log table.
The embodiment of the system interaction log recording method can be realized by the system interaction log recording device provided by the embodiment of the invention, and specific function realization is shown in the description of the embodiment of the method and is not repeated herein.
The embodiment of the invention provides a computer readable storage medium, and a computer program is stored on the computer readable storage medium, and when the program is executed by a processor, the method for recording the system interaction log according to any technical scheme is realized. The computer readable storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS Memory, random access memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (Electrically EraSable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage device includes any medium that stores or transmits information in a form readable by a device (e.g., computer, cell phone), and may be read-only memory, magnetic or optical disk, etc.
The embodiment of the system interaction log recording method can be realized, in the application, the main key information of the positioning system interaction data and the record identification of the corresponding data in the log table are obtained through the annotation in the system, so that the writing amount of log record codes can be reduced, meanwhile, when each system interaction is not needed, the assembly parameters are not needed, the code amount irrelevant to service codes is reduced, meanwhile, in the later maintenance and expansion process, the check of developers is convenient, in particular, in the later code or data check process, the number of check codes of the developers is reduced, and the difficulty of code maintenance and expansion is further reduced; the method for recording the system interaction log provided by the embodiment of the application comprises the following steps: acquiring a log annotation of the current system interactive program code, and determining a record identifier and a main key identifier for positioning the current system interactive information according to the log annotation; extracting system interaction information with the record identifier from the system interaction information with the record identifier, and extracting primary key information corresponding to the primary key identifier from the system interaction information with the record identifier; and adding the primary key information and the system interaction information with the record identifier into a preset log table. When the log searching or positioning is carried out, the program and the code in the current system interaction process are acquired, the code annotation mainly explains a section of program code, wherein the log annotation of the access point can be defined, so that the information of starting and ending more detailed system interaction can be recorded in a log table, and the method comprises the following steps: ID. The user name, content, time, anomaly information, etc. may also include access parameters and feedback parameters of the counter interface as in the subsequent steps, so that the interaction interface, etc. can be quickly determined by annotation. In order to successfully extract the related information or data to be recorded in the log record table, a log annotation determination record identifier is needed. Because the log annotation comprises the identification which needs to be recorded in the log table, when the log annotation of the current system interactive program code is obtained, the record identification can be determined from the log annotation. After the log record identifier is determined, the interaction information with the record identifier in the log annotation is extracted from the interaction information of the system, and the interaction information also comprises the interaction data of the system. Since interactions between systems are often data interactions between systems and information interactions between systems in a business scenario, data transfer between systems is achieved. The main key identification is mainly used for acquiring identification of main key information in the system interaction information, and the main key information is mainly used for positioning data in the current interaction process of the system, so that corresponding data interaction conditions can be conveniently positioned according to the main key information in the later stage, and abnormal conditions can be conveniently searched in the later stage, so that the abnormal conditions can be conveniently solved. And adding the primary key information and the system interaction information with the record identifier into a preset log table, and further positioning the system interaction information based on the primary key information in the log table and other information corresponding to the primary key information in the later period. In the process, the log record of the interaction information between the systems is realized through the related record identifications, other personnel are not required to manually add records, the code of one line of log record is not required to be watched when a developer can quickly position data according to the primary key information in the later period, the workload of the developer is reduced, in the process of log record, the log record is realized according to the corresponding record identifications, further, the record parameters of corresponding data are not required to be assembled in each log record process, redundant codes irrelevant to service codes in the frequent assembly parameter process are avoided, and the difficulty of maintaining and expanding the later period codes is reduced.
In addition, in another embodiment, the present invention further provides a server, as shown in fig. 3, where the server processor 503, the memory 505, the input unit 507, the display unit 509, and other devices. Those skilled in the art will appreciate that the structural elements shown in fig. 3 do not constitute a limitation on all servers, and may include more or fewer components than shown, or may combine certain components. The memory 505 may be used to store an application 501 and various functional modules, and the processor 503 runs the application 501 stored in the memory 505 to perform various functional applications and data processing of the device. The memory 505 may be an internal memory or an external memory, or include both internal and external memories. The internal memory may include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include a hard disk, floppy disk, ZIP disk, U-disk, tape, etc. The disclosed memory includes, but is not limited to, these types of memory. The memory 505 of the present disclosure is by way of example only and not by way of limitation.
The input unit 507 is used for receiving input of signals, as well as personal information and related physical condition information input by a user. The input unit 507 may include a touch panel and other input devices. The touch panel can collect touch operations on or near the client (such as operations of the client on or near the touch panel using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a preset program; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., play control keys, switch keys, etc.), a trackball, mouse, joystick, etc. The display unit 509 may be used to display information input by a client or information provided to the client and various menus of the computer device. The display unit 509 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 503 is the control center of the computer device, connecting the various parts of the overall computer using various interfaces and lines, performing various functions and processing data by running or executing software programs and/or modules stored in the memory 503, and invoking data stored in the memory. The one or more processors 503 shown in fig. 3 are capable of executing, implementing, the functions of the record identity determination module 100, the functions of the first extraction module 200, the functions of the first addition module 300, the functions of the association module 101, the functions of the creation module 102, the functions of the node acquisition module 103, the functions of the first insertion module 104, the functions of the second insertion module 105, the functions of the execution unit 210, the functions of the second extraction module 110, the functions of the second addition module 120 shown in fig. 2.
In one embodiment, the server includes one or more processors 503 and one or more memories 505, one or more applications 501, wherein the one or more applications 501 are stored in the memory 505 and configured to be executed by the one or more processors 503, and the one or more applications 301 are configured to perform the system interaction logging method described in the above embodiments.
According to the embodiment of the invention, the embodiment of the system interaction log recording method can be realized, the main key information of the positioning system interaction data and the record identification of the corresponding data in the log table are obtained through the annotation in the system, so that the writing quantity of log record codes can be reduced, meanwhile, when each system interaction is not needed, the assembly parameters are not needed, the code quantity irrelevant to service codes is reduced, meanwhile, in the later maintenance and expansion process, the check of developers is convenient, in particular in the later code or data check process, the number of check codes of the developers is reduced, and the difficulty of code maintenance and expansion is further reduced; the method for recording the system interaction log provided by the embodiment of the application comprises the following steps: acquiring a log annotation of the current system interactive program code, and determining a record identifier and a main key identifier for positioning the current system interactive information according to the log annotation; extracting system interaction information with the record identifier from the system interaction information with the record identifier, and extracting primary key information corresponding to the primary key identifier from the system interaction information with the record identifier; and adding the primary key information and the system interaction information with the record identifier into a preset log table. When the log searching or positioning is carried out, the program and the code in the current system interaction process are acquired, the code annotation mainly explains a section of program code, wherein the log annotation of the access point can be defined, so that the information of starting and ending more detailed system interaction can be recorded in a log table, and the method comprises the following steps: ID. The user name, content, time, anomaly information, etc. may also include access parameters and feedback parameters of the counter interface as in the subsequent steps, so that the interaction interface, etc. can be quickly determined by annotation. In order to successfully extract the related information or data to be recorded in the log record table, a log annotation determination record identifier is needed. Because the log annotation comprises the identification which needs to be recorded in the log table, when the log annotation of the current system interactive program code is obtained, the record identification can be determined from the log annotation. After the log record identifier is determined, the interaction information with the record identifier in the log annotation is extracted from the interaction information of the system, and the interaction information also comprises the interaction data of the system. Since interactions between systems are often data interactions between systems and information interactions between systems in a business scenario, data transfer between systems is achieved. The main key identification is mainly used for acquiring identification of main key information in the system interaction information, and the main key information is mainly used for positioning data in the current interaction process of the system, so that corresponding data interaction conditions can be conveniently positioned according to the main key information in the later stage, and abnormal conditions can be conveniently searched in the later stage, so that the abnormal conditions can be conveniently solved. And adding the primary key information and the system interaction information with the record identifier into a preset log table, and further positioning the system interaction information based on the primary key information in the log table and other information corresponding to the primary key information in the later period. In the process, the log record of the interaction information between the systems is realized through the related record identifications, other personnel are not required to manually add records, the code of one line of log record is not required to be watched when a developer can quickly position data according to the primary key information in the later period, the workload of the developer is reduced, in the process of log record, the log record is realized according to the corresponding record identifications, further, the record parameters of corresponding data are not required to be assembled in each log record process, redundant codes irrelevant to service codes in the frequent assembly parameter process are avoided, and the difficulty of maintaining and expanding the later period codes is reduced.
The server provided by the embodiment of the present invention can implement the embodiment of the system interaction log recording method provided above, and specific function implementation is referred to the description in the method embodiment, and is not repeated herein.
The foregoing is only a partial embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (7)

1. A system interaction logging method, comprising:
establishing a log annotation, and associating the log annotation with a record mark in a preset log table;
establishing business logic of the log annotation according to the log annotation;
acquiring an interaction starting node of a current system;
if the service logic corresponds to the system interaction information which does not comprise data interaction, inserting the service logic before the interaction initiation node;
if the service logic corresponds to the system interaction information comprising data interaction, inserting the service logic before the adjacent node of the interaction initiation node;
acquiring a log annotation of the current system interactive program code, and determining a record identifier and a main key identifier for positioning the current system interactive information according to the log annotation;
extracting system interaction information with the record identifier from the system interaction information with the record identifier, and extracting primary key information corresponding to the primary key identifier from the system interaction information with the record identifier;
and adding the primary key information and the system interaction information with the record identifier into a preset log table.
2. The system interaction log recording method according to claim 1, wherein the extracting system interaction information having the record identifier from the system interaction information having the record identifier, extracting the primary key information corresponding to the primary key identifier, comprises:
and operating the business logic of the log annotation, and extracting the primary key information in the system interaction information and the system interaction information with the record identifier according to the business logic of the log annotation.
3. The system interaction logging method of claim 2, wherein after determining a logging identifier and a primary key identifier for locating current system interaction information according to the log annotation, further comprising:
the record identifier comprises an access parameter and a feedback parameter of the current system interaction interface;
and extracting the access parameters and the feedback parameters from the system interaction information according to the record identification.
4. The system interaction logging method according to claim 3, wherein after the access parameter and the feedback parameter are extracted from the system interaction information, the method further comprises
And adding the access parameters and the feedback parameters to corresponding record identifiers in the preset log table.
5. A system interaction logging apparatus, comprising:
the association module is used for establishing log annotation and associating the log annotation with a record mark in a preset log table;
the establishing module is used for establishing business logic of the log annotation according to the log annotation;
the node acquisition module is used for acquiring an interaction starting node of the current system;
the first insertion module is used for inserting the business logic before the interaction initiation node if the business logic corresponds to the system interaction information which does not comprise data interaction;
the second inserting module is used for inserting the service logic before the adjacent node of the interaction starting node if the service logic corresponds to the system interaction information comprising data interaction;
the record identification determining module is used for acquiring the log annotation of the current system interaction program code, and determining a record identification and a main key identification for positioning the current system interaction information according to the log annotation;
the first extraction module is used for extracting system interaction information with the record identifier from the system interaction information with the record identifier and extracting main key information corresponding to the main key identifier;
and the first adding module is used for adding the primary key information and the system interaction information with the record identifier into a preset log table.
6. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the system interaction logging method of any of claims 1 to 4.
7. A server, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the steps of the system interaction logging method according to any of claims 1 to 4.
CN201910078963.6A 2019-01-28 2019-01-28 System interaction log recording method and device, storage medium and server Active CN109857716B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910078963.6A CN109857716B (en) 2019-01-28 2019-01-28 System interaction log recording method and device, storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910078963.6A CN109857716B (en) 2019-01-28 2019-01-28 System interaction log recording method and device, storage medium and server

Publications (2)

Publication Number Publication Date
CN109857716A CN109857716A (en) 2019-06-07
CN109857716B true CN109857716B (en) 2023-06-27

Family

ID=66896414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910078963.6A Active CN109857716B (en) 2019-01-28 2019-01-28 System interaction log recording method and device, storage medium and server

Country Status (1)

Country Link
CN (1) CN109857716B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324510B (en) * 2020-02-21 2024-04-02 腾讯科技(深圳)有限公司 Log processing method and device and electronic equipment
CN113282475B (en) * 2021-06-02 2022-12-06 青岛海尔科技有限公司 Method and device for evaluating interactive performance of interactive system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9460008B1 (en) * 2013-09-20 2016-10-04 Amazon Technologies, Inc. Efficient garbage collection for a log-structured data store
CN109271331A (en) * 2018-08-20 2019-01-25 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of log

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092742B (en) * 2011-10-31 2015-08-19 国际商业机器公司 Program log recording optimization method and system
US10049171B2 (en) * 2014-09-10 2018-08-14 Ca, Inc. Batch processed data structures in a log repository referencing a template repository and an attribute repository

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9460008B1 (en) * 2013-09-20 2016-10-04 Amazon Technologies, Inc. Efficient garbage collection for a log-structured data store
CN109271331A (en) * 2018-08-20 2019-01-25 平安普惠企业管理有限公司 Generation method, device, computer equipment and the storage medium of log

Also Published As

Publication number Publication date
CN109857716A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
US8429645B2 (en) Method for optimizing migration of software applications to address needs
CN110928772B (en) Test method and device
CN101135989B (en) Automatization test method and device for Web applied system
US7702959B2 (en) Error management system and method of using the same
US20190026193A1 (en) Method and apparatus for executing data recovery operation
CN111158741B (en) Method and device for monitoring dependency relationship change of service module on third party class library
CN110489310B (en) Method and device for recording user operation, storage medium and computer equipment
US7257735B2 (en) Identifying solutions to computer problems in client/server system
CN109857716B (en) System interaction log recording method and device, storage medium and server
US7418628B2 (en) Systems and methods for identifying solutions to computer problems using contexts and versions
CN111143383B (en) Data updating method and device, electronic equipment and storage medium
CN116560683A (en) Software updating method, device, equipment and storage medium
US7302610B2 (en) Identifying solutions to computer problems in main system by service system in distributed system landscape
CN114356964A (en) Data blood margin construction method and device, storage medium and electronic equipment
US7403933B2 (en) Identifying solutions to computer problems in main system by service system
CN116561146A (en) Database log recording method, device, computer equipment and computer readable storage medium
KR20070019881A (en) Error management system providing debugging information and method using the same
CN111338609B (en) Information acquisition method, device, storage medium and terminal
CN111488286B (en) Method and device for independently developing Android modules
CN111459547B (en) Method and device for displaying function call link
CN114281688A (en) Codeless or low-code automatic case management method and device
CN107885537A (en) Configuration file loading method and device
CN117555621A (en) Policy processing method and device
CN116582592A (en) Method, apparatus, device and medium for managing services of an application
CN115686592A (en) Method and system for maintaining small program, storage medium and computer equipment

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