CN116225830A - Service operation log reporting method and device, computer equipment and storage medium - Google Patents
Service operation log reporting method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN116225830A CN116225830A CN202211618287.5A CN202211618287A CN116225830A CN 116225830 A CN116225830 A CN 116225830A CN 202211618287 A CN202211618287 A CN 202211618287A CN 116225830 A CN116225830 A CN 116225830A
- Authority
- CN
- China
- Prior art keywords
- service operation
- interface
- service
- dynamic data
- data
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application relates to a business operation log reporting method, a business operation log reporting device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: when a service operation request is received, acquiring operation attribute data of service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing service operation; determining an interface data template corresponding to a business operation interface in a preset interface log template; filling an interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface; and when the service operation interface is successfully invoked, reporting the service operation log based on the operation attribute data and the service operation dynamic data. By adopting the method, the resources consumed by system maintenance can be saved.
Description
Technical Field
The present invention relates to the field of log technologies, and in particular, to a method, an apparatus, a computer device, a storage medium, and a computer program product for reporting a service operation log.
Background
With the development of computer technology, journaling technology has emerged. The log records information of various operations or events occurring in the computer system, facilitating knowledge of historical computer system behavior through the log for corresponding adjustment or analysis. For example, when the user performs a business operation, a business operation log can be generated for the business operation of the user, so that the user can view historical operation data, and business personnel can be assisted in performing business analysis. In general, when a user performs a service operation through a terminal, a service center can receive an operation request sent by the user, call an interface of the service operation to implement the service operation, acquire log information to be recorded by the service operation after the service operation is completed, and report the log information to an audit server to generate a service operation log.
However, in the current mode of acquiring log information of service operation after the service operation is completed and reporting the log information to an audit server to generate a service operation log, the service codes of the service center station need to process specific service operation and report the log, so that the service codes are chaotic and the consumption of system maintenance resources is high.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device, a computer readable storage medium, and a computer program product for reporting a service operation log, which can save resources consumed by system maintenance.
In a first aspect, the present application provides a method for reporting a service operation log. The method comprises the following steps:
when a service operation request is received, acquiring operation attribute data of service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing the service operation;
determining an interface data template corresponding to the service operation interface in a preset interface log template;
filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and when the service operation interface is successfully invoked, reporting a service operation log based on the operation attribute data and the service operation dynamic data.
In one embodiment, the operation attribute data includes operation menu data; the obtaining the operation attribute data of the service operation indicated by the service operation request includes:
determining a service authority module corresponding to a service operation interface for realizing service operation indicated by the service operation request according to the service operation request;
performing authority verification on the service authority module according to the user object identifier carried by the service operation request to obtain an authority verification result;
And when the authority verification result representation verification passes, acquiring operation menu data matched with the service authority module.
In one embodiment, the determining, in a preset interface log template, an interface data template corresponding to the service operation interface includes:
acquiring a service interface path carried by the service operation request, wherein the service interface path is used for representing the position of a service operation interface for triggering and calling the service operation;
and determining an interface data template taking the service interface path as an index in a preset interface log template.
In one embodiment, the filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface includes:
determining dynamic data items in the interface data templates according to a preset dynamic data item format;
acquiring a service operation parameter value from the service operation request according to the service operation parameter name in the dynamic data item;
determining a dynamic data item value corresponding to the dynamic data item based on the business operation parameter value;
And replacing the dynamic data item in the interface data template with the corresponding dynamic data item value to obtain the business operation dynamic data corresponding to the business operation interface.
In one embodiment, the determining the dynamic data item in the interface data template according to the preset dynamic data item format includes:
determining a dynamic item starting identification of a preset dynamic data item format;
and when the dynamic item starting identification is identified in the interface data template and the item started from the dynamic item starting identification accords with a preset dynamic data item format, determining that the item started from the dynamic item starting identification is a dynamic data item in the interface data template.
In one embodiment, the determining, based on the service operation parameter value, a dynamic data item value corresponding to the dynamic data item includes:
when the dynamic data item accords with the dynamic data item format of the enumeration type, determining an enumeration value sequence identifier in the dynamic data item;
and selecting an enumeration value corresponding to the business operation parameter value in the enumeration value sequence identified by the enumeration value sequence identification from a preset enumeration dynamic template to serve as a dynamic data item value corresponding to the dynamic data item.
In one embodiment, when the service operation interface is successfully invoked, reporting a service operation log based on the operation attribute data and the service operation dynamic data includes:
when the service operation interface is successfully called, a log reporting interface is called, and the operation attribute data and the service operation dynamic data are transmitted to the log reporting interface;
and generating and reporting a service operation log comprising the operation attribute data and the service operation dynamic data through the log reporting interface.
In a second aspect, the present application further provides a service operation log reporting device. The device comprises:
the data acquisition module is used for acquiring operation attribute data of the business operation indicated by the business operation request when the business operation request is received; the service operation request is used for triggering and calling a service operation interface for realizing the service operation; determining an interface data template corresponding to the service operation interface in a preset interface log template; filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
And the log reporting module is used for reporting the service operation log based on the operation attribute data and the service operation dynamic data when the service operation interface is successfully invoked.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
when a service operation request is received, acquiring operation attribute data of service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing the service operation;
determining an interface data template corresponding to the service operation interface in a preset interface log template;
filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and when the service operation interface is successfully invoked, reporting a service operation log based on the operation attribute data and the service operation dynamic data.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
When a service operation request is received, acquiring operation attribute data of service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing the service operation;
determining an interface data template corresponding to the service operation interface in a preset interface log template;
filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and when the service operation interface is successfully invoked, reporting a service operation log based on the operation attribute data and the service operation dynamic data.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
when a service operation request is received, acquiring operation attribute data of service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing the service operation;
determining an interface data template corresponding to the service operation interface in a preset interface log template;
Filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and when the service operation interface is successfully invoked, reporting a service operation log based on the operation attribute data and the service operation dynamic data.
According to the method, the device, the computer equipment, the storage medium and the computer program product for reporting the business operation log, the business operation dynamic data can be determined through the interface data template corresponding to the business operation interface in the preset interface log template, so that the business operation dynamic data can dynamically change along with different business operations; in addition, the operation attribute data and the service operation dynamic data required by the report of the service operation log are obtained and the service operation is realized by calling the service operation interface in parallel, namely, the report part of the service operation log and the call part of the service operation interface are decoupled, so that the system maintenance efficiency is improved, and the resources consumed by the system maintenance are saved.
Drawings
FIG. 1 is an application environment diagram of a method for reporting a business operation log in one embodiment;
FIG. 2 is a flow chart of a method for reporting a business operation log in one embodiment;
FIG. 3 is a flowchart illustrating steps for populating an interface data template according to a business operation request to obtain business operation dynamic data corresponding to a business operation interface, according to one embodiment;
FIG. 4 is a diagram of an example of an interface data template in one embodiment;
FIG. 5 is a diagram of an example sequence of enumerated values in one embodiment;
FIG. 6 is an application environment diagram of a specific application scenario in one embodiment;
FIG. 7 is a schematic diagram of a business operation log for sending messages in one embodiment;
FIG. 8 is a block diagram illustrating a structure of a service operation log reporting apparatus in one embodiment;
fig. 9 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The method for reporting the business operation log provided by the embodiment of the application can be applied to an application environment shown in fig. 1. The client 102 may communicate with a middleware layer where the log reporting middleware 104 is located through a network, and the log reporting middleware 104 may communicate with the audit server 110. Specifically, when the log reporting middleware 104 receives a service operation request from the client 102, the log reporting middleware 104 acquires operation attribute data and service operation dynamic data, and when the service operation interface 108 is successfully invoked by the controller 106, the log reporting middleware 104 reports the service operation log to the audit server 110 based on the operation attribute data and the service operation dynamic data. The client 102 may run on a terminal, which may be various desktop computers, notebook computers, smart phones, and tablet computers. The log reporting middleware 104 is a computer program module for implementing log reporting, the controller 106 is a computer program module for responding to a service operation request and calling a service operation interface 108 indicated by the service operation request, the log reporting middleware 104, the controller 106 and the service operation interface 108 can be deployed in a middle platform, the middle platform is a service platform between a service end on a server and a client end on a terminal, and the audit service end 110 is deployed on the service end. The middle station and the server can be realized by different servers, and can also be realized by the same server. The server may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a method for reporting a service operation log is provided, and this embodiment is described by taking the application of the method to the log reporting middleware 104 in fig. 1 as an example, the method includes the following steps:
step 202, when a service operation request is received, operation attribute data of service operation indicated by the service operation request is obtained; the service operation request is used for triggering and calling a service operation interface for realizing service operation.
Wherein business operations are the actions of operating objects in a computer system to implement business logic. The business operation request is a request for acquiring a business service from a server to realize business operation. The business operation request may be an HTTP request transmitted through HTTP (Hyper Text Transfer Protocol ). The interfaces are communication channels between different computer program modules. The business operation interface is an interface of a business service computer program module that implements business operations. The operation attribute data is data describing static attributes of business operations.
In one embodiment, the operation attribute data may include operation identity data and operation time. When a service operation request is received, the log reporting middleware can acquire the parameter value of the operation identity data and the parameter value of the operation time from the service operation request according to the parameter name of the preconfigured operation identity data and the parameter name of the operation time, and the parameter value of the operation identity data is the operation identity data and the parameter value of the operation time is the operation time. The operation identity data is the identity data of the operation identity triggering the service operation request. The operation identity data includes operator name and operator mobile phone number.
In one embodiment, the operation attribute data may include operation menu data. When a service operation request is received, the log reporting middleware can determine a service authority module indicated by service operation according to the service operation request, and the operation menu data is determined through the service authority module.
Step 204, determining an interface data template corresponding to the business operation interface in a preset interface log template.
The interface log template is a preset log template in which the interface data templates of a plurality of service operation interfaces are recorded. The interface log template may be JSON (JavaScript Object Notation, JS object numbered musical notation) formatted data. The interface data template is a template for determining the service operation dynamic data to be reported by the corresponding service operation interface.
In one embodiment, the log reporting middleware may determine an interface identifier of a service operation interface indicated by the service operation request, and query an interface data template corresponding to the service operation interface from a preset interface log template by virtue of the interface identifier. The interface identifier may be a service interface path of the service operation interface.
And 206, filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface.
The business operation dynamic data is data which dynamically changes according to different business operations.
In one embodiment, the log reporting middleware can identify dynamic data items to be filled from the interface data template, determine values of the dynamic data items according to the service operation request, replace the dynamic data items in the interface data template with the values of the dynamic data items, and obtain service operation dynamic data corresponding to the service operation interface. Wherein the dynamic data item is data to be filled with a specific value in the interface data template.
In one embodiment, when the dynamic data item accords with the dynamic data item format of the preset data type, the value of the dynamic data item is obtained from the preset dynamic data template, the dynamic data item in the interface data template is replaced by the value of the dynamic data item, and the service operation dynamic data corresponding to the service operation interface is obtained.
And step 208, when the service operation interface is successfully invoked, reporting the service operation log based on the operation attribute data and the service operation dynamic data.
The business operation log is information recorded for business operations after the business operations occur. The business operations diary allows the impact of the business operations on the computer system to be traced.
In one embodiment, when the service operation interface is successfully invoked, the log reporting middleware can upload the operation attribute data and the service operation dynamic data to the auditing server, and the auditing server generates a service operation log comprising the operation attribute data and the service operation dynamic data.
In the service operation log reporting method, the service operation dynamic data can be determined through the interface data template corresponding to the service operation interface in the preset interface log template, so that the service operation dynamic data can dynamically change along with different service operations; in addition, the operation attribute data and the service operation dynamic data required by the report of the service operation log are obtained and the service operation is realized by calling the service operation interface in parallel, namely, the report part of the service operation log and the call part of the service operation interface are decoupled, so that the system maintenance efficiency is improved, and the resources consumed by the system maintenance are saved.
In one embodiment, the operation attribute data includes operation menu data, and the step of acquiring operation attribute data of the business operation indicated by the business operation request in step 202 includes: according to the service operation request, determining a service authority module corresponding to a service operation interface for realizing service operation indicated by the service operation request; performing authority verification on a service authority module according to a user object identifier carried by a service operation request to obtain an authority verification result; and when the right verification result representation verification passes, acquiring operation menu data matched with the service right module.
The service authority module is a computer program module for checking whether the user object identifier has the authority to use the service operation interface. The user object identification is an identification of the operation identity in the computer system. Rights verification is the act of verifying whether a user object identification has rights to use a business operations interface. The right verification result represents that verification passes, and indicates that the user object identifier has the right to use the service operation interface, the service operation request sent by the user object identifier can be responded by the controller, and the controller invokes the service operation interface.
In this embodiment, according to the user object identifier carried by the service operation request, the authority verification is performed on the service authority module, so that the system security can be ensured; after the verification is passed, the operation menu data matched with the service authority module is obtained, so that conditions are created for subsequent service operation log reporting based on operation attribute data comprising the operation menu data, and further the service operation log reporting can be realized.
In one embodiment, the log reporting middleware may obtain a service interface path of a service operation interface carried by the service operation request, and query a service permission module corresponding to the service interface path from a lookup table in which a correspondence between the service interface path and the service permission module is recorded by means of the service interface path.
In one embodiment, when the right verification result indicates that verification is passed, the log reporting middleware can read the operation menu data from the storage area storing the matching relationship between the service right module and the operation menu data by means of the service right module.
In one embodiment, step 204 includes: acquiring a service interface path carried by a service operation request, wherein the service interface path is used for characterizing the position of a service operation interface for triggering and calling to realize service operation; and determining an interface data template taking the service interface path as an index in a preset interface log template.
Wherein each interface data template in the interface log template can be composed of fixed fields, such as event name, instance name, and operation detail field. Each interface data template in the interface log template may use the service interface path as an index, and a field corresponding to the service interface path may be called a Key (Key value).
In this embodiment, through a service interface path carried by a service operation request, an interface data template may be conveniently obtained from a preset interface log template, so that service operation dynamic data may be determined based on the interface data template, so that service operation log reporting may be performed based on the service operation dynamic data.
In one embodiment, the log reporting middleware may obtain a service interface path carried by the service operation request, traverse an index of an interface data template in a preset interface log template, and obtain an interface data template corresponding to the traversed index when the traversed index is the same as the service interface path.
In one embodiment, the log reporting middleware may traverse the index of the interface data template in a preset interface log template, and stop processing the service operation request when the traversed index is different from the service interface path carried by the service operation request.
In one embodiment, as shown in FIG. 3, step 206 includes steps 302 through 308:
step 302, determining the dynamic data item in the interface data template according to the preset dynamic data item format.
The preset dynamic data item format is a preset format for identifying dynamic data items. The dynamic data items are data in the interface data templates that need to be substituted filled to form business operation dynamic data.
In one embodiment, the dynamic data item format may include a dynamic data item start identifier and a parameter indication identifier, which may include an indication start identifier and an indication end identifier, the parameter indication identifier pointing to a business operational parameter name that needs to be queried. For example, as shown in the exemplary schematic of the interface data template of fig. 4, the dynamic data item format may be "$ { }", the dynamic data item start identifier may be "$", "the parameter indication identifier may be" { } ", the parameter indication identifier may be" { ", the parameter indication identifier may be" } ", and the dynamic data item may be data constrained by" $ { } "such as" $ { username }).
In one embodiment, the dynamic data item format may include a specific identifier that has the function of specifying both a starting location of the dynamic data item and a parameter location of the dynamic data item. In another embodiment, the dynamic data item format may include a dynamic data item indication identifier and a data length parameter value for specifying a data length occupied by a business operation parameter name to be queried indicated by the dynamic data item indication identifier.
Step 304, obtaining the service operation parameter value from the service operation request according to the service operation parameter name in the dynamic data item.
The service operation parameter name is the name of the preset service operation parameter in the dynamic data item. The service operation parameter name may be a parameter between an indication start identifier and an indication end identifier of the parameter indication identifier. As shown in fig. 4, when the dynamic data item is "$ { username }", the business operation parameter name may be "username" between the indication start identifier "{" and the indication end identifier "}". The service operation parameter value is a value of a service operation parameter.
In one embodiment, the log reporting middleware may obtain a service operation parameter name in the dynamic data item, query the service operation parameter name in data transmitted by the service operation request, and obtain a service operation parameter value corresponding to the service operation parameter name when the service operation parameter name is queried.
Step 306, determining a dynamic data item value corresponding to the dynamic data item based on the business operation parameter value.
Wherein the dynamic data item value is a specific value of the dynamic data item that is required to be filled by the interface data template and is adapted to the business operation request.
In one embodiment, the logging middleware may determine the business operational parameter value as a dynamic data item value corresponding to the dynamic data item.
In one embodiment, when the dynamic data item accords with the dynamic data item format of the enumeration type, the log reporting middleware may acquire an enumeration value matched with the service operation parameter value from a preset enumeration dynamic template according to the service operation parameter value, and use the enumeration value as a dynamic data item value corresponding to the dynamic data item.
And 308, replacing the dynamic data item in the interface data template with a corresponding dynamic data item value to obtain the business operation dynamic data corresponding to the business operation interface.
In one embodiment, the log reporting middleware may replace a plurality of dynamic data items in the interface data template with respective corresponding dynamic data item values, obtain a filled interface data template, and use the filled interface data template as service operation dynamic data corresponding to the service operation interface.
In this embodiment, the dynamic data item in the interface data template may be identified according to a preset dynamic data item format, so as to determine the data portion of the interface data template that needs to be replaced to form the service operation dynamic data; and further, acquiring a service operation parameter value according to the service operation parameter name in the dynamic data item to determine the dynamic data item value, replacing the dynamic data item with the dynamic data item value, completing the filling of the interface data template, and accurately acquiring the service operation dynamic data corresponding to the service operation interface.
In one embodiment, step 302 includes: determining a dynamic item starting identification of a preset dynamic data item format; when the dynamic item starting identification is identified in the interface data template and the item started from the dynamic item starting identification accords with a preset dynamic data item format, determining that the item started from the dynamic item starting identification is the dynamic data item in the interface data template.
Wherein the dynamic item start identifier is an identifier in the dynamic item data format for indicating a start position of the dynamic data item.
In this embodiment, through the dynamic item start identifier, the item that may be a dynamic data item in the interface data template can be quickly identified, and then the identified item is determined to be a dynamic data item through the preset dynamic item data format, so that the dynamic data item in the interface data template can be quickly and accurately determined.
In one embodiment, the log reporting middleware may determine a dynamic data item start identifier of a preset dynamic data item format, traverse character data of the interface data template, and determine a set of character data with the dynamic data item start identifier as start data as a dynamic data item when the set of character data conforms to the dynamic data item format when traversing to the dynamic data item start identifier in the interface data template.
In one embodiment, step 306 includes: when the dynamic data item accords with the dynamic data item format of the enumeration type, determining an enumeration value sequence identifier in the dynamic data item; and selecting an enumeration value corresponding to the business operation parameter value in the enumeration value sequence identified by the enumeration value sequence identification from a preset enumeration dynamic template to be used as a dynamic data item value corresponding to the dynamic data item.
Wherein the enumeration type is a data type of a variable that takes a value only from a pre-enumerated sequence of values. The enumeration value sequence identifier is an identifier of an enumeration value sequence to which a service operation parameter belongs in the dynamic data item. The preset enumeration dynamic template is a preset template comprising a plurality of enumeration value sequences. The sequence of enumeration values in the enumeration dynamic template may be dynamically changed, such as adding a sequence of enumeration values, deleting a sequence of enumeration values, or modifying enumeration values in a sequence of enumeration values. The enumerated values are values in a sequence of enumerated values.
In one embodiment, the dynamic data item format may include an enumeration type identifier in addition to the dynamic data item start identifier and the parameter indication identifier; when the parameter indication identifier includes a start and a stop, the enumeration type identifier may be between an indication start identifier and an indication stop identifier of the parameter indication identifier. For example, as shown in fig. 4, the enumeration type identifier may be "|", the enumeration type identifier "|" may be among the parameter indication identifiers "{ }, the dynamic data item format of the enumeration type may be" $ { |}, the dynamic data item conforming to the dynamic data item format of the enumeration type may be "$ { type|msgtype }, where" type "may be a service operation parameter in the dynamic data item, and" msgType "may be an enumeration value sequence identifier. As shown in the exemplary schematic diagram of the enumeration value sequence of fig. 5, the value of the service operation parameter corresponding to "type" may be 1, 2, 3, 4, 5 or 6, and when the value of the service operation parameter of "type" is 1, the enumeration value corresponding to the enumeration value of the sequence identified by "msgType" and the service operation parameter value is identified as "product message", the enumeration value is used as a dynamic data item value, and the dynamic data item value is "product message".
In this embodiment, in addition to determining a dynamic data item value based on a service operation request, the dynamic data item value may also be determined by acquiring an enumeration value, and when the dynamic data item accords with a dynamic data item format of an enumeration type, an enumeration value corresponding to a service operation parameter value is determined by a preset enumeration dynamic template, and the enumeration value is used as the dynamic data item value, so that the configuration is flexible and the system is suitable for more service operation log scenes.
In one embodiment, step 208 includes: when the service operation interface is successfully called, a log reporting interface is called, and operation attribute data and service operation dynamic data are transmitted to the log reporting interface; and generating and reporting a service operation log comprising operation attribute data and service operation dynamic data through a log reporting interface.
The log reporting interface is an interface of a computer program module for realizing the reporting of the business operation log.
In this embodiment, when the service operation interface is successfully invoked, it is described that the service operation interface successfully responds to the service operation request to implement the service operation, at this time, the acquired operation attribute data and the service operation dynamic data are transmitted to the log reporting interface, the service operation log is generated and reported through the log reporting interface, the reporting timer of the service operation log is determined by the invoking state of the service operation interface, and accords with the logic of log reporting, and the service operation log is reported through the log reporting interface, where the log reporting interface is separated from the service operation interface, so that decoupling of the log reporting code and the service operation code is implemented, and further the maintenance efficiency of the system is improved.
In one embodiment, when the service operation interface is successfully invoked, the log reporting middleware may invoke the log reporting interface to transfer the operation attribute data and the service operation dynamic data to the log reporting interface. The audit server side can generate a business operation log according to the operation attribute data and the business operation dynamic data which are transmitted by the log reporting interface, and write the business operation log into the database.
In one embodiment, as shown in fig. 6, in a specific application scenario, a middle platform may be deployed with a Middleware layer (Middleware layer), a Router layer (routing layer), a Controller layer (Controller layer), and a service layer (service layer), where a log reporting Middleware is in the Middleware layer, a service operation interface and a log reporting interface are in the service layer, and a service server is a service end for implementing a specific service operation. The service operation log reporting method specifically comprises the following steps:
when the Middleware layer receives a service operation request, the log reporting Middleware of the Middleware layer can acquire the operation time, the name of an operator and the mobile phone number of the operator of the service operation indicated by the service operation request; and determining a service authority module corresponding to the service interface path according to the service interface path of the service operation interface carried by the service operation request, and acquiring operation menu data (such as menu names) matched with the service authority module. Meanwhile, when the Middleware layer receives the service operation request, the service operation request can reach the Router layer through the Middleware layer, and the Router layer starts to respond to the service operation request to execute the service operation.
The log reporting middleware can determine an interface data template taking the service interface path as an index in a preset interface log template according to the service interface path carried by the service operation request, and determine dynamic data items in the interface data template according to a preset dynamic data item format; acquiring a service operation parameter value from a service operation request according to the service operation parameter name in the dynamic data item; determining a dynamic data item value corresponding to the dynamic data item based on the business operation parameter value; and replacing the dynamic data item in the interface data template with a corresponding dynamic data item value to obtain the business operation dynamic data corresponding to the business operation interface.
When the dynamic data item accords with the dynamic data item format of the enumeration type, the log reporting middleware can determine an enumeration value sequence identifier in the dynamic data item; and selecting an enumeration value corresponding to the business operation parameter value in the enumeration value sequence identified by the enumeration value sequence identification from a preset enumeration dynamic template to be used as a dynamic data item value corresponding to the dynamic data item.
When the service operation interface is successfully called by the Controller layer, the log reporting middleware can call the log reporting interface of the service layer, and the operation time, the name of an operator, the mobile phone number of the operator, the menu name and the service operation dynamic data are transmitted to the log reporting interface; and generating and reporting a service operation log comprising operation time, operator names, operator mobile phone numbers, menu names and service operation dynamic data by an audit server through a log reporting interface. Taking the example that the service operation is sending a message, the service operation log may be as shown in fig. 7.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a service operation log reporting device for implementing the above related service operation log reporting method. The implementation scheme of the solution to the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitation in the embodiments of the device for reporting a service operation log provided below may refer to the limitation of the method for reporting a service operation log, which is not described herein.
In one embodiment, as shown in fig. 8, there is provided a service operation log reporting apparatus 800, including: a data acquisition module 810 and a log reporting module 820, wherein:
the data obtaining module 810 is configured to obtain, when receiving a service operation request, operation attribute data of a service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing service operation; determining an interface data template corresponding to a business operation interface in a preset interface log template; filling an interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and the log reporting module 820 is configured to report the service operation log based on the operation attribute data and the service operation dynamic data when the service operation interface is successfully invoked.
In one embodiment, the operation attribute data includes operation menu data, and the data obtaining module 810 is further configured to determine, according to the service operation request, a service permission module corresponding to a service operation interface for implementing the service operation indicated by the service operation request; performing authority verification on a service authority module according to a user object identifier carried by a service operation request to obtain an authority verification result; and when the right verification result representation verification passes, acquiring operation menu data matched with the service right module.
In one embodiment, the data obtaining module 810 is further configured to obtain a service interface path carried by the service operation request, where the service interface path is used to characterize a location of a service operation interface for triggering and invoking a service operation; and determining an interface data template taking the service interface path as an index in a preset interface log template.
In one embodiment, the data acquisition module 810 is further configured to determine the dynamic data item in the interface data template according to a preset dynamic data item format; acquiring a service operation parameter value from a service operation request according to the service operation parameter name in the dynamic data item; determining a dynamic data item value corresponding to the dynamic data item based on the business operation parameter value; and replacing the dynamic data item in the interface data template with a corresponding dynamic data item value to obtain the business operation dynamic data corresponding to the business operation interface.
In one embodiment, the data acquisition module 810 is further configured to determine a dynamic item start identifier of a preset dynamic data item format; when the dynamic item starting identification is identified in the interface data template and the item started from the dynamic item starting identification accords with a preset dynamic data item format, determining that the item started from the dynamic item starting identification is the dynamic data item in the interface data template.
In one embodiment, the data acquisition module 810 is further configured to determine an enumeration value sequence identifier in the dynamic data item when the dynamic data item conforms to a dynamic data item format of an enumeration type; and selecting an enumeration value corresponding to the business operation parameter value in the enumeration value sequence identified by the enumeration value sequence identification from a preset enumeration dynamic template to be used as a dynamic data item value corresponding to the dynamic data item.
In one embodiment, the log reporting module 820 is further configured to call the log reporting interface when the service operation interface is successfully called, and transfer the operation attribute data and the service operation dynamic data to the log reporting interface; and generating and reporting a service operation log comprising operation attribute data and service operation dynamic data through a log reporting interface.
All or part of the modules in the service operation log reporting device can be realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 9. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data to be stored when the business operation log is reported. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method for reporting a business operation log.
It will be appreciated by those skilled in the art that the structure shown in fig. 9 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application applies, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
when a service operation request is received, acquiring operation attribute data of service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing service operation;
determining an interface data template corresponding to a business operation interface in a preset interface log template;
filling an interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and when the service operation interface is successfully invoked, reporting the service operation log based on the operation attribute data and the service operation dynamic data.
In one embodiment, the operation attribute data comprises operation menu data, and the processor when executing the computer program further performs the steps of: according to the service operation request, determining a service authority module corresponding to a service operation interface for realizing service operation indicated by the service operation request; performing authority verification on a service authority module according to a user object identifier carried by a service operation request to obtain an authority verification result; and when the right verification result representation verification passes, acquiring operation menu data matched with the service right module.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a service interface path carried by a service operation request, wherein the service interface path is used for characterizing the position of a service operation interface for triggering and calling to realize service operation; and determining an interface data template taking the service interface path as an index in a preset interface log template.
In one embodiment, the processor when executing the computer program further performs the steps of: determining dynamic data items in the interface data templates according to a preset dynamic data item format; acquiring a service operation parameter value from a service operation request according to the service operation parameter name in the dynamic data item; determining a dynamic data item value corresponding to the dynamic data item based on the business operation parameter value; and replacing the dynamic data item in the interface data template with a corresponding dynamic data item value to obtain the business operation dynamic data corresponding to the business operation interface.
In one embodiment, the processor when executing the computer program further performs the steps of: determining a dynamic item starting identification of a preset dynamic data item format; when the dynamic item starting identification is identified in the interface data template and the item started from the dynamic item starting identification accords with a preset dynamic data item format, determining that the item started from the dynamic item starting identification is the dynamic data item in the interface data template.
In one embodiment, the processor when executing the computer program further performs the steps of: when the dynamic data item accords with the dynamic data item format of the enumeration type, determining an enumeration value sequence identifier in the dynamic data item; and selecting an enumeration value corresponding to the business operation parameter value in the enumeration value sequence identified by the enumeration value sequence identification from a preset enumeration dynamic template to be used as a dynamic data item value corresponding to the dynamic data item.
In one embodiment, the processor when executing the computer program further performs the steps of: when the service operation interface is successfully called, a log reporting interface is called, and operation attribute data and service operation dynamic data are transmitted to the log reporting interface; and generating and reporting a service operation log comprising operation attribute data and service operation dynamic data through a log reporting interface.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to comply with the related laws and regulations and standards of the related countries and regions.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.
Claims (10)
1. A method for reporting a service operation log, the method comprising:
when a service operation request is received, acquiring operation attribute data of service operation indicated by the service operation request; the service operation request is used for triggering and calling a service operation interface for realizing the service operation;
determining an interface data template corresponding to the service operation interface in a preset interface log template;
Filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and when the service operation interface is successfully invoked, reporting a service operation log based on the operation attribute data and the service operation dynamic data.
2. The method of claim 1, wherein the operational attribute data comprises operational menu data; the obtaining the operation attribute data of the service operation indicated by the service operation request includes:
determining a service authority module corresponding to a service operation interface for realizing service operation indicated by the service operation request according to the service operation request;
performing authority verification on the service authority module according to the user object identifier carried by the service operation request to obtain an authority verification result;
and when the authority verification result representation verification passes, acquiring operation menu data matched with the service authority module.
3. The method according to claim 1, wherein determining an interface data template corresponding to the business operation interface in a preset interface log template includes:
Acquiring a service interface path carried by the service operation request, wherein the service interface path is used for representing the position of a service operation interface for triggering and calling the service operation;
and determining an interface data template taking the service interface path as an index in a preset interface log template.
4. The method according to claim 1, wherein said populating the interface data template according to the business operation request to obtain business operation dynamic data corresponding to the business operation interface, comprises:
determining dynamic data items in the interface data templates according to a preset dynamic data item format;
acquiring a service operation parameter value from the service operation request according to the service operation parameter name in the dynamic data item;
determining a dynamic data item value corresponding to the dynamic data item based on the business operation parameter value;
and replacing the dynamic data item in the interface data template with the corresponding dynamic data item value to obtain the business operation dynamic data corresponding to the business operation interface.
5. The method of claim 4, wherein said determining the dynamic data item in the interface data template according to a predetermined dynamic data item format comprises:
Determining a dynamic item starting identification of a preset dynamic data item format;
and when the dynamic item starting identification is identified in the interface data template and the item started from the dynamic item starting identification accords with a preset dynamic data item format, determining that the item started from the dynamic item starting identification is a dynamic data item in the interface data template.
6. The method of claim 4, wherein determining the dynamic data item value corresponding to the dynamic data item based on the business operation parameter value comprises:
when the dynamic data item accords with the dynamic data item format of the enumeration type, determining an enumeration value sequence identifier in the dynamic data item;
and selecting an enumeration value corresponding to the business operation parameter value in the enumeration value sequence identified by the enumeration value sequence identification from a preset enumeration dynamic template to serve as a dynamic data item value corresponding to the dynamic data item.
7. The method of claim 1, wherein when the service operation interface call is successful, reporting a service operation log based on the operation attribute data and the service operation dynamic data, comprising:
When the service operation interface is successfully called, a log reporting interface is called, and the operation attribute data and the service operation dynamic data are transmitted to the log reporting interface;
and generating and reporting a service operation log comprising the operation attribute data and the service operation dynamic data through the log reporting interface.
8. A service operation log reporting device, the device comprising:
the data acquisition module is used for acquiring operation attribute data of the business operation indicated by the business operation request when the business operation request is received; the service operation request is used for triggering and calling a service operation interface for realizing the service operation; determining an interface data template corresponding to the service operation interface in a preset interface log template; filling the interface data template according to the service operation request to obtain service operation dynamic data corresponding to the service operation interface;
and the log reporting module is used for reporting the service operation log based on the operation attribute data and the service operation dynamic data when the service operation interface is successfully invoked.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211618287.5A CN116225830A (en) | 2022-12-15 | 2022-12-15 | Service operation log reporting method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211618287.5A CN116225830A (en) | 2022-12-15 | 2022-12-15 | Service operation log reporting method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116225830A true CN116225830A (en) | 2023-06-06 |
Family
ID=86572017
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211618287.5A Pending CN116225830A (en) | 2022-12-15 | 2022-12-15 | Service operation log reporting method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116225830A (en) |
-
2022
- 2022-12-15 CN CN202211618287.5A patent/CN116225830A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107798038B (en) | Data response method and data response equipment | |
CN111352935B (en) | Index creating method, device and equipment in block chain type account book | |
CN112819617B (en) | Data uplink method and device, electronic equipment and storage medium | |
CN116204540A (en) | Operation log recording method, device, equipment and storage medium | |
CN112035471B (en) | Transaction processing method and computer equipment | |
CN115495452A (en) | Data processing method, data processing device, computer equipment and storage medium | |
CN116225830A (en) | Service operation log reporting method and device, computer equipment and storage medium | |
CN112860755B (en) | Service identifier generation method, device, computer equipment and medium | |
CN117271445A (en) | Log data processing method, device, server, storage medium and program product | |
CN116880927A (en) | Rule management method, device, computer equipment and storage medium | |
CN117708117A (en) | Batch data processing method, device, electronic device and storage medium | |
CN118200314A (en) | File interaction method, device, computer equipment and storage medium | |
CN116011029A (en) | Information verification method, information verification device, computer equipment and storage medium | |
CN118400433A (en) | Message processing method, device, computer equipment, readable storage medium and product | |
CN118070067A (en) | Data verification method and device based on Flink technology and computer equipment | |
CN117951135A (en) | Data processing method, device, computer equipment and storage medium | |
CN116881318A (en) | Maintenance period entry generation method, device, computer equipment and storage medium | |
CN117155661A (en) | Risk log data pushing method, apparatus, computer device and storage medium | |
CN117150449A (en) | Source code use permission monitoring method, device, computer equipment and storage medium | |
CN117354154A (en) | Network element determination method, device, computer equipment and storage medium | |
CN117350689A (en) | Message notification method, device, computer equipment and storage medium | |
CN116633774A (en) | Platform address configuration method, device, computer equipment and storage medium | |
CN116562608A (en) | Service receipt status determining method and related products | |
CN116880869A (en) | System interface updating method, device, computer equipment and storage medium | |
CN116955357A (en) | Object identification recognition method and device 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 |