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

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

Info

Publication number
CN116610719A
CN116610719A CN202310587036.3A CN202310587036A CN116610719A CN 116610719 A CN116610719 A CN 116610719A CN 202310587036 A CN202310587036 A CN 202310587036A CN 116610719 A CN116610719 A CN 116610719A
Authority
CN
China
Prior art keywords
query
data sources
data
candidate data
traversed
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
CN202310587036.3A
Other languages
Chinese (zh)
Inventor
童东生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202310587036.3A priority Critical patent/CN116610719A/en
Publication of CN116610719A publication Critical patent/CN116610719A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the disclosure provides a data query method, a device, equipment and a storage medium. Acquiring a query request; wherein the query request includes a query keyword; determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources include online data sources and/or offline data sources; traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiring keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing to traverse the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources. According to the data query method provided by the embodiment of the disclosure, the plurality of candidate data sources are traversed according to the priority until the target data is queried from the traversed candidate data sources, so that the success rate of data query can be improved.

Description

Data query method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of data retrieval, in particular to a data query method, a device, equipment and a storage medium.
Background
In the existing internet service, a large number of online data sets exist, and users expect to perform query analysis on the data sets, but if the query period is too long or some high-base fields with a plurality of different values are hit, the query scanning data amount is too large, and the query scanning data amount exceeds the performance bottleneck of a cluster, so that the user fails to query.
Disclosure of Invention
The embodiment of the disclosure provides a data query method, a device, equipment and a storage medium, which can improve the success rate of data query.
In a first aspect, an embodiment of the present disclosure provides a data query method, including:
acquiring a query request; wherein the query request includes a query keyword;
determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources include online data sources and/or offline data sources;
traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiring keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing to traverse the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources.
In a second aspect, an embodiment of the present disclosure further provides a data query apparatus, including:
the query request acquisition module is used for acquiring a query request; wherein the query request includes a query keyword;
the candidate data source acquisition module is used for determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources include online data sources and/or offline data sources;
and the data query module is used for traversing the plurality of candidate data sources according to the priority, querying data from the traversed candidate data sources based on the query keywords, stopping traversing if the target data is queried from the traversed candidate data sources, and continuing traversing the candidate data sources of the next priority until the target data is acquired if the data is not queried from the traversed candidate data sources.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data query method as described in embodiments of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a data query method as described in the disclosed embodiments.
The embodiment of the disclosure discloses a data query method, a device, equipment and a storage medium, and a query request is obtained; wherein the query request includes a query keyword; determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources comprise online data sources and/or offline data sources; traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiry keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing traversing the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources. According to the data query method provided by the embodiment of the disclosure, the plurality of candidate data sources are traversed according to the priority until the target data is queried from the traversed candidate data sources, so that the success rate of data query can be improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a flow chart of a data query method according to an embodiment of the disclosure;
FIG. 2 is a flow chart of a data query method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a data query device according to an embodiment of the disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium for executing the operation of the technical scheme of the present disclosure according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization process is merely illustrative and not limiting of the implementations of the present disclosure, and that other ways of satisfying relevant legal regulations may be applied to the implementations of the present disclosure.
It will be appreciated that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solution should comply with the corresponding legal regulations and the requirements of the relevant regulations.
Fig. 1 is a schematic flow chart of a data query method provided by an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a case of querying data, the method may be performed by a data query device, and the device may be implemented in a form of software and/or hardware, optionally, by an electronic device, where the electronic device may be a mobile terminal, a PC end, a server, or the like.
As shown in fig. 1, the method includes:
s110, acquiring a query request.
Wherein the query request includes a query keyword. The number of the query keywords is not limited, and the query keywords can be one or more, the query keywords can be user-defined keyword fields or selected from query keyword fields preconfigured by the system, and the query request can be generated based on triggering of the user according to actual query requirements. In this embodiment, when the user needs to query data, a desired query keyword may be selected in the system configuration, or a user-defined query keyword may be input, so as to generate a query request based on the query keyword.
S120, determining a plurality of candidate data sources according to the query keywords.
The candidate data sources include online data sources and/or offline data sources, wherein the number of online data sources may be 1 or more, the number of offline data sources may be 1, and the offline data sources are used as spam data sources of the data query in the embodiment. The candidate data sources store data corresponding to the query keywords.
Alternatively, the manner of determining the plurality of candidate data sources according to the query keyword may be: determining a logic keyword corresponding to the query keyword based on the set metadata information; obtaining a logic query grammar; assembling the logic keywords based on the logic query grammar to obtain a logic query statement; a plurality of candidate data sources is determined based on the logical query statement.
The metadata information may be preconfigured, and includes a correspondence between a query keyword and a logical keyword. The logical query grammar may be a logical expression for query data pre-configured in a query engine for representing logical relationships between logical keywords (also referred to as data elements). The query engine comprises an online query engine and an offline query engine, so that a logic query grammar corresponding to the online query engine and a logic query grammar corresponding to the offline query engine are required to be acquired respectively.
In this embodiment, the process of determining a plurality of candidate data sources based on the logical query statement may be: an initial data source is first determined based on the logical query statement, and then a plurality of candidate data sources are determined from the initial data source based on the set configuration information. The setting configuration information may be that when the data source satisfies a setting condition set by a developer, it may be a candidate data source.
Specifically, firstly, analyzing a query request to obtain query keywords, then determining logic keywords corresponding to the query keywords based on set metadata information, then obtaining logic query grammar corresponding to an online query engine and logic query grammar corresponding to an offline query engine, then assembling the logic keywords based on the obtained logic query grammar, thus obtaining logic query sentences, and finally determining a plurality of candidate data sources according to the logic query sentences. In this embodiment, a plurality of candidate data sources are determined to make a spam on data query, so that the success rate of data query is improved, and the query experience of a user is improved to a certain extent.
Optionally, the method for obtaining the logical query statement may include assembling the logical keywords based on the logical query grammar: generating a unique identifier corresponding to the logic keyword; and assembling the unique identifier based on the logic query grammar to obtain a logic query statement.
Wherein the unique identifier is used for uniquely marking the logic keyword and is used for generating subsequent physical query sentences. Specifically, after generating the unique identifier corresponding to the logic keyword, the unique identifier is assembled based on the logic query grammar, so as to obtain a logic query statement. The logic query statement is composed of the unique identifiers corresponding to the logic keywords, so that the logic query statement can be simplified, subsequent analysis is facilitated, and the data query efficiency can be improved to a certain extent.
And S130, traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiry keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing traversing the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources.
Wherein the priority of the candidate data sources is pre-configured. The offline data source has the lowest priority, that is, the offline data source is used as a spam data source for data query in the embodiment. In this embodiment, candidate data sources are traversed in order of priority from high to low. If the target data is queried from the traversed candidate data sources, stopping traversing, and if the target data is not queried from the traversed candidate data sources, continuing traversing the candidate data sources with the next priority until the target data is queried. Wherein, the fact that no data is queried from the traversed candidate data source can be understood as that the data is failed to be queried from the traversed candidate data source or the time required for querying the data from the traversed candidate data source exceeds a set duration.
In this embodiment, the process of querying data from the traversed candidate data sources based on the query keyword may be: determining physical keywords corresponding to the logical keywords based on the set metadata information; acquiring physical query grammar corresponding to the traversed candidate data source; assembling the physical keywords based on the physical query grammar to obtain a physical query statement; data is queried from the traversed candidate data sources based on the physical query statement.
The set metadata information includes a correspondence between a logical keyword and a physical keyword. The physical query grammar may be a physical expression pre-configured in the data source for querying the data. The process of querying data from the traversed candidate data sources based on the physical query statement may be: if the traversed candidate data source is an online data source, sending a physical query statement to an online query engine, and querying data from the traversed candidate data source by the online query engine based on the physical query statement; if the traversed candidate data source is an offline data source, the physical query statement is sent to an offline query engine, and the offline query engine queries data from the traversed candidate data source based on the physical query statement.
Specifically, firstly, analyzing a logic query sentence to obtain a logic keyword, then determining a physical keyword corresponding to the logic keyword based on set metadata information, then assembling the physical keyword based on the obtained physical query grammar to obtain a physical query sentence, and finally, sending the physical query sentence to a corresponding query engine to enable the query engine to query target data from a traversed data source based on the physical query sentence. In this embodiment, the data is queried from the candidate data sources based on the physical query statement, so that the accuracy of data query can be improved.
For example, assume three candidate data sources are determined, and the priorities of the three data sources are, in order from high to low: the system comprises a data source A, a data source B and a data source C, wherein the data source A and the data source B are online data sources, and the data source C is an offline data source. The query procedure is: firstly, inquiring data from a data source A based on a physical inquiry statement, and stopping inquiring if target data is inquired from the data source A; if the target data is not queried from the data source A, querying the data from the data source B based on a physical query statement, and if the target data is queried from the data source B, stopping querying; if the target data is not queried from the data source B, querying the target data from the data source C based on the physical query statement.
Optionally, after the target data is acquired, the method further includes the following steps: and sending the target data to the target user.
Based on the foregoing embodiments, fig. 2 is a schematic flow chart of a data query method according to an embodiment of the disclosure, as shown in fig. 2, where the method includes:
s210, acquiring query keywords in the query request.
S220, assembling the logic keywords corresponding to the query keywords based on the logic query grammar to obtain a logic query statement.
S230, determining a plurality of candidate data sources based on the logical query statement.
S240, traversing the candidate data sources according to the priority.
S250, for the traversed candidate data sources, assembling physical keywords corresponding to the logical keywords based on the physical query grammar corresponding to the candidate data sources, and obtaining physical query sentences.
S260, calling a corresponding query engine to perform data query based on the physical query statement.
S270, judging whether target data is queried, and executing S280 if the target data is queried; if the target data is not queried, traversing the candidate data sources of the next priority.
According to the technical scheme, a query request is acquired; wherein the query request includes a query keyword; determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources comprise online data sources and/or offline data sources; traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiry keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing traversing the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources. According to the data query method provided by the embodiment of the disclosure, the plurality of candidate data sources are traversed according to the priority until the target data is queried from the traversed candidate data sources, so that the success rate of data query can be improved.
Fig. 3 is a schematic structural diagram of a data query device according to an embodiment of the present disclosure, where, as shown in fig. 3, the device includes:
a query request acquisition module 310, configured to acquire a query request; wherein the query request includes a query keyword;
a candidate data source acquisition module 320, configured to determine a plurality of candidate data sources according to the query keyword; wherein the candidate data sources comprise online data sources and/or offline data sources;
the data query module 330 is configured to traverse the plurality of candidate data sources according to priorities, query data from the traversed candidate data sources based on query keywords, stop traversing if target data is queried from the traversed candidate data sources, and continue traversing the candidate data sources of the next priority until the target data is acquired if data is not queried from the traversed candidate data sources.
Optionally, the candidate data source obtaining module 320 is further configured to:
determining a logic keyword corresponding to the query keyword based on the set metadata information;
obtaining a logic query grammar;
assembling the logic keywords based on the logic query grammar to obtain a logic query statement;
a plurality of candidate data sources is determined based on the logical query statement.
Optionally, the candidate data source obtaining module 320 is further configured to:
generating a unique identifier corresponding to the logic keyword;
and assembling the unique identifier based on the logic query grammar to obtain a logic query statement.
Optionally, the data query module 330 is further configured to:
determining physical keywords corresponding to the logical keywords based on the set metadata information;
acquiring physical query grammar corresponding to the traversed candidate data source;
assembling the physical keywords based on the physical query grammar to obtain a physical query statement;
data is queried from the traversed candidate data sources based on the physical query statement.
Optionally, the metadata information includes a correspondence between the query keyword and the logical keyword, and a correspondence between the logical keyword and the physical keyword.
Optionally, the method further comprises: a data sending module, configured to:
and sending the target data to the target user.
Optionally, the offline data source has the lowest priority.
The data query device provided by the embodiment of the disclosure can execute the data query method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. Referring now to fig. 4, a schematic diagram of an electronic device (e.g., a terminal device or server in fig. 4) 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The electronic device provided in the embodiment of the present disclosure and the data query method provided in the foregoing embodiment belong to the same inventive concept, and technical details not described in detail in the present embodiment may be referred to the foregoing embodiment, and the present embodiment has the same beneficial effects as the foregoing embodiment.
The present disclosure provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the data query method provided by the above embodiments.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a query request; wherein the query request includes a query keyword; determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources include online data sources and/or offline data sources; traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiring keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing to traverse the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable 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. 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a data query method including:
acquiring a query request; wherein the query request includes a query keyword;
determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources include online data sources and/or offline data sources;
traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiring keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing to traverse the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources.
Further, determining a plurality of candidate data sources according to the query keyword, including:
determining a logic keyword corresponding to the query keyword based on the set metadata information;
obtaining a logic query grammar;
assembling the logic keywords based on the logic query grammar to obtain a logic query statement;
a plurality of candidate data sources is determined based on the logical query statement.
Further, assembling the logic keywords based on the logic query grammar to obtain a logic query statement, including:
generating a unique identifier corresponding to the logic keyword;
and assembling the unique identifier based on the logic query grammar to obtain a logic query statement.
Further, querying data from the traversed candidate data sources based on the query keywords comprises:
determining physical keywords corresponding to the logical keywords based on the setting metadata information;
acquiring physical query grammar corresponding to the traversed candidate data source;
assembling the physical keywords based on the physical query grammar to obtain a physical query statement;
and querying data from the traversed candidate data sources based on the physical query statement.
Further, the metadata information includes a correspondence between the query keyword and the logical keyword, and a correspondence between the logical keyword and the physical keyword.
Further, after the target data is acquired, the method further comprises:
and sending the target data to a target user.
Further, the offline data source has the lowest priority.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (10)

1. A method of querying data, comprising:
acquiring a query request; wherein the query request includes a query keyword;
determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources include online data sources and/or offline data sources;
traversing the plurality of candidate data sources according to the priority, inquiring data from the traversed candidate data sources based on the inquiring keywords, stopping traversing if the target data is inquired from the traversed candidate data sources, and continuing to traverse the candidate data sources of the next priority until the target data is acquired if the data is not inquired from the traversed candidate data sources.
2. The method of claim 1, wherein determining a plurality of candidate data sources from the query terms comprises:
determining a logic keyword corresponding to the query keyword based on the set metadata information;
obtaining a logic query grammar;
assembling the logic keywords based on the logic query grammar to obtain a logic query statement;
a plurality of candidate data sources is determined based on the logical query statement.
3. The method of claim 2, wherein assembling the logical keywords based on the logical query grammar to obtain a logical query statement comprises:
generating a unique identifier corresponding to the logic keyword;
and assembling the unique identifier based on the logic query grammar to obtain a logic query statement.
4. The method of claim 2, wherein querying data from the traversed candidate data sources based on the query terms comprises:
determining physical keywords corresponding to the logical keywords based on the setting metadata information;
acquiring physical query grammar corresponding to the traversed candidate data source;
assembling the physical keywords based on the physical query grammar to obtain a physical query statement;
and querying data from the traversed candidate data sources based on the physical query statement.
5. The method of claim 4, wherein the metadata information includes a correspondence of the query keyword and the logical keyword, and a correspondence of the logical keyword and the physical keyword.
6. The method of claim 1, further comprising, after the target data is acquired:
and sending the target data to a target user.
7. The method of claim 1, wherein the offline data source has a lowest priority.
8. A data query device, comprising:
the query request acquisition module is used for acquiring a query request; wherein the query request includes a query keyword;
the candidate data source acquisition module is used for determining a plurality of candidate data sources according to the query keywords; wherein the candidate data sources include online data sources and/or offline data sources;
and the data query module is used for traversing the plurality of candidate data sources according to the priority, querying data from the traversed candidate data sources based on the query keywords, stopping traversing if the target data is queried from the traversed candidate data sources, and continuing traversing the candidate data sources of the next priority until the target data is acquired if the data is not queried from the traversed candidate data sources.
9. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data query method of any of claims 1-7.
10. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the data query method of any of claims 1-7.
CN202310587036.3A 2023-05-23 2023-05-23 Data query method, device, equipment and storage medium Pending CN116610719A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310587036.3A CN116610719A (en) 2023-05-23 2023-05-23 Data query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310587036.3A CN116610719A (en) 2023-05-23 2023-05-23 Data query method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116610719A true CN116610719A (en) 2023-08-18

Family

ID=87676111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310587036.3A Pending CN116610719A (en) 2023-05-23 2023-05-23 Data query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116610719A (en)

Similar Documents

Publication Publication Date Title
US20210200806A1 (en) Method and apparatus for parallel processing of information
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN112099982B (en) Crash information positioning method and device, medium and electronic equipment
CN111625422B (en) Thread monitoring method, thread monitoring device, electronic equipment and computer readable storage medium
CN113704291A (en) Data query method and device, storage medium and electronic equipment
CN113220281A (en) Information generation method and device, terminal equipment and storage medium
CN112306685A (en) Task isolation method and device, electronic equipment and computer readable medium
CN116483891A (en) Information prediction method, device, equipment and storage medium
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN112100211B (en) Data storage method, apparatus, electronic device, and computer readable medium
CN116610719A (en) Data query method, device, equipment and storage medium
CN110377654B (en) Data request processing method and device, electronic equipment and computer-readable storage medium
CN112115154A (en) Data processing and data query method, device, equipment and computer readable medium
CN116431523B (en) Test data management method, device, equipment and storage medium
CN111507734B (en) Method and device for identifying cheating request, electronic equipment and computer storage medium
CN112084440B (en) Data verification method, device, electronic equipment and computer readable medium
CN116756213A (en) Data query method, device, equipment and storage medium
CN111291199B (en) Information query method and device
CN116680316A (en) Method, device, medium and electronic equipment for acquiring dimension data
CN117806739A (en) Method, device, medium and equipment for determining calling relation of cross-code warehouse
CN112286773A (en) Method, device, medium and electronic equipment for collecting crash information
CN116886531A (en) Service processing method, device, medium and electronic equipment
CN117880608A (en) Data processing method and device, readable medium and electronic equipment
CN118260173A (en) Time-consuming information determining 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