CN117827869A - Database operation method, device and equipment for automatic filling of universal fields - Google Patents

Database operation method, device and equipment for automatic filling of universal fields Download PDF

Info

Publication number
CN117827869A
CN117827869A CN202311610632.5A CN202311610632A CN117827869A CN 117827869 A CN117827869 A CN 117827869A CN 202311610632 A CN202311610632 A CN 202311610632A CN 117827869 A CN117827869 A CN 117827869A
Authority
CN
China
Prior art keywords
sql
statement
database
storage process
handwriting
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
CN202311610632.5A
Other languages
Chinese (zh)
Inventor
陈晓明
刘海东
张宝浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance 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 China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202311610632.5A priority Critical patent/CN117827869A/en
Publication of CN117827869A publication Critical patent/CN117827869A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to database technology and discloses a database operation method, device and equipment for automatically filling universal fields and a storage medium. The method comprises the following steps: acquiring a handwriting SQL sentence input by a user, and inquiring whether the handwriting SQL sentence belongs to a built-in SQL set in a pre-constructed persistence frame; triggering a pre-built storage process when the handwritten SQL statement does not belong to the built-in SQL set; acquiring user information of the user by using the storage process; and according to a preset execution sequence strategy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by utilizing a trigger in the storage process to obtain a database execution result. The method can ensure that the user-defined handwriting SQL statement does not depend on a persistence framework used by the system in the operation process of the database, thereby improving the adaptability of the system.

Description

Database operation method, device and equipment for automatic filling of universal fields
Technical Field
The present invention relates to the field of database technologies, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for operating a database with automatic filling of universal fields.
Background
The database operations domain when using persisted frames of the business mainstream (e.g., hibernate, myBatis, etc.), these frames provide convenient functions to handle common fields in the database tables, such as creator, creation time, updater, update time, etc., which can automatically populate the values of these fields when inserting or updating data.
However, if we choose a complex handwritten SQL statement to operate the database, the auto-fill functionality provided by these frameworks will not be effective. This means that we need to manually fill the values of these fields explicitly each time the database is operated on, which can lead to code repeatability and inconsistency, which is detrimental to code unification and maintenance.
Disclosure of Invention
The invention provides a database operation method, device, equipment and storage medium for automatically filling universal fields, which mainly aims to ensure that a user-defined handwriting SQL statement does not depend on a persistence framework used by a system in the database operation process, and improve the system adaptability.
In order to achieve the above object, the present invention provides a method for operating a database with automatic filling of general fields, including:
acquiring a handwriting SQL sentence input by a user, and inquiring whether the handwriting SQL sentence belongs to a built-in SQL set in a pre-constructed persistence frame;
triggering a pre-built storage process when the handwritten SQL statement does not belong to the built-in SQL set;
acquiring user information of the user by using the storage process;
and according to a preset execution sequence strategy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by utilizing a trigger in the storage process to obtain a database execution result.
Optionally, according to a preset execution sequence policy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by using a trigger in the storage process to obtain a database execution result, where the step of obtaining the database execution result includes:
judging the execution logic of the handwriting SQL statement by utilizing the execution sequence strategy;
according to the execution logic, performing action sequence arrangement on the field filling operation and the SQL instruction execution operation to obtain an action sequence;
and executing the action sequence by using the trigger in the storage process to obtain a database execution result.
Optionally, before the triggering the pre-built storage procedure, the method further includes:
acquiring a pre-constructed information extraction statement, a field filling statement and an SQL instruction execution statement;
creating an initial storage process by utilizing a pre-constructed database management tool, and configuring the information extraction statement, the field filling statement and the SQL instruction execution statement into the initial storage process;
and carrying out calling statement packaging operation on the initial storage process to obtain a storage process.
Optionally, the acquiring the handwriting SQL statement input by the user includes:
acquiring an initial handwriting SQL sentence input by a user, and performing format verification operation based on SQL grammar specification on the initial handwriting SQL sentence by utilizing a regular expression algorithm;
when the result of the format verification operation is passing, the SQL sentence is protected by utilizing a parameterized query method, and a protected SQL sentence is obtained;
and performing sensitive word filtering operation on the protection SQL statement by using a preset blacklist to obtain a handwriting SQL statement.
Optionally, after the querying whether the handwritten SQL statement belongs to a built-in SQL set in a pre-built persistence framework, the method further includes:
and when the handwritten SQL statement belongs to the built-in SQL set, performing database operation on the handwritten SQL statement by utilizing the persistence framework to obtain a database execution result.
In order to solve the above problems, the present invention also provides a database operating apparatus for automatically filling a general field, the apparatus comprising:
the handwriting SQL sentence screening module is used for acquiring handwriting SQL sentences input by a user, inquiring whether the handwriting SQL sentences belong to a built-in SQL set in a pre-built persistence framework, and triggering a pre-built storage process when the handwriting SQL sentences do not belong to the built-in SQL set;
the user information acquisition module is used for acquiring the user information of the user by utilizing the storage process;
and the automatic field filling and executing module is used for performing field filling operation and SQL instruction executing operation based on the user information on the handwritten SQL statement by utilizing the trigger in the storage process according to a preset executing sequence strategy to obtain a database executing result.
Optionally, according to a preset execution sequence policy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by using a trigger in the storage process to obtain a database execution result, where the step of obtaining the database execution result includes:
judging the execution logic of the handwriting SQL statement by utilizing the execution sequence strategy;
according to the execution logic, performing action sequence arrangement on the field filling operation and the SQL instruction execution operation to obtain an action sequence;
and executing the action sequence by using the trigger in the storage process to obtain a database execution result.
Optionally, before the triggering the pre-built storage procedure, the apparatus further includes:
acquiring a pre-constructed information extraction statement, a field filling statement and an SQL instruction execution statement;
creating an initial storage process by utilizing a pre-constructed database management tool, and configuring the information extraction statement, the field filling statement and the SQL instruction execution statement into the initial storage process;
and carrying out calling statement packaging operation on the initial storage process to obtain a storage process.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database operating method of general field auto-population described above.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-mentioned database operation method for general-purpose field automatic population.
According to the embodiment of the invention, a storage process is configured in the database, wherein the storage process comprises an information extraction statement, a field filling statement and an SQL instruction execution statement, the information extraction statement can automatically acquire identity information, timestamp information and the like of a user, when the handwriting SQL statement cannot be attached to a persistence frame, the information such as the identity information, the timestamp and the like can be automatically filled through the field filling statement, and finally the database operation is carried out on the handwriting SQL statement by utilizing the SQL instruction execution statement under the condition that the SQL instruction execution statement does not depend on the persistence frame and codes are not generated in the database. Therefore, the database operation method, device, equipment and storage medium for automatically filling the universal fields can be characterized in that the custom handwriting SQL statement does not depend on a persistence framework used by a system in the database operation process, and the system adaptability is improved.
Drawings
FIG. 1 is a flowchart of a method for automatically filling universal fields into a database according to an embodiment of the present invention;
FIG. 2 is a detailed flowchart of a step in a database operation method for automatic filling of common fields according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a database operating device with automatic filling of common fields according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the method is used to implement the method for automatically filling a general field into a database.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a database operation method for automatically filling universal fields. In the embodiment of the present application, the execution body of the database operation method for automatically filling the universal field includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided in the embodiment of the present application. In other words, the database operation method of the universal field automatic filling may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flowchart of a method for automatically filling a general field in a database according to an embodiment of the invention is shown. In this embodiment, the method for operating the database with automatic filling of the universal field includes:
s1, acquiring a handwriting SQL sentence input by a user.
In detail, in the embodiment of the present invention, the obtaining the handwriting SQL statement input by the user includes:
acquiring an initial handwriting SQL sentence input by a user, and performing format verification operation based on SQL grammar specification on the initial handwriting SQL sentence by utilizing a regular expression algorithm;
when the result of the format verification operation is passing, the SQL sentence is protected by utilizing a parameterized query method, and a protected SQL sentence is obtained;
and performing sensitive word filtering operation on the protection SQL statement by using a preset blacklist to obtain a handwriting SQL statement.
In the embodiment of the invention, the regular expression or other related tools are firstly used for carrying out format verification on the SQL sentence input by the user so as to prevent the SQL sentence input by the user from containing grammar errors. Then, the data input by the user is converted into query parameters by using a pre-compiled sentence or a bound variable mode instead of being directly spliced into the SQL sentence, and then the parameters are transferred to a database system, so that a malicious user is prevented from modifying the structure of the SQL sentence through injection attack. And finally, performing sensitive word filtering by using a blacklist or keyword filtering method and the like so as to prevent sentences input by a user from containing sensitive information or harmful contents.
According to the embodiment of the invention, the safety compliance of the handwriting SQL sentence input by the user is ensured by the method, and the system stability is improved.
Further, it should be appreciated that for fields common to database tables, such as creator, creation time, updater, update time, etc., the service mainstream persistence framework is provided by relying on the capabilities of the framework itself, e.g., the Hibernate framework is provided by @ Audio annotation profile, and the Mybatisplus is provided by providing @ CreateBy, etc.
However, the above solution is only suitable for operating the database through the API of Hibernate or mybat plus, and in the actual software development process, it is often necessary to manually write SQL to operate the database, and the written SQL will not automatically update the fields of creator and the like.
For example, in an embodiment of the present invention, a handwritten SQL may include complex operations and grammars such as connection of multiple tables, sub-queries, aggregation functions, conditional logic, etc., while a persistence framework of the system can only perform automated parameter filling execution on a single or a combination of several common functions, while no assistance is provided for other operations.
Therefore, in the embodiment of the invention, the SQL instruction can be queried, for example, a document with a persistence framework is used by querying and consulting, a list or description of a built-in SQL set is usually provided in the document, and knowing the framework can know that the built-in SQL set is provided, so as to determine how to execute the handwritten SQL statement.
Therefore, S2, inquiring whether the handwriting SQL statement belongs to a built-in SQL set in a pre-constructed persistence framework.
And when the handwritten SQL statement belongs to the built-in SQL set, S3, carrying out database operation on the handwritten SQL statement by utilizing the persistence framework to obtain a database execution result.
In the embodiment of the invention, the persistence frameworks can better process the universal fields in the database table, improve the maintainability and uniformity of codes, provide convenient functions for automatically filling the values of the fields, do not need manual processing, and lead the codes to be more concise and normative. Therefore, when the handwritten SQL statement belongs to the built-in SQL set, the handwritten SQL statement can be directly executed through a persistence framework, so that a database execution result is obtained.
For example, the user-entered SQL statement of the creating user is in the built-in SQL set, the persistence framework can obtain the current timestamp and the identity information of the current user (e.g., the ID of the current login user) in a Service logic layer (Service), and then populate these values into the corresponding fields. The persistence framework will automatically include the values of these fields in the insert statements, saving them to the database.
And when the handwritten SQL statement does not belong to the built-in SQL set, S4, triggering a pre-built storage process.
The storage process is a section of pre-compiled program code which can be stored and executed in a database, is a set of SQL sentences, can accept parameters, execute logic operation and return a result.
In detail, in an embodiment of the present invention, before the triggering the pre-built storage procedure, the method further includes:
acquiring a pre-constructed information extraction statement, a field filling statement and an SQL instruction execution statement;
creating an initial storage process by utilizing a pre-constructed database management tool, and configuring the information extraction statement, the field filling statement and the SQL instruction execution statement into the initial storage process;
and carrying out calling statement packaging operation on the initial storage process to obtain a storage process.
In the embodiment of the invention, the storage process can be constructed according to the service requirement, wherein the storage process comprises an information extraction statement, a field filling statement and an SQL instruction execution statement. The information extraction statement is used for automatically acquiring identity information, timestamp information and the like of a user, when the handwriting SQL statement cannot be attached to the persistence frame, the information such as the identity information, the timestamp and the like can be automatically filled through the field filling statement, and finally, database operation is carried out on the handwriting SQL statement by utilizing the SQL instruction execution statement under the condition that the handwriting SQL statement does not depend on the persistence frame and does not generate codes in a database.
In the embodiment of the invention, the common database connection pool SDK is modified and enhanced by constructing a storage process. And when the service system receives a service request and applies for a database connection from the database connection pool, the database is automatically called to execute the storage process.
S5, acquiring user information of the user by using the storage process.
The user information may include information such as a user name, a password, a role, and the like.
In the embodiment of the invention, the input parameter @ UserId is preconfigured in the storage process, and then the user table can be queried by using a SELECT statement by using the storage process, the result is filtered according to the @ UserId parameter, and the query result is returned to obtain the user information.
S6, according to a preset execution sequence strategy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by utilizing a trigger in the storage process to obtain a database execution result.
Wherein the trigger is a special type of stored procedure, which is a piece of code defined in a database, and automatically triggers execution when a certain condition is met.
In detail, referring to fig. 2, in the embodiment of the present invention, according to a preset execution sequence policy, a field filling operation and an SQL instruction execution operation based on the user information are performed on the handwritten SQL statement by using a trigger in the storage process, so as to obtain a database execution result, which includes:
s61, judging the execution logic of the handwriting SQL sentence by utilizing the execution sequence strategy;
s62, according to the execution logic, performing action sequence arrangement on the field filling operation and the SQL instruction execution operation to obtain an action sequence;
and S63, executing the action sequence by utilizing the trigger in the storage process to obtain a database execution result.
In the embodiment of the invention, the sequence of the trigger for executing the instruction execution and the field filling operation on the handwriting SQL depends on specific requirements and service logic.
For example: 1) Executing a handwriting SQL instruction and then configuring user information: first, a handwriting SQL instruction, such as insert, update, delete, etc., is executed to modify the data in the database. Then, after the data modification is completed, operations of configuring user information, such as creating a user, assigning rights, and the like, are performed. 2) Firstly, configuring user information, and then executing a handwriting SQL instruction: first, an operation of configuring user information, such as creating a user, assigning rights, etc., is performed. And then, after the configuration of the user information is completed, executing a handwriting SQL instruction, and operating the data in the database.
Therefore, in the embodiment of the invention, the execution logic judgment needs to be performed to obtain the action sequence, and finally the action sequence is executed to obtain the database execution result.
In addition, in another embodiment of the invention, the handwriting SQL statement can be stored in the built-in SQL set of the persistence framework, so that the range of the built-in SQL set is improved, and the handwriting SQL execution efficiency is improved.
According to the embodiment of the invention, a storage process is configured in the database, wherein the storage process comprises an information extraction statement, a field filling statement and an SQL instruction execution statement, the information extraction statement can automatically acquire identity information, timestamp information and the like of a user, when the handwriting SQL statement cannot be attached to a persistence frame, the information such as the identity information, the timestamp and the like can be automatically filled through the field filling statement, and finally the database operation is carried out on the handwriting SQL statement by utilizing the SQL instruction execution statement under the condition that the SQL instruction execution statement does not depend on the persistence frame and codes are not generated in the database. Therefore, the database operation method for automatically filling the universal fields can be characterized in that in the database operation process, the custom handwriting SQL statement does not depend on a persistence framework used by a system, and the system adaptability is improved.
FIG. 3 is a functional block diagram of a database operating apparatus with automatic filling of common fields according to an embodiment of the present invention.
The database operating apparatus 100 for automatic filling of general fields according to the present invention may be installed in an electronic device. The general field automatic filling database operating device 100 may include a handwriting SQL statement screening module 101, a user information acquisition module 102, and a field automatic filling and execution module 103 according to the implemented functions. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the handwriting SQL statement screening module 101 is configured to obtain a handwriting SQL statement input by a user, query whether the handwriting SQL statement belongs to a built-in SQL set in a pre-built persistence framework, and trigger a pre-built storage process when the handwriting SQL statement does not belong to the built-in SQL set;
the user information obtaining module 102 is configured to obtain user information of the user using the stored procedure;
the automatic field filling and executing module 103 is configured to perform a field filling operation and an SQL instruction executing operation based on the user information on the handwritten SQL statement by using a trigger in the storage process according to a preset execution sequence policy, so as to obtain a database execution result.
In detail, each module in the general field automatic filling database operating device 100 in the embodiment of the present application adopts the same technical means as the general field automatic filling database operating method described in fig. 1 to 2, and can produce the same technical effects, which are not repeated here.
Fig. 4 is a schematic structural diagram of an electronic device 1 according to an embodiment of the present invention, which implements a database operation method for automatically filling universal fields.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a database operating program with automatic filling of general fields.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing Unit, CPU), a microprocessor, a digital processing chip, a graphics processor, a combination of various control chips, and so on. The processor 10 is a Control Unit (Control Unit) of the electronic device 1, connects respective parts of the entire electronic device using various interfaces and lines, executes or executes programs or modules stored in the memory 11 (for example, a database operation program for executing general field auto-fill, etc.), and invokes data stored in the memory 11 to perform various functions of the electronic device and process data.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes of database operation programs with general-purpose fields automatically filled, but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Fig. 4 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The database operating program with automatic filling of general fields stored in the memory 11 of the electronic device 1 is a combination of instructions which, when run in the processor 10, can implement:
acquiring a handwriting SQL sentence input by a user, and inquiring whether the handwriting SQL sentence belongs to a built-in SQL set in a pre-constructed persistence frame;
triggering a pre-built storage process when the handwritten SQL statement does not belong to the built-in SQL set;
acquiring user information of the user by using the storage process;
and according to a preset execution sequence strategy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by utilizing a trigger in the storage process to obtain a database execution result.
In particular, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of the drawings, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
acquiring a handwriting SQL sentence input by a user, and inquiring whether the handwriting SQL sentence belongs to a built-in SQL set in a pre-constructed persistence frame;
triggering a pre-built storage process when the handwritten SQL statement does not belong to the built-in SQL set;
acquiring user information of the user by using the storage process;
and according to a preset execution sequence strategy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by utilizing a trigger in the storage process to obtain a database execution result.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A method of database operation with automatic population of generic fields, the method comprising:
acquiring a handwriting SQL sentence input by a user, and inquiring whether the handwriting SQL sentence belongs to a built-in SQL set in a pre-constructed persistence frame;
triggering a pre-built storage process when the handwritten SQL statement does not belong to the built-in SQL set;
acquiring user information of the user by using the storage process;
and according to a preset execution sequence strategy, performing field filling operation and SQL instruction execution operation based on the user information on the handwritten SQL statement by utilizing a trigger in the storage process to obtain a database execution result.
2. The method for automatically filling the general fields into the database according to claim 1, wherein the step of performing the field filling operation and the SQL instruction execution operation based on the user information on the handwritten SQL statement by using the trigger in the storage process according to the preset execution sequence policy to obtain the database execution result comprises the steps of:
judging the execution logic of the handwriting SQL statement by utilizing the execution sequence strategy;
according to the execution logic, performing action sequence arrangement on the field filling operation and the SQL instruction execution operation to obtain an action sequence;
and executing the action sequence by using the trigger in the storage process to obtain a database execution result.
3. The method of database operations with automatic population of generic fields according to claim 1, wherein prior to said triggering of the pre-built storage process, the method further comprises:
acquiring a pre-constructed information extraction statement, a field filling statement and an SQL instruction execution statement;
creating an initial storage process by utilizing a pre-constructed database management tool, and configuring the information extraction statement, the field filling statement and the SQL instruction execution statement into the initial storage process;
and carrying out calling statement packaging operation on the initial storage process to obtain a storage process.
4. The method for automatically populating a database of claim 1, wherein the step of obtaining the user-entered handwritten SQL statement comprises:
acquiring an initial handwriting SQL sentence input by a user, and performing format verification operation based on SQL grammar specification on the initial handwriting SQL sentence by utilizing a regular expression algorithm;
when the result of the format verification operation is passing, the SQL sentence is protected by utilizing a parameterized query method, and a protected SQL sentence is obtained;
and performing sensitive word filtering operation on the protection SQL statement by using a preset blacklist to obtain a handwriting SQL statement.
5. The method of claim 1, wherein after querying whether the handwritten SQL statement belongs to a built-in SQL collection in a pre-built persistence framework, the method further comprises:
and when the handwritten SQL statement belongs to the built-in SQL set, performing database operation on the handwritten SQL statement by utilizing the persistence framework to obtain a database execution result.
6. A database operating apparatus for automatic population of generic fields, said apparatus comprising:
the handwriting SQL sentence screening module is used for acquiring handwriting SQL sentences input by a user, inquiring whether the handwriting SQL sentences belong to a built-in SQL set in a pre-built persistence framework, and triggering a pre-built storage process when the handwriting SQL sentences do not belong to the built-in SQL set;
the user information acquisition module is used for acquiring the user information of the user by utilizing the storage process;
and the automatic field filling and executing module is used for performing field filling operation and SQL instruction executing operation based on the user information on the handwritten SQL statement by utilizing the trigger in the storage process according to a preset executing sequence strategy to obtain a database executing result.
7. The apparatus for automatically filling a general field into a database according to claim 6, wherein the performing, according to a preset execution sequence policy, a field filling operation and an SQL instruction execution operation based on the user information on the handwritten SQL statement by using a trigger in the storing process to obtain a database execution result, includes:
judging the execution logic of the handwriting SQL statement by utilizing the execution sequence strategy;
according to the execution logic, performing action sequence arrangement on the field filling operation and the SQL instruction execution operation to obtain an action sequence;
and executing the action sequence by using the trigger in the storage process to obtain a database execution result.
8. The general field auto-filling database operating apparatus according to claim 6, wherein before said triggering the pre-built storage procedure, said apparatus further comprises:
acquiring a pre-constructed information extraction statement, a field filling statement and an SQL instruction execution statement;
creating an initial storage process by utilizing a pre-constructed database management tool, and configuring the information extraction statement, the field filling statement and the SQL instruction execution statement into the initial storage process;
and carrying out calling statement packaging operation on the initial storage process to obtain a storage process.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the general field auto-filling database operating method according to any one of claims 1 to 5.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method of database operation for automatic population of generic fields according to any of claims 1 to 5.
CN202311610632.5A 2023-11-28 2023-11-28 Database operation method, device and equipment for automatic filling of universal fields Pending CN117827869A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311610632.5A CN117827869A (en) 2023-11-28 2023-11-28 Database operation method, device and equipment for automatic filling of universal fields

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311610632.5A CN117827869A (en) 2023-11-28 2023-11-28 Database operation method, device and equipment for automatic filling of universal fields

Publications (1)

Publication Number Publication Date
CN117827869A true CN117827869A (en) 2024-04-05

Family

ID=90517972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311610632.5A Pending CN117827869A (en) 2023-11-28 2023-11-28 Database operation method, device and equipment for automatic filling of universal fields

Country Status (1)

Country Link
CN (1) CN117827869A (en)

Similar Documents

Publication Publication Date Title
CN108268253B (en) Interface code generation method and terminal equipment
CN111414407A (en) Data query method and device of database, computer equipment and storage medium
CN103970758A (en) Database accessing system and method
CN112948427B (en) Data query method, device, equipment and storage medium
CN112231417A (en) Data classification method and device, electronic equipment and storage medium
CN111125064A (en) Method and device for generating database mode definition statement
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN113297180A (en) Data migration method and device, electronic equipment and storage medium
CN116028045A (en) Third party application code rapid distribution method, device, equipment and storage medium
CN117827869A (en) Database operation method, device and equipment for automatic filling of universal fields
WO2022105494A1 (en) Automatic data backfilling method and apparatus, electronic device, and computer storage medium
CN114528593A (en) Data authority control method, device, equipment and storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN112527443A (en) Prompt box display method and device, electronic equipment and computer readable storage medium
CN113590217A (en) Function management method and device based on engine, electronic equipment and storage medium
CN115905660B (en) Network security data acquisition method, device, equipment and storage medium
CN113704109B (en) Front-end and back-end data interaction method and device, electronic equipment and storage medium
CN116627546A (en) Interface debugging method and device, electronic equipment and storage medium
CN117573199B (en) Model difference comparison analysis method, device, equipment and medium
CN115022171B (en) Method and device for optimizing update interface, electronic equipment and readable storage medium
CN115098514A (en) Method and device for identifying scene based on annotation, electronic equipment and storage medium
CN112817601A (en) Configurable program generation method and device, electronic equipment and storage medium
CN117170729A (en) Method, device, equipment and medium for analyzing compatibility among versions of open source component
CN117632012A (en) Data lake data storage method, device, equipment and medium based on storage stripping

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