CN114741417A - Multi-database query and data processing method and device and electronic equipment - Google Patents

Multi-database query and data processing method and device and electronic equipment Download PDF

Info

Publication number
CN114741417A
CN114741417A CN202210347664.XA CN202210347664A CN114741417A CN 114741417 A CN114741417 A CN 114741417A CN 202210347664 A CN202210347664 A CN 202210347664A CN 114741417 A CN114741417 A CN 114741417A
Authority
CN
China
Prior art keywords
database
instruction
data
selection event
query
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
CN202210347664.XA
Other languages
Chinese (zh)
Inventor
马学韬
侯冰玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ziroom Information Technology Co Ltd
Original Assignee
Beijing Ziroom Information 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 Beijing Ziroom Information Technology Co Ltd filed Critical Beijing Ziroom Information Technology Co Ltd
Priority to CN202210347664.XA priority Critical patent/CN114741417A/en
Publication of CN114741417A publication Critical patent/CN114741417A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24558Binary matching operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

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

Abstract

The invention discloses a method, a device and electronic equipment for multi-database query and data processing, wherein the query method comprises the following steps: detecting a selection event, responding to the selection event, displaying the data file in the scene database corresponding to the selection event in a data file display area to prompt an external user to input a query instruction in a data instruction area based on the data file, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting the scene database corresponding to the corresponding name; and receiving a query instruction, responding to the query instruction, and displaying the target data corresponding to the query instruction in the data display area. According to the technical scheme provided by the invention, multiple database interfaces are integrated in a multiple data query system, so that the multiple databases are butted with one front-end interface, the redundant step of switching multiple query software is avoided, and the query efficiency is improved.

Description

Multi-database query and data processing method and device and electronic equipment
Technical Field
The invention relates to the field of software design, in particular to a method and a device for multi-database query and data processing and electronic equipment.
Background
Data is a valuable and sensitive resource for enterprises and users may query data using database query tools. Due to the diversity of data, different data are usually stored in different types of databases, such as MySQL, TiDB, and the like, and in order to distinguish the types of data, each type of database further includes a plurality of databases to store different types of data applied in various scenarios. For example: the two existing databases have the same name and are both used for the work of the same project, both belong to MySQL type databases, but the data types stored in the two databases are a and b respectively, and because the data types are different, the two databases are respectively applied to a scene a and a scene b in the current project work. This situation causes the employee to use different database software to perform the query in the process of querying the data. When a certain item needs to be queried in a plurality of data types, query efficiency is seriously reduced by switching query operations among various database software, so that the problem of low query efficiency caused by frequent switching of various database software is urgently needed to be solved.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and an electronic device for querying and processing multiple databases, so as to improve data querying efficiency of multiple databases.
According to a first aspect, an embodiment of the present invention provides a method for querying multiple databases, where the method includes: detecting a selection event, and responding to the selection event, displaying the data file in the scene database corresponding to the selection event in a data file display area to prompt an external user to input a query instruction in a data instruction area based on the data file, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting a scene database corresponding to the corresponding name; and receiving a query instruction, and displaying the target data queried corresponding to the query instruction in a data display area in response to the query instruction.
Optionally, the method further comprises: detecting a modification event to the target data in the data display area, and generating a modification instruction in the data instruction area in response to the modification event; and when the execution control in the data instruction area is triggered, responding to the modification instruction, and updating a modification result generated by the modification instruction into a corresponding data file.
Optionally, if the current scene database is a preset scene database, before the executing control in the data instruction region is triggered, the method further includes: displaying a work order submitting control in a data instruction area, and detecting a trigger action of the work order submitting control; when the work order submitting control is triggered, the modification instruction is packaged into a work order and sent to an auditing end, so that the auditing end audits the work order, wherein the execution control is hidden before the work order auditing is passed; and if a result that the work order returned by the auditing end passes the auditing is received, displaying the execution control in the data instruction area.
Optionally, the interface for detecting the selection event further includes a task selection area, where the task selection area is used to display all query tasks currently in the query process, and switch the interface for detecting the selection event according to the trigger action of each query task in the task selection area.
According to a second aspect, an embodiment of the present invention provides an apparatus for querying multiple databases, the apparatus including: the detection module is used for detecting a selection event and responding to the selection event, displaying the data file in the scene database corresponding to the selection event in a data file display area so as to prompt an external user to input a query instruction in a data instruction area based on the data file, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting a scene database corresponding to the corresponding name; and the instruction receiving module is used for receiving the query instruction and responding to the query instruction to display the target data queried corresponding to the query instruction in the data display area.
According to a third aspect, an embodiment of the present invention provides a method for processing multiple databases, where the method includes: acquiring a selection event and an operation instruction, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting a scene database corresponding to a corresponding name, and the operation instruction comprises at least one of a query instruction and a modification instruction; constructing a corresponding grammar parser based on the database type selection event; and analyzing the operation instruction by using the grammar analyzer, and if the operation instruction is analyzed successfully, calling a corresponding actuator to perform corresponding operation in a data file in a corresponding scene database.
Optionally, if the operation instruction is a query instruction, the invoking a corresponding executor to perform a corresponding operation in a data file in a corresponding scene database includes: calling a query executor to query and extract target data from the data files in the corresponding scene database; and feeding back the extracted target data to display the target data in a data display area in an interface for detecting the selection event.
Optionally, if the target data has a read-only right, the target data is displayed in an un-editable state in a data display area in an interface for detecting a selection event.
Optionally, if the operation instruction is a modification instruction, the invoking a corresponding executor to perform a corresponding operation in a data file in a corresponding scene database includes: and calling a modification executor to update the modification result generated by the modification instruction in the data file in the corresponding scene database.
Optionally, before the invoking the corresponding executor to perform the corresponding operation in the data file in the corresponding scene database, the method further includes: judging whether the corresponding scene database supports the operation type of the current operation instruction; and if the corresponding scene database does not support the operation type of the current operation instruction, feeding back the message which is not supported by the operation type so as to display the message which is not supported by the feedback operation type in a data display area in an interface for detecting and selecting the event.
Optionally, each database includes a master library and a slave library, the slave library is a backup of the master library, the slave library is only allowed to be read, and when the operation instruction is a query instruction, the query executor is invoked to perform an operation of querying data in the slave library.
According to a fourth aspect, an embodiment of the present invention provides an apparatus for processing multiple databases, the apparatus including: the system comprises an operation information acquisition module, a database type selection module, a database name selection module and a scene database selection module, wherein the operation information acquisition module is used for acquiring a selection event and an operation instruction, the selection event comprises a database type selection event used for selecting a database type, a database selection event used for selecting a database name and a scene database selection event used for selecting a scene database corresponding to a corresponding name, and the operation instruction comprises at least one of a query instruction and a modification instruction; the parser construction module is used for constructing a corresponding parser based on the database type selection event; and the operation module is used for analyzing the operation instruction by using the grammar analyzer, and if the operation instruction is successfully analyzed, calling the corresponding actuator to perform corresponding operation in the data file in the corresponding scene database.
According to a fifth aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method of the first aspect, the third aspect, or any one of the optional embodiments of the first aspect and the third aspect.
According to a sixth aspect, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method described in the first aspect, the third aspect, or any one of the optional implementation manners of the first aspect and the third aspect.
The technical scheme provided by the application has the following advantages:
according to the technical scheme, a multi-database query interface is integrated in a multi-data query system through the cooperation of a front end and a back end, a user firstly clicks and selects the type of a database, the name of the database and a scene database in an initial query page of a front end client, when the system detects a corresponding selection event, an instruction triggered by the selection event is transmitted to the back end, the back end feeds back the name of a data file in the corresponding scene database, a data file list is displayed in a data file display area of the query interface, and the user is helped to compile an operation instruction based on the data file of the current scene database. And when the operation instruction analysis is successful, calling a corresponding actuator from actuator interfaces of all databases initialized in advance to enable the actuator to inquire, modify and the like the target data in the databases according to the operation instruction, and then returning a corresponding result to the data display area. Therefore, the multi-database is butted with a front-end interface, the redundant step of switching the query software of various databases back and forth is avoided, and the query efficiency is improved.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the invention in any way, and in which:
FIG. 1 is a diagram illustrating the steps of a method for querying multiple databases according to an embodiment of the present invention;
FIG. 2 illustrates an exemplary diagram of a query interface in one embodiment of the invention;
FIG. 3 illustrates an exemplary diagram of a query interface generation modification instruction in one embodiment of the invention;
FIG. 4 illustrates an exemplary diagram of a query interface generating modification instructions and approving in one embodiment of the invention;
FIG. 5 is a schematic diagram illustrating steps of a method for processing multiple database data according to an embodiment of the present invention;
FIG. 6 is a flow chart illustrating a method for processing multiple database data according to an embodiment of the invention;
FIG. 7 is a schematic diagram of an apparatus for querying multiple databases according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a multi-database data processing apparatus according to an embodiment of the present invention;
fig. 9 shows a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
Referring to fig. 1, in an embodiment, a method for querying multiple databases includes the following steps:
step S101: and detecting a selection event, and responding to the selection event, displaying the data file in the scene database corresponding to the selection event in a data file display area to prompt an external user to input a query instruction in a data instruction area based on the data file, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting the scene database corresponding to the corresponding name.
Step S102: and receiving a query instruction, and displaying the target data queried corresponding to the query instruction in the data display area in response to the query instruction.
Specifically, as shown in fig. 2, in the embodiment of the present invention, the front end and the back end are matched to implement comprehensive query of multiple databases, and the front end of the embodiment of the present invention may implement modes such as making a Web page and a software application, so that a user inputs a corresponding website or downloads corresponding software through a client device including, but not limited to, a personal computer, a mobile phone, a tablet computer, and the like, thereby implementing operation on multiple databases in a front-end page. In the front-end page, a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting a scene database corresponding to the corresponding name are set, and a user clicks the corresponding database type, the corresponding database name and the corresponding scene database in the front-end page of the selection event. The database is divided into a plurality of database types, such as MySQL, Oracle, TiDB, MongoDB, and is used for storing data table structures, and different databases have different query communication protocols. The scene database in the database is used for storing data of different categories, and in this embodiment, the scene database is set based on different development environments, such as a test environment (KT), a production environment (KQ), and a production environment (KP), and the sensitivity and the safety requirements of different environments are different. The front-end page detects the clicking operation of the user in real time, so that a selection event generated by the clicking operation is sent to the back-end server for processing or directly processed on the client-side equipment, and the back-end server or the client-side equipment calls a corresponding database interface according to the detection event to request all data file names in the current scene database from the database. The database returns the data names of all the data files in the current scene database, and forms a data file list to be displayed in a data file display area in a front-end page, so that an external user is prompted to input a query instruction in a data instruction area based on the file names of the data files, and therefore target data in a target position in a corresponding file is queried. After receiving a query instruction input by a user, the front end responds to the query instruction, executes the query operation in a back-end processor of the client or sends the query instruction to the background server for query operation, and displays target data fed back by the back end in a data display area of a query page for the user to perform subsequent operation. Through the steps, the embodiment realizes the butt joint of multiple databases to one front-end interface, avoids the redundant step of switching the query software of multiple databases back and forth, and improves the query efficiency.
Specifically, in an embodiment, the multi-database query method provided in the embodiment of the present invention further includes the following steps:
the method comprises the following steps: a modification event to the target data within the data presentation area is detected, and a modification instruction is generated within the data instruction area in response to the modification event.
Step two: and when the execution control in the data instruction area is triggered, responding to the modification instruction, and updating a modification result generated by the modification instruction into a corresponding data file.
Specifically, as shown in fig. 3, in this embodiment, the data display area in the front-end page displays the target data queried by the user, and the user can directly modify the data in the data display area according to actual needs, so as to further improve the efficiency of using the relevant data by the user. When a user modifies target Data in a Data display area, a front-end client automatically generates a database DML statement in a Data instruction area according to a modified result, an execution control is displayed below the Data display area, namely a control button for clicking, and when the user clicks the execution control, the front-end responds to a modification instruction and informs a rear-end to call a modification actuator to update the modification result generated by the modification instruction into a corresponding Data file.
Specifically, in an embodiment, if the current scene database is the preset scene database, before the step two, the method further includes:
step three: and displaying the work order submitting control in the data instruction area, and detecting the trigger action of the work order submitting control.
Step four: and when the submitted work order control is triggered, packaging the modification instruction into a work order and sending the work order to the auditing end so as to enable the auditing end to audit the work order, wherein the execution control is hidden before the work order is approved.
Step five: and if a result that the work order returned by the auditing end passes the auditing is received, displaying the execution control in the data instruction area.
Specifically, in this embodiment, for some specific scenario databases, data thereof has special requirements, such as high confidentiality, so that when a user modifies the data in the specific scenario database, the modification can be performed after the database administrator has approved the modification. Therefore, when a user modifies the data of the specific scene database, the execution control is not displayed at the front end, the work order submitting control is displayed first, and when the work order submitting control is triggered by clicking of the user, the modification instruction is packaged into a work order and is sent to the auditing end, so that the auditing end audits the work order. And the execution control is not displayed in the data instruction area until the result that the work order returned by the auditing end passes the auditing is received, so that the safety compliance of the database is ensured. For example: as shown in fig. 4, in this embodiment, data modified in the KT KQ environment is automatically executed to the database, and for the KP environment, in order to ensure the safety compliance of the KP database, a leader review step (initiating a work order) is initiated, and after the leader review is passed, the data is executed to the inside of the database.
Specifically, as shown in fig. 2, in an embodiment, the interface for detecting a selection event further includes a task selection area, where the task selection area is used to show all query tasks currently in the query process, and switch the interface for detecting a selection event according to a trigger action of each query task in the task selection area. The user can establish the new query task to perform the query task operation of other databases under the condition of not closing the current query task, thereby realizing multi-task parallel operation and further improving the efficiency of data query and modification.
Referring to fig. 5 and fig. 6, in another embodiment, a method for processing multiple database data includes the following steps:
step S201: the method comprises the steps of obtaining a selection event and an operation instruction, wherein the selection event comprises a database type selection event used for selecting a database type, a database selection event used for selecting a database name and a scene database selection event used for selecting a scene database corresponding to a corresponding name, and the operation instruction comprises at least one of a query instruction and a modification instruction.
Step S202: and constructing a corresponding grammar parser based on the database type selection event.
Step S203: and analyzing the operation instruction by using a grammar analyzer, and if the operation instruction is successfully analyzed, calling a corresponding actuator to perform corresponding operation in the data file in the corresponding scene database.
Specifically, the above steps are applied to back-end processing, in this embodiment, the back-end may be a processor of a client, or may be an independent background server device, and may be flexibly selected according to an actual hardware condition of the device. After a selection event (including a database type, a database name and a scene database) input by a user and an operation instruction are collected in a front-end interface (the modification instruction is automatically generated in a data instruction area of a page based on the modification event of the user, but the subsequent submission performs operation, the principle of which can also be regarded as being equal to a query instruction input by the user, namely the modification instruction is also a product input by the user), a corresponding syntax parser is constructed according to the selection event of the database type, for example: the existing database types comprise MySQL, Oracle, TiDB and MongoDB, different database types have different corresponding SQL instructions and different required syntax parsers, and if the user selects the MySQL database in the database type selection event, the corresponding MySQL syntax parser needs to be constructed to parse the operation instruction input by the user. In this embodiment, an open source parser tidb parser based on Golang is constructed, and Lex & YaCC is used to perform syntax parsing for parsing SQL syntax, and a parsing flow of SQL is constructed by Lex & YaCC, an AST syntax parsing tree is generated according to Token generated by a defined lexical analyzer, SQL of different databases is parsed by the syntax parsing tree, and then SQL processing and determination of different databases are performed. After different SQL is determined, different processing measures are taken. Meanwhile, the SQL command is pre-checked through the syntax parser, whether the SQL syntax is correct or not is detected, and the accuracy of the operation command is guaranteed. If the grammar parser successfully parses the operation instruction input by the user, the operation instruction of the user is indicated to accord with the database type of the target database. And calling the actuator corresponding to the operation instruction to perform corresponding operation in the data file in the corresponding scene database from a plurality of actuators initialized in advance according to the operation instruction. In the embodiment, because SQL execution of multiple databases needs to be processed, a uniform execution interface is abstracted for different bottom layers aiming at an executor, wherein the MySQL and TiDB bottom layers use a goniception open source component; com/gordor open source library is used as the Oracle bottom layer; the MonogDB bottom layer uses go. Because the libraries used at the bottom layer are different, a large amount of calling cost is caused, so that the embodiment encapsulates a uniform execution interface, and the executors of the front-end different databases are processed by uniformly walking the executor interface.
In this embodiment, the executor executes the operation instruction by using an asynchronous mechanism, and executes other requests that do not block the page submission by using the asynchronous executor, thereby quickly returning the request result.
In this embodiment, in order to prevent the SQL execution time from affecting the performance of the database, an execution manager is further constructed, and is used to automatically check and kill the SQL when the SQL is abnormally overtime and abnormally loaded.
Therefore, through the steps, the embodiment realizes the butt joint of multiple databases to one front-end interface, avoids the redundant step of switching the query software of multiple databases back and forth, and improves the query efficiency.
In this embodiment, before the step S201, user information such as an account number and a password of the user is further obtained from the front end, and the step of authenticating the user authority is performed, so that the security of data operation is ensured.
Specifically, in an embodiment, before the step of invoking the corresponding executor to perform the corresponding operation in the data file in the corresponding scene database, the method further includes the following steps:
step six: and judging whether the corresponding scene database supports the operation type of the current operation instruction.
Step seven: and if the corresponding scene database does not support the operation type of the current operation instruction, feeding back the message which is not supported by the operation type so as to display the message which is not supported by the feedback operation type in a data display area in the interface for detecting the selection event.
In particular, in a practical application scenario, data operations supported by different scenario databases are different, for example: for database security, KP environments support Query operations only, i.e. are able to identify only DQL instructions (Data Query Language, DQL, Data Query Language), and KQ and KT environments support Query and modification operations, i.e. KQ and KT environments are able to identify DQL, DML and DDL instructions (Data Definition Language, DDL, Data Definition Language). If the KP environment is currently operated, the user just mistakenly inputs a modification operation instruction. Although the grammar parser detects that the instruction of the user has no grammar error aiming at the current database type and can successfully parse, in the step of judging the environmental compliance, if the KP environment is preset to not support the modification operation instruction, the instruction input by the user can not carry out the corresponding operation, and at the moment, the message which is not supported by the operation type is fed back so as to display the message which is not supported by the feedback operation type in the data display area in the interface for detecting and selecting the event. Therefore, the user is informed to modify the correct operation instruction in time, the problem that the data cannot be correspondingly operated due to the input error of the user is avoided, and the data processing efficiency is further improved.
Specifically, in an embodiment, when the operation instruction is an inquiry instruction, the step S203 specifically includes the following steps:
step eight: and calling a query executor to query and extract the target data in the data files in the corresponding scene database.
Step nine: and feeding back the extracted target data to display the target data in a data display area in the interface for detecting the selection event.
Specifically, the query operation at the back end refers to the related description of the steps S101 to S102, which is not described herein again.
In particular, in one embodiment, the data in some scene databases has strong confidentiality and is not freely changeable, so if the target data has read-only rights, the target data is presented in a non-editable state in a data presentation area in an interface for detecting a selection event. So that the user cannot modify the target data in the data presentation area. Thereby improving the security of the data in the database.
Specifically, in an embodiment, when the operation instruction is a modification instruction, the step S203 specifically includes the following steps:
step ten: and calling a modification executor to update the modification result generated by the modification instruction in the data file in the corresponding scene database. Specifically, the modification operation of the back end refers to the related description of the steps from the first step to the second step and the steps from S201 to S203, and is not repeated herein.
Specifically, in one embodiment, each database includes a master library and a slave library, the slave library is a backup of the master library, the slave library is only allowed to read, and when the operation instruction is a query instruction, the query executor is called to perform an operation of querying data in the slave library. Because the master library has larger authority and more corresponding operations, the slave libraries are used for sharing the query operation of the master library, thereby further improving the efficiency of querying data of multiple databases. In the embodiment, the data queried and extracted from the database is compressed and stored in the cache, so that the problem of speed reduction caused by the overlarge data when the data is frequently called in the later period is solved, and the data querying efficiency of multiple databases is further improved.
Through the steps, according to the technical scheme provided by the application, the multi-database query interface is integrated in the multi-database query system through the matching of the front end and the rear end, firstly, a user clicks the type, the name and the scene database of the database in an initial query page of a front end client, when the system detects a corresponding selection event, an instruction triggered by the selection event is transmitted to the rear end, the rear end feeds back the name of a data file in the corresponding scene database, and displays a data file list in a data file display area of the query interface, so that the user is helped to compile an operation instruction based on the data file of the current scene database. And when the operation instruction analysis is successful, calling a corresponding actuator from actuator interfaces of all databases initialized in advance to enable the actuator to inquire, modify and the like the target data in the databases according to the operation instruction, and then returning a corresponding result to the data display area. Therefore, the multi-database is butted with one front-end interface, the redundant step of switching various database query software back and forth is avoided, and the query efficiency is improved.
As shown in fig. 7, the present embodiment further provides an apparatus for querying multiple databases, where the apparatus includes:
the detection module 101 is configured to detect a selection event, and in response to the selection event, display a data file in the scene database corresponding to the selection event in a data file display area to prompt an external user to input a query instruction in the data instruction area based on the data file, where the selection event includes a database type selection event for selecting a database type, a database selection event for selecting a database name, and a scene database selection event for selecting a scene database corresponding to the corresponding name. For details, refer to the related description of step S101 in the above method embodiment, and no further description is provided here.
The instruction receiving module 102 is configured to receive a query instruction, and in response to the query instruction, display target data queried corresponding to the query instruction in the data display area. For details, refer to the related description of step S102 in the above method embodiment, and no further description is provided here.
The multi-database query device provided by the embodiment of the present invention is used for executing the multi-database query method provided by the above embodiment, and the implementation manner and the principle thereof are the same, and the details are referred to the related description of the above method embodiment and are not repeated.
As shown in fig. 8, the present embodiment also provides a multi-database data processing apparatus, including:
the operation information acquisition module 201 is configured to acquire a selection event and an operation instruction, where the selection event includes a database type selection event for selecting a database type, a database selection event for selecting a database name, and a scenario database selection event for selecting a scenario database corresponding to a corresponding name, and the operation instruction includes at least one of a query instruction and a modification instruction. For details, refer to the related description of step S201 in the above method embodiment, and no further description is provided here.
The parser construction module 202 is configured to construct a corresponding parser based on the database type selection event, for details, refer to the related description of step S202 in the foregoing method embodiment, and no further description is provided herein.
And the operation module 203 is configured to analyze the operation instruction by using the syntax analyzer, and if the operation instruction is successfully analyzed, call the corresponding actuator to perform corresponding operation in the data file in the corresponding scene database. For details, refer to the related description of step S203 in the above method embodiment, and no further description is provided here.
The multiple database data processing apparatus provided in the embodiment of the present invention is configured to execute the multiple database data processing method provided in the foregoing embodiment, and the implementation manner and the principle thereof are the same, and details are referred to the related description of the foregoing method embodiment and are not described again.
Through the cooperative cooperation of the components, the technical scheme provided by the application integrates a multi-database query interface into a multi-database query system through the cooperation of the front end and the rear end, firstly, a user clicks and selects the type, the name and the scene database of the database in an initial query page of a front-end client, when the system detects a corresponding selection event, an instruction triggered by the selection event is transmitted to the rear end, the rear end feeds back the name of a data file in the corresponding scene database, and displays a data file list in a data file display area of the query interface, so that the user is helped to compile an operation instruction based on the data file of the current scene database. And when the operation instruction analysis is successful, calling a corresponding actuator from actuator interfaces of all databases initialized in advance to enable the actuator to inquire, modify and the like the target data in the databases according to the operation instruction, and then returning a corresponding result to the data display area. Therefore, the multi-database is butted with one front-end interface, the redundant step of switching various database query software back and forth is avoided, and the query efficiency is improved.
Fig. 9 shows an electronic device according to an embodiment of the present invention, where the device includes a processor 901 and a memory 902, which may be connected by a bus or by other means, and fig. 9 illustrates an example of a connection by a bus.
Processor 901 may be a Central Processing Unit (CPU). The Processor 901 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 902, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the methods in the above-described method embodiments. The processor 901 executes various functional applications and data processing of the processor by executing non-transitory software programs, instructions and modules stored in the memory 902, that is, implements the methods in the above-described method embodiments.
The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 901, and the like. Further, the memory 902 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 902 may optionally include memory located remotely from the processor 901, which may be connected to the processor 901 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 902, which when executed by the processor 901 perform the methods in the above-described method embodiments.
The specific details of the electronic device may be understood by referring to the corresponding related descriptions and effects in the above method embodiments, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, and the implemented program can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (14)

1. A method for multi-database query, the method comprising:
detecting a selection event, and responding to the selection event, displaying the data file in the scene database corresponding to the selection event in a data file display area to prompt an external user to input a query instruction in a data instruction area based on the data file, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting a scene database corresponding to the corresponding name;
and receiving a query instruction, and displaying the target data queried corresponding to the query instruction in a data display area in response to the query instruction.
2. The method of claim 1, further comprising:
detecting a modification event to the target data in the data display area, and generating a modification instruction in the data instruction area in response to the modification event;
and when the execution control in the data instruction area is triggered, responding to the modification instruction, and updating a modification result generated by the modification instruction into a corresponding data file.
3. The method of claim 2, wherein if the current context database is a default context database, before the time when the execution control in the data instruction region is triggered, the method further comprises:
displaying a work order submitting control in a data instruction area, and detecting a trigger action of the work order submitting control;
when the work order submitting control is triggered, the modification instruction is packaged into a work order and sent to an auditing end, so that the auditing end audits the work order, wherein the execution control is hidden before the work order audit is passed;
and if a result that the work order is approved and returned by the auditing end is received, displaying the execution control in the data instruction area.
4. The method according to claim 1 or 3, characterized in that in the interface for detecting the selection event, a task selection area is further included, and the task selection area is used for displaying all query tasks currently in the query process and switching the interface for detecting the selection event according to the trigger action of each query task in the task selection area.
5. An apparatus for multi-database querying, the apparatus comprising:
the detection module is used for detecting a selection event and responding to the selection event, displaying the data file in the scene database corresponding to the selection event in a data file display area so as to prompt an external user to input a query instruction in a data instruction area based on the data file, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting a scene database corresponding to the corresponding name;
and the instruction receiving module is used for receiving the query instruction and responding to the query instruction to display the target data queried corresponding to the query instruction in the data display area.
6. A method for processing data of multiple databases, the method comprising:
acquiring a selection event and an operation instruction, wherein the selection event comprises a database type selection event for selecting a database type, a database selection event for selecting a database name and a scene database selection event for selecting a scene database corresponding to a corresponding name, and the operation instruction comprises at least one of a query instruction and a modification instruction;
constructing a corresponding grammar parser based on the database type selection event;
and analyzing the operation instruction by using the grammar analyzer, and if the operation instruction is analyzed successfully, calling a corresponding actuator to perform corresponding operation in a data file in a corresponding scene database.
7. The method according to claim 6, wherein if the operation command is a query command, the invoking the corresponding executor to perform a corresponding operation in a data file in the corresponding scene database includes:
calling a query executor to query and extract target data from the data files in the corresponding scene database;
and feeding back the extracted target data to display the target data in a data display area in an interface for detecting the selection event.
8. The method of claim 7, wherein if the target data has read-only rights, the target data is presented in an uneditable state in a data presentation area in an interface for detecting selection events.
9. The method according to claim 6, wherein if the operation command is a modification command, the invoking the corresponding actuator to perform a corresponding operation in a data file in the corresponding scene database includes:
and calling a modification executor to update the modification result generated by the modification instruction in the data file in the corresponding scene database.
10. The method of claim 6, wherein prior to the invoking the corresponding executor to perform the corresponding operation in the data file in the corresponding scene database, the method further comprises:
judging whether the corresponding scene database supports the operation type of the current operation instruction;
and if the corresponding scene database does not support the operation type of the current operation instruction, feeding back a message which is not supported by the operation type, so as to display the message which is not supported by the feedback operation type in a data display area in an interface for detecting the selection event.
11. The method according to claim 6 or 8, wherein each database comprises a master library and a slave library, the slave library is a backup of the master library, the slave library only allows reading, and when the operation instruction is a query instruction, a query executor is invoked to perform a data query operation in the slave library.
12. An apparatus for processing multiple database data, the apparatus comprising:
the system comprises an operation information acquisition module, a database type selection module, a database name selection module and a scene database selection module, wherein the operation information acquisition module is used for acquiring a selection event and an operation instruction, the selection event comprises a database type selection event used for selecting a database type, a database selection event used for selecting a database name and a scene database selection event used for selecting a scene database corresponding to a corresponding name, and the operation instruction comprises at least one of a query instruction and a modification instruction;
the parser construction module is used for constructing a corresponding parser based on the database type selection event;
and the operation module is used for analyzing the operation instruction by using the grammar analyzer, and if the operation instruction is successfully analyzed, calling the corresponding actuator to perform corresponding operation in the data file in the corresponding scene database.
13. An electronic device, comprising:
a memory and a processor communicatively coupled to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the method of any of claims 1-4 or 6-11.
14. A computer-readable storage medium having stored thereon computer instructions for causing a computer to thereby perform the method of any one of claims 1-4 or 6-11.
CN202210347664.XA 2022-04-01 2022-04-01 Multi-database query and data processing method and device and electronic equipment Pending CN114741417A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210347664.XA CN114741417A (en) 2022-04-01 2022-04-01 Multi-database query and data processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210347664.XA CN114741417A (en) 2022-04-01 2022-04-01 Multi-database query and data processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114741417A true CN114741417A (en) 2022-07-12

Family

ID=82278146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210347664.XA Pending CN114741417A (en) 2022-04-01 2022-04-01 Multi-database query and data processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114741417A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706810A (en) * 2009-11-23 2010-05-12 北京中创信测科技股份有限公司 Method and device for querying databases
US20130198223A1 (en) * 2012-01-31 2013-08-01 Bank Of America Corporation System And Method For Processing, Maintaining, And Verifying Data
CN108874926A (en) * 2018-05-31 2018-11-23 康键信息技术(深圳)有限公司 Mass data inquiry method, device, computer equipment and storage medium
CN109189383A (en) * 2018-08-28 2019-01-11 厦门海迈科技股份有限公司 The generation method of code file, calculates equipment and storage medium at device
CN109614427A (en) * 2018-10-23 2019-04-12 平安科技(深圳)有限公司 The access method and device of Various database, storage medium and electronic equipment
CN110020114A (en) * 2017-09-28 2019-07-16 北京国双科技有限公司 Processing method, device and the equipment of data query
CN112860699A (en) * 2021-02-22 2021-05-28 北京互金新融科技有限公司 Database management method and device, storage medium and electronic device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706810A (en) * 2009-11-23 2010-05-12 北京中创信测科技股份有限公司 Method and device for querying databases
US20130198223A1 (en) * 2012-01-31 2013-08-01 Bank Of America Corporation System And Method For Processing, Maintaining, And Verifying Data
CN110020114A (en) * 2017-09-28 2019-07-16 北京国双科技有限公司 Processing method, device and the equipment of data query
CN108874926A (en) * 2018-05-31 2018-11-23 康键信息技术(深圳)有限公司 Mass data inquiry method, device, computer equipment and storage medium
CN109189383A (en) * 2018-08-28 2019-01-11 厦门海迈科技股份有限公司 The generation method of code file, calculates equipment and storage medium at device
CN109614427A (en) * 2018-10-23 2019-04-12 平安科技(深圳)有限公司 The access method and device of Various database, storage medium and electronic equipment
CN112860699A (en) * 2021-02-22 2021-05-28 北京互金新融科技有限公司 Database management method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN108427631B (en) Application test system, method, electronic equipment and readable storage medium
WO2020119434A1 (en) Method and apparatus for interface data processing, method and apparatus for automated testing, device, and medium
CN108595329B (en) Application testing method and device and computer storage medium
US9311214B2 (en) System and methods for tracing individual transactions across a mainframe computing environment
US9411616B2 (en) Classloader/instrumentation approach for invoking non-bound libraries
US20060271510A1 (en) Database Caching and Invalidation using Database Provided Facilities for Query Dependency Analysis
US9652353B2 (en) Monitoring business transaction failures involving database procedure calls
US20190324834A1 (en) Implementing a post error analysis system that includes log creation facilities associated with instances of software applications
JP2013540308A (en) Support for parameterized queries / views in complex event processing
CN103647794A (en) Data correlation method based on J2EE platform and correlation plug-in
US20080059940A1 (en) System and method for implementing a safe framework
US10459833B2 (en) Software integration testing with unstructured database
CN111026634A (en) Interface automation test system, method, device and storage medium
US9026612B2 (en) Generating a custom parameter rule based on a comparison of a run-time value to a request URL
CN111737140A (en) Interface automation test method, device, equipment and computer readable storage medium
US10983782B1 (en) User interface upgrade analyzer
US11693859B2 (en) Systems and methods for data retrieval from a database indexed by an external search engine
CN111813633A (en) Performance monitoring method, device, equipment and readable storage medium
CN114741417A (en) Multi-database query and data processing method and device and electronic equipment
US20180173615A1 (en) Software integration testing with unstructured database
US11341022B2 (en) Runtime performance introspection
US10824532B2 (en) Dump analysis generation
CN110413496B (en) Method for realizing componentized collection of electronic license operation data
CN113220586A (en) Automatic interface pressure test execution method, device and system
CN113821557A (en) Method for data interaction between Web page and back end

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