A method and system for recording table data modification logs based on Uliweb
By using thread-based middleware and instruction dispatcher to record data change logs within the Uliweb framework, the problems of high logging difficulty and lack of operator information in existing technologies are solved, achieving low-intrusion automatic logging and auditing functions.
Patent Information
- Application Number
- CN202211152586.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2042-09-21
AI Technical Summary
Existing technologies, when using the Uliweb framework to develop network services, cannot or are inconvenient to record database table data change logs, have a high degree of code intrusion, are difficult to maintain, and lack operator information in the Binlog, making it unusable as an auditing basis.
By using thread-based middleware to preprocess user requests when they arrive at the server, user information is recorded and data change information is obtained. Different request commands are sent, and the command dispatcher is used to parse and record logs. This allows an independent app to be embedded in the project code without modifying the original code or parsing the Binlog.
It achieves automatic recording of data changes with low code intrusion and low maintenance difficulty, and obtains operator information as an audit basis, thus reducing the difficulty of implementation.
Smart Images

Figure CN115495425B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software, in particular to a table data modification log recording method and system based on Uliweb. BACKGROUND
[0002] In a business system, when the data in the database changes due to user interface operation, API interface calling or other reasons, the data modification content is very important audit basis and problem troubleshooting basis when abnormality occurs, which needs to be recorded.
[0003] To record the data modification content into the log, generally speaking, there are two ways: the first way is to write code at all possible data change triggering time, read out the data before change and save it in a temporary variable, then compare the fields of the data before and after change, find the difference between before and after, manually record the difference to a file or other carrier, and finally save the data after change to the database. The second way is to analyze the database binary log (Binlog) without invading the business code, and parse the data change from the Binlog.
[0004] However, it is found that the above-mentioned way at least has the following technical problems:
[0005] The prior art cannot record or is not convenient to record the data change log when the data in the database table changes during the running process of the network service developed based on the Uliweb framework, needs to write code at the time of causing data change, has high code invasion degree, has large subsequent maintenance difficulty, has large parsing difficulty, and the Binlog does not have the related information of the operator, which cannot be used as the audit basis. SUMMARY
[0006] The present application provides a table data modification log recording method and system based on Uliweb, which solves the technical problems that the prior art cannot record or is not convenient to record the data change log, needs to write code at the time of causing data change, has high code invasion degree, has large subsequent maintenance difficulty, has large parsing difficulty, and the Binlog does not have the related information of the operator, which cannot be used as the audit basis, achieves the technical effect that the independent app is embedded in the project code, the code invasion degree is low, the original project code does not need to be modified, the Binlog does not need to be parsed, the implementation difficulty is low, the operator information of the page operation can be obtained, which is used as the audit basis, thereby realizing the automatic recording of the log of all data changes in the project.
[0007] In view of the above problems, the present application is proposed to provide a method which overcomes the above problems or at least partially solves the above problems.
[0008] In a first aspect, the application provides a Uliweb-based table data modification log recording method, which comprises: obtaining a user request; when the user request reaches a server, a thread processing middleware pre-processes the user request, and records user information in the user request to a local variable; the server processes the user request, and obtains data change information; different request instructions are sent according to the type of the data change information, and the data change information is taken as an instruction parameter; a code application program receives the request instruction through an instruction distributor, parses the instruction parameter, and obtains the data change information; the user information in the local variable is read, and the user information and the data change information are recorded to a log file.
[0009] In another aspect, the application also provides a Uliweb-based table data modification log recording system, which comprises: a request obtaining module for obtaining a user request; a request preprocessing module for, when the user request reaches a server, a thread processing middleware pre-processing the user request, and recording user information in the user request to a local variable; a data change information obtaining module for the server processing the user request, and obtaining data change information; a request instruction sending module for sending different request instructions according to the type of the data change information, and taking the data change information as an instruction parameter; an instruction parameter parsing module for a code application program receiving the request instruction through an instruction distributor, parsing the instruction parameter, and obtaining the data change information; and a log recording module for reading the user information in the local variable, and recording the user information and the data change information to a log file.
[0010] In a third aspect, the application provides an electronic device, which comprises a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected through the bus, and the computer program, when executed by the processor, implements the steps in any of the above methods.
[0011] In a fourth aspect, the application also provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps in any of the above methods.
[0012] The one or more technical solutions provided in the application have at least the following technical effects or advantages:
[0013] The technical scheme is characterized in that when a user request reaches a server, a thread processing middleware pre-processes the user request, records user information in the user request into a local variable, the server processes the user request, obtains data change information, according to the type of the data change information, sends different request instructions, and takes the data change information as instruction parameters; a code application program receives the request instructions through an instruction distributor, parses the instruction parameters, obtains the data change information, reads the user information in the local variable, and records the user information and the data change information into a log file. Further, the technical scheme has the technical effects that an independent app is embedded into project code, the code has low invasiveness, the original project code does not need to be modified, Binlog does not need to be parsed, the implementation difficulty is low, the operator information of a page operation can be obtained as an audit basis, and thus all data changes in the project can be automatically recorded in a log.
[0014] The above description is only a summary of the technical scheme of the application, in order to more clearly understand the technical means of the application, the application can be implemented according to the content of the specification, and in order to make the above and other purposes, characteristics and advantages of the application more obvious and easy to understand, the following specific embodiments of the application are described. BRIEF DESCRIPTION OF DRAWINGS
[0015] Figure 1 A flowchart of a table data modification log recording method based on Uliweb according to an embodiment of the application is shown in FIG. 1.
[0016] Figure 2 A flowchart of a table data modification log recording method based on Uliweb according to an embodiment of the application is shown in FIG. 1.
[0017] Figure 3 A structure diagram of a table data modification log recording system based on Uliweb according to an embodiment of the application is shown in FIG. 2.
[0018] Figure 4 A structure diagram of an exemplary electronic device according to an embodiment of the application is shown in FIG. 3.
[0019] The reference signs are explained as follows: a request obtaining unit 11, a request preprocessing unit 12, a data change information obtaining unit 13, a request instruction sending unit 14, an instruction parameter parsing unit 15, a log recording unit 16, a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150, an operating system 1151, an application program 1152, and a user interface 1160. DETAILED DESCRIPTION
[0020] In the description of the present application, those skilled in the art should know that the present application can be implemented as a method, device, electronic device and computer readable storage medium. Therefore, the present application can be specifically implemented as follows: complete hardware, complete software (including firmware, resident software, microcode, etc.), hardware and software combined form. In addition, in some embodiments, the present application can also be implemented as a computer program product in one or more computer readable storage media, which contains computer program code.
[0021] The computer readable storage medium described above can adopt any combination of one or more computer readable storage media. The computer readable storage medium includes: electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any combination thereof. More specific examples of computer readable storage medium include: portable computer diskette, hard disk, random access memory, read-only memory, erasable programmable read-only memory, flash memory, optical fiber, compact disk read-only memory, optical storage device, magnetic storage device or any combination thereof. In this application, the computer readable storage medium can be any tangible medium containing or storing programs, which can be used or combined with instruction execution system, device, instrument.
[0022] The acquisition, storage, use, processing and other data in the technical solution of the present application comply with the relevant provisions of national laws.
[0023] The present application describes the methods, devices and electronic devices provided by the flow chart and / or block diagram.
[0024] It should be understood that each block of the flowchart and / or block diagram, and the combination of blocks in the flowchart and / or block diagram, can be implemented by computer readable program instructions. These computer readable program instructions can be provided to the processor of a general purpose computer, a special purpose computer, or other programmable data processing apparatus, so as to produce a machine, which executes the functions / operations specified in the blocks of the flowchart and / or block diagram by the computer or other programmable data processing apparatus.
[0025] These computer readable program instructions can also be stored in a computer readable storage medium, which can make the computer or other programmable data processing apparatus work in a specific way. Thus, the instructions stored in the computer readable storage medium produce an instruction device product, which includes the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0026] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable data processing apparatus provide a process for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0027] This application will now be described with reference to the accompanying drawings.
[0028] Example 1
[0029] like Figure 1 As shown, this application provides a method for recording table data modification logs based on Uliweb, the method including:
[0030] Step S100: Obtain the user request;
[0031] Step S200: When the user request arrives at the server, the thread processing middleware preprocesses the user request and records the user information in the user request into local variables;
[0032] Step S300: The server processes the user request and obtains data change information;
[0033] Specifically, in a business system, when data in the database changes due to user interface operations, API calls, or other reasons, these modifications are crucial audit evidence and troubleshooting information in case of anomalies, and therefore need to be logged. There are generally two ways to log data modifications: The first method involves writing code at all possible points of data change to read the data before the change and store it in a temporary variable. Then, the code compares the fields of the data before and after the change, identifies the differences, manually records these differences to a file or other medium, and finally saves the changed data to the database. The second method, without intruding into the business code, involves analyzing the database's binary log to parse out the data changes.
[0034] The user request is a request message sent by a user, including a modification request, an addition request, a deletion request, a calling request, etc. When the user request reaches the server, the threading middleware pre-processes the user request, that is, when the user interface operation or api interface calling request reaches the backend service, the threading middleware pre-processes the request, saves the user information in the user request in a local variable, and the local variable is a variable defined in the function. Some user requests will modify the backend data, causing data changes. The Uliweb framework processes the data before and after the change, and the data change information is the data before and after the modification. The data before and after the modification is recorded in a variable.
[0035] Step S400: according to the type of the data change information, different request instructions are sent, and the data change information is taken as an instruction parameter;
[0036] Further, according to the type of the data change information, different request instructions are sent, and the data change information is taken as an instruction parameter. Specifically, it is judged whether the type of the data change information is deletion data. If it is deletion data, a post_delete instruction is sent, and the data to be deleted is taken as an instruction parameter. If the type is not deletion data, it is addition or modification data, a post_save instruction is sent, and the data before and after the modification is taken as an instruction parameter. Different request instructions are sent for different data change types, and the subsequent technical effect of automatically recording logs for all data changes in the project is achieved.
[0037] Step S410: judging whether the type of the data change information is deletion data;
[0038] Step S420: if the type is deletion data, a post_delete instruction is sent.
[0039] Further, the present application S410 further includes:
[0040] Step S411: if the type is not deletion data, a post_save instruction is sent.
[0041] Specifically, according to the type of the data change information, different request instructions are sent, and the data change information is taken as an instruction parameter. Specifically, it is judged whether the type of the data change information is deletion data. If it is deletion data, a post_delete instruction is sent, and the data to be deleted is taken as an instruction parameter. If the type is not deletion data, it is addition or modification data, a post_save instruction is sent, and the data before and after the modification is taken as an instruction parameter. Different request instructions are sent for different data change types, and the subsequent technical effect of automatically recording logs for all data changes in the project is achieved.
[0042] Step S500: the code application program receives the request instruction through the instruction distributor, parses the instruction parameter, and obtains the data change information;
[0043] Further, the present application S500 further includes:
[0044] Step S510: the code application includes the thread processing middleware and view, wherein the thread processing middleware pre-processes the user request, and the view is used to process the code logic of the log.
[0045] Further, the present application S510 further includes:
[0046] Step S511: when the Uliweb service starts, the code application is loaded.
[0047] Step S512: the process_post_save method in the view of the code application is bound with the post_save instruction, the process_post_delete method is bound with the post_delete instruction, and the Middleware middleware of the thread processing middleware is registered in the instruction distributor.
[0048] Specifically, the code application is model_change_log app, and the model_change_log is the app name of the code specifically implemented in the Uliweb project. The app is a code unit in the Uliweb framework. Uliweb is an open source web development framework written in Python language, and Uliweb is composed of multiple apps. Each app can have its own configuration file, template directory, and static directory. Existing applications can be easily reused and considered as a whole.
[0049] The code application program model_change_log app includes the threading_middleware and views, wherein the threading_middleware preprocesses the user request, records the user information in the request to a local variable which can be accessed across threads. The views are code logic for processing the log. When the Uliweb service starts, all apps are initialized, at this time, the process_post_save method in the views of the model_change_log app is bound with the post_save instruction, the process_post_delete method is bound with the post_delete instruction, and is registered to the instruction distributor. At the same time, the ThreadingMiddleware in the threading_middleware is registered to the middleware list of the project, wherein the Middleware is a kind of middleware in the Uliweb framework, which is used for preprocessing and post-processing of the request. The technical effects are achieved by embedding the project code in the form of an independent app, without modifying other codes in the project, with low code invasion, and without parsing Binlog, reducing the difficulty of implementation.
[0050] Step S600: reading the user information in the local variable, and recording the user information and the data change information to a log file.
[0051] Further, the reading the user information in the local variable, and recording the user information and the data change information to a log file, the present application S600 further includes:
[0052] Step S610: calling a save_log function;
[0053] Step S620: reading the user information from the local variable when the save_log function is executed;
[0054] Step S630: recording the user information and the data change information to a log file through the save_log function.
[0055] Specifically, when recording the log file, the save_log function is called to save the log. When the save_log function is executed, the user information is read from the local variable, and the user information is recorded in the log file together with the data change content. This achieves the technical effect of low implementation difficulty without the need to parse Binlog, obtaining the operator information of the page operation, recording the data operator in the log as the basis for auditing, and further achieving the technical effect of automatically recording the log of all data changes in the project.
[0056] In summary, the Uliweb-based table data modification log recording method and system provided by the present application has the following technical effects:
[0057] Due to the adoption of the technical scheme that when a user request reaches a server, a thread processing middleware pre-processes the user request, records user information in the user request to a local variable, the server processes the user request to obtain data change information, sends different request instructions according to the type of the data change information, and takes the data change information as an instruction parameter, a code application program receives the request instruction through an instruction distributor, parses the instruction parameter to obtain the data change information, reads the user information in the local variable, and records the user information and the data change information in a log file. Further, the technical effect of automatically recording the log of all data changes in the project is achieved by embedding an independent app in the project code, with low code invasion, without the need to modify the original project code, without the need to parse Binlog, low implementation difficulty, and the ability to obtain operator information of page operation as the basis for auditing.
[0058] Embodiment Two
[0059] Based on the same inventive concept as the Uliweb-based table data modification log recording method in the foregoing embodiments, the present application also provides a Uliweb-based table data modification log recording system, as shown in Figure 3 The system comprises:
[0060] A request obtaining module 11 is configured to obtain a user request.
[0061] A request preprocessing module 12 is configured to, when the user request reaches a server, pre-process the user request through a thread processing middleware, and record user information in the user request to a local variable.
[0062] A data change information obtaining module 13 is configured to process the user request through the server to obtain data change information.
[0063] The request instruction sending module 14 is configured to send different request instructions according to the type of the data change information, and send the data change information as instruction parameters.
[0064] The instruction parameter analysis module 15 is configured to receive the request instruction by the code application program through the instruction dispatcher, analyze the instruction parameters, and obtain the data change information.
[0065] The log recording module 16 is configured to read the user information in the local variable, and record the user information and the data change information into a log file.
[0066] Further, the request instruction sending module further comprises:
[0067] The information type judgment unit is configured to judge whether the type of the data change information is deleting data.
[0068] The deleting instruction sending unit is configured to send a post_delete instruction if the type is deleting data.
[0069] Further, the system further comprises:
[0070] The saving instruction sending unit is configured to send a post_save instruction if the type is not deleting data.
[0071] Further, the system further comprises:
[0072] The code application program constituting unit is configured to comprise the thread processing middleware and a view in the code application program, wherein the thread processing middleware is configured to pre-process the user request, and the view is configured to process the code logic of the log.
[0073] Further, the system further comprises:
[0074] The code application program loading unit is configured to load the code application program when the Uliweb service starts.
[0075] The instruction binding unit is configured to bind a process_post_save method in the view of the code application program with the post_save instruction, bind a process_post_delete method with the post_delete instruction, and register the Middleware middleware of the thread processing middleware in the instruction dispatcher.
[0076] Further, the log recording module further comprises:
[0077] The function calling unit is configured to call a save_log function.
[0078] a user information reading unit, configured to read the user information from the local variable when the save_log function is executed;
[0079] a user information reading unit, configured to read the user information from the local variable when the save_log function is executed;
[0080] The foregoing Figure 1 The various variations and specific examples of the Uliweb-based table data modification log recording method in Embodiment One are also applicable to the Uliweb-based table data modification log recording system in this embodiment, and through the foregoing detailed description of the Uliweb-based table data modification log recording method, those skilled in the art can clearly understand the implementation method of the Uliweb-based table data modification log recording system in this embodiment, so as to avoid repetition, the detailed description is not repeated here.
[0081] In addition, the present application also provides an electronic device, comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor, the transceiver, the memory and the processor are connected through the bus respectively, the computer program is executed by the processor to realize each process of the method for controlling output data and achieve the same technical effect, to avoid repetition, the detailed description is not repeated here.
[0082] Exemplary electronic device
[0083] Specifically, referring to Figure 4 As shown in the figure, the present application also provides an electronic device, which comprises a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150 and a user interface 1160.
[0084] In the present application, the electronic device further comprises a computer program stored in the memory 1150 and executable on the processor 1120, and the computer program is executed by the processor 1120 to realize each process of the method for controlling output data.
[0085] The transceiver 1130 is used for receiving and sending data under the control of the processor 1120.
[0086] In the present application, the bus architecture (represented by the bus 1110) can include any number of interconnected buses and bridges, and the bus 1110 connects various circuits including one or more processors represented by the processor 1120 and the memory represented by the memory 1150 together.
[0087] Bus 1110 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Extended ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnects (PCI) bus.
[0088] Processor 1120 can be an integrated circuit chip located on a board such as motherboard or network circuit board. In implementations, steps of the methods disclosed above can be completed by integrated logic circuit of hardware or instructions of software in the processor. The processor above includes: general processor, central processing unit, network processor, digital signal processor, application specific integrated circuit, field programmable gate array, complex programmable logic device, programmable logic array, micro control unit or other programmable logic device, discrete gate or transistor logic, discrete hardware component. The methods, steps and logic block diagrams disclosed in the present application can be implemented or executed. For example, the processor can be a single core processor or a multi core processor, and the processor can be integrated into a single chip or located in multiple different chips.
[0089] Processor 1120 can be a microprocessor or any conventional processor. The methods disclosed in the present application can be directly executed by hardware decoding processor, or executed by combination of hardware and software modules in decoding processor. The software modules can be located in random access memory, flash memory, read only memory, programmable read only memory, erasable programmable read only memory, register or other readable storage medium known in the art. The readable storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the method in combination with the hardware thereof.
[0090] Bus 1110 can also connect various other circuits or devices, such as peripheral devices, voltage stabilizers or power management circuits, together, and bus interface 1140 provides an interface between bus 1110 and transceiver 1130, which are well known in the art. Therefore, the present application will not be further described.
[0091] Transceiver 1130 can be one element or multiple elements, such as multiple receivers and transmitters, which provide units for communicating with various other devices on transmission medium. For example: transceiver 1130 receives external data from other devices, and transceiver 1130 is used to send data processed by processor 1120 to other devices. Depending on the nature of the computer device, user interface 1160 can also be provided, such as touch screen, physical keyboard, display, mouse, speaker, microphone, trackball, joystick, stylus.
[0092] It is to be understood that the memory 1150 in the present application can further include a memory remotely located with respect to the processor 1120, which can be connected to a server through a network. One or more portions of the above-mentioned network can be an ad hoc network, an intranet, an extranet, a virtual private network, a local area network, a wireless LAN, a wide area network, a wireless wide area network, a metropolitan area network, the Internet, a publicly switched telephone network, a conventional telephone network, a cellular telephone network, a wireless network, a Wi-Fi network, and a combination of two or more of the above-mentioned networks. For example, the cellular telephone network and the wireless network can be a Global System for Mobile Communications, a Code Division Multiple Access, a Worldwide Interoperability for Microwave Access, a Universal Mobile Telecommunications System, a Wideband Code Division Multiple Access, a Long Term Evolution, an LTE Frequency Division Duplex, an LTE Time Division Duplex, an LTE-Advanced, a Universal Mobile Telecommunications System, an Enhanced Mobile Broadband, a Massive Machine Type Communications, an Ultra-Reliable and Low Latency Communications, and the like.
[0093] It is to be understood that the memory 1150 in the present application can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory includes a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory.
[0094] The volatile memory includes a random access memory used as an external cache. By way of example, and not limitation, many forms of RAM can be used, such as: a static random access memory, a dynamic random access memory, a synchronous dynamic random access memory, a double data rate synchronous dynamic random access memory, an enhanced synchronous dynamic random access memory, a synchronous link dynamic random access memory, and a direct memory bus random access memory. The memory 1150 of the electronic device described in the present application includes, but is not limited to, the above-mentioned and any other suitable type of memory.
[0095] In the present application, the memory 1150 stores an operating system 1151 and the following elements of an application program 1152: executable modules, data structures, or a subset thereof, or an extended set thereof.
[0096] Specifically, the operating system 1151 contains various device programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and handling hardware-based tasks. The application program 1152 contains various application programs, such as a media player, a browser, for implementing various application services. The program implementing the method of the present application can be included in the application program 1152. The application program 1152 includes: applets, objects, components, logic, data structures, and other computer device executable instructions that perform specific tasks or implement specific abstract data types.
[0097] In addition, the application further provides a computer readable storage medium, which stores a computer program, the computer program is executed by a processor to realize each process of the method for controlling output data and achieve the same technical effects. To avoid repetition, details are not repeated here.
[0098] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for recording table data modification logs based on Uliweb, characterized in that, The method includes: Obtain user request; When the user request arrives at the server, the thread processing middleware preprocesses the user request and records the user information in the user request into local variables; The server processes the user request and obtains data change information; Based on the type of the data change information, different request instructions are sent, and the data change information is used as the instruction parameter; The code application receives the request instruction through the instruction dispatcher, parses the instruction parameters, and obtains the data change information; Read the user information from the local variables, and record the user information and the data change information to a log file; The method includes: the code application includes the thread processing middleware and the view, wherein the thread processing middleware preprocesses the user request, and the view is used for code logic to process logs; The method includes: loading the code application when the Uliweb service starts; The process_post_save method in the view of the code application is bound to the post_save instruction, and the process_post_delete method is bound to the post_delete instruction. These are then registered in the instruction dispatcher, and the Middleware middleware of the thread processing middleware is also registered. The code application consists of multiple apps under Uliweb, and can configure its own configuration files, template directories, and static directories to achieve reuse.
2. The method as described in claim 1, characterized in that, The step of sending different request instructions based on the type of data change information includes: Determine whether the type of the data change information is deleted data; If the type is data deletion, send a post_delete command.
3. The method as described in claim 2, characterized in that, The method includes: If the type is not data to be deleted, send a post_save command.
4. The method as described in claim 1, characterized in that, The step of reading the user information from the local variables and recording the user information and the data change information to a log file includes: Call the save_log function; When the save_log function is executed, it reads the user information from the local variable; The save_log function records the user information and data change information to a log file.
5. A table data modification log recording system based on Uliweb, characterized in that, The system includes: The request retrieval module is used to obtain user requests; The request preprocessing module is used to preprocess the user request when the user request arrives at the server, and to record the user information in the user request to local variables. A data change information acquisition module is used by the server to process the user request and obtain data change information. The request instruction sending module is used to send different request instructions according to the type of the data change information, and use the data change information as instruction parameters; The instruction parameter parsing module is used by the code application to receive the request instruction through the instruction dispatcher, parse the instruction parameters, and obtain the data change information. The logging module is used to read the user information from the local variables and record the user information and the data change information to a log file; The system further includes: the code application includes the thread processing middleware and the view, wherein the thread processing middleware preprocesses the user request, and the view is used for code logic to process logs. When the Uliweb service starts, the code application is loaded; the process_post_save method in the view of the code application is bound to the post_save instruction, and the process_post_delete method is bound to the post_delete instruction, and registered in the instruction dispatcher, and the Middleware of the thread processing middleware is also registered. The code application consists of multiple apps under Uliweb, and can configure its own configuration files, template directories, and static directories to achieve reuse.
6. An electronic device for recording table data modification logs based on Uliweb, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, characterized in that, When the computer program is executed by the processor, it implements the steps of the method as described in any one of claims 1-4.
7. A computer program product, comprising a computer program and / or instructions, characterized in that, When the computational program and / or instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-4.
Citation Information
Patent Citations
Method and system for implementing data modification log as well as application server
CN104598622A
Data processing method, client, server, and computer readable storage medium
CN109284332A