CN116204540A - Operation log recording method, device, equipment and storage medium - Google Patents

Operation log recording method, device, equipment and storage medium Download PDF

Info

Publication number
CN116204540A
CN116204540A CN202310269379.5A CN202310269379A CN116204540A CN 116204540 A CN116204540 A CN 116204540A CN 202310269379 A CN202310269379 A CN 202310269379A CN 116204540 A CN116204540 A CN 116204540A
Authority
CN
China
Prior art keywords
field
request
service
log
data before
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
Application number
CN202310269379.5A
Other languages
Chinese (zh)
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.)
Mingdu Zhiyun Zhejiang Technology Co Ltd
Original Assignee
Mingdu Zhiyun Zhejiang Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mingdu Zhiyun Zhejiang Technology Co Ltd filed Critical Mingdu Zhiyun Zhejiang Technology Co Ltd
Publication of CN116204540A publication Critical patent/CN116204540A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The application provides an operation log recording method, device, equipment and storage medium, and relates to the technical field of log recording. The method comprises the following steps: acquiring a plurality of operation requests, wherein the operation requests comprise adding, modifying or deleting operation requests, and the plurality of operation requests comprise operating a material management module in a medical service management system; acquiring business data before and after the operation corresponding to each operation request through an operation business interface corresponding to each operation request; and inputting the business data before and after the operation corresponding to each operation request into a log generation interface, respectively carrying out comparison processing on the business data before and after the operation corresponding to each operation request by the log generation interface, and generating an operation log corresponding to the operation request according to the comparison processing result, wherein the comparison processing result is used for indicating the change condition of the business data. By applying the embodiment of the application, the operation log can be uniformly managed.

Description

Operation log recording method, device, equipment and storage medium
Technical Field
The present invention relates to the field of log recording technologies, and in particular, to an operation log recording method, apparatus, device, and storage medium.
Background
Along with the development of computer technology, enterprises have stronger dependence on a service management system, and in order to ensure that the service management system runs stably and reliably, the operation condition of the service management system can be tracked by adopting a mode of recording an operation log, for example, in the pharmaceutical industry, information of what person inputs a small amount of materials, what person modifies a certain experimental purpose and the like can be recorded.
In the prior art, a corresponding operation service interface is allocated to each operation type, and an operation log of each operation type is generated on each operation service interface corresponding to each operation type. Correspondingly, the generated operation logs need to be acquired from each operation service interface and processed later.
However, in such a processing manner, the workload of collecting each operation log in the later period is increased, so how to uniformly manage the operation logs is a problem to be solved at present.
Disclosure of Invention
The present application aims to solve the above-mentioned drawbacks of the prior art, and to provide an operation log recording method, apparatus, device and storage medium, which can uniformly manage operation logs.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
In a first aspect, an embodiment of the present application provides an operation log recording method, where the method includes:
acquiring a plurality of operation requests, wherein the operation requests comprise adding, modifying or deleting operation requests, and the operation requests comprise operating a material management module in a medical service management system;
acquiring service data before and after the operation corresponding to each operation request through an operation service interface corresponding to each operation request;
and inputting the business data before and after the operation corresponding to each operation request into a log generation interface, respectively carrying out comparison processing on the business data before and after the operation corresponding to each operation request by the log generation interface, and generating operation logs corresponding to all the operation requests according to the comparison processing result, wherein the comparison processing result is used for indicating the change condition of the business data.
Optionally, before the service data before and after the operation corresponding to each operation request is obtained through the operation service interface corresponding to each operation request, the method further includes:
and configuring the service type, the operation type and the access method of each operation service interface according to the attribute information of each operation service interface, wherein the access method is used for indicating the method for acquiring the service data before and after the operation corresponding to each operation request.
Optionally, the obtaining, through the operation service interfaces corresponding to the operation requests, service data before and after the operation corresponding to the operation requests includes:
before the operation service interface is executed, calling a number taking method of the operation service interface to obtain service data before operation corresponding to an operation request;
and after the operation service interface is executed, calling a fetch method of the operation service interface to acquire the service data after the operation corresponding to each operation request.
Optionally, the log generating interface performs comparison processing on the service data before and after the operation corresponding to each operation request, and generates the operation logs corresponding to all the operation requests according to the result of the comparison processing, including:
the log generation interface respectively identifies fields in the business data before and after the operation corresponding to each operation request to obtain the information of the fields corresponding to each operation request, wherein the information of the fields comprises: field type, field name, and field value;
and respectively comparing the business data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and generating operation logs corresponding to all the operation requests according to the comparison result.
Optionally, the comparing processing is performed on the service data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and the generating operation logs corresponding to all operation requests according to the result of the comparing processing includes:
if the field type of the first field corresponding to the operation request is an array type, comparing the field values before and after the operation corresponding to the first field, and determining whether the field values before and after the operation are the same;
if the field values before and after the operation are different, using the field name of the first field as a key;
performing cycle comparison on each element of the field values before and after the operation corresponding to the first field, determining different elements in the field values before and after the operation, and taking the different elements as values respectively;
and generating an operation log corresponding to the operation request according to the key and the value.
Optionally, the comparing processing is performed on the service data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and the generating operation logs corresponding to all operation requests according to the result of the comparing processing includes:
If the field type of the second field corresponding to the operation request is a non-array type, comparing the field values before and after the operation corresponding to the second field, and determining whether the field values before and after the operation are the same;
if the field values before and after the operation are different, taking the field name of the second field as a key and taking the field value before and after the operation corresponding to the second field as a value;
and generating an operation log corresponding to the operation request according to the key and the value.
Optionally, the method further comprises:
and correlating the operation logs corresponding to all the operation requests and the service types and operation types corresponding to the operation service interfaces by using the log generation interface, and storing the operation logs and the service types and the operation types into a database.
Optionally, the method further comprises:
receiving a query request, wherein the query request carries a query keyword;
and determining a target operation log from the database according to the query keyword and the associated information of the operation log.
In a second aspect, an embodiment of the present application further provides an oplogging apparatus, where the apparatus includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a plurality of operation requests, the operation requests comprise adding, modifying or deleting operation requests, and the plurality of operation requests comprise operating a material management module in a medical service management system;
The second acquisition module is used for acquiring the business data before and after the operation corresponding to each operation request through the operation business interface corresponding to each operation request;
the generation module is used for inputting the business data before and after the operation corresponding to each operation request into the log generation interface, respectively carrying out comparison processing on the business data before and after the operation corresponding to each operation request by the log generation interface, and generating operation logs corresponding to all the operation requests according to the comparison processing result, wherein the comparison processing result is used for indicating the change condition of the business data.
Optionally, the apparatus further comprises: a configuration module;
the configuration module is configured to configure a service type, an operation type and a number obtaining method of each operation service interface according to attribute information of each operation service interface, where the number obtaining method is used to indicate a method for obtaining service data before and after an operation corresponding to each operation request.
Optionally, the second obtaining module is specifically configured to invoke, before the operation service interface executes, a method for obtaining service data before an operation corresponding to the operation request; and after the operation service interface is executed, calling a fetch method of the operation service interface to acquire the service data after the operation corresponding to each operation request.
Optionally, the generating module is specifically configured to identify, by the log generating interface, fields in the service data before and after the operation corresponding to each operation request, to obtain information of the fields corresponding to each operation request, where the information of the fields includes: field type, field name, and field value; and respectively comparing the business data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and generating operation logs corresponding to all the operation requests according to the comparison result.
Optionally, the generating module is further specifically configured to compare the field values before and after the operation corresponding to the first field if the field type of the first field corresponding to the operation request is an array type, and determine whether the field values before and after the operation are the same; if the field values before and after the operation are different, using the field name of the first field as a key; performing cycle comparison on each element of the field values before and after the operation corresponding to the first field, determining different elements in the field values before and after the operation, and taking the different elements as values respectively; and generating an operation log corresponding to the operation request according to the key and the value.
Optionally, the generating module is further specifically configured to compare the field values before and after the operation corresponding to the second field if the field type of the second field corresponding to the operation request is a non-array type, and determine whether the field values before and after the operation are the same; if the field values before and after the operation are different, taking the field name of the second field as a key and taking the field value before and after the operation corresponding to the second field as a value; and generating an operation log corresponding to the operation request according to the key and the value.
Optionally, the apparatus further comprises: an association module;
and the association module is used for associating the operation logs corresponding to all the operation requests and the service types and operation types corresponding to the operation service interfaces by the log generation interface and storing the operation logs and the service types and the operation types into a database.
Optionally, the apparatus further comprises: a query module;
the query module receives a query request, wherein the query request carries a query keyword; and determining a target operation log from the database according to the query keyword and the associated information of the operation log.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a storage medium, and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the oplogging method of the first aspect described above.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor performs the steps of the oplogging method of the first aspect described above.
The beneficial effects of this application are:
the embodiment of the application provides an operation log recording method, device, equipment and storage medium, wherein the method comprises the following steps: acquiring a plurality of operation requests, wherein the operation requests comprise addition, modification or deletion operation requests; acquiring business data before and after the operation corresponding to each operation request through an operation business interface corresponding to each operation request; and inputting the business data before and after the operation corresponding to each operation request into a log generation interface, respectively carrying out comparison processing on the business data before and after the operation corresponding to each operation request by the log generation interface, and generating an operation log corresponding to the operation request according to the comparison processing result, wherein the comparison processing result is used for indicating the change condition of the business data.
By adopting the operation log recording method provided by the embodiment of the application, each operation service interface can only acquire the service data before and after the operation corresponding to each operation request, and after the service data before and after the operation corresponding to each operation request acquired by each operation service interface is sent to the log generation interface, the comparison processing can be carried out on the service data before and after the operation corresponding to all the operation requests through the log generation interface, so that the operation log corresponding to all the operation requests is generated. That is, the operation logs corresponding to each operation request can be uniformly generated through the log generation interface, so that the workload of collecting each operation log in the later period can be avoided from being increased, and the operation logs can be uniformly managed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for recording an operation log according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another method for operation log recording according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating another method for operation log recording according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a method for recording an operation log according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a method for recording an operation log according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an operation log recording device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
Before explaining the embodiments of the present application in detail, an application scenario of the present application will be described first. The application scenario may specifically be a scenario of recording an operation log, where the operation log may belong to a pharmaceutical industry, or may belong to other industries, such as a financial industry, etc., and it should be noted that the application is not limited thereto. In the business management system corresponding to the pharmaceutical industry, the operation types of each business module can be respectively corresponding to operation business interfaces, for example, the operations of adding, modifying, deleting and the like of the material management module can be respectively corresponding to adding business interfaces, modifying business interfaces and deleting business interfaces. As can be seen from the description in the background section of the present application, the adding operation log, the modifying operation log and the deleting operation log of the material management module can be generated by the adding service interface, the modifying service interface and the deleting service interface, respectively. It can be understood that, if the operation logs corresponding to the service management modules need to be collected later, the operation logs need to be obtained from the operation service interfaces corresponding to the service management modules. Thus, since each operation log is too dispersed, there is a problem that it takes time to collect a plurality of operation logs.
In view of the above-mentioned technical problems, the present application proposes an operation log recording method, and specific content may refer to the following examples of the present application, which are not described herein. The operation service interfaces are only used for acquiring service data before and after operation, and the log generation interface can generate an operable log based on the service data before and after operation acquired by the operation service interfaces, that is, the operation logs are finally stored in the same database, so that the operation logs can be managed in a unified way.
The operation log recording method mentioned in the present application is exemplified as follows with reference to the accompanying drawings. Fig. 1 is a flow chart of a method for recording an operation log according to an embodiment of the present application. As shown in fig. 1, the method may include:
s101, acquiring a plurality of operation requests.
Wherein the operation request includes an add, modify, or delete operation request. For example, for a medical service management system, the material management module in the medical service management system may be operated, and the operation type may include operations of addition, modification, deletion, and the like. Taking a material as an example, a user may add the material to the material management module, modify information related to the material in the material management module, or delete the material from the material management module.
In one embodiment, the user may operate the medical service management system according to actual requirements, such as modifying experimental purposes, adding materials, etc., so as to generate an operation request. It should be understood that the plurality of operation requests may belong to the same management module in the medical service management system, such as a material management module, or may belong to different management modules in the medical service management system, and it should be noted that the application is not limited thereto.
S102, respectively acquiring service data before and after the operation corresponding to each operation request through the operation service interfaces corresponding to each operation request.
As can be seen from the above description, different operation types correspond to different operation service interfaces, for example, an addition operation type corresponds to an addition service interface, a modification operation type corresponds to a modification service interface, and a deletion operation type corresponds to a deletion service interface. That is, the operation service interfaces and the operation types, that is, the operation requests have a corresponding relationship, and the operation service interfaces corresponding to the operation requests can be determined according to the corresponding relationship, so that the operation service interfaces corresponding to the operation requests are utilized to execute the operation requests, and before and after the operation data is added, modified or deleted, the operation data before and after the operation corresponding to the operation requests can be obtained.
It should be understood that the operation service interface is an operation service method, and the operation service method can operate, such as adding, modifying and deleting, service data based on the operation service request, so as to obtain the service data before and after the operation corresponding to each operation request.
For example, if the operation request is to modify the service data 1 into the service data 2, the service data 1 may be modified into the service data 2 by using the modification service interface, and the service data before the modification operation, that is, the service data 1, and the service data after the modification operation, that is, the service data 2, may be obtained.
S103, inputting the business data before and after the operation corresponding to each operation request into a log generation interface, respectively comparing the business data before and after the operation corresponding to each operation request by the log generation interface, and generating operation logs corresponding to all the operation requests according to the comparison result.
The comparison processing result is used for indicating the change condition of the service data, that is, the change condition of the service data is included in the operation log, that is, the change condition of the service data in the operation log corresponding to each operation request can be obtained by using the log generation interface.
After each operation service interface obtains the service data before and after the operation corresponding to each operation request, the service data before and after the operation corresponding to each operation request can be sent to the log generation interface, the log generation interface can compare the service data before and after each operation sent by all operation service interfaces, and further, operation logs corresponding to all operation requests are generated, and each operation log contains a comparison processing result. That is, no matter which operation service interface obtains the service data before and after the operation corresponding to the operation request, the log generation interface generates the operation logs corresponding to all the operation requests.
In summary, in the operation log recording method provided by the present application, each operation service interface may only obtain the service data before and after the operation corresponding to each operation request, and after the service data before and after the operation corresponding to each operation request obtained by each operation service interface is sent to the log generation interface, the log generation interface may compare the service data before and after the operation corresponding to all the operation requests, so as to generate the operation log corresponding to all the operation requests. That is, the operation logs corresponding to each operation request can be uniformly generated through the log generation interface, so that the workload of collecting each operation log in the later period can be avoided from being increased, and the operation logs can be uniformly managed.
Optionally, before the service data before and after the operation corresponding to each operation request is obtained through the operation service interface corresponding to each operation request, the method further includes: according to the attribute information of each operation service interface, configuring the service type, operation type and number obtaining method of each operation service interface, wherein the number obtaining method is used for indicating the method for obtaining the service data before and after the operation corresponding to each operation request.
For example, before each operation service interface processes each operation request, the annotation of each operation service interface may be configured according to the attribute information of each operation service interface, that is, the annotation includes the service type, the operation type and the number-taking method of the corresponding operation service interface. For example, assuming that the operation service interface is a service interface for modifying the material management module, the service type is a material management type, the operation type is a modification type, and the number obtaining method is a method for obtaining service data before and after modifying the material management module.
For example, after the annotation configuration of each operation service interface is completed, each annotation may be marked on the corresponding operation service interface, and after each operation service interface obtains the operation request, each operation service interface may be used to execute the operation request, that is, perform operations such as adding, modifying, deleting, etc. on the service data. Before and after each operation service interface executes the operation request, a fetch method can be extracted from notes on each operation service interface based on the section-oriented programming (AOP, aspect Oriented Programming), and the fetch method is utilized to obtain the service data before and after the operation corresponding to each operation request.
Fig. 2 is a flowchart of another method for recording an operation log according to an embodiment of the present application. Optionally, as shown in fig. 2, the acquiring, through the operation service interfaces corresponding to the operation requests, service data before and after the operation corresponding to the operation requests includes:
s201, before the operation service interface is executed, calling a fetch method of the operation service interface to acquire service data before operation corresponding to the operation request.
S202, after the operation service interface is executed, calling a fetch method of the operation service interface to acquire the service data after the operation corresponding to the operation request.
This example is illustrated with one operational service interface being similar to the other operational service interfaces. Assuming that the operation service interface is specifically a modification service interface, the modification operation request is a request for modifying the service data 1 into the service data 2, before the modification service interface receives the modification operation request to modify the service data 1 into the service data 2, a preconfigured access method can be extracted from the corresponding annotation, and then the access method is utilized to extract the service data 1 from the database; after the modification operation request is received by the modification service interface and the service data 1 is modified into the service data 2, then a preconfigured access method is extracted from the corresponding annotation, and then the service data 2 is extracted from the database by using the access method, namely the service data before and after modification corresponding to the modification operation request, such as the service data 1 and the service data 2, can be obtained by using the access method in the annotation.
Fig. 3 is a flowchart of another method for recording an operation log according to an embodiment of the present application. Optionally, as shown in fig. 3, the log generating interface performs comparison processing on the service data before and after the operation corresponding to each operation request, and generates the operation logs corresponding to all the operation requests according to the result of the comparison processing, where the method includes:
s301, respectively identifying fields in the business data before and after the operation corresponding to each operation request by a log generation interface to obtain information of the fields corresponding to each operation request.
Wherein the information of the field includes: field type, field name, and field value. For example, the field type may include an array type and a non-data type, and it is understood that a plurality of elements may be included in a field value corresponding to a field of the array type and a single element may be included in a field value corresponding to a field of the non-array type.
This example illustrates one operation request as an example, with other operation request types. After the log generation interface obtains the service data before and after the operation corresponding to the operation request, the fields in the service data before and after the operation can be identified respectively, and the information of the fields in the service data before and after the operation can be identified. It is to be understood that the fields belonging to the same field name in the service data before and after the operation are the same, so the description is given here with the operation request as the dimension, and the information of the fields in the service data before and after the operation can be used as the information of the fields corresponding to the operation request. Meanwhile, since the service data before and after the operation may include a plurality of fields, the information of the field corresponding to the operation request is the information of the plurality of fields, and it should be noted that the present application is not limited thereto.
S302, respectively comparing the business data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and generating operation logs corresponding to all the operation requests according to the comparison result.
And comparing the business data before and after the operation according to the field types of the fields corresponding to the operation request. That is, when the field types of the fields are different, the corresponding comparison processing manners are also different. For example, assuming that the service data before and after the operation corresponding to the operation request includes a field 1 and a field 2, a field type of the field 1 belongs to an array type, a field type of the field 2 belongs to a non-array type, and when comparing field values corresponding to the field 1 in the service data before and after the operation, a preset comparison processing mode strategy corresponding to the array type is utilized; when the field value corresponding to the field 2 in the service data before and after the operation is compared, a preset comparison processing mode strategy corresponding to the non-array type is utilized. Based on the comparison processing mode, whether the field value corresponding to the field 1 in the business data before and after the operation is changed or not and whether the field value corresponding to the field 2 is changed or not can be obtained, and further, the operation log of the operation request can be obtained according to the comparison processing result. It will be appreciated that the log generation interface may obtain the operation logs corresponding to all the operation requests according to the manner described above.
Fig. 4 is a flowchart of another method for recording an operation log according to an embodiment of the present application. Optionally, as shown in fig. 4, the comparing processing is performed on the service data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and the operation logs corresponding to all the operation requests are generated according to the result of the comparing processing, which includes:
s401, if the field type of the first field corresponding to the operation request is an array type, comparing the field values before and after the operation corresponding to the first field, and determining whether the field values before and after the operation are the same.
In this example, an operation request is further described as an example, and assuming that the service data before and after the operation corresponding to the operation request includes the first field, when the field type of the identified first field is an array type, the field value of the first field in the service data before the operation may be compared with the field value of the first field in the service data after the operation, so as to determine whether the field values of the first field in the service data before and after the operation are the same.
S402, if the field values before and after the operation are different, the field name of the first field is used as a key.
If the field values of the first field in the business data before and after the operation are the same, skipping, and continuing to compare the field values of other fields in the business data before and after the operation corresponding to the operation request; if the field value of the first field in the service data before and after the operation is different, the field name of the first field may be used as a key.
S403, performing loop comparison on each element of the field values before and after the operation corresponding to the first field, determining different elements in the field values before and after the operation, and taking the different elements as values respectively.
S404, generating an operation log corresponding to the operation request according to the key and the value.
It may be understood that, if the field value of the first field of the group type includes a plurality of elements, after determining that the field values of the first field of the service data before and after the operation are different, the first element of the field value of the first field of the service data before the operation may be compared with the first element of the field value of the first field of the service data after the operation first, if the first element of the field value is the same, the comparison is skipped, if the second element of the field value is different, the first element of the field value of the first field of the service data before the operation and the first element of the field value of the first field of the service data after the operation are respectively used as values, after the comparison of the first element of the field value of the first field is completed, the comparison may be continued with other elements of the field value of the first field until all the elements of the field value of the first field are completed, and finally, the different elements of the field value of the first field of the service data before the operation may be obtained, and the different elements may be respectively used as values.
After the key and the value are obtained, an operation log corresponding to the operation request can be generated, wherein the operation log corresponding to the operation request records the field name of the first field and different elements in the field values of the first field before and after the operation in a key value pair mode.
It can be understood that the service data before and after the operation acquired by each operation service interface is in a map format, after the key and the value are obtained, the key and the value in the map format can be converted into the key and the value in the json format first, and then the operation log corresponding to the operation request is generated according to the key and the value in the json format.
Fig. 5 is a flowchart of a method for recording an operation log according to an embodiment of the present application. Optionally, as shown in fig. 5, the comparing processing is performed on the service data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and the operation logs corresponding to all the operation requests are generated according to the result of the comparing processing, which includes:
s501, if the field type of the second field corresponding to the operation request is a non-array type, comparing the field values before and after the operation corresponding to the second field, and determining whether the field values before and after the operation are the same.
In this example, an operation request is further described as an example, and assuming that the service data before and after the operation corresponding to the operation request includes the second field, when the field type of the identified second field is an array type, the field value of the second field in the service data before the operation may be compared with the field value of the second field in the service data after the operation, so as to determine whether the field values of the second field in the service data before and after the operation are the same.
S502, if the field values before and after the operation are different, the field name of the second field is used as a key, and the field value before and after the operation corresponding to the second field is used as a value.
S503, generating an operation log corresponding to the operation request according to the key and the value.
If the field values of the second fields in the business data before and after the operation are the same, skipping, and continuing to compare the field values of other fields in the business data before and after the operation corresponding to the operation request; if the field value of the second field in the service data before and after the operation is different, the field name of the second field may be used as a key. It can be understood that the field value of the second field of the non-array type includes a single element, so when it is determined that the field values of the second field before and after the operation are different, it can be determined that the elements indicated by the field values of the second field before and after the operation are different, and then the field value before and after the operation corresponding to the second field can be directly used as the value.
After the key and the value are obtained, an operation log corresponding to the operation request can be generated, wherein the field name of the second field and the field values of the second field before and after the operation are recorded in the operation log corresponding to the operation request in a key value pair mode.
For example, assume that the service data before operation is { "name": "Zhang san", "age": "10" }, the service data after operation is { "name": "Zhang Si", "age": "10" }, where the field name of the second field is "name", then the field value before operation corresponding to the second field is "Zhang san", and the field value after operation corresponding to the second field is "Zhang si". Based on the above, the key is "name", and the values are respectively the field value corresponding to the second field before operation, i.e. "old": "Zhang San", and the field value corresponding to the second field after operation, i.e. "new": "Zhang Si". According to the obtained key and value, an operation log corresponding to the operation request can be generated, wherein the operation log comprises the following components: { "name": { "new": "Zhang Si", "old": "Zhang Sanj }.
Optionally, the method may further comprise: and the log generating interface correlates the operation logs corresponding to all the operation requests with the service types and the operation types corresponding to the operation service interfaces and stores the operation logs and the service types and the operation types into the database.
According to the above description, each operation service interface corresponds to a service type and an operation type, and then the log generation interface may associate the operation log corresponding to each operation request generated by the log generation interface with each operation service interface corresponding to the service type and the operation type, and store the operation log and the operation type in the database. That is, the operation logs stored in the database can be uniformly managed from the dimension of the service type, the operation type, and the like.
Optionally, the method may further comprise: receiving a query request, wherein the query request carries a query keyword; and determining the target operation log from the database according to the query keyword and the associated information of the operation log.
The log generation interface generates operation logs from the business data before and after the operation acquired by different operation log interfaces, and stores each operation log and the corresponding business type and operation type association in a public log table of the database. Based on the above, after receiving the query request carrying the query keyword, the query keyword in the query request can be matched with the service type and the operation type corresponding to each operation log in the public log table, and the successfully matched operation log is used as the target operation log.
Therefore, the query of the operation log can be uniformly processed, and the query efficiency is improved.
Fig. 6 is a schematic structural diagram of an operation log recording device according to an embodiment of the present application. As shown in fig. 6, the apparatus may include:
a first obtaining module 601, configured to obtain a plurality of operation requests, where the operation requests include an add, modify, or delete operation request;
a second obtaining module 602, configured to obtain, through operation service interfaces corresponding to the operation requests, service data before and after the operation corresponding to the operation requests;
the generating module 603 is configured to input the service data before and after the operation corresponding to each operation request to the log generating interface, and perform comparison processing on the service data before and after the operation corresponding to each operation request by using the log generating interface, and generate the operation logs corresponding to all the operation requests according to the comparison processing result, where the comparison processing result is used to indicate a change situation of the service data.
Optionally, the apparatus further comprises: a configuration module;
the configuration module is used for configuring the service type, the operation type and the number obtaining method of each operation service interface according to the attribute information of each operation service interface, wherein the number obtaining method is used for indicating the method for obtaining the service data before and after the operation corresponding to each operation request.
Optionally, the second obtaining module 602 is specifically configured to call a number obtaining method of the operation service interface to obtain service data before the operation corresponding to the operation request before the operation service interface is executed; and after the operation service interface is executed, calling a fetch method of the operation service interface to acquire the service data after the operation corresponding to each operation request.
Optionally, the generating module 603 is specifically configured to identify, by the log generating interface, fields in the service data before and after the operation corresponding to each operation request, to obtain information of the fields corresponding to each operation request, where the information of the fields includes: field type, field name, and field value; and respectively comparing the business data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and generating operation logs corresponding to all the operation requests according to the comparison result.
Optionally, the generating module 603 is further specifically configured to compare the field values before and after the operation corresponding to the first field if the field type of the first field corresponding to the operation request is an array type, and determine whether the field values before and after the operation are the same; if the field values before and after the operation are different, the field name of the first field is used as a key; performing cyclic comparison on each element of the field values before and after the operation corresponding to the first field, determining different elements in the field values before and after the operation, and taking the different elements as values respectively; and generating an operation log corresponding to the operation request according to the key and the value.
Optionally, the generating module 603 is further specifically configured to compare the field values before and after the operation corresponding to the second field if the field type of the second field corresponding to the operation request is a non-array type, and determine whether the field values before and after the operation are the same; if the field values before and after the operation are different, the field name of the second field is used as a key, and the field value before and after the operation corresponding to the second field is used as a value; and generating an operation log corresponding to the operation request according to the key and the value.
Optionally, the apparatus further comprises: an association module;
the association module is used for associating the operation logs corresponding to all the operation requests and the service types and operation types corresponding to the operation service interfaces by the log generation interface and storing the operation logs and the service types and the operation types into the database.
Optionally, the apparatus further comprises: a query module;
the query module receives a query request, wherein the query request carries a query keyword; and determining the target operation log from the database according to the query keyword and the associated information of the operation log.
The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more microprocessors (Digital Signal Processor, abbreviated as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), or the like. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in fig. 7, the electronic device may include: a processor 701, a storage medium 702, and a bus 703, the storage medium 702 storing machine-readable instructions executable by the processor 701, the processor 701 and the storage medium 702 communicating over the bus 703 when the electronic device is operating, the processor 701 executing machine-readable instructions to perform the steps of the method embodiments described above. The specific implementation manner and the technical effect are similar, and are not repeated here.
Optionally, the present application further provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor performs the steps of the above-described method embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (11)

1. A method of operation logging for use in a medical services management system, the method comprising:
acquiring a plurality of operation requests, wherein the operation requests comprise adding, modifying or deleting operation requests, and the operation requests comprise operating a material management module in a medical service management system;
Acquiring service data before and after the operation corresponding to each operation request through an operation service interface corresponding to each operation request;
and inputting the business data before and after the operation corresponding to each operation request into a log generation interface, respectively carrying out comparison processing on the business data before and after the operation corresponding to each operation request by the log generation interface, and generating operation logs corresponding to all the operation requests according to the comparison processing result, wherein the comparison processing result is used for indicating the change condition of the business data.
2. The method according to claim 1, wherein before the service data before and after the operation corresponding to each operation request is obtained through the operation service interface corresponding to each operation request, the method further comprises:
and configuring the service type, the operation type and the access method of each operation service interface according to the attribute information of each operation service interface, wherein the access method is used for indicating the method for acquiring the service data before and after the operation corresponding to each operation request.
3. The method according to claim 2, wherein the obtaining, through the operation service interfaces corresponding to the operation requests, service data before and after the operation corresponding to the operation requests includes:
Before the operation service interface is executed, calling a number taking method of the operation service interface to obtain service data before operation corresponding to an operation request;
and after the operation service interface is executed, calling a fetch method of the operation service interface to acquire the service data after the operation corresponding to each operation request.
4. The method according to claim 1, wherein the log generating interface performs a comparison process on the service data before and after the operation corresponding to each operation request, and generates the operation logs corresponding to all the operation requests according to a result of the comparison process, including:
the log generation interface respectively identifies fields in the business data before and after the operation corresponding to each operation request to obtain the information of the fields corresponding to each operation request, wherein the information of the fields comprises: field type, field name, and field value;
and respectively comparing the business data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and generating operation logs corresponding to all the operation requests according to the comparison result.
5. The method of claim 4, wherein the comparing the service data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and generating the operation log corresponding to all operation requests according to the result of the comparing, includes:
if the field type of the first field corresponding to the operation request is an array type, comparing the field values before and after the operation corresponding to the first field, and determining whether the field values before and after the operation are the same;
if the field values before and after the operation are different, using the field name of the first field as a key;
performing cycle comparison on each element of the field values before and after the operation corresponding to the first field, determining different elements in the field values before and after the operation, and taking the different elements as values respectively;
and generating an operation log corresponding to the operation request according to the key and the value.
6. The method of claim 4, wherein the comparing the service data before and after the operation corresponding to each operation request according to the information of the field corresponding to each operation request, and generating the operation log corresponding to all operation requests according to the result of the comparing, includes:
If the field type of the second field corresponding to the operation request is a non-array type, comparing the field values before and after the operation corresponding to the second field, and determining whether the field values before and after the operation are the same;
if the field values before and after the operation are different, taking the field name of the second field as a key and taking the field value before and after the operation corresponding to the second field as a value;
and generating an operation log corresponding to the operation request according to the key and the value.
7. The method according to claim 2, wherein the method further comprises:
and correlating the operation logs corresponding to all the operation requests and the service types and operation types corresponding to the operation service interfaces by using the log generation interface, and storing the operation logs and the service types and the operation types into a database.
8. The method of claim 7, wherein the method further comprises:
receiving a query request, wherein the query request carries a query keyword;
and determining a target operation log from the database according to the query keyword and the associated information of the operation log.
9. An operation log recording apparatus, characterized by being applied to a medical service management system, comprising:
The system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a plurality of operation requests, the operation requests comprise adding, modifying or deleting operation requests, and the plurality of operation requests comprise operating a material management module in a medical service management system;
the second acquisition module is used for acquiring the business data before and after the operation corresponding to each operation request through the operation business interface corresponding to each operation request;
the generation module is used for inputting the business data before and after the operation corresponding to each operation request into the log generation interface, respectively carrying out comparison processing on the business data before and after the operation corresponding to each operation request by the log generation interface, and generating operation logs corresponding to all the operation requests according to the comparison processing result, wherein the comparison processing result is used for indicating the change condition of the business data.
10. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the oplogging method of any one of claims 1-8.
11. 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, performs the steps of the oplogging method according to any one of claims 1-8.
CN202310269379.5A 2022-11-29 2023-03-13 Operation log recording method, device, equipment and storage medium Pending CN116204540A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211504602.1A CN115544050A (en) 2022-11-29 2022-11-29 Operation log recording method, device, equipment and storage medium
CN2022115046021 2022-11-29

Publications (1)

Publication Number Publication Date
CN116204540A true CN116204540A (en) 2023-06-02

Family

ID=84721596

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202211504602.1A Withdrawn CN115544050A (en) 2022-11-29 2022-11-29 Operation log recording method, device, equipment and storage medium
CN202310269379.5A Pending CN116204540A (en) 2022-11-29 2023-03-13 Operation log recording method, device, equipment and storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202211504602.1A Withdrawn CN115544050A (en) 2022-11-29 2022-11-29 Operation log recording method, device, equipment and storage medium

Country Status (1)

Country Link
CN (2) CN115544050A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407369A (en) * 2023-12-14 2024-01-16 宁德时代新能源科技股份有限公司 Operation log recording method and device and electronic equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8812580B2 (en) * 2006-03-15 2014-08-19 Beats Music, Llc Override of automatically shared meta-data of media
CN104598622A (en) * 2015-02-02 2015-05-06 浪潮软件股份有限公司 Method and system for implementing data modification log as well as application server
CN106980638B (en) * 2016-09-29 2020-12-04 创新先进技术有限公司 Operation record system, method and operation object change information query method
CN112882900B (en) * 2021-02-26 2022-11-29 浪潮通用软件有限公司 Method and device for recording service data change log
CN113220762A (en) * 2021-05-06 2021-08-06 普元信息技术股份有限公司 Method, device, processor and storage medium for realizing general record processing of key service field change in big data application
CN113608955B (en) * 2021-06-30 2024-01-26 北京新氧科技有限公司 Log recording method, device, equipment and storage medium
CN113849473A (en) * 2021-09-17 2021-12-28 重庆京东方智慧科技有限公司 Operation recording method, operation recording device, electronic device, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407369A (en) * 2023-12-14 2024-01-16 宁德时代新能源科技股份有限公司 Operation log recording method and device and electronic equipment

Also Published As

Publication number Publication date
CN115544050A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN109997126B (en) Event driven extraction, transformation, and loading (ETL) processing
US10540383B2 (en) Automatic ontology generation
CN107220142B (en) Method and device for executing data recovery operation
US20140344273A1 (en) System and method for categorizing time expenditure of a computing device user
CN112685433B (en) Metadata updating method and device, electronic equipment and computer-readable storage medium
CN112882699B (en) Service processing method, device, equipment and medium based on flow configuration engine
CN103890709A (en) Cache based key-value store mapping and replication
KR101355273B1 (en) A computing system, a method for controlling thereof, and a computer-readable recording medium having a computer program for controlling thereof
EP2831774A1 (en) Method and system for centralized issue tracking
CN116204540A (en) Operation log recording method, device, equipment and storage medium
CN107463638A (en) File sharing method and equipment between offline virtual machine
CN107357836B (en) VNF package and method and device for deleting mirror image file referenced by VNF package
US10664501B2 (en) Deriving and interpreting users collective data asset use across analytic software systems
CN112199426B (en) Interface call management method, device, server and medium under micro-service architecture
CN115905274A (en) Data processing method and device, electronic equipment and medium
CN112347066A (en) Log processing method and device, server and computer readable storage medium
KR101638048B1 (en) Sql query processing method using mapreduce
CN115390912B (en) Resource discovery method, device, computer equipment and storage medium
CN113722334B (en) Data processing method, device, electronic equipment and medium
CN111596975B (en) Event calling method and device, electronic equipment and storage medium
CN117370339A (en) Report blood edge relationship processing method and device, computer equipment and storage medium
CN116225830A (en) Service operation log reporting method and device, computer equipment and storage medium
CN117891794A (en) Log generation method and device, terminal equipment and storage medium
CN114356945A (en) Data processing method, data processing device, computer equipment and storage medium
CN115705327A (en) Data processing method and device, electronic equipment and medium

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