CN115525659A - Data query method and device, electronic equipment and storage medium - Google Patents

Data query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115525659A
CN115525659A CN202211303199.6A CN202211303199A CN115525659A CN 115525659 A CN115525659 A CN 115525659A CN 202211303199 A CN202211303199 A CN 202211303199A CN 115525659 A CN115525659 A CN 115525659A
Authority
CN
China
Prior art keywords
query
field
queried
data
fragment
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
CN202211303199.6A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211303199.6A priority Critical patent/CN115525659A/en
Publication of CN115525659A publication Critical patent/CN115525659A/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/245Query processing
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention discloses a data query method, a data query device, electronic equipment and a storage medium, wherein the method comprises the following steps: when a data query request is received, determining query condition fields contained in the data query request, query input information corresponding to the query condition fields and fields to be queried; acquiring a pre-constructed query fragment table based on the query condition field and the field to be queried, and determining information to be queried corresponding to the field to be queried based on the query fragment table and the query input information; the query fragment table is a fragment table constructed by taking the query condition field as a fragment key. The technical scheme of the embodiment of the invention realizes the effect of global unique index in the distributed system, improves the query efficiency and improves the performance of the distributed system.

Description

Data query method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of big data processing, in particular to a data query method and device, electronic equipment and a storage medium.
Background
With the development of the financial industry, the data volume of related information systems is rapidly increased, and the traditional centralized database is difficult to support the storage of mass data. The distributed database has better support effect on mass data storage and better performance by virtue of the advanced architecture, and the financial industry information system is always migrated from the centralized database to the distributed database.
However, since the distributed database stores data in a plurality of data nodes, it is difficult to implement a globally unique indexing function. For each fragment independent index scheme, when data query is performed based on query conditions without fragment keys, a query request is sent to all fragments in a distributed system for polling operation, so that query efficiency is affected, and although a corresponding execution result is finally obtained, performance overhead of the whole distributed database system is high, and fault risk probability is improved.
Disclosure of Invention
The invention provides a data query method, a data query device, electronic equipment and a storage medium, which are used for realizing the effect of global unique index in a distributed system, improving the query efficiency and improving the performance of the distributed system.
According to an aspect of the present invention, there is provided a data query method, including:
when a data query request is received, determining a query condition field contained in the data query request, query input information corresponding to the query condition field and a field to be queried;
acquiring a pre-constructed query fragment table based on the query condition field and the field to be queried, and determining information to be queried corresponding to the field to be queried based on the query fragment table and the query input information;
the query fragment table is a fragment table constructed by taking the query condition field as a fragment key.
According to another aspect of the present invention, there is provided a data query apparatus, including:
the field determination module is used for determining a query condition field contained in a data query request, query input information corresponding to the query condition field and a field to be queried when the data query request is received;
the to-be-queried information determining module is used for acquiring a pre-constructed query fragment table based on the query condition field and the to-be-queried field, and determining to-be-queried information corresponding to the to-be-queried field based on the query fragment table and the query input information; the query fragment table is a fragment table constructed by taking the query condition field as a fragment key.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the data query method of any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a data query method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme, when a data query request is received, the query condition field, the query input information corresponding to the query condition field and the field to be queried which are contained in the data query request are determined, and further, the pre-constructed query fragment table is obtained based on the query condition field and the field to be queried, so that the information to be queried corresponding to the field to be queried is determined based on the query fragment table and the query input information.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a data query method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a data query method according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a data query device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing the data query method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a data query method according to an embodiment of the present invention, where this embodiment is applicable to a case where, in a process of performing data query in a distributed system, the distributed system does not support a globally unique index and cannot perform data query directly based on a sharded key corresponding to a query condition field, and the method may be executed by a data query device, where the data query device may be implemented in a form of hardware and/or software, and the data query device may be configured in a terminal and/or a server. As shown in fig. 1, the method includes:
s110, when a data query request is received, determining query condition fields contained in the data query request, query input information corresponding to the query condition fields and fields to be queried.
In this embodiment, the data query request may be a pre-written program code, and the program code is used to implement the data query function. The data query request may be a statement written in any programming language, and may alternatively be an SQL statement. A plurality of fields for implementing the corresponding query function may be included in the data query request. Accordingly, the query condition field may be a field that serves as a query filter criterion in the data query process. The query input information may be specific filtering information corresponding to the query condition field. The field to be queried may be a field in which specific information needs to be queried. In practical application, when a data query statement is received, a corresponding column in a database may be located based on a query condition field and a field to be queried, and further, a specific row corresponding to the column corresponding to the query condition field may be determined based on query input information, and further, information in the row in the field to be queried may be determined based on the row corresponding to the query input information, that is, the information may be used as information to be queried.
It should be noted that the query condition field may be one field or may be a plurality of fields. When the query condition field is a plurality of fields, the corresponding query logic may include "and" or "and the like.
It should be further noted that the query condition field may be a field capable of ensuring information uniqueness.
In specific implementation, when any data in the database needs to be queried, a data query request can be generated based on query requirements, and when a query operation on the data query request is detected, the data query request can be responded to, and a query condition field, query input information corresponding to the data query condition field, and a field to be queried in the data query request are determined, so that the required query content can be obtained based on the information in the data query request.
For example, if the query requirement corresponding to the data query request is to query the order date based on the user order account, the query condition field may be the user order account, the query input information may be a character string corresponding to the user order account, and the field to be queried may be the order date.
And S120, acquiring a pre-constructed query fragment table based on the query condition field and the field to be queried, and determining the information to be queried corresponding to the field to be queried based on the query fragment table and the query input information.
The query fragment table is a fragment table constructed by taking the query condition field as a fragment key.
In this embodiment, the query fragment table may be a fragment table that is constructed in advance and only includes the query condition field and the field to be queried, and the query fragment table is a fragment table in which the query condition field is used as a fragment key. As will be understood by those skilled in the art, a fragmentation table, i.e., a horizontal splitting table, specifically, splits data originally stored in one table into N tables, and in the splitting process, a field, i.e., a fragmentation key, may be specified, and different fragmentation algorithms (e.g., hash algorithm, list algorithm, and range algorithm) are used to distribute the data to different data nodes. Accordingly, the Shard Key (Shard Key) can be a basis for performing horizontal splitting of data for each Shard table. Each fragmentation table contains a corresponding fragmentation key and at least one data field. It should be noted that the fragmentation key in each fragmentation table is matched with the fragmentation table, that is, the fragmentation key in each fragmentation table is different.
It should be noted that, the fragment table may be queried as a sub-table constructed on the basis of the original database table in the system according to the requirements of the service scenario. The query fragment table may only include at least one query condition field and at least one field to be queried, which satisfy the service scenario requirements, and since the distributed system includes a plurality of data nodes, when data query is performed, in order to improve query efficiency, a fragment key may be carried in the data query request, that is, a query condition field in the data query request is a field corresponding to any fragment key in a database table, at this time, when the data query request is received, the request may be sent to a corresponding data node based on the fragment key.
In specific implementation, after the query condition field and the field to be queried are determined, a query fragment table which is constructed in advance, takes the query condition field as a fragment key and contains the field to be queried is obtained based on the query condition field and the field to be queried, and further, query can be performed in the query fragment table according to query input information so as to obtain the information to be queried corresponding to the field to be queried.
It should be noted that, because the distributed system includes a plurality of data nodes, and the total database table stored in the distributed system database may be divided horizontally into a plurality of sub-tables, which are stored in each data node, respectively, so as to reduce the pressure of the system on data storage, when data query is performed, the data node may be first located, and thus, a required query fragment table may be obtained from the data node.
Optionally, the obtaining of the pre-constructed query fragment table based on the query condition field and the field to be queried includes: determining data nodes which belong to a distributed database based on the query input information corresponding to the query condition field; and calling a corresponding query fragment table from the data node based on the query condition field and the field to be queried.
The data node may be a node for storing data in a distributed system database. The data node may be any one of the computer devices in the distributed system.
In an actual application process, after the query input information corresponding to the query condition field is determined, the data node for storing all the service data corresponding to the query input information can be determined based on the query input information, and further, according to the query condition field and the field to be queried, a pre-constructed query fragment table can be called from the data node.
Optionally, determining the information to be queried corresponding to the field to be queried based on the query fragment table and the query input information includes: and inquiring in the inquiry fragment table based on the inquiry input information so as to determine corresponding information to be inquired based on the inquiry input information.
In an actual application process, after the query fragment table is obtained, query can be performed in the query fragment table according to the query input information, information in a field to be queried, which is in the same row as the query input information, can be used as the information to be queried, and further, the determined information to be queried is sent to a node corresponding to the data query request.
It should be noted that the method provided by the embodiment of the present invention is applied to a distributed system.
According to the technical scheme, when a data query request is received, the query condition field, the query input information corresponding to the query condition field and the field to be queried, which are contained in the data query request, are determined, and further, the pre-constructed query fragment table is obtained based on the query condition field and the field to be queried, so that the information to be queried corresponding to the field to be queried is determined based on the query fragment table and the query input information.
Example two
Fig. 2 is a flowchart of a data query method provided in the second embodiment of the present invention, and based on the foregoing embodiments, a query fragment table may be constructed in advance, so that when a data query request is received, a corresponding query fragment table may be called to perform application. The specific implementation manner can be referred to the technical scheme of the embodiment. The technical terms that are the same as or corresponding to the above embodiments are not repeated herein.
As shown in fig. 2, the method includes:
s210, at least one service requirement is obtained, and query condition fields and fields to be queried corresponding to the service requirements are determined.
In this embodiment, the service requirement may be a query requirement corresponding to a service scenario. The business scenario may include, but is not limited to, a transfer business scenario, a transaction business scenario, a risk assessment business scenario, a query business scenario, and the like.
In the actual application process, at least one service requirement corresponding to each service scene can be respectively determined, then, the query condition field and the field to be queried corresponding to each service requirement are determined, whether each query condition field is a fragment key of a distributed system database table to which the query condition field belongs currently is judged, and each query condition field and the field to be queried are processed based on the judgment result.
S220, when the query condition field is detected to be a non-fragment key in the original information table, acquiring at least one item of query input information corresponding to the query condition field and at least one item of information to be queried corresponding to the field to be queried based on the original information table.
In this embodiment, the original information table may be a total information storage table constructed in the distributed system, that is, the data stored in the original information table may be data acquired in the entire distributed system. The original information table may include all fields related to each service in the distributed system, and the setting of the fragmentation key in the original information table may satisfy most service requirements. It should be noted that the original information table may be divided into a plurality of original information fragment tables based on the fragment key, and randomly distributed in each data node.
In the actual application process, after the query condition fields corresponding to the business requirements are determined, whether the query condition fields are fragment keys of an original information table or not can be detected in the distributed database, if at least one query condition field is detected to be a non-fragment key in the original information table, at least one item of query input information corresponding to the query condition fields and at least one item of information to be queried corresponding to the fields to be queried can be obtained according to the original information table, and therefore the information can be processed to obtain the fragment table meeting the business requirements.
And S230, constructing and storing a query fragment table with the query condition field as a fragment key based on the query input information and the to-be-queried information.
In the actual application process, after at least one item of query input information corresponding to the query condition field and the information to be queried corresponding to the field to be queried are obtained, a query fragment table which takes the query condition field as a fragment key and contains the field to be queried can be constructed based on the information, and the query fragment table is randomly stored in each data node in the distributed system.
It should be noted that the query fragment table may be matched with the service requirements, that is, each service requirement corresponds to one query fragment table, so that when a data query request corresponding to each service requirement is received, the data query request may be sent to the corresponding query fragment table for querying.
It should be further noted that, because each query fragment table is constructed based on the original information table, when database table processing operations such as adding, deleting, and changing are performed on the original information table, each operation is also correspondingly updated to the corresponding query fragment table.
On the basis of the above technical solutions, the method further comprises: when a data processing request for the original information table is received, the original information table is processed based on the data processing request, and the corresponding query fragment table is updated based on the processed original information table.
In this embodiment, the data processing request may be a piece of pre-written program code for implementing a corresponding data processing operation. The data processing request may be a statement written in any programming language, and may alternatively be an SQL statement. Optionally, the data processing request may include, but is not limited to, a new data processing request, a data deleting request, a data changing request, and the like.
In the actual application process, when a data processing request aiming at the original information table is received, the data processing request can be responded, the data processing operation contained in the data processing request and the data needing data processing are determined, further, the corresponding data processing is carried out on the original information table based on the data processing request, meanwhile, the changed field and the corresponding content are determined according to the processed original information table, and therefore the corresponding query fragment table can be updated based on the changed field content.
On the basis of the above technical solutions, the method further comprises: when a newly increased service requirement is received, determining a newly increased query condition field and a newly increased field to be queried corresponding to the newly increased service requirement; determining whether a query fragment table corresponding to the newly added query condition field and the newly added field to be queried exists or not based on each query fragment table; and if not, constructing a newly-added query fragment table with the newly-added query condition field as the fragment key based on the original information table.
In this embodiment, when the distributed system is in the application process, a new service requirement may be added based on the service scenario, and the subsequently added service requirement may be used as a new service requirement, and accordingly, the fields corresponding to the new service requirement are the new query condition field and the new field to be queried.
In the practical application process, when a newly-added service request is received, a newly-added query condition field and a newly-added field to be queried corresponding to the newly-added service request can be determined, then, whether an inquiry fragment table which takes the newly-added query condition field as a fragment key and contains the newly-added field to be queried exists in each inquiry fragment table which is constructed in advance is determined, if not, at least one piece of inquiry input information corresponding to the newly-added query condition field and at least one piece of information to be queried corresponding to the newly-added field to be queried can be extracted from an original information table, and therefore, the newly-added inquiry fragment table which takes the newly-added query condition field as a fragment key and contains the newly-added field to be queried can be constructed on the basis of the information.
S240, when the data query request is received, determining query condition fields contained in the data query request, query input information corresponding to the query condition fields and fields to be queried.
And S250, acquiring a pre-constructed query fragment table based on the query condition field and the field to be queried, and determining the information to be queried corresponding to the field to be queried based on the query fragment table and the query input information.
According to the technical scheme, the query fragment table with the query condition field as the fragment key is constructed in advance, so that the query condition field, the query input information corresponding to the query condition field and the field to be queried contained in the data query request are determined when the data query request is received, further, the constructed query fragment table is obtained based on the query condition field and the field to be queried, the information to be queried corresponding to the field to be queried is determined based on the query fragment table and the query input information, and the problem that in the prior art, when data query is carried out based on the query condition without the fragment key, the query request is sent to all fragments in a distributed system to carry out polling operation is solved, the query efficiency is affected, the effect of global unique index in the distributed system is achieved, the query efficiency is improved, and the performance of the distributed system is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data query device according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: a field determination module 310 and an information to be queried determination module 320.
The field determining module 310 is configured to determine, when a data query request is received, a query condition field included in the data query request, query input information corresponding to the query condition field, and a field to be queried;
a to-be-queried information determining module 320, configured to obtain a pre-constructed query fragment table based on the query condition field and the to-be-queried field, and determine, based on the query fragment table and the query input information, to-be-queried information corresponding to the to-be-queried field; the query fragment table is a fragment table constructed by taking the query condition field as a fragment key.
According to the technical scheme, when a data query request is received, the query condition field, the query input information corresponding to the query condition field and the field to be queried which are contained in the data query request are determined, and further, the pre-constructed query fragment table is obtained based on the query condition field and the field to be queried, so that the information to be queried corresponding to the field to be queried is determined based on the query fragment table and the query input information.
Optionally, the apparatus further comprises: the system comprises a service demand acquisition module, an inquiry input information acquisition module and an inquiry fragment table construction module.
The service requirement acquisition module is used for acquiring at least one service requirement and determining query condition fields and fields to be queried corresponding to the service requirements;
the query input information acquisition module is used for acquiring at least one item of query input information corresponding to the query condition field and at least one item of information to be queried corresponding to the field to be queried based on the original information table when the query condition field is detected to be a non-fragment key in the original information table;
and the query fragment table construction module is used for constructing and storing a query fragment table taking the query condition field as a fragment key based on each query input information and each to-be-queried information.
Optionally, the apparatus further comprises: and a fragment table updating module is inquired.
And the query fragment table updating module is used for processing the original information table based on the data processing request and updating the corresponding query fragment table based on the processed original information table when receiving the data processing request for the original information table.
Optionally, the apparatus further comprises: a newly added query condition field determining module, a query fragment table determining module and a newly added query fragment table constructing module.
A newly-added query condition field determining module, configured to determine, when a newly-added service requirement is received, a newly-added query condition field and a newly-added field to be queried in the newly-added service requirement;
the query fragment table determining module is used for determining whether a query fragment table corresponding to the newly added query condition field and the newly added to-be-queried field exists or not based on each query fragment table;
and the newly-added query fragment table construction module is used for constructing a newly-added query fragment table taking the newly-added query condition field as a fragment key based on the original information table if the newly-added query fragment table is not constructed.
Optionally, the to-be-queried information determining module 320 includes: the system comprises a data node determining unit and a partition table inquiring and retrieving unit.
The data node determining unit is used for determining data nodes subordinate to the distributed database based on the query input information corresponding to the query condition field;
and the query fragment table calling unit is used for calling a corresponding query fragment table from the data node based on the query condition field and the field to be queried.
Optionally, the to-be-queried information determining module 320 includes: and an information to be queried determining unit.
And the to-be-queried information determining unit is used for querying in the query fragment table based on the query input information so as to determine corresponding to-be-queried information based on the query input information.
Optionally, the method is applied to a distributed system.
The data query device provided by the embodiment of the invention can execute the data query method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 4 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 may also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the data query method.
In some embodiments, the data query method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data query method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data query method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for querying data, comprising:
when a data query request is received, determining a query condition field contained in the data query request, query input information corresponding to the query condition field and a field to be queried;
acquiring a pre-constructed query fragment table based on the query condition field and the field to be queried, and determining information to be queried corresponding to the field to be queried based on the query fragment table and the query input information;
the query fragment table is a fragment table constructed by taking the query condition field as a fragment key.
2. The method of claim 1, further comprising:
acquiring at least one item of service requirement, and determining a query condition field and a field to be queried corresponding to each service requirement;
when the query condition field is detected to be a non-fragment key in an original information table, acquiring at least one item of query input information corresponding to the query condition field and at least one item of information to be queried corresponding to the field to be queried based on the original information table;
and constructing and storing a query fragment table with the query condition field as a fragment key based on each query input information and each to-be-queried information.
3. The method of claim 2, further comprising:
and when a data processing request for the original information table is received, processing the original information table based on the data processing request, and updating the corresponding fragment table based on the processed original information table.
4. The method of claim 2, further comprising:
when a newly increased service requirement is received, determining a newly increased query condition field and a newly increased field to be queried corresponding to the newly increased service requirement;
determining whether a query fragment table corresponding to the newly added query condition field and the newly added to-be-queried field exists or not based on each query fragment table;
if not, constructing a newly-added query fragment table taking the newly-added query condition field as a fragment key based on the original information table.
5. The method according to claim 1, wherein the obtaining a pre-constructed query fragment table based on the query condition field and the field to be queried comprises:
determining data nodes belonging to a distributed database based on the query input information corresponding to the query condition field;
and calling a corresponding query fragment table from the data node based on the query condition field and the field to be queried.
6. The method according to claim 1, wherein the determining information to be queried corresponding to the field to be queried based on the query shard table and the query input information comprises:
and inquiring in the inquiry fragment table based on the inquiry input information so as to determine corresponding information to be inquired based on the inquiry input information.
7. The method of claim 1, wherein the method is applied in a distributed system.
8. A data query apparatus, comprising:
the field determination module is used for determining a query condition field contained in a data query request, query input information corresponding to the query condition field and a field to be queried when the data query request is received;
a to-be-queried information determining module, configured to obtain a pre-constructed query fragment table based on the query condition field and the to-be-queried field, and determine to-be-queried information corresponding to the to-be-queried field based on the query fragment table and the query input information; the query fragment table is a fragment table constructed by taking the query condition field as a fragment key.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data query method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the data query method of any one of claims 1-7 when executed.
CN202211303199.6A 2022-10-24 2022-10-24 Data query method and device, electronic equipment and storage medium Pending CN115525659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211303199.6A CN115525659A (en) 2022-10-24 2022-10-24 Data query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211303199.6A CN115525659A (en) 2022-10-24 2022-10-24 Data query method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115525659A true CN115525659A (en) 2022-12-27

Family

ID=84702806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211303199.6A Pending CN115525659A (en) 2022-10-24 2022-10-24 Data query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115525659A (en)

Similar Documents

Publication Publication Date Title
CN112528067A (en) Graph database storage method, graph database reading method, graph database storage device, graph database reading device and graph database reading equipment
CN115495473A (en) Database query method and device, electronic equipment and storage medium
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN112887426B (en) Information stream pushing method and device, electronic equipment and storage medium
CN115328917A (en) Query method, device, equipment and storage medium
CN115237426A (en) Method, device and equipment for determining database difference and storage medium
CN114443772A (en) Distributed data processing method, device, equipment and medium
CN115525659A (en) Data query method and device, electronic equipment and storage medium
CN114691781A (en) Data synchronization method, system, device, equipment and medium
CN113495891A (en) Data processing method and device
CN115878627A (en) Database partitioning method, device, equipment and storage medium
CN115577055A (en) Data processing method, device and equipment based on HBase data table and storage medium
CN114416881A (en) Real-time synchronization method, device, equipment and medium for multi-source data
CN115599863A (en) Bank data synchronization method and device based on Hudi, electronic equipment and medium
CN115470210A (en) Data query method, device, equipment and medium in OA system
CN117709903A (en) Library separation method and device, electronic equipment and storage medium
CN115617801A (en) Data retrieval method, device, equipment and medium based on distributed system
CN114722264A (en) Data query method and device, electronic equipment and storage medium
CN117573775A (en) Service data processing method and device, electronic equipment and storage medium
CN117573677A (en) Data updating method, device, equipment and medium based on transverse table database structure
CN114936246A (en) Redis data management method, device, equipment, storage medium and product
CN115203246A (en) Linked list query method and device, electronic equipment and storage medium
CN115495528A (en) Distributed database statement execution method, device, equipment and storage medium
CN115576977A (en) Data paging query method and device, electronic equipment and storage medium

Legal Events

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