CN114996243A - Database operation method and device, electronic equipment and storage medium - Google Patents

Database operation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114996243A
CN114996243A CN202210719886.XA CN202210719886A CN114996243A CN 114996243 A CN114996243 A CN 114996243A CN 202210719886 A CN202210719886 A CN 202210719886A CN 114996243 A CN114996243 A CN 114996243A
Authority
CN
China
Prior art keywords
database
statement
operation statement
target object
audit field
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210719886.XA
Other languages
Chinese (zh)
Inventor
朱明奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lianren Healthcare Big Data Technology Co Ltd
Original Assignee
Lianren Healthcare Big Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lianren Healthcare Big Data Technology Co Ltd filed Critical Lianren Healthcare Big Data Technology Co Ltd
Priority to CN202210719886.XA priority Critical patent/CN114996243A/en
Publication of CN114996243A publication Critical patent/CN114996243A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a database operation method, a database operation device, electronic equipment and a storage medium. The method comprises the following steps: when a target object operates a database, acquiring object information of the target object, and acquiring a first operation statement of the target object operating the database; and determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement to perform data operation on the database. According to the technical scheme of the embodiment of the invention, the data corresponding to the audit field is automatically recorded when the database is operated, so that the development efficiency is improved, and the development cost is reduced.

Description

Database operation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a database operation method and apparatus, an electronic device, and a storage medium.
Background
With the development of computer technology, databases are widely applied to software development. Currently, in the software development process, data in a database is generally operated based on database operation statements written by technicians, for example, data in the database is modified or data is inserted into the database. In order to ensure the source of the data recorded in the database, the data in the database needs to be recorded through the audit field. In the prior art, when a technician operates a database, the technician is usually required to assign values to audit fields in a manual mode, so that not only is the development efficiency greatly influenced, but also the problem of high development cost exists.
Disclosure of Invention
The invention provides a database operation method, a database operation device, electronic equipment and a storage medium, which are used for automatically recording data corresponding to an audit field when a database is operated, thereby improving the development efficiency and reducing the development cost.
According to an aspect of the present invention, there is provided a database operation method, the method including:
when a target object operates a database, acquiring object information of the target object, and acquiring a first operation statement of the target object operating the database;
and determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement to perform data operation on the database.
According to another aspect of the present invention, there is provided a database operating apparatus. The device includes:
the first operation statement acquisition module is used for acquiring object information of a target object and acquiring a first operation statement of the database operated by the target object when the target object operates the database;
and the first database operation module is used for determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement to perform data operation on the database.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the database operation method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to execute a method for database operations according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, when the target object operates the database, the object information of the target object is obtained, and the first operation statement of the target object operating the database is obtained. And further determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement to perform data operation on the database. The technical scheme of the embodiment of the invention solves the technical problems of low development efficiency and high development cost of manually assigning the audit field when the database is operated in the prior art, and realizes the automatic recording of the data corresponding to the audit field when the database is operated, thereby improving the development efficiency and reducing the development cost.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a database operation method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a database operating apparatus according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It is understood that before the technical solutions disclosed in the embodiments of the present disclosure are used, the type, the use range, the use scene, etc. of the personal information related to the present disclosure should be informed to the user and obtain the authorization of the user through a proper manner according to the relevant laws and regulations.
For example, in response to receiving an active request from a user, a prompt message is sent to the user to explicitly prompt the user that the requested operation to be performed would require the acquisition and use of personal information to the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the disclosed technical solution, according to the prompt information.
As an optional but non-limiting implementation manner, in response to receiving an active request from the user, the manner of sending the prompt information to the user may be, for example, a pop-up window, and the prompt information may be presented in a text manner in the pop-up window. In addition, a selection control for providing personal information to the electronic device by the user's selection of "agreeing" or "disagreeing" can be carried in the pop-up window.
It is understood that the above notification and user authorization process is only illustrative and is not intended to limit the implementation of the present disclosure, and other ways of satisfying the relevant laws and regulations may be applied to the implementation of the present disclosure.
Example one
Fig. 1 is a flowchart of a database operation method according to an embodiment of the present invention, where the present embodiment is applicable to a case of operating a database, and the method may be executed by a database operation apparatus, where the database operation apparatus may be implemented in a form of hardware and/or software, and the database operation apparatus may be configured in an electronic device such as a computer or a server. As shown in fig. 1, the method of the present embodiment includes:
s110, when the target object operates the database, acquiring object information of the target object, and acquiring a first operation statement of the target object operating the database.
Wherein the target object can understand the object operating on the database. The number of target objects may be one, two, or more than two. In the embodiment of the present invention, the operating the database includes: at least one of an operation of creating a data table in the database, an operation of modifying a data table in the database, an operation of inserting data in a data table in the database, and an operation of modifying data in a data table in the database. The object information may include an object identification and/or an operation time. The object identification may be combined by information such as object name and object role. The operation time may be understood as the time when the target object operates on the data in the database. The first operation statement may be understood as an original database operation statement that operates on the database. It should be noted that the first operation statement may be obtained by combining at least one database operation statement.
Specifically, when it is detected that a target object operates a database, an object identifier of the target object may be obtained, and an operation time of the target object operating the database may be recorded. And further, the object identification and the operation time can be used as the object information of the target object. And when the target object operates the database, a first operation statement of the target object operating the database can be intercepted. It should be noted that, when the target object operates the database, the operation of acquiring the object information may be executed first, and then the operation of acquiring the first operation statement may be executed; alternatively, the operation of acquiring the first operation statement may be performed first, and then the operation of acquiring the object information may be performed.
The database operated by the target object may be of various types, and is not particularly limited, and may be, for example, an Oracle database, an SQLServer database, a MongoDB database, or the like.
Optionally, after obtaining the object information of the target object, the method further includes: and determining whether the object information is valid information, so that the phenomenon that data in the database is maliciously modified can be avoided. And if so, executing a first operation statement for acquiring the operation of the target object on the database. In the embodiment of the invention, after the object information of the target object is acquired, whether the acquired object information is valid information is determined, so that the data security can be effectively ensured. It will be appreciated that if it is determined that the object information is not valid information, a prompt message may be generated to prompt the target object for valid information.
In the embodiment of the present invention, there are various ways to determine whether the object information is valid information, which are not specifically limited herein, for example, the object information may be analyzed to determine analysis key information in the object information; acquiring reference key information of a target object; comparing the reference key information with the analysis key information to obtain a comparison result; based on the comparison result, it can be determined whether the object information is valid information.
The analysis key information may be information obtained by analyzing the object information. Optionally, the parsing key information may be a currently input current object name of the target object. Accordingly, the reference key information may be an actual object name of the target object. The comparison result may be used to determine whether the object information is valid information. If the comparison result is that the comparison is consistent, the object information can be determined to be effective information; if the comparison result is that the comparison is inconsistent, it can be determined that the object information is not valid information.
Optionally, obtaining a first operation statement that the target object operates on the database includes: and acquiring a first operation statement of the target object operating the database by calling a predefined database statement interceptor.
The database statement interceptor may be configured to intercept the first operation statement before the first operation statement is precompiled to obtain the first operation statement.
Specifically, when it is detected that the target object operates the database, a predefined database statement interceptor may be loaded into the memory. When the database statement interceptor is loaded into the memory, the database statement interceptor may be invoked to execute the database statement interceptor in the memory. And then intercepting a first operation statement of the target object operating the database by executing the database statement interceptor. So that the first operation statement can be acquired.
Illustratively, the operation of the database by the target object can be started for the springboot application. The database statement interceptor may be a mybatis interceptor. When the springboot application starts, the mybatis interceptor is loaded.
Optionally, intercepting a first operation statement of a target object operating on the database by calling a predefined database statement interceptor, including: intercepting an entry parameter of a database operation method for operating a database by calling a predefined database statement interceptor; and analyzing the entry parameters to obtain database operation statements contained in the entry parameters.
A database operation method may be understood as a method for operating a database. The entry parameters of the database operating method can be understood as the actual parameters of the database operating method. The actual parameters of the database operation method comprise a first operation statement.
Optionally, intercepting an entry parameter of a database operation method for operating a database by calling a predefined database statement interceptor, includes: and intercepting an entry parameter of a database operation method encapsulated by an interface for operating the database by calling a predefined database interceptor. The interface for operating the database may be a StatementHandler interface. The database manipulation method may be a prepare method.
And S120, determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement to perform data operation on the database.
The preset audit field may be understood as a creator field (crterId), a creation time field (crtimetime), a modifier field (modierId), and a modification time field (modiTime) of data in the record database, which may be embodied in each data table in the database. The second operation statement is a database operation statement generated based on the preset audit field, the object information and the first operation statement. It should be noted that, in the embodiment of the present invention, the number of the preset audit fields included in the first operation statement may be one, two, or more than two.
Specifically, after the first operation statement is obtained, the first operation statement may be analyzed, and then all fields included in the first operation statement may be obtained. All fields can be analyzed. And then, whether all the fields contain the preset audit field can be determined, namely, whether the first operation statement contains the preset audit field is determined. If the preset audit field is not contained in the first operation statement, the first operation statement can be rewritten based on the preset audit field and the object information. The rewritten first operation statement can be obtained and used as the second operation statement. After the second operation statement is obtained, the second operation statement may be executed, so that the data in the database may be operated on based on the second operation statement.
Optionally, generating a second operation statement based on the preset audit field, the object information, and the first operation statement, including: and adding the preset audit field to the first operation statement, so that the first operation statement contains the preset audit field. After the addition is completed, assignment processing can be performed on the preset audit field in the first operation statement based on the object information, and automatic assignment of the preset audit field can be achieved, so that the information of the audit field is recorded without sensing. After the assignment is completed, the first operation statement with the assignment completed can be obtained and used as the second operation statement.
Optionally, before determining whether the first operation statement includes the preset audit field, the method further includes: determining an operation type of a first operation statement; and if the operation type is the target type, executing to determine whether the first operation statement contains a preset audit field.
Wherein the target type comprises data modification and/or data writing. The operation type may include at least one of data modification, data writing, data deletion, and data querying.
Specifically, an operation keyword in the first operation statement may be extracted. The operation key may include at least one of INSERT, DELETE, UPDATE, and SELECT. Further, the operation type corresponding to the operation keyword, that is, the operation type corresponding to the first operation sentence may be determined based on the operation keyword. If the operation type is data modification and/or data writing, an operation of determining whether the first operation statement contains a preset audit field may be performed. It is to be understood that the first operation statement may be executed if the operation type of the first operation statement is data deletion and/or data query.
On the basis of the above embodiment, the method further includes: if the first operation statement contains the preset audit field, the preset audit field can be assigned based on the object information, and the phenomenon that the preset audit field is not assigned can be avoided. And after the assignment is completed, obtaining a first operation statement after the assignment is completed, and executing the first operation statement after the assignment is completed so as to operate the database.
According to the technical scheme, when the target object operates the database, the object information of the target object is obtained, and the first operation statement of the target object operating the database is obtained. And further determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement to perform data operation on the database. The technical scheme of the embodiment of the invention solves the technical problems of low development efficiency and high development cost of manually assigning the audit field when the database is operated in the prior art, and realizes the automatic recording of the data corresponding to the audit field when the database is operated, thereby improving the development efficiency and reducing the development cost.
Example two
Fig. 2 is a schematic structural diagram of a database operating apparatus according to a second embodiment of the present invention. As shown in fig. 2, the apparatus includes: a first operation statement acquisition module 210 and a first database operation module 220.
The first operation statement acquiring module 210 is configured to acquire object information of a target object and acquire a first operation statement of the target object operating a database when the target object operates the database; the first database operation module 220 is configured to determine whether the first operation statement includes a preset audit field, and if not, generate a second operation statement based on the preset audit field, the object information, and the first operation statement, and execute the second operation statement to perform data operation on the database.
According to the technical scheme, when a target object operates a database, object information of the target object is obtained through a first operation statement obtaining module, and a first operation statement of the target object operating the database is obtained. And then, whether the first operation statement contains a preset audit field or not can be determined through a first database operation module, if not, a second operation statement can be generated based on the preset audit field, the object information and the first operation statement, and the second operation statement is executed to perform data operation on the database. The technical scheme of the embodiment of the invention solves the technical problems of low development efficiency and high development cost of manually assigning the audit field when the database is operated in the prior art, and realizes the automatic recording of the data corresponding to the audit field when the database is operated, thereby improving the development efficiency and reducing the development cost.
Optionally, the first database operation module 220 is configured to:
adding the preset audit field to the first operation statement; and performing assignment processing on a preset audit field in the first operation statement based on the object information to obtain a first operation statement with the assigned value, and using the first operation statement as a second operation statement.
Optionally, before determining whether the first operation statement includes a preset audit field, the apparatus further includes:
an operation type determining module, configured to determine an operation type of the first operation statement; if the operation type is a target type, executing the step of determining whether the first operation statement contains a preset audit field; wherein the target type comprises data modification and/or data writing.
Optionally, the apparatus further comprises: a second database operation module to:
and if the first operation statement comprises the preset audit field, performing assignment processing on the preset audit field based on the object information to obtain a first operation statement with assigned value, and executing the first operation statement with assigned value to operate the database.
Optionally, the first operation statement obtaining module 210 is configured to:
and acquiring a first operation statement of the target object operating the database by calling a predefined database statement interceptor.
Optionally, the first operation statement obtaining module 210 is specifically configured to:
intercepting an entry parameter of a database operation method for operating a database by calling a predefined database statement interceptor; and analyzing the entry parameter to obtain a first operation statement contained in the entry parameter.
Optionally, after the obtaining of the object information of the target object, the apparatus further includes:
and the object information judging module is used for determining whether the object information is valid information, and if so, executing a first operation statement for acquiring the operation of the target object on the database.
The database operation device provided by the embodiment of the invention can execute the database operation method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the database operating apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
EXAMPLE III
FIG. 3 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The processor 11 performs the various methods and processes described above, such as database operation methods.
In some embodiments, the database operation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the database operation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the database operation method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of database operations, comprising:
when a target object operates a database, acquiring object information of the target object, and acquiring a first operation statement of the target object operating the database;
and determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement to perform data operation on the database.
2. The method of claim 1, wherein generating a second operation statement based on the preset audit field, the object information and the first operation statement comprises:
adding the preset audit field to the first operation statement;
and performing assignment processing on a preset audit field in the first operation statement based on the object information to obtain the first operation statement with the assigned value, and using the first operation statement as a second operation statement.
3. The method of claim 1, wherein prior to said determining whether a preset audit field is included in the first operation statement, the method further comprises:
determining an operation type of the first operation statement;
if the operation type is a target type, executing the step of determining whether the first operation statement contains a preset audit field; wherein the target type comprises data modification and/or data writing.
4. The method of claim 1, further comprising:
and if the first operation statement comprises the preset audit field, performing assignment processing on the preset audit field based on the object information to obtain a first operation statement with assigned value, and executing the first operation statement with assigned value to operate the database.
5. The method of claim 1, wherein obtaining the first operation statement of the target object operating on the database comprises:
and acquiring a first operation statement of the target object operating the database by calling a predefined database statement interceptor.
6. The method of claim 5, wherein intercepting a first operation statement of the target object operating on the database by calling a predefined database statement interceptor comprises:
intercepting an entry parameter of a database operation method for operating a database by calling a predefined database statement interceptor;
and analyzing the entry parameter to obtain a first operation statement contained in the entry parameter.
7. The method of claim 1, wherein after the obtaining object information of the target object, the method further comprises:
and determining whether the object information is valid information, if so, executing a first operation statement for acquiring the operation of the target object on the database.
8. A database operating apparatus, comprising:
the first operation statement acquisition module is used for acquiring object information of a target object and acquiring a first operation statement of the database operated by the target object when the target object operates the database;
and the first database operation module is used for determining whether the first operation statement contains a preset audit field, if not, generating a second operation statement based on the preset audit field, the object information and the first operation statement, and executing the second operation statement so as to perform data operation on the database.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database operation method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the method of database operation of any one of claims 1-7 when executed.
CN202210719886.XA 2022-06-23 2022-06-23 Database operation method and device, electronic equipment and storage medium Pending CN114996243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210719886.XA CN114996243A (en) 2022-06-23 2022-06-23 Database operation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210719886.XA CN114996243A (en) 2022-06-23 2022-06-23 Database operation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114996243A true CN114996243A (en) 2022-09-02

Family

ID=83037028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210719886.XA Pending CN114996243A (en) 2022-06-23 2022-06-23 Database operation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114996243A (en)

Similar Documents

Publication Publication Date Title
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN116775613A (en) Data migration method, device, electronic equipment and computer readable medium
CN116009847A (en) Code generation method, device, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN115309730A (en) Data auditing method and device, electronic equipment and storage medium
CN113076343B (en) Data query method, device, equipment and storage medium
CN114996243A (en) Database operation method and device, electronic equipment and storage medium
CN111159142A (en) Data processing method and device
CN116301869B (en) Front-end page configuration management and control system, method, equipment and medium
CN113626409B (en) Test data processing method, device, equipment and storage medium
CN115455029A (en) Battery replacement data acquisition method and device, electronic equipment and storage medium
CN115576977A (en) Data paging query method and device, electronic equipment and storage medium
CN115017134A (en) Database operation management method and device, electronic equipment and storage medium
CN117573677A (en) Data updating method, device, equipment and medium based on transverse table database structure
CN114185864A (en) Operation log management method and device, electronic equipment and storage medium
CN115983222A (en) EasyExcel-based file data reading method, device, equipment and medium
CN114936246A (en) Redis data management method, device, equipment, storage medium and product
CN117331507A (en) Data processing method, device, electronic equipment and storage medium
CN115981657A (en) Code generation method and device, electronic equipment and readable medium
CN115220722A (en) Method, device, equipment and medium for back-end internationalization
CN114706578A (en) Data processing method, device, equipment and medium
CN114329197A (en) Method, electronic device and program product for feeding back target data to user terminal
CN113849170A (en) Code sharing method and device, electronic equipment and storage medium
CN115167847A (en) Application log acquisition method, device, equipment and storage medium

Legal Events

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