Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the invention provides a service auditing method, equipment and a computer readable storage medium, which can be adapted to various service scenes and are simple to develop.
The business auditing method according to the first aspect embodiment of the invention comprises the following steps:
receiving an operation request of a target object, and acquiring an operation type of the operation request;
determining an initial auditing process corresponding to the target object according to the target object and a preset auditing database, wherein the preset auditing database comprises matching information of the target object and the initial auditing process;
and performing corresponding operation on the initial auditing process of the target object according to the operation type to obtain a target auditing process.
The service auditing method according to the embodiment of the first aspect of the invention at least has the following beneficial effects: the method comprises the steps of receiving an operation request of a target object, obtaining an operation type of the operation request, and determining an initial auditing process corresponding to the target object according to the target object and a preset auditing database, so that when a service is accessed, the corresponding initial auditing process can be determined in the preset auditing database according to the target object, and the corresponding operation is performed on the initial auditing process of the target object according to the operation type to obtain the target auditing process.
According to some embodiments of the invention, the operation types include: updating and creating, wherein the corresponding operation is performed on the initial auditing process of the target object according to the operation type to obtain a target auditing process, and the method comprises the following steps:
if the operation type is updating, comparing the target object with a preset database object to obtain a comparison result;
changing the state of the associated business object in the initial auditing process according to the target object;
determining a log processing flow according to the target object, and setting the state of the target object to be processed;
carrying out serialization processing on the target object to obtain a first business process;
and obtaining the target auditing process according to the first business process and the initial auditing process, and storing the target auditing process and the comparison result in the preset auditing database.
According to some embodiments of the present invention, the performing corresponding operation on the initial auditing process of the target object according to the operation type to obtain a target auditing process further includes:
if the operation type is newly increased, changing the state of the associated service object in the initial auditing process according to the target object;
determining a log processing flow according to the target object, setting the state of the target object to be processed, and obtaining a second service flow;
and obtaining the target auditing process according to the second business process and the initial auditing process, and storing the target auditing process to the preset auditing database.
According to some embodiments of the invention, further comprising:
receiving an auditing request of a target object, and acquiring an auditing identifier of the auditing request;
determining a target auditing process corresponding to the auditing identifier according to the auditing identifier and a preset auditing database, wherein the preset auditing database comprises the auditing identifier and the matching information of the target auditing process;
and auditing the target object according to the target auditing process to obtain a target auditing record.
According to some embodiments of the present invention, the auditing the target object according to the target auditing process to obtain a target auditing record includes:
generating an audit application record according to the target audit flow;
determining a node audit record corresponding to the current node according to the audit application record and the target object;
auditing the target object according to the target auditing process to obtain an auditing result;
according to the audit result, modifying the state and the result of the node audit record to obtain a target audit record;
and updating the state of the target object and saving the target audit record.
According to some embodiments of the present invention, the modifying the state and the result of the node audit record according to the audit result to obtain the target audit record includes:
and if the audit result is that the node passes and no subsequent node exists in the audit process of the current node, modifying the node audit record state to be completed and the result to be passed, and obtaining the target audit record.
According to some embodiments of the present invention, the modifying the state and the content of the node audit record according to the audit result to obtain a target audit record includes:
and if the audit result is that the node passes the audit process and the current node has a follow-up node to be processed in the audit process, modifying the state of the node audit record into a process state to obtain a target audit record.
According to some embodiments of the present invention, the modifying the state and the content of the node audit record according to the audit result to obtain a target audit record includes:
and if the audit result is rejected, modifying the state of the node audit record to be completed, and obtaining a target audit record if the result is rejected.
The service auditing device according to the second aspect of the embodiment of the invention comprises:
at least one processor, and,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method according to any one of the embodiments of the first aspect of the present invention.
The service auditing device according to the embodiment of the second aspect of the invention has at least the following beneficial effects: by executing the service auditing method of the embodiment of the first aspect of the invention, the service auditing device of the invention can receive the operation request of the target object, acquire the operation type of the operation request, and determine the initial auditing process corresponding to the target object according to the target object and the preset auditing database, so that when a service is accessed, the corresponding initial auditing process can be determined in the preset auditing database according to the target object, and the corresponding operation is performed on the initial auditing process of the target object according to the operation type to obtain the target auditing process.
A computer-readable storage medium according to an embodiment of the third aspect of the present invention stores computer-executable instructions for causing a computer to perform the method according to any one of the embodiments of the first aspect of the present invention.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as the upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality is one or more, the meaning of a plurality is two or more, and the above, below, exceeding, etc. are understood as excluding the present numbers, and the above, below, within, etc. are understood as including the present numbers. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
In the description of the present invention, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
At present, in many office software systems, there are many business scenes that have functions related to auditing, such as leave-asking approval, reimbursement approval, purchase approval, and the like, and meanwhile, part of business scenes also need to be subjected to multi-level auditing. When these functions are developed, if an audit model meeting the requirements is designed for each service scenario, the development cost and the maintenance cost will be greatly increased. When a new service function needs to be accessed and examined, a large amount of workload is generally required to be expended for modification, which is easy to affect the original service function.
Compared with the traditional design scheme, the business auditing method, the business auditing equipment and the storage medium can be expanded under the condition that the original codes are not modified, the original business functions are not influenced, safety and stability are ensured, meanwhile, developers only need to write a small number of codes, time and labor are saved, the workload of the developers is reduced, and the efficiency and the reliability are also obviously improved. The method is particularly suitable for multi-level auditing scenes and can be adapted to various service scenes.
The embodiments of the present invention will be further explained with reference to the drawings.
Referring to fig. 1, an embodiment of the present invention provides a service auditing method, which includes, but is not limited to, step S110, step S120, and step S130.
Step S110, receiving an operation request of a target object, and acquiring an operation type of the operation request;
step S120, determining an initial auditing process corresponding to the target object according to the target object and a preset auditing database, wherein the preset auditing database comprises matching information of the target object and the initial auditing process;
step S130, performing corresponding operation on the initial auditing process of the target object according to the operation type to obtain a target auditing process.
In an embodiment, when a user needs to perform an operation on a certain service flow, for example, when an audit flow is created in a certain service scene, the user may input a target service scene and an operation type to generate an operation request, that is, input an operation request for a target object, and then the processor receives the operation request and obtains the operation type of the operation request, so as to perform processing of the audit flow according to the operation type in the following process, thereby implementing extension of a multi-stage audit model.
It should be noted that the target service scenario may include a service type name and a service name.
In an embodiment, the preset audit database includes matching information of the target object and the initial audit process, and the corresponding initial audit process can be queried in the preset database according to information carried by the target object, so that the audit process can be subsequently processed according to the initial audit process to construct the audit process capable of realizing different service scenarios.
In an embodiment, an operation request of a target object is received, an operation type of the operation request is obtained, an initial auditing process corresponding to the target object is determined according to the target object and a preset auditing database, when a service is accessed, the corresponding initial auditing process can be determined in the preset auditing database according to the target object, corresponding operation is performed on the initial auditing process of the target object according to the operation type to obtain the target auditing process, for different service scenes needing auditing functions, the auditing functions can be embedded into the service only by performing a very small amount of development, and the code development is simple and is adaptive to various service scenes.
Referring to fig. 2, another embodiment of the present invention further provides a business auditing method, and fig. 2 is a schematic diagram of another embodiment of a refinement flow of step S130 in fig. 1, where the step S130 includes, but is not limited to:
step S210, if the operation type is updating, comparing the target object with a preset database object to obtain a comparison result;
step S220, changing the state of the associated business object in the initial auditing process according to the target object;
step S230, determining a log processing flow according to the target object, and setting the state of the target object to be processed;
step S240, carrying out serialization processing on the target object to obtain a first business process;
and step S250, obtaining a target auditing process according to the first service process and the initial auditing process, and storing the target auditing process and the comparison result into a preset auditing database.
In one embodiment, an object comparison tool and an object comparison annotation are adopted to compare a target object with a preset database object to obtain a comparison result, the object comparison tool and the object comparison annotation are used for assisting the auditing process, the tool is used for recursively traversing the attribute of an annotated mark, when the attribute is a basic data type, comparing whether the homonymous attribute values of the two objects are consistent or not, if the homonymous attribute values are not consistent, recording and storing the different attributes, and in this way, all the different attributes between the new object and the original object are accurately obtained, so that whether the target object is changed or not is judged, and an intuitive change relation between the new object and the original object is provided for auditors.
In an embodiment, a pre-audit operation is performed on a target object, where business logic before auditing is started is implemented, and some business object state changes are made, so as to change the state of a related business object in an initial audit process.
In one embodiment, the log processing operation of the present invention is performed on the target object, and the log processing service logic before the audit is started is implemented here, and is generally used to print the log information related to the target object to be audited.
In one embodiment, the target object is serialized, where business logic that converts the target object into a serialized string is implemented to obtain serialized data, which is stored in a preset audit database and is typically used for audit record list display and query.
Referring to fig. 3, another embodiment of the present invention further provides a business auditing method, and fig. 3 is a schematic diagram of another embodiment of a refinement flow of step S130 in fig. 1, where step S130 includes, but is not limited to:
step S310, if the operation type is newly increased, the state of the associated business object in the initial auditing process is changed according to the target object;
step S320, determining a log processing flow according to the target object, setting the state of the target object to be processed, and obtaining a second service flow;
and step S330, obtaining a target auditing process according to the second service process and the initial auditing process, and storing the target auditing process to a preset auditing database.
In one embodiment, a pre-audit operation is performed on the target object, where business logic before auditing is started is implemented, and some business object state changes are made to change the state of the associated business object in the initial audit process.
In one embodiment, the log processing operation of the present invention is performed on the target object, and the log processing service logic before the audit is started is implemented here, and is generally used to print the log information related to the target object to be audited.
Referring to fig. 4, another embodiment of the present invention further provides a service auditing method, further including but not limited to:
step S410, receiving an auditing request of a target object, and acquiring an auditing identifier of the auditing request;
step S420, determining a target auditing process corresponding to the auditing identifier according to the auditing identifier and a preset auditing database, wherein the preset auditing database comprises the auditing identifier and the matching information of the target auditing process;
and step S430, auditing the target object according to the target auditing process to obtain a target auditing record.
In an embodiment, an audit process type and an audit node which need to be expanded are defined in an audit process node table of a preset database, an audit object interface provided by the method is realized, and a unique identifier (generally, a primary key id) of a target object which needs to be audited is specified. The auditing object interface enables the audited target object to have a unique identifier, a target auditing process corresponding to the target object can be determined in a preset auditing database according to the auditing identifier, and the target object is audited according to the target auditing process, so that the auditing function can be embedded into a service, and for different service scenes needing the auditing function, only a small amount of development is needed, the code development is simple, and the method is suitable for various service scenes.
Referring to fig. 5, another embodiment of the present invention further provides a business auditing method, fig. 5 is a schematic diagram of another embodiment of a refinement flow of step S430 in fig. 4, where step S430 includes, but is not limited to:
step S510, generating an audit application record according to a target audit process;
step S520, determining a node audit record corresponding to the current node according to the audit application record and the target object;
step S530, auditing the target object according to the target auditing process to obtain an auditing result;
step S540, the state and the result of the node audit record are modified according to the audit result to obtain a target audit record;
and step S550, updating the state of the target object and saving the target audit record.
In an embodiment, an audit application record is generated in a target audit process queried from a preset database, an audit record corresponding to a current node is generated, an audit method is called to audit a target object, the state and the result of the node audit record are modified according to the audit result to obtain the target audit record, and the target object is subjected to audit post-operation to update the state of the target object and save the target audit record.
Another embodiment of the present invention further provides a service auditing method, and step S540 further includes, but is not limited to:
and if the audit result is that the node passes and no subsequent node exists in the audit process of the current node, modifying the node audit record state to be completed and the result is that the node audit record state passes, and obtaining the target audit record.
In an embodiment, if the audit result is a pass result, it indicates that the node audit is performed and the result is a pass, and when there is no subsequent node in the current node audit process, the node audit record state is modified to be completed and the result is a pass, the node audit record state is stored in a preset audit database to obtain a target audit record, and the node is audited next time, so that the audit process can be reduced, and the expansion of the multi-stage audit model is realized.
Another embodiment of the present invention further provides a service auditing method, and step S540 further includes, but is not limited to:
and if the audit result is that the node passes the audit process and the current node has a follow-up node to be processed in the audit process, modifying the state of the node audit record into a process state to obtain the target audit record.
In an embodiment, if there are subsequent nodes to be processed in the audit process, after the audit result of a certain node passes, the node flows to the next node, and the state of the node audit record is modified into processing, so as to obtain the target audit record, so as to perform the audit of the subsequent nodes.
Another embodiment of the present invention further provides a service auditing method, and step S540 further includes, but is not limited to:
and if the audit result is rejected, modifying the state of the node audit record to be completed, and if the result is rejected, obtaining the target audit record.
In an embodiment, if the audit result is rejected, it indicates that the node has been audited but the result is rejected, the node audit record state is modified to be completed, and the result is rejected, and the node is stored in the preset audit database to obtain the target audit record.
An embodiment of the present invention further provides a service auditing apparatus, including: at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a business auditing method as described above.
Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions for execution by one or more control processors, where the one or more control processors execute the service auditing method in the above method embodiment, for example, execute the above-described method steps S110 to S130 in fig. 1, method steps S210 to S250 in fig. 2, method steps S310 to S330 in fig. 3, method steps S410 to S430 in fig. 4, and method steps S510 to S550 in fig. 5.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention. Furthermore, the embodiments of the present invention and the features of the embodiments may be combined with each other without conflict.