CN114722264A - 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
CN114722264A
CN114722264A CN202210375205.2A CN202210375205A CN114722264A CN 114722264 A CN114722264 A CN 114722264A CN 202210375205 A CN202210375205 A CN 202210375205A CN 114722264 A CN114722264 A CN 114722264A
Authority
CN
China
Prior art keywords
query
data
data query
target
list item
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
CN202210375205.2A
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.)
Dawning Network Technology Co ltd
Original Assignee
Dawning 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 Dawning Network Technology Co ltd filed Critical Dawning Network Technology Co ltd
Priority to CN202210375205.2A priority Critical patent/CN114722264A/en
Publication of CN114722264A publication Critical patent/CN114722264A/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/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
    • 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/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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/9532Query formulation

Landscapes

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

Abstract

The embodiment of the invention discloses a data query method, a data query device, electronic equipment and a storage medium. The method specifically comprises the following steps: responding to a data query request of a target user for a Web page, and identifying at least one list item in the Web page; the list item comprises at least one data field to be displayed; detecting whether list item screening conditions of a target user for a Web page are stored or not, and if yes, identifying at least one target list item to be displayed in each list item according to the list item screening conditions; constructing data query clauses corresponding to all target list items, and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to obtain query result data matched with the data query sentences; and displaying the query result data in the target list item in the Web page. The technical scheme of the embodiment of the invention can improve the data query response speed, thereby improving the data query speed.

Description

Data query method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data query method and device, electronic equipment and a storage medium.
Background
With the rapid development of the internet, the amount of data is also sharply increased. In various application scenarios, a large amount of data needs to be queried, for example, in an application scenario of data source tracing analysis, a data result needs to be screened from the large amount of data.
However, due to the limitation of various resources, such as server resources or I/O (Input/Output) resources, a request for data query cannot be responded to in time during data query, so that the existing data query method has a slow data query rate and cannot quickly screen out data results from a large amount of data.
Disclosure of Invention
Embodiments of the present invention provide a data query method, an apparatus, an electronic device, and a storage medium, which can improve data query response speed, thereby increasing data query rate.
According to an aspect of the present invention, there is provided a data query method, including:
identifying at least one list item in a Web (World Wide Web) page in response to a data query request of a target user for the Web page; the list item comprises at least one data field to be displayed;
detecting whether a list item screening condition of a target user for a Web page is stored, if so, identifying at least one target list item to be displayed in each list item according to the list item screening condition;
constructing data query clauses corresponding to all target list items, and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to obtain query result data matched with the data query sentences;
and displaying the query result data in the target list item in the Web page.
In addition, the data query method according to the above embodiment of the present invention may further have the following additional technical features:
optionally, detecting whether to store a list item screening condition of the target user for the Web page includes:
identifying a target access record corresponding to the Web page in a historical page access record corresponding to the target user;
analyzing the target access record, and detecting whether the target user sets a screening list item aiming at the Web page;
and if so, determining the screening list item set by the target user as the list item screening condition.
One embodiment of the above invention has the following advantages or benefits: the specific implementation mode for detecting whether to store the list item screening condition of the target user aiming at the Web page is provided so as to reduce a calculation data set and a calculation result set in the data query process.
Optionally, after detecting whether to store the list item filtering condition of the target user for the Web page, the method further includes:
if not, providing a screening setting interface aiming at each list item in the Web page for the target user;
responding to at least one screening list item selected by the target user in the screening setting interface, constructing a data query statement corresponding to the screening list item, and acquiring query result data matched with the data query statement;
and displaying the query result data in the screening list items in the Web page.
One embodiment of the above invention has the following advantages or benefits: the method and the device have the advantages that a supplementary processing strategy for detecting the list item screening condition of the non-storage target user for the Web page is added, namely, after the list item screening condition of the non-storage target user for the Web page is detected, a screening setting interface is provided for the target user, so that the target user can determine the screening list item on the screening setting interface, data query is carried out according to the data query statement corresponding to the screening list item, and the query success rate of the data query request can be ensured.
Optionally, the constructing a data query clause corresponding to all target list items, and constructing a data query statement corresponding to the data query request according to the data query clause includes:
for a current processing target list item, inquiring a pre-constructed inquiry clause list according to each target data field included in the current processing target list item, and acquiring inquiry clauses corresponding to each target data field;
combining the query clauses to form an inner-layer query statement corresponding to the current processing target list item;
combining the inner query sentences of all the currently processed target list items to construct data query clauses corresponding to all the target list items;
forming an outer layer query statement corresponding to all target list items according to the storage form of each target data field in the original database;
and constructing and obtaining a data query statement corresponding to the data query request according to the data query clause and the outer layer query statement.
One embodiment of the above invention has the following advantages or benefits: the data query clauses corresponding to all the target list items are obtained by constructing the inner layer query clause corresponding to the current target list item, the outer layer query clauses corresponding to all the target list items are constructed, the data query clauses are determined through the data query clauses and the outer layer query clauses, each list item can be guaranteed to be independently calculated, and therefore the data query response speed is improved.
Optionally, before detecting whether to store the list item filtering condition of the target user for the Web page, the method further includes: splitting a data query request into at least one query task according to a query time period in the data query request; each query task is used for querying data in a set time interval in a query time period;
the method comprises the following steps of constructing data query clauses corresponding to all target list items, constructing data query sentences corresponding to the data query requests according to the data query clauses, and obtaining query result data matched with the data query sentences, wherein the method comprises the following steps:
and constructing data query clauses of all target list items aiming at all query tasks, and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to obtain query result data matched with the data query sentences.
One embodiment of the above invention has the following advantages or benefits: according to the data query request, the data query request is split according to the query time period of the data query request to obtain a plurality of query tasks, and data query clauses and data query sentences aiming at the query tasks are constructed, so that the query calculation data set can be reduced, and the data query efficiency is improved.
Optionally, splitting the data query request into at least one query task according to a query time period in the data query request, where the splitting includes:
acquiring a starting time point and an ending time point which are matched with the query time period;
determining at least one integral unit partition time point of a preset time unit type matched with the starting time point along the direction from the starting time point to the ending time point; different time unit types correspond to different time spans;
determining at least one integral unit division time point of a preset time unit type matched with the end time point along the direction from the end time point to the starting time point;
forming at least one time interval according to the starting time point, the ending time point and each whole unit dividing time point;
and splitting the data query request into at least one query task according to each time interval.
One embodiment of the above invention has the following advantages or benefits: the data query request is split according to the time interval by determining the starting time point and the ending time point of the query time period and the dividing time point of each whole unit and determining the time interval according to the starting time point, the ending time point and the dividing time point of each whole unit, so that the query calculation data set is further reduced, and the data query efficiency is improved.
Optionally, the constructing data query clauses of all target list items for all query tasks, and constructing a data query statement corresponding to the data query request according to the data query clauses to obtain query result data matched with the data query statement, includes:
acquiring a target data query clause matched with a currently processed target query task, and acquiring a target time interval matched with the target query task;
determining whether the target time interval matches a target time unit type;
if so, updating the target data query clause according to a cache query format, and then acquiring query result data matched with the data query clause in a data cache region; the data cache region is used for storing cache data matched with the target time unit type;
and if not, acquiring query result data matched with the data query statement in the original data table.
One embodiment of the above invention has the following advantages or benefits: under the condition that the time interval of the query task is matched with the type of the target time unit, the data query clause is updated according to the cache query format, so that query result data matched with the data query sentence are acquired in the data cache region, the data cache region can be accurately hit in the data query process, the query calculation data set is reduced, and the data query efficiency is improved.
According to another aspect of the present invention, there is provided a data query apparatus including:
the system comprises a list item identification module, a data query module and a query module, wherein the list item identification module is used for responding to a data query request of a target user for a Web page and identifying at least one list item in the Web page; the list item comprises at least one data field to be displayed;
the target list item identification module is used for detecting whether a list item screening condition of a target user for the Web page is stored or not, and if yes, identifying at least one target list item to be displayed in each list item according to the list item screening condition;
the query result data acquisition module is used for constructing data query clauses corresponding to all target list items and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to acquire query result data matched with the data query sentences;
and the query result data display module is used for displaying the query result data in the target list item in the Web page.
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.
The technical scheme of the embodiment of the invention identifies at least one list item in the Web page by responding to the data query request of a target user for the Web page, detects whether the list item screening condition of the target user for the Web page is stored or not, identifies at least one target list item to be displayed in each list item according to the list item screening condition when the list item screening condition of the target user for the Web page is detected, constructs a data query clause corresponding to all the target list items, constructs a data query statement corresponding to the data query request according to the data query clause, thereby obtaining query result data matched with the data query clause, further displaying the query result data in the target list item in the Web page, and solving the problem that the data result cannot be quickly screened due to the slow data query rate in the existing data query method, the data query response speed can be improved, and therefore the data query speed is improved.
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 needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these 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 flowchart of a data query method according to a third embodiment of the present invention;
FIG. 4 is a flowchart illustrating a data query method according to a fourth embodiment of the present invention;
FIG. 5 is an exemplary flowchart of data query request splitting according to a fourth embodiment of the present invention;
FIG. 6 is an exemplary flowchart of data query statement construction according to the fourth embodiment of the present invention;
fig. 7 is a schematic diagram of a data query device according to a fifth embodiment of the present invention;
fig. 8 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 is to be understood that the terms "target" and the like in the description and claims of the present invention and in the above-described drawings 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 situation where a data query request is quickly responded and a data query rate is increased, and the method may be executed by a data query apparatus, where the apparatus may be implemented in a software and/or hardware manner, and may generally be directly integrated in an electronic device that executes the method, where the electronic device may be a terminal device or a server device, and the embodiment of the present invention does not limit the type of the electronic device that executes the data query method. Specifically, as shown in fig. 1, the data query method may specifically include the following steps:
s110, responding to a data query request of a target user for a Web page, and identifying at least one list item in the Web page; the list item comprises at least one data field to be displayed.
The target user may be any user capable of querying data. The data query request may be any request for data sent by a user. The list items may be lists presented in a Web page. The data field to be presented may be a data field that needs to be presented in a list item. It is understood that, if the data requested to be queried in the data query request includes data in the data field to be presented, the query result data may be presented in the data field to be presented after the query result data is queried according to the data query request.
In the embodiment of the present invention, after the target user sends the data query request on the Web page, the data query system may respond to the data query request sent by the target user to identify at least one list item in the Web page. Specifically, the list item may include at least one data field to be displayed. It will be appreciated that multiple list items may be presented in a Web page. The target user may initiate a data query request for all the list items displayed in the Web page, or may initiate a data query request for some list items displayed in the Web page, which is not limited in the embodiment of the present invention.
S120, whether list item screening conditions of the target user for the Web page are stored or not is detected, and if yes, at least one target list item to be displayed is identified in each list item according to the list item screening conditions.
The list item screening condition may be a condition for screening a list item in the list items displayed on the Web page. For example, the list item filtering condition may be determined according to a condition for filtering a list item set by the target user in the data query request, or may be determined according to a condition for filtering a list item set by the target user in a previous data query process, and the like, which is not limited in this embodiment of the present invention. It can be understood that the data query system may determine the screened list items according to the list item screening conditions, so as to perform data query on the screened list items according to the data query request. The target list item may be a list item screened from the list items according to the list item screening condition.
In the embodiment of the present invention, after the data query system identifies at least one list item in the Web page in response to the data query request of the target user for the Web page, it may further detect, in the data query system, whether to store a list item screening condition of the target user for the Web page. If the list item screening conditions of the target user for the Web page are stored in the data query system, at least one target list item to be displayed can be identified in each list item according to the list item screening conditions.
S130, constructing data query clauses corresponding to all target list items, and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to obtain query result data matched with the data query sentences.
The data query clause may be a query statement constructed in the data query process to query data in each target list item. Illustratively, the data Query clause may be an SQL (Structured Query Language) statement corresponding to each target list item. The data query statement may be a query statement corresponding to the data query request, which is constructed during the data query process. Illustratively, the data query statement may be an SQL statement corresponding to the data query request. The query result data may be result data obtained by a data query statement query.
In the embodiment of the invention, after the data query system identifies at least one target list item to be displayed in each list item according to the list item screening condition, data query clauses corresponding to all the target list items can be further constructed, and a data query statement corresponding to the data query request is constructed according to the data query clauses so as to obtain query result data matched with the data query statement.
S140, displaying the query result data in the target list item in the Web page.
In the embodiment of the present invention, after the data query system obtains the query result data matched with the data query statement, the query result data may be further displayed in the target list item in the Web page. Specifically, the query result data may be displayed in a data field to be displayed of the target list item in the Web page.
In the technical scheme of this embodiment, the data query system identifies at least one list item in the Web page in response to the data query request of the target user for the Web page, and detects whether to store a list item screening condition of the target user for the Web page, and when detecting the list item screening condition of the storage target user for the Web page, identifies at least one target list item to be displayed in each list item according to the list item screening condition, and constructs a data query clause corresponding to all target list items, so as to construct a data query statement corresponding to the data query request according to the data query clause, thereby obtaining query result data matched with the data query statement, and further displaying the query result data in the target list item in the Web page, thereby solving the problem that the data query method in the prior art cannot rapidly screen data results due to a slow data query rate, the data query response speed can be improved, and therefore the data query speed is improved.
Example two
Fig. 2 is a flowchart of a data query method according to a second embodiment of the present invention, which further details the above technical solutions, and this embodiment provides multiple specific optional implementation manners for detecting whether to store a list item screening condition of a target user for a Web page, constructing data query clauses corresponding to all target list items, and constructing a data query statement corresponding to the data query request according to the data query clauses. The solution in this embodiment may be combined with the various alternatives in one or more of the embodiments described above. As shown in fig. 2, the method may include the steps of:
s210, responding to a data query request of a target user for a Web page, and identifying at least one list item in the Web page; the list item comprises at least one data field to be displayed.
S220, whether list item screening conditions of the target user for the Web page are stored or not is detected, and if yes, at least one target list item to be displayed is identified in each list item according to the list item screening conditions.
Optionally, detecting whether to store a list item screening condition of the target user for the Web page may include: identifying a target access record corresponding to a Web page in a historical page access record corresponding to a target user; analyzing the target access record, and detecting whether a target user sets a screening list item aiming at the Web page; and if so, determining the screening list item set by the target user as a list item screening condition.
The historical page access record may be an access record of a page visited by a target user, for example, the historical page access record may be an access record of a page a visited by the target user, or an access record of a page B visited by the target user, which is not limited in the embodiment of the present invention. The target access record may be an access record of a target user accessing a Web page. The screening list item can be a list item obtained by screening the list items displayed on the Web page.
Specifically, after the data query system responds to a data query request of a target user for a Web page, and identifies at least one list item in the Web page, the data query system may further identify a target access record corresponding to the Web page in a historical page access record corresponding to the target user, and analyze the target access record to detect whether the target user sets a screening list item for the Web page. If the target user sets a screening list item for the Web page, the screening list item set by the target user can be determined as a list item screening condition. It may be appreciated that if the target user does not set a filter listing for the Web page, it may be determined that no listing filter condition for the target user for the Web page is stored in the data query system.
According to the technical scheme, a specific implementation mode for detecting whether the screening condition of the target user for the list item of the Web page is stored is provided, so that a calculation data set and a calculation result set in the data query process are reduced.
Optionally, after detecting whether to store the list item filtering condition of the target user for the Web page, the method may further include: if not, providing a screening setting interface aiming at each list item in the Web page for the target user; responding to at least one screening list item selected by a target user in a screening setting interface, constructing a data query statement corresponding to the screening list item, and acquiring query result data matched with the data query statement; and displaying the query result data in the screening list items in the Web page.
The screening setting interface can be an interface which is provided for the target user and is used for screening and setting all list items in the Web page.
Specifically, after the data query system responds to a data query request of a target user for a Web page and identifies at least one list item in the Web page, whether a list item screening condition of the target user for the Web page is stored may be further detected in the data query system. If the screening condition of the target user for the list item of the Web page is not stored in the data query system, the data query system may provide a screening setting interface for each list item in the Web page to the target user. After the data query system provides a screening setting interface for the target user, the target user can select screening list items on the screening setting interface and feed the screening list items back to the data query system. The data query system responds to the screening list item selected by the target user in the screening setting interface, constructs a data query statement corresponding to the screening list item, and obtains query result data matched with the data query statement so as to display the query result data in the screening list item in the Web page. It can be understood that one or more screening list items selected by the target user in the screening setting interface may be selected, and the embodiment of the present invention does not limit this.
According to the technical scheme, a supplementary processing strategy for detecting the list item screening condition of the non-storage target user for the Web page is added, namely after the list item screening condition of the non-storage target user for the Web page is detected, a screening setting interface is provided for the target user, so that the target user can determine the screened list item on the screening setting interface, data query is carried out according to the data query statement corresponding to the screened list item, and the query success rate of the data query request can be ensured.
S230, aiming at the current processing target list item, inquiring a pre-constructed inquiry clause list according to each target data field included in the current processing target list item, and acquiring inquiry clauses corresponding to each target data field.
Wherein the current processing target list item may be a target list item of the current build data query clause. The target data field may be a data field in a currently processed target list item. The query clause list may be a list of query clauses for storing data fields in the list items. It will be appreciated that the query clauses for each data field in the query clause list may be pre-constructed.
In the embodiment of the present invention, after the data query system identifies at least one target list item to be displayed in each list item according to the list item screening condition, a query clause list constructed in advance may be further queried for the current processing target list item according to each target data field included in the current processing target list item, and a query clause corresponding to each target data field is obtained. It will be appreciated that there may be multiple target data fields in the current processing target list item, each having a unique corresponding query clause.
S240, combining the query clauses to form an inner-layer query statement corresponding to the current processing target list item.
Wherein, the inner layer query statement may be a query statement corresponding to the current processing target list item.
In the embodiment of the present invention, after the data query system obtains the query clauses corresponding to each target data field, the data query system may further combine the query clauses to form an inner-layer query statement corresponding to the currently processed target list item. It is understood that the inner query statement corresponding to the current processing target list item may be a set of query clauses.
And S250, combining the inner query sentences of the current processing target list items to construct and obtain data query clauses corresponding to all the target list items.
In the embodiment of the present invention, after the data query system combines the query clauses to form the inner-layer query statement corresponding to the currently processed target list item, the inner-layer query statement of each currently processed target list item may be further combined to construct and obtain the data query clauses corresponding to all the target list items. It will be appreciated that the data query clause may be a collection of inner-layer query statements.
And S260, forming an outer layer query statement corresponding to all target list items according to the storage form of each target data field in the original database.
Wherein the raw database may be a database of unprocessed stored data. The outer query statement may be a query statement constructed from the storage of the target data fields in the original database.
In the embodiment of the present invention, after the data query system combines the inner query statements of each currently processed target list item to construct and obtain the data query clauses corresponding to all target list items, the data query system may further form the outer query statements corresponding to all target list items according to the storage form of each target data field in the original database. It will be appreciated that the data type of the target data field may not be consistent with the data type stored in the original database. Illustratively, the data type of the data field a is integer type, and the storage form of the data in the original database can be character type. It will be further appreciated that the data for the target data field may be calculated from data for a plurality of fields in the original database. Illustratively, the data field B may be calculated from the fields a, B and c in the original database.
S270, according to the data query clause and the outer layer query statement, constructing and obtaining a data query statement corresponding to the data query request so as to obtain query result data matched with the data query statement.
In the embodiment of the invention, after the data query system forms the outer query statement corresponding to all target list items according to the storage form of each target data field in the original database, the data query statement corresponding to the data query request can be further constructed according to the data query clause and the outer query statement so as to obtain the query result data matched with the data query statement.
According to the technical scheme, the data query clauses corresponding to all the target list items are obtained by constructing the inner layer query clause corresponding to the current target list item, the outer layer query clauses corresponding to all the target list items are constructed, the data query clauses are determined through the data query clauses and the outer layer query clauses, each list item can be guaranteed to be independently calculated, and therefore the data query response speed is improved.
S280, displaying the query result data in the target list item in the Web page.
In the technical solution of this embodiment, the data query system identifies at least one list item in the Web page by responding to the data query request of the target user for the Web page, and when detecting and storing the list item screening condition of the target user for the Web page, identifies at least one target list item to be displayed in each list item according to the list item screening condition, and for the current processing target list item, queries a query clause list constructed in advance according to each target data field included in the current processing target list item, obtains query clauses corresponding to each target data field, combines the query clauses to form an inner query statement corresponding to the current processing target list item, combines the inner query statements of each current processing target list item, and constructs a data query clause corresponding to all target list items, and then, according to the storage form of each target data field in the original database, an outer layer query statement corresponding to all target list items is formed, so that a data query statement corresponding to the data query request is constructed according to the data query clause and the outer layer query statement, query result data matched with the data query statement is obtained, and then the query result data is displayed in the target list items in the Web page.
EXAMPLE III
Fig. 3 is a flowchart of a data query method according to a third embodiment of the present invention, which further details the technical solutions described above, and this embodiment provides a plurality of specific optional implementation manners for constructing data query clauses corresponding to all target list items, and constructing a data query statement corresponding to the data query request according to the data query clauses, so as to obtain query result data matched with the data query statement. The solution in this embodiment may be combined with the individual alternatives in one or more of the embodiments described above. As shown in fig. 3, the method may include the steps of:
s310, responding to a data query request of a target user for a Web page, and identifying at least one list item in the Web page; the list item comprises at least one data field to be displayed.
S320, splitting the data query request into at least one query task according to the query time period in the data query request; each query task is used for querying data in a time interval set in the query time period.
Wherein the query time period may be a time period of query data in the data query request. It is understood that the data query request may include a query time period for querying the data. The query task may be a task of querying data corresponding to different query time periods. The set time interval may be a time interval preset within the query time period.
In the embodiment of the present invention, after the data query system identifies at least one target list item to be displayed in each list item according to the list item screening condition, the data query system may further split the data query request into query tasks according to a query time period in the data query request. Specifically, each query task may be used to query data within a set time interval within a query time period. It is to be understood that the query task may be one or more, and the embodiment of the present invention does not limit this.
According to the technical scheme, the data query requests are split according to the query time periods of the data query requests to obtain a plurality of query tasks, so that the query calculation data sets can be reduced, and the data query efficiency is improved.
Optionally, splitting the data query request into at least one query task according to the query time period in the data query request, which may include: acquiring a starting time point and an ending time point which are matched with the query time period; determining at least one integral unit partition time point of a preset time unit type matched with the starting time point along the direction from the starting time point to the ending time point; different time unit types correspond to different time spans; determining at least one integral unit division time point of a preset time unit type matched with the ending time point along the direction from the ending time point to the starting time point; dividing time points according to the starting time point, the ending time point and each whole unit to form at least one time interval; and splitting the data query request into at least one query task according to each time interval.
The preset time unit type may be a preset type that may characterize a time unit. For example, the preset time unit type may be day, hour, minute, or the like, which is not limited by the embodiment of the present invention. The whole unit division time point may be a time point at which the query time period is divided into whole time units according to the time unit type.
Specifically, after identifying at least one target list item to be displayed in each list item according to the list item screening condition, the data query system may further obtain a starting time point and an ending time point which are matched with the query time period, determine the whole unit division time point matched with the starting time point along the direction from the starting time point to the ending time point, and determine the whole unit division time point matched with the ending time point along the direction from the ending time point to the starting time point, so as to form at least one time interval according to the starting time point, the ending time point and each whole unit division time point, thereby splitting the data query request into at least one query task. Specifically, the time spans corresponding to different time unit types are different. It can be understood that the whole unit dividing time point matched with the starting time point may be a whole unit dividing time point of one preset time unit type, or may be whole unit dividing time points of a plurality of preset time unit types, which is not limited in the embodiment of the present invention. The whole unit partition time point matched with the end time point may be a whole unit partition time point of one preset time unit type, or may be whole unit partition time points of multiple preset time unit types, which is not limited in the embodiment of the present invention.
For example, assuming that the query time period is eight to nine tenths, the starting time point is eight and the ending time point is nine tenths. If the preset time unit type is day, the whole unit division time point of which the time unit type is day and which is matched with the starting time point does not exist, and the whole unit division time point of which the time unit type is day and which is matched with the ending time point does not exist. If the preset time unit type is hour, the whole unit division time point of which the time unit type is hour is matched with the starting time point is eight points, and the whole unit division time point of which the time unit type is hour is matched with the ending time point is nine points. If the preset time unit type is minute, the integral unit division time point of the time unit type of minute matched with the starting time point is nine points, and the integral unit division time point of the time unit type of minute matched with the ending time point is nine points ten. Then, according to the starting time point, the ending time point, and the time points divided by the whole units, a time interval from eight to nine points and a time interval from nine to nine tenths of a point can be formed.
According to the technical scheme, the starting time point and the ending time point of the query time period and the dividing time points of all the units are determined, and the time interval is determined according to the starting time point, the ending time point and the dividing time points of all the units, so that the data query request is split according to the time interval, the query calculation data set is further reduced, and the data query efficiency is improved.
S330, whether list item screening conditions of the target user aiming at the Web page are stored or not is detected, and if yes, at least one target list item to be displayed is identified in each list item according to the list item screening conditions.
S340, constructing data query clauses of all target list items aiming at all query tasks, and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to obtain query result data matched with the data query sentences.
In the embodiment of the invention, after the data query system splits the data query request into the query tasks according to the query time period in the data query request, data query clauses of all target list items for all query tasks can be further constructed, and a data query statement corresponding to the data query request is constructed according to the data query clauses so as to obtain query result data matched with the data query statement.
Optionally, the constructing data query clauses of all target list items for all query tasks, and constructing a data query statement corresponding to the data query request according to the data query clauses to obtain query result data matched with the data query statement, may include: acquiring a target data query clause matched with a currently processed target query task, and acquiring a target time interval matched with the target query task; determining whether the target time interval matches the target time unit type; if so, updating the target data query clause according to the cache query format, and acquiring query result data matched with the data query clause in a data cache region; the data cache region is used for storing cache data matched with the type of the target time unit; if not, acquiring query result data matched with the data query statement in the original data table.
The target query task may be one of the query tasks that is currently building the data query clause. The target data query clause may be a constructed query statement corresponding to the target query task. The target time interval may be a time interval corresponding to the target query task. The target time unit type may be one of the time unit types. The cache query format may be a format of a query statement when querying the cache table. Optionally, the cached query format may include a format of a query function in a query statement. The raw data table may be a table storing data in an unprocessed database.
Specifically, after the data query system splits the data query request into query tasks according to the query time period in the data query request, the data query system may further obtain a target data query clause matched with the currently processed target query task, and obtain a target time interval matched with the target query task, so as to determine whether the target time interval is matched with the target time unit.
And if the target time interval is matched with the target time unit, updating the target data query clause according to a cache query format, constructing data query clauses of all target list items aiming at all query tasks according to the updated target data query clause, and constructing a data query sentence corresponding to the data query request according to the data query clauses so as to obtain query result data matched with the data query sentence in a data cache region. In particular, the data buffer may be used to store buffered data that matches the target time unit type. It can be understood that, according to the time unit type of the original data in the original data table, the original data table may be split to obtain the data buffer.
And if the target time interval is not matched with the target time unit, constructing data query clauses of all target list items aiming at all query tasks, and constructing a data query statement corresponding to the data query request according to the data query clauses so as to obtain query result data matched with the data query statement in the original data table.
According to the technical scheme, the data query clauses are updated according to the cache query format under the condition that the time interval of the query task is matched with the type of the target time unit, so that query result data matched with the data query clauses are obtained in the data cache region, the data cache region can be accurately hit in the data query process, the query calculation data set is reduced, and the data query efficiency is improved.
And S350, displaying the query result data in the target list item in the Web page.
In the technical scheme of this embodiment, the data query system identifies at least one list item in the Web page in response to a data query request of a target user for the Web page, identifies at least one target list item to be displayed in each list item according to the list item screening condition when detecting and storing the list item screening condition of the target user for the Web page, splits the data query request into at least one query task according to a query time period in the data query request, constructs a data query clause of all target list items for all query tasks, constructs a data query statement corresponding to the data query request according to the data query clause, so as to obtain query result data matched with the data query statement, thereby displaying the query result data in the target list item in the Web page, and solving the problem that the data query method in the prior art cannot rapidly screen data results due to a slow data query rate, the data query response speed can be improved, and therefore the data query speed is improved.
Example four
The embodiment of the invention specifically explains the application scene of data query of the clickhouse database system as an example, wherein the clickhouse database system is a column-type database system. Fig. 4 is an exemplary flowchart of a data query method according to a fourth embodiment of the present invention, as shown in fig. 4, which may specifically include the following steps:
step 401: the data query system responds to a data query request of a target user, enters the data query system, and the data query system acquires user information (such as historical page access records) of the target user.
Step 402: and splitting the data query request into at least one query task (namely a query entity set) according to the query time period in the data query request. Fig. 5 is an exemplary flowchart of data query request splitting according to a fourth embodiment of the present invention, and as shown in fig. 5, splitting a data query request into at least one query task according to a query time period in the data query request may include:
(1) the method comprises the steps of obtaining a starting time point (namely s0) and an ending time point (namely e0) which are matched with a query time period, determining a whole day time point (namely s1), a whole hour time point (namely s2) and a whole minute time point (namely s3) which are matched with the starting time point along the direction from the starting time point to the ending time point, and determining a whole day time point (namely e1), a whole hour time point (namely e2) and a whole minute time point (namely e3) which are matched with the ending time point along the direction from the ending time point to the starting time point.
(2) At least one time interval is formed according to the starting time point, the ending time point, each whole day time point, each whole hour time point and each whole minute time point.
Specifically, the sizes of e1 and s1 are determined, and if e1 is less than or equal to s1, indicating that the entire day time period is not included in the time period, the sizes of e2 and s2 are further determined. If e1 is greater than s1, indicating that the query period includes a full day period, then a time interval is determined from s1 and e1, and further a determination is made as to whether s2 is equal to s1, and a determination is made as to whether e2 is equal to e 1. If s2 does not equal s1, indicating that the full hour period is not included in the query period, a further determination is made as to whether s3 equals s 2. If s2 equals s1, indicating that the query period includes an entire hour period, then a time interval is determined from s1 and s 2. If e2 equals e1, indicating that the full hour period is not included in the query period, a further determination is made as to whether e3 equals e 2. If e2 is not equal to e1, indicating that the query period includes an entire hour period, then a time interval is determined from e1 and e 2. If e3 equals e2, indicating that the full minute period is not included in the query period, a further determination is made as to whether e3 equals e 0. If e3 is not equal to e2, indicating that the query period includes a full minute period, then a time interval is determined from e2 and e 3. If e3 is not equal to e0, indicating that the query period includes an entire second period, then a time interval is determined from e3 and e 0. If e3 equals e0, indicating that the entire second period is not included in the query period, the data query may be exited.
If e2 is greater than s2, indicating that the query period includes an entire hour period, then a time interval is determined from s1 and s2, and a determination is made as to whether s3 is equal to s 2. If e2 is less than or equal to s2, indicating that the query period includes an entire hour period, then the sizes of e3 and s3 are further determined. If s3 equals s2, indicating that the full minute period is not included in the query period, a further determination is made as to whether s3 equals s 0. If s3 does not equal s2, indicating that the query period includes a full minute period, then a time interval is determined based on s3 and s 2.
If e3 is greater than s3, indicating that the query period includes a full minute period, then a time interval is determined from s2 and s3, and a determination is made as to whether s3 is equal to s 0. If e3 is less than or equal to s3, indicating that the full minute period is not included in the query period, then a time interval is determined from s0 and e 0. If s3 is not equal to s0, indicating that the query period includes an entire second period, then a time interval is determined from s3 and s 0. If s3 equals s0, indicating that the full second period is not included in the query period, then the data query may be exited.
If e1 is greater than s1 and e2 is not equal to e1, indicating that the full hour period is not included in the query period, a further determination is made as to whether e3 is equal to e 2. If e1 is greater than s1 and e2 is equal to e1, indicating that the query period includes an entire hour period, then a time interval is determined based on e1 and e 2.
(3) And splitting the data query request into at least one query task according to each time interval.
Step 403: and constructing a data query statement. Fig. 6 is an exemplary flowchart of data query statement construction provided by the fourth embodiment of the present invention, and as shown in fig. 6, constructing a data query statement may include:
(1) and constructing a target data query clause matched with the currently processed target query task.
And determining whether the target user is provided with a screening list item (namely a customized display column) aiming at the Web page or not in the user information of the target user. And if the screening list item exists, identifying a target list item to be displayed in each list item according to the screening list item, inquiring a pre-constructed inquiry clause list, and acquiring an inquiry clause corresponding to the target list item. And if no screening list item exists, identifying a target list item to be displayed in each list item according to a default list item, inquiring a pre-constructed inquiry clause list, and acquiring an inquiry clause corresponding to the target list item.
And determining a target time interval of the currently processed target query task, and determining whether the data query needs to query the cache table according to whether the target time interval is matched with the type of the target time unit. And if the cache table needs to be inquired, updating the inquiry clause according to the cache inquiry format. Specifically, if the target time interval exists in the whole day, the query clause is updated according to the query format of the day-level cache table. And if the target time interval has the whole hour, updating the query clause according to the query format of the hour-level cache table. And if the target time interval has the whole minute, updating the query clause according to the query format of the minute-level cache table. If the target time interval has non-integer time, the query clause does not need to be updated.
And determining target data query clauses matched with all target list items aiming at the currently processed target query task according to the updated query clauses corresponding to all the target list items.
(2) And constructing a data query clause corresponding to all target list items and aiming at all query tasks. And combining the target data query clauses of all the query tasks to construct a data query clause (namely an internal final query clause) aiming at all the query tasks together with all the target list items.
(3) And constructing a data query statement corresponding to the data query request.
And forming an outer layer query statement corresponding to all target list items according to the storage form of the target data field in the target list item to be displayed in the original database. And combining the data query clause and the outer layer query sentence to obtain a combined query sentence. And constructing a data query statement (namely a final query statement) corresponding to the data query request according to the query condition in the combined query statement and the data query request.
Step 404: and acquiring query result data matched with the data query statement in a data cache region or an original data table of the clickhouse database system, and displaying the query result data in a Web page.
According to the technical scheme, the list items in the data query process are reduced, so that the calculation data set in the data query process is reduced, and meanwhile, the calculation result set is reduced; the original data set is divided into caches, different data cache regions are generated, and the data cache regions can be accurately hit in the data query process, so that the data set query and calculation is reduced, and the data query efficiency is improved; each target list item uniquely corresponds to one query clause, so that each list item can be guaranteed to be independently calculated, and the data query response speed is improved.
EXAMPLE five
Fig. 7 is a schematic diagram of a data query apparatus according to a fifth embodiment of the present invention, and as shown in fig. 7, the apparatus includes: a list item identification module 710, a target list item identification module 720, a query result data acquisition module 730, and a query result data presentation module 740, wherein:
a list item identification module 710, configured to identify at least one list item in a Web page in response to a data query request of a target user for the Web page; the list item comprises at least one data field to be displayed;
the target list item identification module 720 is configured to detect whether a list item screening condition of a target user for the Web page is stored, and if yes, identify at least one target list item to be displayed in each list item according to the list item screening condition;
the query result data obtaining module 730 is configured to construct data query clauses corresponding to all target list items, and construct a data query statement corresponding to the data query request according to the data query clauses, so as to obtain query result data matched with the data query statement;
and the query result data display module 740 is configured to display the query result data in the target list item in the Web page.
In the technical scheme of this embodiment, the data query system identifies at least one list item in the Web page in response to the data query request of the target user for the Web page, and detects whether to store a list item screening condition of the target user for the Web page, and when detecting the list item screening condition of the storage target user for the Web page, identifies at least one target list item to be displayed in each list item according to the list item screening condition, and constructs a data query clause corresponding to all target list items, so as to construct a data query statement corresponding to the data query request according to the data query clause, thereby obtaining query result data matched with the data query statement, and further displaying the query result data in the target list item in the Web page, thereby solving the problem that the data query method in the prior art cannot rapidly screen data results due to a slow data query rate, the data query response speed can be improved, and therefore the data query speed is improved.
Optionally, the target list item identifying module 720 may be specifically configured to: identifying a target access record corresponding to a Web page in a historical page access record corresponding to a target user; analyzing the target access record, and detecting whether a target user sets a screening list item aiming at the Web page; and if so, determining the screening list item set by the target user as a list item screening condition.
Optionally, the target list item identifying module 720 may be further specifically configured to: after detecting whether the screening conditions of the target user for the list items of the Web page are stored or not, if not, providing a screening setting interface for each list item in the Web page for the target user; responding to at least one screening list item selected by a target user in a screening setting interface, constructing a data query statement corresponding to the screening list item, and acquiring query result data matched with the data query statement; and displaying the query result data in the screening list items in the Web page.
Optionally, the query result data obtaining module 730 may be specifically configured to: according to the current processing target list item, inquiring a pre-constructed inquiry clause list according to each target data field included in the current processing target list item, and acquiring inquiry clauses corresponding to each target data field; combining all the query clauses to form an inner-layer query statement corresponding to the current processing target list item; combining the inner query sentences of all current processing target list items to construct and obtain data query clauses corresponding to all target list items; forming an outer layer query statement corresponding to all target list items according to the storage form of each target data field in the original database; and constructing and obtaining a data query sentence corresponding to the data query request according to the data query clause and the outer layer query sentence.
Optionally, the target list item identifying module 720 may be further specifically configured to: splitting the data query request into at least one query task according to the query time period in the data query request; each query task is used for querying data in a set time interval in a query time period; correspondingly, the query result data obtaining module 730 may be further specifically configured to: and constructing data query clauses of all target list items aiming at all query tasks, and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to obtain query result data matched with the data query sentences.
Optionally, the query result data obtaining module 730 may be further configured to: acquiring a starting time point and an ending time point which are matched with the query time period; determining at least one integral unit division time point of a preset time unit type matched with the starting time point along the direction from the starting time point to the ending time point; different time unit types correspond to different time spans; determining at least one integral unit division time point of a preset time unit type matched with the ending time point along the direction from the ending time point to the starting time point; dividing time points according to the starting time point, the ending time point and each whole unit to form at least one time interval; and splitting the data query request into at least one query task according to each time interval.
Optionally, the query result data obtaining module 730 may be further configured to: acquiring a target data query clause matched with a currently processed target query task, and acquiring a target time interval matched with the target query task; determining whether the target time interval matches the target time unit type; if yes, updating the target data query clause according to a cache query format, and then acquiring query result data matched with the data query statement in a data cache region; the data cache region is used for storing cache data matched with the type of the target time unit; if not, acquiring query result data matched with the data query statement in the original data table.
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 six
FIG. 8 illustrates a schematic 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. 8, 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 can 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 a 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 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 the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the 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 portable 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 can 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 may 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 in accordance with 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:
responding to a data query request of a target user for a Web page, and identifying at least one list item in the Web page; the list item comprises at least one data field to be displayed;
detecting whether a list item screening condition of a target user for a Web page is stored, if so, identifying at least one target list item to be displayed in each list item according to the list item screening condition;
constructing data query clauses corresponding to all target list items, and constructing data query statements corresponding to the data query requests according to the data query clauses so as to obtain query result data matched with the data query statements;
and displaying the query result data in the target list item in the Web page.
2. The method of claim 1, wherein detecting whether to store a list item filtering condition of a target user for a Web page comprises:
identifying a target access record corresponding to the Web page in a historical page access record corresponding to the target user;
analyzing the target access record, and detecting whether the target user sets a screening list item aiming at the Web page;
and if so, determining the screening list item set by the target user as the list item screening condition.
3. The method according to claim 1 or 2, after detecting whether to store the list item filtering condition of the target user for the Web page, further comprising:
if not, providing a screening setting interface aiming at each list item in the Web page for the target user;
responding to at least one screening list item selected by the target user in the screening setting interface, constructing a data query statement corresponding to the screening list item, and acquiring query result data matched with the data query statement;
and displaying the query result data in the screening list items in the Web page.
4. The method of claim 1, wherein constructing a data query clause corresponding to all target list items and constructing a data query statement corresponding to the data query request according to the data query clause comprises:
for a current processing target list item, inquiring a pre-constructed inquiry clause list according to each target data field included in the current processing target list item, and acquiring inquiry clauses corresponding to each target data field;
combining the query clauses to form an inner-layer query statement corresponding to the current processing target list item;
combining the inner query sentences of all the currently processed target list items to construct data query clauses corresponding to all the target list items;
forming an outer layer query statement corresponding to all target list items according to the storage form of each target data field in the original database;
and constructing and obtaining a data query statement corresponding to the data query request according to the data query clause and the outer layer query statement.
5. The method of claim 1, prior to detecting whether to store a list item filtering condition of a target user for a Web page, further comprising:
splitting a data query request into at least one query task according to a query time period in the data query request; each query task is used for querying data in a set time interval in a query time period;
the method comprises the following steps of constructing data query clauses corresponding to all target list items, constructing data query sentences corresponding to the data query requests according to the data query clauses, and obtaining query result data matched with the data query sentences, wherein the method comprises the following steps:
and constructing data query clauses of all target list items aiming at all query tasks, and constructing a data query statement corresponding to the data query request according to the data query clauses so as to obtain query result data matched with the data query statement.
6. The method of claim 5, wherein splitting the data query request into at least one query task according to a query time period in the data query request comprises:
acquiring a starting time point and an ending time point which are matched with the query time period;
determining at least one integral unit division time point of a preset time unit type matched with the starting time point along the direction from the starting time point to the ending time point; different time unit types correspond to different time spans;
determining at least one integral unit division time point of a preset time unit type matched with the end time point along the direction from the end time point to the starting time point;
forming at least one time interval according to the starting time point, the ending time point and each whole unit dividing time point;
and splitting the data query request into at least one query task according to each time interval.
7. The method of claim 5, wherein constructing data query clauses of all target list items for all query tasks, and constructing a data query statement corresponding to the data query request according to the data query clauses to obtain query result data matched with the data query statement comprises:
acquiring a target data query clause matched with a currently processed target query task, and acquiring a target time interval matched with the target query task;
determining whether the target time interval matches a target time unit type;
if so, updating the target data query clause according to a cache query format, and then acquiring query result data matched with the data query clause in a data cache region; the data cache region is used for storing cache data matched with the target time unit type;
and if not, acquiring query result data matched with the data query statement in the original data table.
8. A data query apparatus, comprising:
the system comprises a list item identification module, a data query module and a query module, wherein the list item identification module is used for responding to a data query request of a target user for a Web page and identifying at least one list item in the Web page; the list item comprises at least one data field to be displayed;
the target list item identification module is used for detecting whether a list item screening condition of a target user for the Web page is stored or not, and if yes, identifying at least one target list item to be displayed in each list item according to the list item screening condition;
the query result data acquisition module is used for constructing data query clauses corresponding to all target list items and constructing data query sentences corresponding to the data query requests according to the data query clauses so as to acquire query result data matched with the data query sentences;
and the query result data display module is used for displaying the query result data in the target list item in the Web page.
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.
CN202210375205.2A 2022-04-11 2022-04-11 Data query method and device, electronic equipment and storage medium Pending CN114722264A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210375205.2A CN114722264A (en) 2022-04-11 2022-04-11 Data query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210375205.2A CN114722264A (en) 2022-04-11 2022-04-11 Data query method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114722264A true CN114722264A (en) 2022-07-08

Family

ID=82244066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210375205.2A Pending CN114722264A (en) 2022-04-11 2022-04-11 Data query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114722264A (en)

Similar Documents

Publication Publication Date Title
CN111339171B (en) Data query method, device and equipment
CN111737564A (en) Information query method, device, equipment and medium
CN115495473A (en) Database query method and device, electronic equipment and storage medium
CN114817651A (en) Data storage method, data query method, device and equipment
CN114816578A (en) Method, device and equipment for generating program configuration file based on configuration table
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN113220705A (en) Slow query identification method and device
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN114722264A (en) Data query method and device, electronic equipment and storage medium
CN115080607A (en) Method, device, equipment and storage medium for optimizing structured query statement
CN111324310A (en) Data reading method and device and computer system
CN117271840B (en) Data query method and device of graph database and electronic equipment
CN115858104A (en) Method, device and equipment for acquiring snapshot of transaction commit sequence number and storage medium
CN116401269A (en) Data query method and device, electronic equipment and storage medium
CN117763060A (en) Data processing method, device, equipment and storage medium based on user behavior
CN115712645A (en) Data processing method, device, equipment and storage medium
CN115730000A (en) Medical data integration method, device, equipment and medium based on data lake
CN115878627A (en) Database partitioning method, device, equipment and storage medium
CN116244321A (en) Data updating method, device, equipment and medium
CN115495528A (en) Distributed database statement execution method, device, equipment and storage medium
CN117033462A (en) Enterprise relation query method, system, equipment and medium
CN118113916A (en) Data processing method, device, electronic equipment and storage medium
CN117633088A (en) File data importing method, device, equipment and storage medium
CN115202791A (en) Method and device for determining first screen loading resource, server and storage medium
CN116955394A (en) Data query method, device, equipment and 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