CN109840257B - Database query method, database query device, computer device and readable storage medium - Google Patents

Database query method, database query device, computer device and readable storage medium Download PDF

Info

Publication number
CN109840257B
CN109840257B CN201811537734.8A CN201811537734A CN109840257B CN 109840257 B CN109840257 B CN 109840257B CN 201811537734 A CN201811537734 A CN 201811537734A CN 109840257 B CN109840257 B CN 109840257B
Authority
CN
China
Prior art keywords
database
query
selection
tree
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811537734.8A
Other languages
Chinese (zh)
Other versions
CN109840257A (en
Inventor
高雪松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811537734.8A priority Critical patent/CN109840257B/en
Publication of CN109840257A publication Critical patent/CN109840257A/en
Application granted granted Critical
Publication of CN109840257B publication Critical patent/CN109840257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a database query method, a database query device, a computer device and a computer readable storage medium. The database query method comprises the following steps: and acquiring attribute information of the database, and generating a tree-shaped selection model according to the attribute information. And receiving an access request and opening a preset interface according to the access request, wherein the preset interface comprises at least one input box and at least one selection box. And associating the nodes of the tree-shaped selection model with the selection frame, acquiring the query information input in the input frame and the options selected in the selection frame, generating a query sentence according to the query information and the nodes of the tree-shaped selection model associated with the options selected in the selection frame, executing the query sentence and acquiring an execution result in the database. The database query method provided by the application can query the data in the database on the preset webpage interface, realize the visualization of data query, and facilitate the database query operation of users.

Description

Database query method, database query device, computer device and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a database query method, a database query device, a database query computer device, and a database query computer readable storage medium.
Background
Database systems have become an integral part of existing systems, and data access functions are the most basic functions of database systems. The traditional query data access method is realized by calling a database special interface to write a structured query language (Structured Query Language, SQL for short). However, the access method has high requirements on the database foundation of the software developer, and when the software developer queries the record, a special SQL query statement needs to be written according to the query field, and then the query result is assigned to an application object of the programming language to write the SQL statement. However, writing SQL statements is difficult for not a software developer, and is inconvenient for users to operate.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a database query method, apparatus, computer apparatus, and storage medium that facilitate user operation.
The application provides a database query method, which comprises the following steps:
acquiring attribute information of a database, and generating a tree-shaped selection model according to the attribute information;
receiving an access request and opening a preset interface according to the access request, wherein the preset interface comprises at least one input frame and at least one selection frame;
associating nodes of the tree selection model with the selection boxes;
acquiring query information input in the input frame and options selected in the selection frame, and generating a query statement according to the query information and nodes of the tree-shaped selection model associated with the options selected in the selection frame; a kind of electronic device with high-pressure air-conditioning system
Executing the query statement and acquiring an execution result in the database.
In one embodiment, the step of receiving an access request and opening a preset interface according to the access request includes:
receiving an access request and acquiring user attribute information carried by the access request;
judging whether the user attribute information is authorized or not; a kind of electronic device with high-pressure air-conditioning system
And when the user attribute information is authorized, opening the preset interface according to the access request.
In one embodiment, the attribute information of the database includes: a database identification, a data table identification, and a field identification, and each of the databases includes one or more data tables, each of the data tables includes one or more fields, each of the fields includes one or more records.
In one embodiment, the database identifier, the data table identifier and the field identifier are all nodes of the tree-shaped selection model, each database identifier node is connected with a root node of the tree-shaped selection model, each data table identifier node is connected with a corresponding database identifier node, and each field identifier node is connected with a corresponding data table identifier node.
In one embodiment, the step of associating the node of the tree selection model with the selection box comprises:
acquiring a first selection frame, a second selection frame and a third selection frame in the preset interface;
associating the first selection frame with a database identification node in the tree-shaped selection model;
associating the second selection frame with a data table identification node in the tree-shaped selection model; a kind of electronic device with high-pressure air-conditioning system
And associating the third selection box with a field identification node in the tree selection model.
In one embodiment, the step of obtaining the query information input in the input box and generating the query sentence according to the options in the selection box and the query information includes:
and a query button is further arranged in the preset interface, and when a trigger request for the query button is acquired, options in the selection frame and query information input in the input frame are packaged into SQL query sentences.
In one embodiment, after the step of executing the query statement and obtaining the execution result in the database, the method further includes:
acquiring a change record of attribute information of the database;
and updating the tree-shaped selection model according to the change record of the attribute information, and carrying out association updating on the selection frame of the preset interface according to the updated tree-shaped selection model.
A database query apparatus, the apparatus comprising:
the generation module is used for acquiring attribute information of the database and generating a tree-shaped selection model according to the attribute information;
the opening module is used for receiving an access request and opening a preset interface according to the access request, wherein the preset interface comprises at least one input frame and at least one selection frame;
an association module for associating nodes of the tree-shaped selection model with the selection boxes;
the query module is used for acquiring the query information input in the input frame and the options selected in the selection frame and generating a query statement according to the query information and the nodes of the tree-shaped selection model associated with the options selected in the selection frame;
and the acquisition module is used for executing the query statement and acquiring an execution result in the database.
A computer apparatus comprising a processor and a memory, the processor for implementing the database query method when executing a computer program stored in the memory.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the database query method.
In summary, the database query method of the present application generates a tree-shaped selection model by acquiring attribute information of a database, associates nodes of the tree-shaped selection model with selection boxes in a preset interface, generates query sentences by acquiring query information input in the input boxes, and finally executes the query sentences and acquires execution results in the database. The application is convenient for the user to perform database query operation.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a database query method according to an embodiment of the present application.
Fig. 2 is a functional block diagram of a database query device according to a second embodiment of the present application.
Fig. 3 is a schematic diagram of a computer device according to a third embodiment of the present application.
The application will be further described in the following detailed description in conjunction with the above-described figures.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will be more clearly understood, a more particular description of the application will be rendered by reference to the appended drawings and appended detailed description. The embodiments of the present application and the features in the embodiments may be combined with each other without collision.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, and the described embodiments are merely some, rather than all, embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to fall within the scope of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
The terms first, second, third and the like in the description and in the claims of the application and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Preferably, the database query method of the present application is applied in one or more computer devices. The computer apparatus is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, and the like.
The computer device may be a computing device such as a desktop computer, a notebook computer, a tablet computer, a server, etc. The computer device can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
Embodiment one:
FIG. 1 is a flowchart illustrating steps of a database query method according to a preferred embodiment of the present application. The order of the steps in the flow diagrams may be changed, and some steps may be omitted, according to different needs.
Referring to fig. 1, the database query method specifically includes the following steps.
And S1, acquiring attribute information of a database, and generating a tree-shaped selection model according to the attribute information.
In this embodiment, the attribute information of the database includes a database identifier, a data table identifier, a field identifier, and a record identifier. It will be appreciated that each database may include one or more data tables, each data table may include one or more fields, and each field may include one or more records.
Preferably, each database has a database identifier, each data table has a data table identifier, each field has a field identifier, and each field identifier has a record identifier. The database identifier, the data table identifier, the field identifier and the record identifier can be used as nodes of the tree-shaped selection model, wherein each database identifier node in the tree-shaped selection model is connected with a root node, each data table identifier node is connected with a corresponding database identifier node, each field identifier node is connected with a corresponding data table identifier node, and each record identifier node is connected with a corresponding field identifier node.
For example, in one embodiment, the database includes a first database having a first database identification and a second database having a second database identification. The first database includes a first data table including a first field and a second field. The second database comprises a second data table and a third data table, the second data table comprises a third field, and the third data table comprises a fourth field. Thus, in the tree selection model, the first database identification node and the second database identification node are both connected to a root node. The first data table identification node is connected with the first database identification node, and the first field identification node and the second field identification node are both connected with the first data table identification node. The second data table identification node and the third data table identification node are both connected to the second database identification node, the third field identification node is connected to the second data table identification node, and the third field identification node is connected to the third data table identification node.
In this embodiment, the tree selection model may be stored in XML or JSON format, so that the tree selection model may be transmitted through a corresponding storage file.
In an embodiment, the tree selection model has rights attributes, i.e. the tree selection model can be read only when a user having the corresponding rights attributes. For example, the tree selection model is encrypted according to the user attribute information.
Step S2, receiving an access request and opening a preset interface according to the access request, wherein the preset interface comprises at least one input frame and at least one selection frame.
Specifically, the access request is an acquired preset website, and then a corresponding preset interface is opened according to the preset website. And accessing the database through the preset interface.
In one embodiment, the corresponding node may be selected in the tree selection model by the selection box, which is used to receive the input query information.
In another embodiment, when the access request is received, a storage file corresponding to the tree selection model is obtained while a preset interface is opened, and the storage file is in an encrypted state. And when the storage file is acquired, acquiring the input user attribute information in the preset interface so as to decode the storage file.
And step S3, associating the nodes of the tree-shaped selection model with the selection frame.
In one embodiment, the preset interface has a first selection frame, a second selection frame and a third selection frame. The first selection frame is associated with a database identification node in the tree-shaped selection model, the second selection frame is associated with a data table identification node in the tree-shaped selection model, and the third selection frame is associated with a field identification node in the tree-shaped selection model.
In another embodiment, after the nodes of the tree selection model are associated with the selection box, the selection box provides several options for the user to select.
Preferably, the first selection frame displays the first database and the second database, the second selection frame displays the first to third data tables, and the third selection frame displays the first to fourth fields.
It will be appreciated that the options displayed in the second selection box are associated with the first selection box and the options displayed in the third selection box are associated with the second selection box. For example, when the option acquired in the first selection frame is the first database, the second selection frame provides the first data table, and other data tables are not displayed. When the option acquired in the first selection frame is the second database, the second selection frame provides a second data table and a third data table, and other data tables are not displayed. And similarly, when the option acquired in the second selection frame is a third data table, displaying the fourth field in the third selection frame, and not displaying other fields.
In this embodiment, when the option acquired in the third selection frame is a corresponding field, the preset interface may display related information corresponding to the field, such as determining a field type, including but not limited to text type, remark type, digital type, date-time type, currency type, auto-code type, boolean type, hyperlink type, etc.
And S4, acquiring the query information input in the input frame and the options selected in the selection frame, and generating a query statement according to the query information and the nodes of the tree-shaped selection model associated with the options selected in the selection frame.
In this embodiment, the preset interface may include one or more input boxes, and each input box may be associated with a corresponding selection box.
Preferably, a first input frame, a second input frame, a first selection frame and a second selection frame are arranged in the preset interface. The first input box is associated with the first selection box and the second input box is associated with the second selection box.
In one embodiment, the options acquired in the selection box and the query information input in the input box are packaged into SQL query sentences, so that the query operation is conveniently executed in the database.
In another embodiment, a query button is further disposed in the preset interface, when the query button is triggered, the options acquired in the selection frame and the query information input in the input frame are packaged into an SQL query statement, and a query operation is performed according to the query statement.
For example, when a user needs to query a first data table, the user may select a first database identifier in the first selection box, and then only the first data table identifier is displayed in the second selection box. As the user needs to query the first data table. Inputting "x" in the first input box, when clicking the query button, a query sentence, such as "SELECT FROM first data table identifier" may be generated.
And S5, executing the query statement and acquiring an execution result from the database.
And when the query statement is executed, the corresponding execution result is acquired and displayed to the user. It can be appreciated that the execution result of the query statement may be packaged into a file or displayed through the preset interface.
In one embodiment, the query operation of the corresponding database is stored and recorded, and the query statement is verified according to the recorded query operation. For example, when the fourth table identifier in the first database is changed, the query statement of "SELECT FROM first table identifier" cannot be executed correctly. Then a "ALTER TABLE first data TABLE identification RENAME TO fourth data TABLE identification" statement is executed TO change the first data TABLE identification in the first database TO the fourth data TABLE identification. Therefore, according to the operation record, the query statement can be correspondingly modified or updated.
In another embodiment, the step of receiving an access request and opening a preset interface according to the access request includes: receiving an access request and acquiring user attribute information carried by the access request; judging whether the user attribute information is authorized or not; and when the user attribute information is authorized, opening the preset interface according to the access request. Preferably, the user attribute information includes a user name and/or a user password. And carrying out encryption operation on the storage file corresponding to the tree-shaped selection model by setting the user name and/or the user password. Therefore, by judging whether the user name and/or the user password are correct or not, the preset interface can be opened and the storage file can be read when the user name and/or the user password are correct.
In another embodiment, after the step of executing the query statement and obtaining the execution result in the database, the method further includes: acquiring a change record of attribute information of the database; and updating the tree-shaped selection model according to the change record of the attribute information, and carrying out association updating on the selection frame of the preset interface according to the updated tree-shaped selection model. And the keywords in the query sentences can be monitored in real time, the keywords are compared with preset keywords, and when the keywords are the preset keywords, the tree-shaped selection model is changed according to the change records. For example, when the preset keyword is "ALTER", and the "ALTER TABLE first data TABLE identifier RENAME TO fourth data TABLE identifier" is executed, the first data TABLE identifier in the tree selection model is changed TO the fourth data TABLE identifier, and the first data TABLE identifier is re-associated with the selection box in the preset page.
In summary, the database query method of the present application generates a tree-shaped selection model by acquiring attribute information of a database, associates nodes of the tree-shaped selection model with selection boxes in a preset interface, generates query sentences by acquiring query information input in the input boxes, and finally executes the query sentences and acquires execution results in the database. The method is based on the data visualization technology in the data display, and is convenient for the user to perform database query operation.
Embodiment two:
FIG. 2 is a functional block diagram of a database query apparatus according to a preferred embodiment of the present application.
Referring to fig. 2, the database query device 20 may include a generating module 201, an opening module 202, an associating module 203, a query module 204, and an obtaining module 205.
The generating module 201 is configured to obtain attribute information of a database, and generate a tree selection model according to the attribute information.
In one embodiment, each database in the generation module 201 has a database identifier, each data table has a data table identifier, each field has a field identifier, and each field identifier has a record identifier. The database identifier, the data table identifier, the field identifier and the record identifier can be used as nodes of the tree-shaped selection model, wherein each database identifier node in the tree-shaped selection model is connected with a root node, each data table identifier node is connected with a corresponding database identifier node, each field identifier node is connected with a corresponding data table identifier node, and each record identifier node is connected with a corresponding field identifier node.
For example, in one embodiment, the database includes a first database having a first database identification and a second database having a second database identification. The first database includes a first data table including a first field and a second field. The second database comprises a second data table and a third data table, the second data table comprises a third field, and the third data table comprises a fourth field. Thus, in the tree selection model, the first database identification node and the second database identification node are both connected to a root node. The first data table identification node is connected with the first database identification node, and the first field identification node and the second field identification node are both connected with the first data table identification node. The second data table identification node and the third data table identification node are both connected to the second database identification node, the third field identification node is connected to the second data table identification node, and the third field identification node is connected to the third data table identification node.
In this embodiment, the generating module 201 stores the tree selection model in XML or JSON format, so that the tree selection model can be transmitted through a corresponding storage file.
In an embodiment, the tree selection model has rights attributes, i.e. the tree selection model can be read only when a user having the corresponding rights attributes. For example, the tree selection model is encrypted according to the user attribute information.
In this embodiment, the attribute information of the database includes a database identifier, a data table identifier, a field identifier, and a record identifier. It will be appreciated that each database may include one or more data tables, each data table may include one or more fields, and each field may include one or more records.
The opening module 202 is configured to receive an access request and open a preset interface according to the access request, where the preset interface includes at least one input box and at least one selection box.
Specifically, the access request is an obtained preset website, and the opening module 202 may open a corresponding preset interface according to the preset website, and may access the database through the preset interface.
In one embodiment, the opening module 202 may select a corresponding node in the tree selection model through the selection box, where the input box is used to receive input query information.
In another embodiment, when the opening module 202 receives the access request, the opening module 202 obtains a storage file corresponding to the tree selection model while opening a preset interface, and the storage file is in an encrypted state. When the opening module 202 obtains the storage file, input user attribute information is obtained in the preset interface to decode the storage file.
The association module 203 is configured to associate a node of the tree selection model with the selection box.
In this embodiment, the preset interface has a first selection frame, a second selection frame and a third selection frame. The association module 203 associates the first selection box with a database identifier node in the tree selection model, associates the second selection box with a data table identifier node in the tree selection model, and associates the third selection box with a field identifier node in the tree selection model.
In another embodiment, after the nodes of the tree selection model are associated with the selection box, the selection box provides several options for the user to select.
Preferably, the first selection frame displays the first database and the second database, the second selection frame displays the first to third data tables, and the third selection frame displays the first to fourth fields.
It will be appreciated that the association module 203 associates options displayed in the second selection box with the first selection box and associates options displayed in the third selection box with the second selection box. For example, when the option acquired in the first selection frame is the first database, the second selection frame provides the first data table, and other data tables are not displayed. When the option acquired in the first selection frame is the second database, the second selection frame provides a second data table and a third data table, and other data tables are not displayed. And similarly, when the option acquired in the second selection frame is a third data table, displaying the fourth field in the third selection frame, and not displaying other fields.
In this embodiment, when the option acquired in the third selection frame is a corresponding field, the preset interface may display related information corresponding to the field, such as determining a field type, including but not limited to text type, remark type, digital type, date-time type, currency type, auto-code type, boolean type, hyperlink type, etc.
The query module 204 is configured to obtain query information input in the input box and options selected in the selection box, and generate a query statement according to the query information and nodes of the tree-shaped selection model associated with the options selected in the selection box.
In this embodiment, the preset interface may include one or more input boxes, and each input box may be associated with a corresponding selection box.
Preferably, a first input frame, a second input frame, a first selection frame and a second selection frame are arranged in the preset interface. The first input box is associated with the first selection box and the second input box is associated with the second selection box.
In one embodiment, the query module 204 encapsulates the options obtained in the selection box and the query information entered in the input box into an SQL query statement to facilitate query operations in a database.
In another embodiment, a query button is further disposed in the preset interface, when the query button is triggered, the options acquired in the selection frame and the query information input in the input frame are packaged into an SQL query statement, and a query operation is performed according to the query statement.
For example, when a user needs to query a first data table, the user may select a first database identifier in the first selection box, and then only the first data table identifier is displayed in the second selection box. As the user needs to query the first data table. Inputting "x" in the first input box, when clicking the query button, a query sentence, such as "SELECT FROM first data table identifier" may be generated.
The obtaining module 205 is configured to execute the query statement and obtain an execution result in the database.
When the obtaining module 205 executes the query statement, the obtaining module 205 returns a corresponding execution result to the user. It may be appreciated that the obtaining module 205 may package the execution result of the query term into a file or display the result through the preset interface.
In one embodiment, the obtaining module 205 stores and records the query operation of the corresponding database, and verifies the query statement according to the recorded query operation. For example, when the fourth table identifier in the first database is changed, the query statement of "SELECT FROM first table identifier" cannot be executed correctly. Then a "ALTER TABLE first data TABLE identification RENAME TO fourth data TABLE identification" statement is executed TO change the first data TABLE identification in the first database TO the fourth data TABLE identification. Therefore, according to the operation record, the query statement can be correspondingly modified or updated.
In another embodiment, the opening module 202 receives an access request, obtains user attribute information carried by the access request, and determines whether the user attribute information is authorized. When the user attribute information is authorized, the opening module 202 opens the preset interface according to the access request. Preferably, the user attribute information includes a user name and/or a user password. The opening module 202 performs encryption operation on the storage file corresponding to the tree-shaped selection model by setting the user name and/or the user password. In this way, the opening module 202 may determine whether the user name and/or the user password are correct, and may open the preset interface and read the storage file when the user name and/or the user password are correct.
In another embodiment, the obtaining module 205 further obtains a change record of the attribute information of the database after executing the query term and obtaining the execution result in the database. And updating the tree-shaped selection model according to the change record of the attribute information, and carrying out association updating on the selection frame of the preset interface according to the updated tree-shaped selection model. And the keywords in the query sentences can be monitored in real time, the keywords are compared with preset keywords, and when the keywords are the preset keywords, the tree-shaped selection model is changed according to the change records. For example, when the preset keyword is "ALTER", and the "ALTER TABLE first data TABLE identifier RENAME TO fourth data TABLE identifier" is executed, the first data TABLE identifier in the tree selection model is changed TO the fourth data TABLE identifier, and the first data TABLE identifier is re-associated with the selection box in the preset page.
In summary, in the database query device 20 according to the present application, the generating module 201 is configured to obtain attribute information of a database, generate a tree-shaped selection model according to the attribute information, the opening module 202 is configured to receive an access request and open a preset interface according to the access request, where the preset interface includes at least one input box and at least one selection box, the associating module 203 is configured to associate a node of the tree-shaped selection model with the selection box, the querying module 204 is configured to obtain query information input in the input box and options selected in the selection box, generate a query sentence according to the query information and nodes of the tree-shaped selection model associated with the options selected in the selection box, and the obtaining module 205 is configured to execute the query sentence and obtain an execution result in the database. The database query device provided by the application is convenient for the user to operate.
Example III
FIG. 3 is a schematic diagram of a computer device according to a preferred embodiment of the application.
The computer device 30 comprises a memory 31, a processor 32 and a computer program 33, such as a database query program, stored in the memory 31 and executable on the processor 32. The processor 32, when executing the computer program 33, implements the steps of the database query method embodiment described above, such as steps S1-S5 shown in fig. 1. Alternatively, the processor 32 may implement the functions of the modules in the database query device embodiments described above, such as the modules 201-205 in fig. 2, when executing the computer program 33.
Illustratively, the computer program 33 may be partitioned into one or more modules/units that are stored in the memory 31 and executed by the processor 32 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program 33 in the computer device 30. For example, the computer program 33 may be partitioned into the generation module 201, the opening module 202, the association module 203, the query module 204, and the acquisition module 205 in fig. 2. For specific functions of each module, see embodiment two.
The computer device 30 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or other computing devices. It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the computer apparatus 30 and is not limiting of the computer apparatus 30, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the computer apparatus 30 may also include input and output devices, network access devices, buses, etc.
The processor 32 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor 32 may be any conventional processor or the like, the processor 32 being the control center of the computer device 30, with various interfaces and lines connecting the various parts of the overall computer device 30.
The memory 31 may be used to store the computer program 33 and/or modules/units, and the processor 32 may perform various functions of the computer device 30 by executing or executing the computer program and/or modules/units stored in the memory 31 and invoking data stored in the memory 31. The memory 31 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the computer device 30, or the like. In addition, the memory 31 may include a high-speed random access memory, and may also include a nonvolatile memory such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), at least one disk storage device, a Flash memory device, or other volatile solid-state storage device.
The modules/units integrated by the computer device 30 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. 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), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
In the several embodiments provided by the present application, it should be understood that the disclosed computer apparatus and method may be implemented in other ways. For example, the above-described embodiments of the computer apparatus are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be other manners of division when actually implemented.
In addition, each functional unit in the embodiments of the present application may be integrated in the same processing unit, or each unit may exist alone physically, or two or more units may be integrated in the same 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 application is not limited to the details of the foregoing illustrative embodiments, and that the present application 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 application 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 sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. Multiple units or computer means recited in the computer means claim may also be implemented by means of software or hardware by means of the same unit or computer 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 application and not for limiting the same, and although the present application 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 application without departing from the spirit and scope of the technical solution of the present application.

Claims (5)

1. A method of database query, the method comprising:
acquiring attribute information of a database, and generating a tree-shaped selection model according to the attribute information, wherein the attribute information of the database comprises: the database identification, the data table identification and the field identification are all nodes of the tree-shaped selection model, each database identification node is connected with a root node of the tree-shaped selection model, each data table identification node is connected with a corresponding database identification node, and each field identification node is connected with a corresponding data table identification node;
receiving an access request and acquiring user attribute information carried by the access request;
judging whether the user attribute information is authorized or not;
when the user attribute information is authorized, opening a preset interface according to the access request, wherein the preset interface comprises at least one input frame and at least one selection frame;
acquiring a first selection frame, a second selection frame and a third selection frame in the preset interface;
associating the first selection frame with a database identification node in the tree-shaped selection model;
associating the second selection frame with a data table identification node in the tree-shaped selection model;
associating the third selection frame with a field identification node in the tree selection model;
acquiring query information input in the input frame and options selected in the selection frame, and packaging the query information and the options selected in the selection frame into SQL query sentences based on the tree-shaped selection model; a kind of electronic device with high-pressure air-conditioning system
And executing the SQL query statement and acquiring an execution result from the database.
2. The database query method of claim 1, wherein after the step of executing the SQL query statement and obtaining the execution result in the database further comprises:
acquiring a change record of attribute information of the database;
and updating the tree-shaped selection model according to the change record of the attribute information, and carrying out association updating on the selection frame of the preset interface according to the updated tree-shaped selection model.
3. A database query apparatus, the apparatus comprising:
the generation module is used for acquiring attribute information of a database and generating a tree-shaped selection model according to the attribute information, wherein the attribute information of the database comprises: the database identification, the data table identification and the field identification are all nodes of the tree-shaped selection model, each database identification node is connected with a root node of the tree-shaped selection model, each data table identification node is connected with a corresponding database identification node, and each field identification node is connected with a corresponding data table identification node;
the opening module is used for receiving an access request, acquiring user attribute information carried by the access request, judging whether the user attribute information is authorized, and opening a preset interface according to the access request under the condition that the user attribute information is authorized, wherein the preset interface comprises at least one input frame and at least one selection frame;
the association module is used for acquiring a first selection frame, a second selection frame and a third selection frame in the preset interface, associating the first selection frame with a database identification node in the tree-shaped selection model, associating the second selection frame with a data table identification node in the tree-shaped selection model, and associating the third selection frame with a field identification node in the tree-shaped selection model;
the query module is used for acquiring query information input in the input frame and options selected in the selection frame, and packaging the query information and the options selected in the selection frame into SQL query sentences based on the tree-shaped selection model;
and the acquisition module is used for executing the SQL query statement and acquiring an execution result from the database.
4. A computer device, characterized in that it comprises a processor and a memory, the processor being adapted to implement the database query method according to claim 1 or 2 when executing a computer program stored in the memory.
5. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the database query method of claim 1 or 2.
CN201811537734.8A 2018-12-15 2018-12-15 Database query method, database query device, computer device and readable storage medium Active CN109840257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811537734.8A CN109840257B (en) 2018-12-15 2018-12-15 Database query method, database query device, computer device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811537734.8A CN109840257B (en) 2018-12-15 2018-12-15 Database query method, database query device, computer device and readable storage medium

Publications (2)

Publication Number Publication Date
CN109840257A CN109840257A (en) 2019-06-04
CN109840257B true CN109840257B (en) 2023-11-21

Family

ID=66883292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811537734.8A Active CN109840257B (en) 2018-12-15 2018-12-15 Database query method, database query device, computer device and readable storage medium

Country Status (1)

Country Link
CN (1) CN109840257B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968601A (en) * 2019-11-28 2020-04-07 中国银行股份有限公司 Data query processing method and device
CN112905586A (en) * 2019-12-03 2021-06-04 阿里巴巴集团控股有限公司 Data processing and accessing method, device, computer system and readable storage medium
CN111694813A (en) * 2020-05-08 2020-09-22 北京明略软件系统有限公司 Data source management method and device
CN111813799B (en) * 2020-07-23 2024-01-19 德清云岫科技有限公司 Database query statement generation method, device, computer equipment and storage medium
CN111880795B (en) * 2020-07-29 2024-03-12 中国银联股份有限公司 Front-end interface generation method and device
CN112098816A (en) * 2020-09-09 2020-12-18 中国航空工业集团公司雷华电子技术研究所 Digital processing module testing method, device, computer equipment and storage medium
CN113761009A (en) * 2021-11-09 2021-12-07 深圳市明源云科技有限公司 Personnel selection method, system, device and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101371220A (en) * 2006-01-10 2009-02-18 Unz.Org有限责任公司 Transferring and displaying hierarchical data between databases and electronic documents
US7580938B1 (en) * 2006-06-29 2009-08-25 Emc Corporation Methods and apparatus facilitating efficient display of data
US8874621B1 (en) * 2011-10-09 2014-10-28 LockPath, Inc. Dynamic content systems and methods
CN107665228A (en) * 2017-05-10 2018-02-06 平安科技(深圳)有限公司 A kind of related information querying method, terminal and equipment
CN107729396A (en) * 2017-09-20 2018-02-23 上海精数信息科技有限公司 Data Dynamic Query method and device
CN108241622A (en) * 2016-12-23 2018-07-03 北京国双科技有限公司 The generation method and device of a kind of query script
WO2018177252A1 (en) * 2017-03-28 2018-10-04 阿里巴巴集团控股有限公司 Block chain-based data storage and query method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101371220A (en) * 2006-01-10 2009-02-18 Unz.Org有限责任公司 Transferring and displaying hierarchical data between databases and electronic documents
US7580938B1 (en) * 2006-06-29 2009-08-25 Emc Corporation Methods and apparatus facilitating efficient display of data
US8874621B1 (en) * 2011-10-09 2014-10-28 LockPath, Inc. Dynamic content systems and methods
CN108241622A (en) * 2016-12-23 2018-07-03 北京国双科技有限公司 The generation method and device of a kind of query script
WO2018177252A1 (en) * 2017-03-28 2018-10-04 阿里巴巴集团控股有限公司 Block chain-based data storage and query method and device
CN107665228A (en) * 2017-05-10 2018-02-06 平安科技(深圳)有限公司 A kind of related information querying method, terminal and equipment
CN107729396A (en) * 2017-09-20 2018-02-23 上海精数信息科技有限公司 Data Dynamic Query method and device

Also Published As

Publication number Publication date
CN109840257A (en) 2019-06-04

Similar Documents

Publication Publication Date Title
CN109840257B (en) Database query method, database query device, computer device and readable storage medium
CN110377851B (en) Method and device for realizing multi-stage linkage drop-down frame and computer equipment
CN107798038B (en) Data response method and data response equipment
CN109918394B (en) Data query method, system, computer device and computer readable storage medium
CA2684822C (en) Data transformation based on a technical design document
US9286329B2 (en) Generating analytics application using reusable application modules
CN109144997A (en) Data correlation method, device and storage medium
US10922640B2 (en) Smart template for predictive analytics
CN110765101B (en) Label generation method and device, computer readable storage medium and server
CN105574070A (en) System and method for reporting multiple objects in enterprise content management
CN112597182A (en) Data query statement optimization method and device, terminal and storage medium
WO2021013057A1 (en) Data management method and apparatus, and device and computer-readable storage medium
US20080077552A1 (en) Systems and methods for analyzing multiple states in one or more groups of data
CN111078761A (en) Data probing method, device, equipment and storage medium
CN108255963A (en) A kind of control method and device of the News Retrieval based on internet
US9934291B2 (en) Dynamic presentation of a results set by a form-based software application
CN111190905A (en) Database table processing method and device and electronic equipment
EP1909170B1 (en) Method and system for automatically generating a communication interface
CN117170655A (en) Metadata processing method and device, data processing equipment and storage medium
US9460139B2 (en) Distributed storage system with pluggable query processing
JP2022050327A (en) Computer-implemented system and method using digital twin and graph-based structure
CN111782208A (en) Index early warning method and device, computer equipment and storage medium
CN110737642B (en) Database information analysis method, database information analysis device, computer device and storage medium
CN115827589A (en) Authority verification method and device, electronic equipment and storage medium
JP2001216306A (en) Category generating device

Legal Events

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