CN109783458B - Method and device for recording log change - Google Patents

Method and device for recording log change Download PDF

Info

Publication number
CN109783458B
CN109783458B CN201811549978.8A CN201811549978A CN109783458B CN 109783458 B CN109783458 B CN 109783458B CN 201811549978 A CN201811549978 A CN 201811549978A CN 109783458 B CN109783458 B CN 109783458B
Authority
CN
China
Prior art keywords
attribute
modification
before modification
attributes
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811549978.8A
Other languages
Chinese (zh)
Other versions
CN109783458A (en
Inventor
柴倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datang Software Technologies Co Ltd
Original Assignee
Datang Software Technologies 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 Datang Software Technologies Co Ltd filed Critical Datang Software Technologies Co Ltd
Priority to CN201811549978.8A priority Critical patent/CN109783458B/en
Publication of CN109783458A publication Critical patent/CN109783458A/en
Application granted granted Critical
Publication of CN109783458B publication Critical patent/CN109783458B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for recording log changes, wherein the method comprises the following steps: acquiring the attribute before modification and the attribute after modification of the changed object; judging whether the attributes before modification and the attributes after modification meet a VO specification, wherein the VO specification is a writing format preset for the object by adopting JAVA annotation; when the attribute before modification and the attribute after modification meet the VO specification and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library, wherein the common component library is used for storing log information. According to the invention, only the user needs to correspondingly adjust the data management system according to the VO specification without re-developing the log service product suitable for the data management system of the user, and the problem of serious homogenization development of the log service product in the related technology can be effectively solved.

Description

Method and device for recording log change
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for recording log changes.
Background
At present, all data management software needs to record log changes, namely, when data in a data management system is modified by someone, but the existing data management software needs to develop a log service product suitable for the data management software by itself if the existing data management software needs to record the modifications, so that a product capable of providing log recording service for most data management software is lacked in the related technology.
Disclosure of Invention
The invention provides a method and a device for recording log changes, and aims to solve the problem of serious homogeneity development of log service products in the related technology.
In order to solve the problems in the related art, the present invention provides a solution: a method of logging changes, comprising:
acquiring the attribute before modification and the attribute after modification of the changed object;
judging whether the attributes before modification and the attributes after modification meet VO specifications, wherein the VO specifications are writing formats of JAVA notes preset for the attributes by a service party;
when the attribute before modification and the attribute after modification meet the VO specification and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library, wherein the common component library is used for storing log information.
Optionally, the obtaining of the property before modification and the property after modification of the changed object includes:
acquiring a service request event of a service requester;
obtaining a VO object from the service request event, wherein the VO object is an entity object which is operated in a data management system by the service requester, and the VO object comprises a VO entity object before modification and a VO entity object after modification;
acquiring the attribute before modification of the changed object from the VO entity object before modification by adopting a JAVA reflection mechanism and a getclass function;
and acquiring the modified attribute of the changed object from the modified VO entity object by adopting a JAVA reflection mechanism and a getclass function.
Optionally, the determining whether the attribute before modification and the attribute after modification meet the VO specification includes:
judging whether the attributes before modification obtained from the VO entity object before modification and the attributes after modification obtained from the VO entity object after modification meet VO specifications or not;
the method further comprises the following steps:
and when the attributes before modification and the attributes after modification do not accord with the VO specification, sending out log alarm.
Optionally, if the attribute before modification and the attribute after modification conform to the VO specification, and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library, including:
and when the attribute before modification and the attribute after modification accord with the VO specification, comparing whether the attribute values of the attribute before modification and the attribute after modification are equal by adopting an equals method, and if not, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to the public component library.
Optionally, before obtaining the property before modification and the property after modification of the changed object, the method further includes:
and acquiring the operation type, the operation time, the operator and the operation entity ID of the service request event from the service request event and recording the operation type, the operation time, the operator and the operation entity ID to the common component library.
Optionally, before obtaining the service request event of the service requester, the method further includes:
and in the data management system of the service requester, performing JAVA annotation on the attribute of the log change service required to be requested according to the writing format of the VO specification.
An apparatus to log changes, comprising:
the acquisition operation event module is used for acquiring the attribute before modification and the attribute after modification of the changed object;
the VO attribute judging module is used for judging whether the attributes before modification and the attributes after modification meet VO specifications, and the VO specifications are writing formats of JAVA notes preset for the attributes by a service party;
and the object comparison module is used for recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library when the attribute before modification and the attribute after modification meet the VO specification and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal, and the common component library is used for storing log information.
In the present invention, the apparatus further comprises:
the acquisition operation request module is used for acquiring the operation type, the operation time, the operator and the operation entity ID of the service request event from the service request event and recording the operation type, the operation time, the operator and the operation entity ID to the public component library;
the public component library is used for storing log information;
and the log display service module is used for providing log display service.
Wherein the common component library comprises:
an operation log information recording module, configured to record information of the service request event acquired from the operation event acquiring module and the operation request acquiring module;
the log content recording module is used for recording the information acquired from the object comparison module;
and the log additional information recording module is used for recording the additional information of the changed object.
The log display service module comprises:
the client basic information query and display service module is used for providing a function of querying the basic information of the client;
the client expansion information query and display service module is used for providing a function of querying client additional information;
the taxpayer qualification inquiry and display service module is used for providing a function of inquiring the qualification of the taxpayer;
and the log query display service module is used for providing a function of querying information of the data management system of the enterprise.
Optionally, the obtaining operation event module includes:
the service request event acquisition module is used for acquiring a service request event of a service requester;
a first obtaining module, configured to obtain a VO object from the service request event, where the VO object is an entity object that the service requester operates in a data management system, and the VO object includes a VO entity object before modification and a VO entity object after modification;
a second obtaining module, configured to obtain, by using a JAVA reflection mechanism and through a getclass function, an attribute before modification of the changed object from the VO entity object before modification;
and a third obtaining module, configured to obtain, by using a JAVA reflection mechanism and through a getclass function, a modified attribute of the changed object from the modified VO entity object.
Optionally, the VO attribute determination module includes:
the judgment submodule is used for judging whether the attributes before modification acquired from the VO entity object before modification and the attributes after modification acquired from the VO entity object after modification meet the VO specification or not;
the device further comprises:
and the log alarm module is used for sending out log alarm when the attribute before modification and the attribute after modification do not accord with the VO specification.
Optionally, the object comparison module comprises:
and the comparison submodule is used for comparing whether the attribute values of the attribute before modification and the attribute after modification are equal or not by adopting an equals method when the attribute before modification and the attribute after modification accord with the VO specification, and recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to the public component library if the attribute values of the attribute before modification and the attribute value of the attribute after modification are not equal. Has the advantages that:
the invention can provide the service of recording the log change for most data management software at the same time, as long as the background program of the data management software is adjusted according to the VO specification, and the invention sends a service request before the log change, the invention obtains the attribute before modification and the attribute after modification of the changed object in the data software and judges whether the attribute values of the attribute before modification and the attribute value after modification are equal, if not, the attribute value before modification and the attribute value after modification are recorded to a public component library for storing log information; the invention can provide the service for recording the log change for the user by only correspondingly adjusting the data management system according to the VO specification of the invention without the need of redeveloping the log service product suitable for the data management system of the user, and can effectively solve the problem of serious homogeneous development of the log service product in the related technology.
Drawings
FIG. 1 is a flow diagram illustrating a method of logging changes in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method for obtaining pre-modified and post-modified properties of a changed object in accordance with an illustrative embodiment;
FIG. 3 is a flow diagram illustrating another method of logging changes in accordance with an illustrative embodiment;
FIG. 4 is a block diagram illustrating an apparatus to log changes in accordance with an example embodiment;
FIG. 5 is a block diagram illustrating a common component library in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating a log presentation service module in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating a get operational events module in accordance with an exemplary embodiment.
Detailed Description
The following describes a specific embodiment of the present invention, which is illustrative, is intended to disclose the operation of the invention, and is not to be construed as further limiting the scope of the claims.
Fig. 1 is a flow chart illustrating a method of logging changes according to an example embodiment, and with reference to fig. 1, includes the following steps.
In step S11, the attribute before modification and the attribute after modification of the changed object are acquired.
In step S12, it is determined whether the attributes before modification and the attributes after modification conform to a VO specification, where the VO specification is a writing format of a JAVA annotation preset for the attributes by a service provider.
In step S13, when the attribute before modification and the attribute after modification conform to the VO specification and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal to each other, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library, where the common component library is used for storing log information.
First, in step S11, the attribute before modification and the attribute after modification of the changed object are acquired. For example, if the service requester modifies personal information of employee a in the data management system, the modified object is the personal information of employee a, the personal information includes a plurality of attributes, such as name, occupation, etc., the obtained attribute before modification is the name, occupation, etc. of employee a before modification, and the obtained attribute after modification is the name, occupation, etc. of employee a after modification.
Then, in step S12, it is determined whether the attributes before modification and the attributes after modification conform to a VO specification, where the VO specification is a writing format of a JAVA annotation preset for the attributes by a service provider. For example, if the service requester needs to change the occupation of employee a from "student" to "doctor" in the data management system, the service requester only needs to delete the student in the column of the occupation and refill "doctor", and at this time, the service requester does not need to perform any other operation because the data management system has previously made JAVA annotation on the attribute of the occupation according to the VO specification, such as "@ comparjob _ occupation", and also made JAVA annotation on the attribute of the name, such as "@ comparname _ name". The character following the @ symbol may be arbitrarily set by the service party, but the service requester must perform the JAVA annotation according to the writing format set by the service party, that is, the VO specification, to request the service from the service party, because only if the attribute of the JAVA annotation is performed according to the VO specification, the service party can obtain the field meaning of the attribute according to the JAVA annotation, and then the step S13 is performed. Since there may be an attribute that does not perform JAVA annotation in advance or the format of the JAVA annotation does not adopt the VO specification of the service party in the attributes acquired by the service party, the attribute that does not perform JAVA annotation or the format of the JAVA annotation does not adopt the VO specification of the service party does not enter the step S13. For example, if the service side obtains the changed object of the personal information of employee a, which includes the attribute of nationality besides the two attributes of name and occupation, if the attribute of nationality is not annotated in advance, or the JAVA annotation made on the attribute of nationality is "@ compabbb _ nationality" does not conform to the "@ compliance _ nationality set by the service side, when it is determined whether the attribute before modification and the attribute after modification conform to the VO specification, the attribute of nationality does not conform to the VO specification and thus cannot enter step S13, and the two attributes of name and occupation that have been annotated in JAVA by the VO specification of the service side continue to enter step S13.
In step S13, when the attribute before modification and the attribute after modification conform to the VO specification and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal to each other, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library, where the common component library is used for storing log information. For example, if the attributes of name and occupation in the personal information of employee a before modification and after modification acquired by the service side both conform to the VO specification, the attribute value before modification of the attribute of name is compared with the attribute value after modification, and the attribute value before modification of the attribute of occupation is compared with the attribute value after modification. If the attribute value before modification is found to be not equal to the attribute value after modification, the attribute value before modification and the attribute value after modification are recorded in a common component library, and if the attribute value before modification is equal to the attribute value after modification, no processing is carried out. For example, before the service requester modifies the personal information of employee A, the name of employee A is Li Ming and the occupation is student; after modification, employee A has a name of Li Ming and a profession of doctor. The attribute value before and after modification of the name attribute is not changed and is not used for processing, and the attribute value of the occupation attribute is changed, so that students before modification and doctors after modification are recorded in a common component library.
FIG. 2 is a flowchart illustrating a method for obtaining pre-modified and post-modified properties of a changed object, according to an example embodiment, and with reference to FIG. 2, including the following steps.
In step S110, a service request event of the service requester is acquired. In step S111, a VO object is obtained from the service request event, where the VO object is an entity object that the service requester operates in the material management system, and the VO object includes a VO entity object before modification and a VO entity object after modification.
In step S112, a JAVA reflection mechanism is used to obtain the pre-modification attribute of the changed object from the pre-modification VO entity object through a getclass function.
In step S113, modified attributes of the changed object are obtained from the modified VO entity object through getclass function by using JAVA reflection mechanism.
First, in step S110, a service request event of a service requester is acquired. When a service requester needs to change data in the data management system, a service requesting logging change is sent to a server, and the server receives the request and acquires event information about the service request event from the generated service request event.
Then, in step S111, a VO object is obtained from the service request event, where the VO object is an entity object that the service requester operates in the material management system, and the VO object includes a VO entity object before modification and a VO entity object after modification. For example, before the service requester changes the occupation of employee a from a student to a doctor in the material management system, the service requester acquires the VO entity object before modification, that is, the personal information of employee a before modification from the material management system through the service request event, and after the service requester changes the occupation of employee a from the student to the doctor in the material management system and clicks and saves, the service requester acquires the VO entity object after modification, that is, the personal information of employee a again from the material management system.
Then in step S112, the JAVA reflection mechanism means that in the running state, for any entity class, all attributes and methods of the entity class can be known; for any object, any method and property belonging to the object can be called. After acquiring the VO entity object before modification of the service requester, the service acquires the attribute before modification of the changed object from the VO entity object before modification by using a JAVA reflection mechanism and a getclass function. For example, the service party obtains the entity object of personal information of employee a before modification, and obtains attributes of name, occupation, nationality, and the like of employee a from the entity object, and may also include other attributes such as address, telephone number, and the like.
Then, in step S113, modified attributes of the changed object are obtained from the modified VO entity object by using a JAVA reflection mechanism and a getclass function. For example, the service party obtains the modified entity object of personal information of employee a, and obtains attributes of name, occupation, nationality, and the like of employee a from the entity object, and may also include other attributes such as address, telephone number, and the like.
In this disclosure, it is determined whether the attributes before modification and the attributes after modification conform to the VO specification, that is, whether the attributes before modification obtained from the VO entity object before modification and the attributes after modification obtained from the VO entity object after modification conform to the VO specification. For example, the service side obtains that the two attributes of the name and the occupation in the personal information before and after modification of employee a are JAVA annotated according to the format set by the service side, that is, the JAVA annotation for the name is "@ compare _ name", the JAVA annotation for the occupation is "@ compare _ occupation", and the property of the nationality in the personal information before and after modification of employee a is not JAVA annotated or the format of the JAVA annotation "@ compare _ nationality" is different from the "@ compliance _ nationality" set by the service side, so that the nationality attribute does not conform to the VO specification.
And when the attribute before modification and the attribute after modification do not accord with the VO specification, sending a log alarm, for example, the attribute of the nationality before and after modification does not accord with the VO specification, so that the service party sends the log alarm to the service requester, and the log alarm is used for reminding the service requester to correspondingly adjust in the data management system according to the VO specification given by the service party.
In this disclosure, if the attribute before modification and the attribute after modification conform to the VO specification, and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal to each other, the attribute value of the attribute before modification and the attribute value of the attribute after modification are recorded in a common component library. When the attribute before modification and the attribute after modification meet the VO specification, comparing whether the attribute values of the attribute before modification and the attribute value after modification are equal or not by adopting an equals method, and if not, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification into the public component library.
The equals method is a method for comparing whether two values are equal in JAVA language. For example, the attribute of the name in the personal information of employee a before modification acquired by the service party conforms to the VO specification, the attribute value is Li Ming, and the attribute value of the attribute of the name after modification is Li Ming, then the attribute value of the name before modification and the attribute value of the name after modification obtained by the equals method are the same attribute value, and the service party does not process the same attribute value. If the attribute of the occupation in the personal information of the employee A before modification acquired by the service party conforms to the VO specification, the attribute value is a student, and the attribute value of the attribute of the modified occupation is a doctor, the attribute value of the occupation before modification and the attribute value of the occupation after modification are different attribute values by adopting an equals method, and then the service party records the different attribute values into a related record table of a public component library, namely the student before modification and the doctor after modification are recorded into a related record table of the public component library. Meanwhile, if the VO object acquired by the service party is a list, if the list contains personal information of the employee A, the employee B and the employee C, judging whether the attribute values in the list before and after modification are consistent by adopting double-layer circulation and an equals method of a generic object. The concrete process of comparing the attribute values by the Equals method is common knowledge in the art, and therefore, is not described herein.
Fig. 3 is a flowchart illustrating another method of logging changes according to an example embodiment, and referring to fig. 3, obtaining pre-modified attributes and post-modified attributes of a changed object further includes the following steps.
In step S10, the operation type, operation time, operator and operation entity ID of the service request event are obtained from the service request event and recorded to the common component library.
In step S10, before the service requester modifies the data management system, the service requester sends a request to the service requester as a third-party platform in the form of an http request, and after confirming that the request is received, the service requester establishes a communication channel with the service requester, and at the same time, the service requester records the operation type, operation time, operator and operation entity ID of the service request event in the common component library. For example, if the operation time of lienhua (employee code 06051) of the operator of the enterprise B is changed from 2018, 9, 1, 15, and the operation time is the current time of the operating system, such as that the client basic information of the group client schneider electric appliance (china) limited company (group client ID012232) is updated, the updated content is that the industry is changed from the manufacturing industry to the special equipment manufacturing industry, and the contact person is changed from zhangwei to the declaration, then before the change, lienhua clicks a button for requesting the service in the data management system for managing the client information of the enterprise B, the service side receives the request to establish the communication channel, the operation type of the service request event acquired by the service side is UPDATE, the acquired operation time is the current time of the operating system, and is as follows: 30: and 35, the code number of the acquired operation entity ID is TF _ F _ CUST _ GROUP, and the information is recorded in the public component library.
In the present disclosure, before acquiring the attributes of the changed object before modification and the attributes after modification to acquire the service request event of the service requester, it is further required to perform JAVA annotation on the attributes of the log change service that needs to be requested to be recorded in the data management system of the service requester according to the writing format of the VO specification. Theoretically, the invention can provide services for all the data management systems, but the data management system of the service requester can only request the log change recording service after JAVA annotating the attribute needing log change according to VO specification. For example, when enterprise B requests services from the present invention, JAVA annotations are first made to the attributes that need to log changes in the backend program of the data management system.
Fig. 4 is a block diagram illustrating an apparatus for logging changes according to an example embodiment, and referring to fig. 4, the apparatus includes:
an obtaining operation event module 100, configured to obtain a property before modification and a property after modification of a changed object;
a VO attribute determining module 101, configured to determine whether the attribute before modification and the attribute after modification meet a VO specification, where the VO specification is a writing format of a JAVA annotation preset for the attribute by a service provider;
an object comparison module 102, configured to record, when the attribute before modification and the attribute after modification meet the VO specification and an attribute value of the attribute before modification and an attribute value of the attribute after modification are not equal to each other, an attribute value of the attribute before modification and an attribute value of the attribute after modification to a common component library, where the common component library is used to store log information. Referring to fig. 4, the apparatus further includes:
an obtaining operation request module 103, configured to obtain an operation type, an operation time, an operator, and an operation entity ID of a service request event from the service request event, and record the operation type, the operation time, the operator, and the operation entity ID in the common component library;
a common component library 104 for storing log information;
a log display service module 105, configured to provide a log display service.
Fig. 5 is a block diagram illustrating a common component library according to an exemplary embodiment, and referring to fig. 5, the common component library 104 includes:
an operation log information recording module 1041, configured to record information of the service request event acquired from the operation event acquiring module and the operation request acquiring module;
a log content recording module 1042 for recording the information obtained from the object comparison module;
a log additional information recording module 1043, configured to record additional information of the changed object.
In this disclosure, the log ID of the service request event obtained from the obtaining operation request module, recorded inside the operation log information recording module 1041, includes an operation type, an operation time, an operator, an operation entity ID, and the like. For example, if the operator of the enterprise B, namely lihua (employee code 06051), UPDATEs the basic client information of the group client schneider electrical appliance (china) limited company (group client ID012232), and the updated contents are that the industry is changed from the manufacturing industry to the special equipment manufacturing industry and the contact person is changed from zhangwei to declaration, when the enterprise B sends the service request, the operation log information recording module 1041 of the service party randomly generates a log ID serial number corresponding to the request event, for example, the serial number is 123456, the operation type is UPDATE under the log ID, the operator is 06051, and the operation time is 2018, 9, 1, 15: 30: 35, the operation entity ID is TF _ F _ list _ GROUP.
The log content recording module 1042 includes a log content table 10421, and one piece of operation log information generated by the operation log information recording module 1041 may correspond to a plurality of log content tables, where each log content table includes a log ID, an operation entity ID, an attribute name, and the like. For example, if the operator lihua (employee CODE 06051) of the enterprise B updates the basic customer information of the GROUP customer schneider electrical equipment (china) limited company (GROUP customer ID012232), and the updated content is to change the industry from the manufacturing industry to the private equipment manufacturing industry and change the contact from zhangwei to declare, the values of two attributes are changed, one is the industry and the other is the contact, in this case, under the operation log information with the serial number of 123456, the content ID of the first log content is a randomly generated serial number, for example, 234567, in the log content table, the log ID is 123456, the operation entity ID is TF _ F _ list _ GROUP, the attribute ID is TF _ F _ list _ GROUP. The content ID of the second log content is a randomly generated serial number, for example, 345678, in the log content table, the log ID is 123456, the operation entity ID is TF _ F _ list _ GROUP, the attribute ID is TF _ F _ list _ GROUP.
The log content recording module 1042 further includes a list content table 10422 for storing the content in the list when the attribute is the list. One piece of operation log information generated by the operation log information recording module 1041 may correspond to a plurality of list content tables, where the list content tables include list content IDs, operation type list contents, and the like.
The log additional information recording module 1043 is configured to record additional information of the changed object, and one piece of operation log information generated by the operation log information recording module 1041 may correspond to multiple pieces of log additional information.
Fig. 6 is a block diagram illustrating a log presentation service module according to an exemplary embodiment, and referring to fig. 6, the log presentation service module 105 includes:
a client basic information query and display service module 1051, which is used for providing the function of querying the basic information of the client;
a customer expansion information query and display service module 1052, which is used for providing the function of querying customer additional information;
the taxpayer qualification inquiry and display service module 1053 is used for providing a function of inquiring the qualification of the taxpayer;
and the log query display service module 1054 is used for providing a function of querying information of the data management system of the enterprise.
In the present disclosure, the log presentation service module 105 may also include other sub-modules, and fig. 7 lists only a few possible sub-modules.
Fig. 7 is a block diagram illustrating the get operational events module 100 according to an exemplary embodiment, and referring to fig. 7, the get operational events module 100 includes:
a service request event obtaining module 1000, configured to obtain a service request event of a service requester;
a first obtaining module 1001, configured to obtain a VO object from the service request event, where the VO object is an entity object that the service requester operates in a data management system, and the VO object includes a VO entity object before modification and a VO entity object after modification;
a second obtaining module 1002, configured to obtain, by using a JAVA reflection mechanism and through a getclass function, an attribute before modification of the changed object from the VO entity object before modification;
a third obtaining module 1003, configured to obtain, by using a JAVA reflection mechanism and through a getclass function, the modified attribute of the changed object from the modified VO entity object.
In this disclosure, the VO attribute determination module includes:
the judgment submodule is used for judging whether the attributes before modification acquired from the VO entity object before modification and the attributes after modification acquired from the VO entity object after modification meet the VO specification or not;
the device further comprises:
and the log alarm module is used for sending out log alarm when the attribute before modification and the attribute after modification do not accord with the VO specification.
In this disclosure, the object comparison module includes:
and the comparison submodule is used for comparing whether the attribute values of the attribute before modification and the attribute after modification are equal or not by adopting an equals method when the attribute before modification and the attribute after modification accord with the VO specification, and recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to the public component library if the attribute values of the attribute before modification and the attribute value of the attribute after modification are not equal.
The invention can provide the service of recording the log change for most data management software at the same time, as long as the background program of the data management software is adjusted according to the VO specification, and the invention sends a service request before the log change, the invention obtains the attribute before modification and the attribute after modification of the changed object in the data software and judges whether the attribute values of the attribute before modification and the attribute value after modification are equal, if not, the attribute value before modification and the attribute value after modification are recorded to a public component library for storing log information; the invention can provide the service for recording the log change for the user by only correspondingly adjusting the data management system according to the VO specification of the invention without the need of redeveloping the log service product suitable for the data management system of the user, and can effectively solve the problem of serious homogeneous development of the log service product in the related technology.
The invention can well play the advantages of group customer management, enterprises do not need to additionally develop log service products suitable for own systems, and change processes and change tracks of customer information and taxpayer qualification information can be completely recorded only by properly adjusting the data management system according to the specification of the invention, so that a customer manager can better serve and track customers, the working pressure of the customer manager is reduced, and the working efficiency of the customer manager is improved.
The invention can identify, record, inquire and display the entity information change condition under the condition of not knowing the internal structure of the entity VO class of the service requester, namely, only the changed VO object is needed to be obtained from the service requester, thereby really realizing the log record in a non-invasive way.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (7)

1. A method of logging changes, comprising:
acquiring the attribute before modification and the attribute after modification of the changed object;
judging whether the attributes before modification and the attributes after modification meet VO specifications, wherein the VO specifications are writing formats of JAVA notes preset by a service party on the attributes before modification and the attributes after modification;
when the attribute before modification and the attribute after modification meet the VO specification and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library, wherein the common component library is used for storing log information;
acquiring the attributes of the changed object before modification and the attributes after modification, wherein the acquiring comprises the following steps:
acquiring a service request event of a service requester;
obtaining a VO object from the service request event, wherein the VO object is an entity object which is operated in a data management system by the service requester, and the VO object comprises a VO entity object before modification and a VO entity object after modification;
acquiring the attribute before modification of the changed object from the VO entity object before modification by adopting a JAVA reflection mechanism and a getclass function;
acquiring the modified attribute of the changed object from the modified VO entity object by adopting a JAVA reflection mechanism and a getclass function;
acquiring the property before modification and the property after modification of the changed object further comprises:
and acquiring the operation type, the operation time, the operator and the operation entity ID of the service request event from the service request event and recording the operation type, the operation time, the operator and the operation entity ID to the common component library.
2. The method of claim 1, wherein determining whether the pre-modified attributes and the modified attributes conform to the VO specification comprises:
judging whether the attributes before modification obtained from the VO entity object before modification and the attributes after modification obtained from the VO entity object after modification meet VO specifications or not;
the method further comprises the following steps:
and when the attributes before modification and the attributes after modification do not accord with the VO specification, sending out log alarm.
3. The method of claim 2, wherein if the attribute before modification and the attribute after modification conform to the VO specification and the attribute value of the attribute before modification and the attribute value of the attribute after modification are not equal, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to a common component library, comprises:
and when the attribute before modification and the attribute after modification accord with the VO specification, comparing whether the attribute values of the attribute before modification and the attribute after modification are equal by adopting an equals method, and if not, recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to the public component library.
4. The method of claim 1, wherein prior to obtaining the pre-modified property and the modified property of the changed object, the method further comprises:
and in the data management system of the service requester, performing JAVA annotation on the attribute of the log change service required to be requested according to the writing format of the VO specification.
5. An apparatus for logging changes, comprising:
the acquisition operation event module is used for acquiring the attribute before modification and the attribute after modification of the changed object;
a VO attribute judging module, configured to judge whether the attribute before modification and the attribute after modification meet a VO specification, where the VO specification is a writing format of a JAVA annotation preset by a service party for the attribute before modification and the attribute after modification;
an object comparison module, configured to record, when the attribute before modification and the attribute after modification meet the VO specification and an attribute value of the attribute before modification and an attribute value of the attribute after modification are not equal to each other, an attribute value of the attribute before modification and an attribute value of the attribute after modification to a common component library, where the common component library is used to store log information;
the get operational event module includes:
the service request event acquisition module is used for acquiring a service request event of a service requester; a first obtaining module, configured to obtain a VO object from the service request event, where the VO object is an entity object that the service requester operates in a data management system, and the VO object includes a VO entity object before modification and a VO entity object after modification;
a second obtaining module, configured to obtain, by using a JAVA reflection mechanism and through a getclass function, an attribute before modification of the changed object from the VO entity object before modification;
a third obtaining module, configured to obtain, by using a JAVA reflection mechanism and through a getclass function, a modified attribute of the changed object from the modified VO entity object;
acquiring the property before modification and the property after modification of the changed object further comprises:
and acquiring the operation type, the operation time, the operator and the operation entity ID of the service request event from the service request event and recording the operation type, the operation time, the operator and the operation entity ID to the common component library.
6. The apparatus of claim 5, wherein the VO attribute determining module comprises:
the judgment submodule is used for judging whether the attributes before modification acquired from the VO entity object before modification and the attributes after modification acquired from the VO entity object after modification meet the VO specification or not;
the device further comprises:
and the log alarm module is used for sending out log alarm when the attribute before modification and the attribute after modification do not accord with the VO specification.
7. The apparatus of claim 6, wherein the object comparison module comprises:
and the comparison submodule is used for comparing whether the attribute values of the attribute before modification and the attribute after modification are equal or not by adopting an equals method when the attribute before modification and the attribute after modification accord with the VO specification, and recording the attribute value of the attribute before modification and the attribute value of the attribute after modification to the public component library if the attribute values of the attribute before modification and the attribute value of the attribute after modification are not equal.
CN201811549978.8A 2018-12-18 2018-12-18 Method and device for recording log change Active CN109783458B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811549978.8A CN109783458B (en) 2018-12-18 2018-12-18 Method and device for recording log change

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811549978.8A CN109783458B (en) 2018-12-18 2018-12-18 Method and device for recording log change

Publications (2)

Publication Number Publication Date
CN109783458A CN109783458A (en) 2019-05-21
CN109783458B true CN109783458B (en) 2022-03-15

Family

ID=66497263

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811549978.8A Active CN109783458B (en) 2018-12-18 2018-12-18 Method and device for recording log change

Country Status (1)

Country Link
CN (1) CN109783458B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010182194A (en) * 2009-02-06 2010-08-19 Mitsubishi Electric Corp Device and program for generating integrated log and recording medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102810057B (en) * 2011-05-30 2016-03-09 中国银联股份有限公司 A kind of method of log
CN102929771B (en) * 2012-09-28 2015-12-02 用友网络科技股份有限公司 Log recording apparatus and log recording method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010182194A (en) * 2009-02-06 2010-08-19 Mitsubishi Electric Corp Device and program for generating integrated log and recording medium

Also Published As

Publication number Publication date
CN109783458A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
US8572023B2 (en) Data services framework workflow processing
US7349929B2 (en) Accessing data based on user identity
KR101230744B1 (en) Method and apparatus for utilizing social network information for showing reviews
US8131560B2 (en) Systems and methods for managing regulatory information
US9128964B2 (en) Selective mapping of integrated data
US20100017415A1 (en) Data access control method and data access control apparatus
US20130167199A1 (en) On-Demand Authorization Management
US8943065B2 (en) Catalog performance and integrity analysis
US7124354B1 (en) Enterprise application transactions as shared active documents
US8126962B1 (en) Systems and methods for tracking user activity at website
CN109522751B (en) Access right control method and device, electronic equipment and computer readable medium
US10120941B2 (en) Dynamic runtime environment configuration for query applications
CN113849473A (en) Operation recording method, operation recording device, electronic device, and storage medium
EP2704031A1 (en) Improved schema mapping based on data views and database tables
US8954389B2 (en) Content generation service for software testing
US7908243B2 (en) Considering transient data also in reports generated based on data eventually stored in a data-warehouse
US10262046B2 (en) Profile-enabled dynamic runtime environment for web application servers
US20190362442A1 (en) System and method for prediction of email addresses of certain individuals and verification thereof
US8037067B1 (en) Systems and methods for tracking user activity at website
US9665732B2 (en) Secure Download from internet marketplace
CN106682180B (en) Data query method and device
CN109783458B (en) Method and device for recording log change
CN113010208B (en) Version information generation method, device, equipment and storage medium
US8453166B2 (en) Data services framework visibility component
CN112650757A (en) Method, device, equipment and medium for storing structured and unstructured data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant