Database-based query method, device and equipment

By obtaining query instructions and determining the query parameter combination and querying results from the database, the problem of large development volume, high cost and poor maintenance in the existing technology is solved, and efficient code development and good maintainability are achieved.

CN113360520BActive Publication Date: 2025-04-18AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110742719.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2025-04-18
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

In the prior art, a large number of logical languages ​​need to be written, resulting in large development volume, high cost, and poor maintainability of the logical language of the query method.

Method used

By obtaining query instructions, determine the query parameter combination corresponding to the query method and database category, and query the results from the corresponding database based on the combination, and return the query results. This method abstracts the control logic of different database categories and query methods into configurable query parameters, improving the reusability and maintainability of the code.

Benefits of technology

It reduces the amount of code development, reduces the cost, and improves the maintainability and reusability of the code, solving the problems of large amount of logical language writing and poor maintainability in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113360520B_ABST
    Figure CN113360520B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a query method, device and equipment based on a database, wherein the method includes: obtaining a query instruction, wherein the query instruction includes a query condition, and the query instruction is used to indicate a query method and a database category; determining a query parameter combination corresponding to the query method and the database category according to the query instruction, wherein the query parameter combination includes at least one query parameter; querying a query result corresponding to the query condition from a database corresponding to the database category according to the query parameter combination corresponding to the query method and the database category, and returning the query result. In addition, by abstracting the corresponding control logic of different database categories and different query methods into configurable query parameters, the query parameters can be called by different query methods and database types, thereby avoiding the problems of large code development, high cost, and poor maintainability of the logical language of the query method, and improving code reusability and maintainability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of database technology, and in particular to a query method, device and equipment based on a database. Background Art

[0002] With the development of informatization, databases have been widely used and developed. Based on databases, various types of data can be queried. Now there are many databases and query methods; databases, such as Oracle database, Mysql database, relational database system (Sysbase) database, etc.; query methods, such as self-service query, ordinary automatic query, emergency automatic query, etc.

[0003] In the prior art, a set of logical languages ​​is provided for each query method of each database. For example, query method a of database A is a set of logical languages, and query method b of database A is a set of logical languages. Then, data query is completed according to the logical languages ​​corresponding to the query methods.

[0004] However, in the prior art, since a set of logic languages ​​is provided for each query method of each database, and the query methods are diverse, a large number of logic languages ​​need to be written, resulting in a large amount of development and high cost; and when the logic language of a certain query method needs to be modified, it needs to be modified in a targeted manner, and the maintainability is poor. Summary of the invention

[0005] The embodiments of the present application provide a database-based query method, apparatus and device to solve the problem that a large amount of logic language needs to be written, resulting in a large amount of development and high cost; and the logical language of the query method has poor maintainability.

[0006] In a first aspect, an embodiment of the present application provides a query method based on a database, the method comprising:

[0007] Obtaining a query instruction, wherein the query instruction includes a query condition, and the query instruction is used to indicate a query method and a database category;

[0008] Determine, according to the query instruction, a query parameter combination corresponding to the query mode and the database category, wherein the query parameter combination includes at least one query parameter;

[0009] According to a combination of query parameters corresponding to the query method and database category, query results corresponding to the query conditions are queried from a database corresponding to the database category, and the query results are returned.

[0010] In a feasible implementation manner, determining a query parameter combination corresponding to the query mode and database category according to the query instruction includes:

[0011] According to the logical correspondence between the preset query method, database category and query parameter combination, the query parameter combination corresponding to the query method and database category is determined.

[0012] In a feasible implementation manner, according to a query parameter combination corresponding to the query mode and the database category, querying a query result corresponding to the query condition from a database corresponding to the database category includes:

[0013] Generate a call instruction according to a combination of query parameters corresponding to the query method and database category;

[0014] According to the calling instruction, query results corresponding to the query condition are queried from a database corresponding to the database category.

[0015] In a feasible implementation manner, the obtaining query instruction includes:

[0016] According to the query condition and the database category, the query method is determined according to the keywords of the query condition;

[0017] A query instruction is generated according to the query method and the database category.

[0018] In a feasible implementation manner, the query parameter is any one of the following:

[0019] The timeout period of a single query statement, the timeout period of a single script, the threshold of the number of connections to the data source, the threshold of the number of records returned by a single query statement, the size of the result file of a single script, whether sensitive fields are anonymized, the threshold of the number of records in the sensitive table, whether there is permission to query the data table, and the execution process parameters of the Java database connection.

[0020] In a second aspect, an embodiment of the present application provides a query device based on a database, the device comprising:

[0021] An acquisition unit, used for acquiring a query instruction, wherein the query instruction includes a query condition, and the query instruction is used for indicating a query method and a database category;

[0022] a determining unit, configured to determine, according to the query instruction, a query parameter combination corresponding to the query mode and the database category, wherein the query parameter combination includes at least one query parameter;

[0023] A query unit, configured to query a query result corresponding to the query condition from a database corresponding to the database category according to a combination of query parameters corresponding to the query mode and the database category;

[0024] The returning unit is used to return the query result.

[0025] In a feasible implementation manner, the determining unit is specifically configured to:

[0026] According to the logical correspondence between the preset query method, database category and query parameter combination, the query parameter combination corresponding to the query method and database category is determined.

[0027] In a feasible implementation manner, the query unit includes:

[0028] A generation module, used to generate a call instruction according to a combination of query parameters corresponding to the query mode and database category;

[0029] The query module is used to query the query result corresponding to the query condition from the database corresponding to the database category according to the calling instruction.

[0030] In a feasible implementation manner, the acquisition unit includes:

[0031] A determination module, configured to determine the query method according to the query condition and the database category and according to the keywords of the query condition;

[0032] The acquisition module is used to generate a query instruction according to the query method and the database category.

[0033] In a feasible implementation manner, the query parameter is any one of the following:

[0034] The timeout period of a single query statement, the timeout period of a single script, the threshold of the number of connections to the data source, the threshold of the number of records returned by a single query statement, the size of the result file of a single script, whether sensitive fields are anonymized, the threshold of the number of records in the sensitive table, whether there is permission to query the data table, and the execution process parameters of the Java database connection.

[0035] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a memory, a processor;

[0036] Memory; Memory for storing instructions executable by the processor;

[0037] The processor is configured to execute the method described in the first aspect.

[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0039] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: a computer program, wherein the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.

[0040] The database-based query method, device and equipment provided in the embodiments of the present application obtain query instructions, wherein the query instructions include query conditions, and the query instructions are used to indicate the query method and database category; determine the query parameter combination corresponding to the query method and database category according to the query instructions, wherein the query parameter combination includes at least one query parameter; query the query result corresponding to the query condition from the database corresponding to the database category according to the query parameter combination corresponding to the query method and database category, and return the query result. In addition, by abstracting the corresponding control logic of different database categories and different query methods into configurable query parameters, the query parameters can be called by different query methods and database types, avoiding the problems of large code development, high cost, and poor maintainability of the logical language of the query method, and improving the code reusability and maintainability. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] Figure 1 A flowchart of a database-based query method provided in an embodiment of the present application;

[0043] Figure 2 A flowchart of another database-based query method provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a database-based query device provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of the structure of another database-based query device provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0047] Figure 6 It is a block diagram of an electronic device provided in an embodiment of the present application.

[0048] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0050] With the development of informatization, the amount of data of various types has increased significantly. In order to facilitate the query of various types of data, databases have been widely used and developed. Databases such as Oracle database, Mysql database, relational database system (Sysbase) database, etc. have emerged. In addition, based on different query requirements for data, such as data query time, different query methods have also been generated. For example, self-service query, ordinary automatic query, emergency automatic query, etc. At the same time, in order to provide a safe, compliant and convenient data query implementation platform, a data query tool has been developed, through which various types of data can be queried through different query methods. The data query tool is a tool that can output query result files by inputting Structured Query Language (SQL) scripts. When using the data query tool for data query, it is necessary to consider the compliance check of SQL scripts under different database types and different query methods, sensitive data table and sensitive field control, query table permission control, SQL script execution time and memory usage control, output result record number, output result format and other factors.

[0051] In existing data query tools, a separate set of logic is generally encapsulated for different database types and different query methods. For example, for Oracle database, MySQL database, relational database system (Sysbase) and other databases, each encapsulates a set of core query interfaces or agents, which are called in different query methods. With the increase in the types of databases supported by data query tools and the increasing richness of query methods, each expansion of data query tools requires a separate design of control and execution logic, so a large amount of logic language needs to be written, resulting in a large amount of development and low code reusability. The cost is high; and when the logic language of a certain query method needs to be modified, it needs to be modified in a targeted manner, which has poor maintainability.

[0052] The database-based query method, device and equipment provided in the embodiments of the present application are intended to solve the above technical problems in the prior art.

[0053] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0054] To facilitate the description of this application, the relevant terms are explained below.

[0055] (1) Data query tool: A tool that integrates multiple database types to implement query SQL statements and return results.

[0056] (2) Query control: Add control to the query process in which users perform data queries and return results, including: implementation time, return result limit, peak value of simultaneous queries, output result format (image or file), etc.

[0057] (3) Abstraction: Sort out, investigate and summarize general logic through surface phenomena.

[0058] (4) Sensitive tables / fields: Data tables or fields containing important information, such as customer information such as name, mobile phone number, etc.

[0059] Figure 1 A flowchart of a database-based query method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes:

[0060] 101. Obtain a query instruction, wherein the query instruction includes a query condition and is used to indicate a query method and a database category;

[0061] Exemplarily, the execution subject of this embodiment is an electronic device, or a terminal device, or a server, or an apparatus and equipment based on a database query method, or other apparatus or equipment that can execute this embodiment, without limitation.

[0062] Exemplarily, the electronic device obtains different query instructions based on the data query tool through different requirements for data query, wherein the different data query requirements include, for example, whether the data to be queried is in a certain database, when the data query needs to be performed, i.e., the query method, etc. Based on the query requirements, the query instruction includes query conditions indicating the query method and database category. The query instruction may be input by a user, or the query instruction may be received by the electronic device from another device.

[0063] 102. Determine a query parameter combination corresponding to the query method and the database category according to the query instruction, wherein the query parameter combination includes at least one query parameter.

[0064] Exemplarily, the electronic device receives a query instruction based on a data query tool, and determines a corresponding query parameter combination according to the query method and database category indicated in the query instruction, wherein the query parameter combination is composed of multiple query parameters. The query parameters are used by the data query tool to query and control the data query process.

[0065] In one example, the common control logic of different database types and different query methods is abstracted to obtain query parameters, which are then configured in a data query tool. When the electronic device receives a query instruction based on the data query tool, it determines the corresponding query parameter combination according to the query instruction.

[0066] 103. According to the query parameter combination corresponding to the query method and the database category, query the query result corresponding to the query condition from the database corresponding to the database category, and return the query result.

[0067] Exemplarily, according to the query parameter combination obtained in step 102, the electronic device controls the data query process based on the data query tool, queries the data that meets the query conditions from the database indicated by the query instruction, returns the query result after the query is completed, and outputs the query result file.

[0068] In this embodiment, the electronic device first obtains a query instruction based on a data query tool, wherein the query instruction indicates the query method of the data query process, and information such as the database category to which the data to be queried belongs; the electronic device determines a query parameter combination corresponding to the above query method and database category based on the data query tool according to the query instruction, wherein the query parameter combination includes at least one query parameter; the electronic device finally queries data from the database corresponding to the database based on the query parameter combination corresponding to the query method and database category based on the data query tool, returns the query result after the query is completed, and outputs the query result file. In this embodiment, the query parameters can be called by different query methods and database types. When performing different data queries, only different parameters need to be used to control the data query process. When the data query tool in the electronic device is expanded, only query parameters need to be added, which greatly improves the maintainability of the code.

[0069] Figure 2 A flowchart of another database-based query method provided in an embodiment of the present application, such as Figure 2 As shown, the method includes:

[0070] 201. According to the query condition and the database category, determine the query method according to the keyword of the query condition; and generate a query instruction according to the query method and the database category. The query instruction includes the query condition, and the query instruction is used to indicate the query method and the database category.

[0071] Exemplarily, the execution subject of this embodiment is a data query tool.

[0072] Exemplarily, the electronic device determines the query method of the data query process based on the keywords of the query conditions, such as self-service query, automatic query (normal, emergency and fixed-point), etc., and determines the database category to which the data query process belongs based on the keywords of the query conditions, for example, GBASE database, ORACLE database, DB2 database, SYSBASE database, SQLSERVER database, MYSQL database, HIVE database and other database categories.

[0073] In one example, self-service query is a query method in which the user enters a query statement on the web page of the data query tool in the electronic device and immediately outputs the query result; automatic query is a query method in which the user initiates a query request, and after approval, the electronic device automatically implements the query based on the data query tool within a specific time period and returns the query result. Automatic query includes ordinary automatic query, emergency automatic query and fixed-point automatic query.

[0074] 202. According to the preset logical correspondence between the query method, the database category and the query parameter combination, determine the query parameter combination corresponding to the query method and the database category. The query parameter combination includes at least one query parameter.

[0075] Exemplarily, the electronic device receives a query instruction based on a data query tool, and determines a corresponding query parameter combination according to the query method and database category indicated in the query instruction and with reference to the logical correspondence between the preset query method, database category and query parameter combination, wherein the query parameter combination is composed of a plurality of query parameters. The query parameters are obtained by abstracting the common control logic under different database types and different query methods.

[0076] For example, when using an electronic device to perform data query based on a data query tool, since the data involves sensitive information, it is necessary to control the data query process through control logic such as process management, data desensitization, and record number limitation, so as to make the data query compliant.

[0077] In one example, during a self-service query process, the electronic device uses sqlparser technology based on a data query tool to parse SQL statements, desensitize sensitive fields, limit the number of records returned by each query statement, and finally displays the result file in the form of a watermarked image, thereby achieving the purpose of controlling data query security control; during an automatic query process, the electronic device uses timed scheduling technology based on a data query tool to implement data query orders in a specific time period, and provides result files for viewing and downloading.

[0078] In one example, a higher degree of query freedom is accompanied by a higher risk of data leakage, so self-service queries require stricter control. Specifically, Table 1 is an introduction table of various query methods. As shown in Table 1, four query methods are introduced, and each query method has the following information: query type, reselection conditions, query time, and query operation method. Each query method has multiple query parameters. Table 2 is the query parameters of the query method, where 0 means that the query parameter is not controlled during the data query process; 1 means that the query parameter is controlled during the data query process. As shown in Tables 1 and 2. Self-service query requires simple approval before data query. During the self-service query process, data table permission control, sensitive table control, sensitive field control, return record control, query time control, number of connections control, query memory control and query result output form control are required. Any number of queries can be made within 24 hours, and the query is manually called; ordinary automatic query requires simple approval, and the data query tool automatically implements the query form in different time periods during working hours. During the ordinary automatic query process, sensitive table control, query time control, number of connections control and query memory control are required; among them, emergency automatic query requires complex approval, and the data query tool automatically implements the query form immediately after approval. During the emergency automatic query process, sensitive table control, query time control, number of connections control and query memory control are required; fixed-point automatic query requires complex approval, and the data query tool automatically implements the query form at a fixed time point. During the fixed-point automatic query process, sensitive table control, query time control, number of connections control and query memory control are required.

[0079] Table 1 Introduction to various query methods

[0080]

[0081] Table 2 Query parameters of query method

[0082]

[0083] In one example, when a query instruction indicates a self-service query in a GBASE database, the electronic device determines the corresponding query parameter combination based on the logical correspondence between the preset query method, database category and query parameter combination of the data query tool, and the following: the timeout period of a single query statement, the timeout period of a single script, the threshold of the number of connections of the data source, the threshold of the number of records returned by a single query statement, the result file size of a single script, whether sensitive fields are desensitized, the threshold of the number of records in the sensitive table, whether there is permission to query the data table, and the execution process parameters of the Java database connection.

[0084] In one example, when a query instruction indicates an automatic (normal, emergency, and fixed-point) query in an ORACLE database, the electronic device determines the corresponding query parameter combination based on the logical correspondence between the preset query method, database category, and query parameter combination by the data query tool, as follows: control of the number of records in the sensitive table, whether the sensitive field is desensitized, the threshold of the number of connections to the data source, and the execution process parameters of the Java database connection.

[0085] 203. Generate a call instruction based on a combination of query parameters corresponding to the query method and database type.

[0086] Exemplarily, the electronic device generates a call instruction based on a data query tool according to a combination of query parameters corresponding to the query method and database category to control the data query process.

[0087] 204. According to the calling instruction, query a query result corresponding to the query condition from a database corresponding to the database category.

[0088] Exemplarily, the electronic device performs query control on the data query process based on the query parameter combination obtained by the data query tool according to step 203, and queries the data that meets the query conditions from the database indicated by the query instruction.

[0089] 205. Return the query result.

[0090] Exemplarily, the electronic device performs a data query based on a data query tool, returns a query result after the query is completed, and outputs a query result file.

[0091] In this embodiment, the electronic device determines the query method of the data query process based on the keyword of the query condition based on the data query tool, determines the database category to which the data query process belongs based on the keyword of the query condition, and determines the corresponding query parameter combination based on the logical correspondence between the preset query method, database category and query parameter combination, wherein the query parameter combination includes at least one query parameter; based on the query parameter combination, a call instruction is generated, and then through the call instruction, data query is performed from the database corresponding to the database category, and the query result file is returned. In this embodiment, by abstracting the corresponding control logic of different database categories and different query methods into configurable query parameters, the query parameters can be called by different query methods and database types, and the data query process can be controlled by inputting different parameters, which improves the large amount of code development caused by the increasing demand for data query and the continuous expansion and change of query methods, and when the logical language of a certain query method needs to be modified, it needs to be modified in a targeted manner, resulting in poor maintainability, thereby improving code reusability and maintainability.

[0092] Figure 3 A schematic diagram of a query device based on a database is provided for an embodiment of the present application, such as Figure 3 As shown, the device comprises:

[0093] The acquisition unit 31 is used to acquire a query instruction, wherein the query instruction includes a query condition and the query instruction is used to indicate a query method and a database category.

[0094] The determination unit 32 is used to determine a query parameter combination corresponding to the query mode and the database category according to the query instruction, and the query parameter combination includes at least one query parameter.

[0095] The query unit 33 is used to query the query result corresponding to the query condition from the database corresponding to the database category according to the query parameter combination corresponding to the query mode and the database category.

[0096] The returning unit 34 is used to return the query result.

[0097] Figure 4 A schematic diagram of another database-based query device provided in an embodiment of the present application, in Figure 3 Based on the embodiment shown, Figure 4 As shown, the determination unit 32 is specifically used for:

[0098] According to the logical correspondence between the preset query method, database category and query parameter combination, the query parameter combination corresponding to the query method and database category is determined.

[0099] In one example, the query unit 33 includes:

[0100] The generation module 331 is used to generate a call instruction according to a combination of query parameters corresponding to the query method and the database type.

[0101] The query module 332 is used to query the query result corresponding to the query condition from the database corresponding to the database category according to the calling instruction.

[0102] In one example, the acquisition unit 31 includes:

[0103] The determination module 311 is used to determine the query method according to the query condition and the database category and the keyword of the query condition.

[0104] The acquisition module 312 is used to generate a query instruction according to the query method and database category.

[0105] In an example, the query parameter is any one of the following: the timeout of a single query statement, the timeout of a single script, the threshold of the number of connections to the data source, the threshold of the number of records returned by a single query statement, the result file size of a single script, whether sensitive fields are anonymized, the threshold of the number of records in a sensitive table, whether there is permission to query the data table, and the execution process parameters of a Java database connection.

[0106] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the electronic device includes: a memory 51, a processor 52;

[0107] Memory 51: a memory for storing instructions executable by the processor 52;

[0108] The processor 52 is configured to execute the method provided in the above embodiment.

[0109] The electronic device further includes a receiver 53 and a transmitter 54. The receiver 53 is used to receive instructions and data sent by an external device, and the transmitter 54 is used to send instructions and data to the external device.

[0110] Figure 6 This is a block diagram of an electronic device provided in an embodiment of the present application. The electronic device may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0111] The apparatus 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0112] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0113] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0114] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0115] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0116] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0117] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0118] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800 and the temperature change of the device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

[0119] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0120] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0121] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0122] An embodiment of the present application also provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method provided by the above embodiment.

[0123] An embodiment of the present application also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0124] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0125] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A query method based on a database, characterized in that: The method comprises: Obtaining a query instruction, wherein the query instruction includes a query condition, and the query instruction is used to indicate a query method and a database category; According to the logical correspondence between the preset query mode, database category and query parameter combination, a query parameter combination corresponding to the query mode and database category is determined, wherein the query parameter combination includes at least one query parameter, and the query parameter is obtained by abstracting the common control logic under different database categories and different query modes, and the query parameter is used by the data query tool to query the data query process, and the query control refers to adding control to the query process of the user performing data query and returning results; According to the query parameter combination corresponding to the query mode and the database category, query the query result corresponding to the query condition from the database corresponding to the database category, and return the query result; The obtaining query instruction includes: Determine the query method and the database category according to the keywords of the query condition; the query method includes self-service query and automatic query, and the database category includes GBASE database, ORACLE database, DB2 database, SYSBASE database, SQLSERVER database, MYSQL database, HIVE database; Generate a query instruction according to the query method and the database category; According to the query parameter combination corresponding to the query mode and the database category, querying the query result corresponding to the query condition from the database corresponding to the database category includes: Generate a call instruction based on a combination of query parameters corresponding to the query method and database category based on a data query tool; According to the calling instruction, query control is performed on the data query process, and data that meets the query condition is searched from the database corresponding to the database category; The query parameter is any of the following: The timeout period of a single query statement, the timeout period of a single script, the threshold of the number of connections to the data source, the threshold of the number of records returned by a single query statement, the size of the result file of a single script, whether sensitive fields are anonymized, the threshold of the number of records in the sensitive table, whether there is permission to query the data table, and the execution process parameters of the Java database connection.

2. A query device based on a database, characterized in that: The device comprises: An acquisition unit, used for acquiring a query instruction, wherein the query instruction includes a query condition, and the query instruction is used for indicating a query method and a database category; A determination unit, for determining a query parameter combination corresponding to the query mode and the database category according to a logical correspondence between the preset query mode, the database category and the query parameter combination, wherein the query parameter combination includes at least one query parameter, and the query parameter is obtained by abstracting the common control logic under different database categories and different query modes, and the query parameter is used by the data query tool to perform query control on the data query process, and the query control refers to adding control to the query process of the user performing data query and returning results; A query unit, configured to query a query result corresponding to the query condition from a database corresponding to the database category according to a combination of query parameters corresponding to the query mode and the database category; A returning unit, used to return the query result; The acquisition unit is specifically used to determine the query method and the database category according to the keywords of the query condition; the query method includes self-service query and automatic query, and the database category includes GBASE database, ORACLE database, DB2 database, SYSBASE database, SQLSERVER database, MYSQL database, HIVE database; generate a query instruction according to the query method and the database category; The query unit comprises: A generating module, for generating a call instruction based on a combination of query parameters corresponding to the query mode and database category based on a data query tool; A query module, used to query and control the data query process according to the calling instruction, and query data that meets the query condition from the database corresponding to the database category; The query parameter is any of the following: The timeout period of a single query statement, the timeout period of a single script, the threshold of the number of connections to the data source, the threshold of the number of records returned by a single query statement, the size of the result file of a single script, whether sensitive fields are anonymized, the threshold of the number of records in the sensitive table, whether there is permission to query the data table, and the execution process parameters of the Java database connection.

3. An electronic device, characterized in that: The electronic device comprises: a memory and a processor; Memory; Memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the method as claimed in claim 1.

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to claim 1 when executed by a processor.

5. A computer program product, comprising a computer program, characterized in that The computer program implements the method according to claim 1 when being executed by a processor.

Citation Information

Patent Citations

  • Data query method and device

    CN110990420A

  • Data query method and device

    CN111897849A