CN109376171B - Data query method and device, computer storage medium and server - Google Patents

Data query method and device, computer storage medium and server Download PDF

Info

Publication number
CN109376171B
CN109376171B CN201810931277.4A CN201810931277A CN109376171B CN 109376171 B CN109376171 B CN 109376171B CN 201810931277 A CN201810931277 A CN 201810931277A CN 109376171 B CN109376171 B CN 109376171B
Authority
CN
China
Prior art keywords
view
target
query
data
subset
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.)
Active
Application number
CN201810931277.4A
Other languages
Chinese (zh)
Other versions
CN109376171A (en
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.)
Guangzhou Huya Information Technology Co Ltd
Original Assignee
Guangzhou Huya Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Information Technology Co Ltd filed Critical Guangzhou Huya Information Technology Co Ltd
Priority to CN201810931277.4A priority Critical patent/CN109376171B/en
Publication of CN109376171A publication Critical patent/CN109376171A/en
Application granted granted Critical
Publication of CN109376171B publication Critical patent/CN109376171B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to the field of data mining, in particular to a data query method, a data query device, a computer storage medium and a server, wherein the method comprises the following steps: acquiring a current query view currently used by a user; receiving a target query request of a user, and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request; replacing the target view subset with a failure view subset in the current query view to generate a target query view; and acquiring target query data corresponding to the target query request according to the target query view, and displaying the target query data. The invention can select the view and acquire the target query data in real time and efficiently.

Description

Data query method and device, computer storage medium and server
Technical Field
The invention relates to the field of data processing, in particular to a data query method and device, a computer storage medium and a server.
Background
With the development of internet technology, data shows explosive growth, the difficulty of data analysis and processing increases with the growth of data, data warehouse technology comes, data warehouse is a database application technology developed by data support, decision and analysis, a large batch of data can be queried, aggregated, and presented via a view through a data warehouse, however, as the size of the data warehouse is increased, the time and resources consumed for acquiring the queried data from a large amount of data are increased, especially the view selection strategy adopted by the prior art cannot meet the query requirement of the user in dynamic change, therefore, how to realize real-time and rapid analysis processing to perform appropriate view selection is a problem that needs to be solved urgently in the industry of big data analysis and processing at present to present the queried data based on appropriate view presentation.
Disclosure of Invention
In order to overcome the technical problems, particularly the problem that the prior art cannot select a view and acquire target query data efficiently in real time, the following technical scheme is proposed:
in a first aspect, the present invention provides a data query method, including:
acquiring a current query view currently used by a user;
receiving a target query request of a user, and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request;
replacing the target view subset with a failure view subset in the current query view to generate a target query view;
and acquiring target query data corresponding to the target query request according to the target query view, and displaying the target query data.
Further, the replacing the target view subset with the failed view subset in the current query view to generate the target query view includes:
acquiring a first target view subset in the target view subset, replacing a failure view subset in the current query view with the first target view subset, and generating a first target query view;
and acquiring a second target view subset in the target view subset, and replacing the second target view subset with the failed view subset in the current query view to generate a second target query view.
Further, the obtaining target query data corresponding to the target query request according to the target query view and displaying the target query data includes:
acquiring first target query data corresponding to the target query request according to the first target query view, and displaying the first target query data; and/or the presence of a gas in the gas,
and acquiring second target query data corresponding to the target query request according to the second target query view, and displaying the second target query data.
Further, the calculating a target view subset corresponding to the target query request based on a dynamic selection policy according to the target query request includes:
calculating a query field and a view aggregation mode corresponding to the target query request based on a greedy algorithm according to the target query request; and acquiring a corresponding target view subset from a data warehouse according to the query field and the view aggregation mode.
Further, the acquiring a corresponding target view subset from a data warehouse according to the query field and the view aggregation manner includes:
and combining the query field and the view aggregation mode into a standard query statement according to a self-adaptive splicing algorithm, and acquiring a corresponding target view subset from a data warehouse according to the standard query statement.
Further, before the obtaining of the current query view currently used by the user, the method further includes:
acquiring a preset number of candidate views according to the historical query probability distribution of the user; the candidate view comprises a subset of target views.
Further, after the presenting the target query data, the method further includes:
and counting the time consumption of the generated target query view and the data volume of the acquired target query data, adjusting a selection strategy according to the time consumption and the data volume, and using the adjusted selection strategy for calculating the target view subset next time.
In a second aspect, the present invention further provides a data query apparatus, including:
an acquisition module: the method comprises the steps of obtaining a current query view currently used by a user;
a calculation module: the system comprises a user interface, a target view subset and a view subset, wherein the user interface is used for receiving a target query request of a user and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request;
a generation module: the target view subset is used for replacing the failure view subset in the current query view, and a target query view is generated;
a display module: and the query view is used for acquiring the target query data corresponding to the target query request according to the target query view and displaying the target query data.
In a third aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the data query method described above.
In a third aspect, the present invention also provides a server comprising one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and the one or more computer programs are configured to perform the above-mentioned data query method.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a data query method, which comprises the steps of obtaining a current query view currently used by a user and a target view subset calculated according to a target query request of the user, replacing a failure view subset in the current view subset with the target view subset to generate a target query view, quickly matching a database table according to the target query view to obtain corresponding target query data, displaying the target query data to the user, storing the calculated target view subset in advance based on view aggregation, replacing the failure view subset in the current query view, calculating all query views in real time when each query is not needed, improving the query performance of data, greatly reducing the load of a computer, quickening the response time of data query, and improving the experience of the user for querying mass data.
In addition, the invention also provides view aggregation selection of the flexibly configurable target query view, different target query views are obtained through different view aggregation modes, and then target query data with different dimensions and different levels are displayed, so that more comprehensive target query data are provided.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart illustrating a data query method according to an embodiment of the present invention;
FIG. 2 is a system flow diagram illustrating a data query method according to the present invention;
FIG. 3 is a schematic diagram of a data query device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, or operations, but do not preclude the presence or addition of one or more other features, integers, steps, operations, or groups thereof.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
It will be appreciated by those skilled in the art that the terms "application," "computer program" and similar terms used herein refer to the same concepts known to those skilled in the art that refer to computer software electronically-adapted to be organized into a series of computer instructions and associated data sources. Unless otherwise specified, such nomenclature is not itself limited by the programming language class, level, or operating system or platform upon which it depends. Of course, such concepts are not limited to any type of terminal.
In one embodiment, the present invention provides a data query method applied in an OLAP (On-line analytical Processing) system, as shown in fig. 1, the method includes:
s10: and acquiring a current query view currently used by a user.
The OLAP system generally takes a data warehouse as a base, extracts a subset of detailed data from the data warehouse and stores the subset into an OLAP memory for a front-end analysis tool to read through necessary aggregation, the whole process of the OLAP system can be regarded as comprising two phases, namely a system starting phase and an online running phase, in the system starting phase, a static view selection strategy is used for acquiring corresponding views from the data warehouse and aggregating the views, each view is a virtual table defined on an SQL Server, each view is another entry for viewing data, generally, the view does not store actual data, but only stores a Select statement and metadata of the related table; when the system enters an online operation stage, the metadata in the data warehouse can be extracted and converted into a view which can be really understood by a user from various angles. In this embodiment, after a user queries data online through a query engine of the OLAP system, the OLAP system presents a view corresponding to the data, and at this time, a current query view currently used by the user is obtained.
S20: receiving a target query request of a user, and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request.
When a user queries new data from the OLAP system again, a target query request of the user is received, wherein the target query request is a query field configured by the user, then a target view subset corresponding to the target query request is calculated based on a dynamic selection strategy according to the target query request, specifically, a candidate view containing the query field is obtained from a data warehouse according to the query field configured by the user, and then a preset candidate view is selected as the target view subset. Since one candidate view generally includes a plurality of query fields, preferably, when a preset candidate view is selected, the selected preset candidate view needs to include all the query fields, and the repetition rate of the query fields included in the selected preset candidate view is low, and then the selected candidate view is used as the target view subset corresponding to the target query request.
S30: and replacing the target view subset with the failure view subset in the current query view to generate the target query view.
After the target view subset is calculated, if the OLAP system calculates the corresponding view again in real time according to the new query requirement every time the user queries, it is very time consuming in this embodiment, first, the failure view subset in the current view is found, which also becomes the failure view subset, specifically, if some views in the current query view do not include the query field in the new query requirement of the user, the views are located as the failure views, all failure views in the current query view become the failure view subset, and then the obtained target view subset replaces the failure view subset in the current query view, thereby generating the target query view.
S40: and acquiring target query data corresponding to the target query request according to the target query view, and displaying the target query data.
Target query data corresponding to the target query request can be acquired according to the target query view, then the target query data is displayed in a user interface of the OLAP system, and a user can intuitively and clearly browse the target query data from the user interface of the OLAP system. As shown in fig. 2, which is a schematic system flow diagram of the data Query method applied to the OLAP system in this embodiment, a user (Client) queries target data through a Query engine (OLAP Query Proxy) of the OLAP system, the Query engine is applied with the data Query method of this embodiment to obtain a current Query view currently used by the user, then, a target view subset corresponding to the target query request is calculated based on a dynamic selection strategy according to the target query request, the target view subset replaces a failure view subset in the current query view to generate a target query view, then, target query data corresponding to the target query request is obtained according to the target query view, the target query data is displayed, the 0 target query view shown in fig. 2 includes D1Vision, D2Vision, and D3Vision, and target query data under different views are shown to the user.
The embodiment provides a data query method applied in an OLAP system, which obtains a current query view currently used by a user and a target view subset calculated according to a target query request of the user, then the target view subset replaces the failure view subset in the current view subset to generate a target query view, obtaining corresponding target query data according to the target query view fast matching database table, displaying the target query data to a user, storing the calculated target view subset in advance based on view aggregation, and then replacing the failure view subset in the current query view, and not calculating all query views again in real time when each query is needed any more, thereby improving the query performance of data, greatly reducing the load of a computer, shortening the response time of data query and improving the experience of a user for querying mass data.
In an embodiment of the present invention, the replacing the target view subset with the failure view subset in the current query view to generate the target query view includes:
acquiring a first target view subset in the target view subset, replacing a failure view subset in the current query view with the first target view subset, and generating a first target query view;
and acquiring a second target view subset in the target view subset, and replacing the second target view subset with the failed view subset in the current query view to generate a second target query view.
In this embodiment, the target view subset comprises a plurality of target views, different view combinations can be combined into different target view subsets, for example, the target view comprises A, B, C, D, E, F, the target view A, B, C, D can be used as a first target view subset, the target view B, C, D, E, F can be used as a second target view subset, and then when the target view subset replaces a failure view subset in the current query view to generate a target query view, a first target view subset in the target view subset is obtained, the first target view subset replaces the failure view subset in the current query view to generate a first target query view, and/or a second target view subset in the target view subset is obtained, the second target view subset replaces the failure view subset in the current query view, and generating a second target query view, and generating a plurality of target query views for the user to select.
On the basis of the above embodiment, the obtaining target query data corresponding to the target query request according to the target query view and displaying the target query data according to an embodiment of the present invention includes:
acquiring first target query data corresponding to the target query request according to the first target query view, and displaying the first target query data; and/or the presence of a gas in the gas,
and acquiring second target query data corresponding to the target query request according to the second target query view, and displaying the second target query data.
On the basis that a plurality of target query views can be obtained in the above embodiment, in this embodiment, if a first target query view is selected, first target query data corresponding to the target query request is obtained according to the first target query view, and then the first target query data is displayed; and if the first target query view is selected, acquiring second target query data corresponding to the target query request according to the second target query view, and displaying the second target query data. Target query data with different dimensionalities can be obtained through the multiple target query views, and more comprehensive target query data are displayed.
In an embodiment of the present invention, the calculating, according to the target query request and based on a dynamic selection policy, a target view subset corresponding to the target query request includes:
calculating a query field and a view aggregation mode corresponding to the target query request based on a greedy algorithm according to the target query request; and acquiring a corresponding target view subset from a data warehouse according to the query field and the view aggregation mode.
In the embodiment, when the target view subset is calculated according to the target query request, the query field and the view aggregation mode corresponding to the target query request are calculated first based on a greedy algorithm, wherein the greedy algorithm is that when a problem is solved, the current selection which is the best in the aspect of the current view is always made, but the selection is not considered from the overall optimum, and the selection made is a local optimum solution in a certain sense; in this embodiment, the optimal solution may be to analyze the target query request to obtain all query fields, then calculate a view including all query fields, and then use the view as the target view subset; or, the optimal solution may be that each view includes the query field, then the aggregation mode of the views is obtained, the corresponding view is obtained from the data warehouse according to the query field, and then the views are aggregated into the corresponding target view subset according to the obtained view aggregation mode.
On the basis of the above embodiment, the acquiring a corresponding target view subset from a data warehouse according to the query field and the view aggregation manner includes:
and combining the query field and the view aggregation mode into a standard query statement according to a self-adaptive splicing algorithm, and acquiring a corresponding target view subset from a data warehouse according to the standard query statement.
After the query field and the view aggregation mode corresponding to the target query request are calculated according to the target query request, in this embodiment, the query field and the view aggregation mode are combined into a standard query statement according to a self-adaptive splicing algorithm, and then, a corresponding target view subset is obtained from a data warehouse according to the standard query statement, where the storage modes of different types of data warehouses are different, in this embodiment, by constructing the standard query statement, specifically, the standard SQL statement can be compatible with the different types of data warehouses, and a corresponding target view subset is obtained from the data warehouse; and the query field and the view aggregation mode are combined into a standard query statement through a self-adaptive splicing algorithm, the self-adaptive process is a process of continuously approaching a target, the query field and the view aggregation mode can be quickly and efficiently spliced into the required standard query statement through the self-adaptive splicing algorithm, and a more concise standard query statement can be continuously adapted and approached, so that the corresponding target view subset can be more efficiently obtained from a data warehouse according to the standard query statement, and the query efficiency of data is improved.
In an embodiment of the present invention, before acquiring the current query view currently used by the user, the method further includes:
acquiring a preset number of candidate views according to the historical query probability distribution of the user; the candidate view comprises a subset of target views.
In this embodiment, the OLAP system stores a preset number of candidate views, where the candidate views are obtained through the historical query probability distribution of the user, and the candidate views include a target view subset, and when the target view subset needs to be obtained subsequently, the target view subset can be obtained from the candidate views, so as to improve the obtaining efficiency of the target view subset, and improve the query efficiency of data, for example, statistics of fields of the historical query of the user is performed, and then the candidate views including the fields are obtained according to the query probability of each field, and the number of the obtained candidate views is increased for data fields with higher historical query probability. Further, after the candidate views are obtained, the preset number of candidate views are added to the data warehouse, so that the OLAP system can quickly obtain the target view subset from the candidate views in the data warehouse.
In an embodiment of the present invention, after displaying the target query data, the method further includes:
and counting the time consumption of the generated target query view and the data volume of the acquired target query data, adjusting a selection strategy according to the time consumption and the data volume, and using the adjusted selection strategy for calculating the target view subset next time.
In this embodiment, after the target query data is displayed each time, the time consumption of the generated target query view and the data volume of the obtained target query data are counted, then the selection policy is adjusted according to the time consumption and the data volume, the selection policy is iteratively optimized, and then the adjusted selection policy is applied to the next calculation of the target view subset, so that the OLAP system can quickly and efficiently select the target view subset.
In another embodiment, as shown in fig. 3, the present invention provides a data query apparatus, including:
the acquisition module 10: the method comprises the steps of obtaining a current query view currently used by a user;
the calculation module 20: the system comprises a user interface, a target view subset and a view subset, wherein the user interface is used for receiving a target query request of a user and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request;
the generation module 30: the target view subset is used for replacing the failure view subset in the current query view, and a target query view is generated;
the display module 40: and the query view is used for acquiring the target query data corresponding to the target query request according to the target query view and displaying the target query data.
In this embodiment, the obtaining module 10 obtains the operation data of the new anchor user within a preset time, for example, the preset time is 3 months, and the operation data of the new anchor user on line in nearly 3 months can be obtained by capturing background data; after acquiring the operation data of the new anchor user, the acquisition module 10 needs to screen the new anchor user in order to predict which new anchor users have better development potential, in this embodiment, the screening module 20 screens the new anchor user meeting the preset condition of daily activity amount according to the operation data, and uses the new anchor user as a candidate anchor user; after the screening module 20 screens out the candidate anchor users, the modeling module 30 selects the operation data of the candidate anchor users for modeling, firstly, the operation data is preprocessed to obtain data samples, then, a first preset percentage of the data samples is used as a training set, a second preset percentage of the data samples is used as a test set, a decision tree model and an SVM model are constructed according to the operation data, correlation coefficients of the decision tree model and the SVM model are adjusted, the accuracy and the coverage of the decision tree model and the SVM model meet conditions, and then, the test set of the data samples is substituted into the decision tree model and the SVM model to obtain a model result of the operation data of each new anchor user; mining module 40 screens out candidate anchor users for which both models are predicted to be 1, and determines potential anchor users.
In an embodiment of the present invention, the generating module 30 performs replacing the target view subset with the failure view subset in the current query view, and generates the target query view, including:
acquiring a first target view subset in the target view subset, replacing a failure view subset in the current query view with the first target view subset, and generating a first target query view;
and acquiring a second target view subset in the target view subset, and replacing the second target view subset with the failed view subset in the current query view to generate a second target query view.
In an embodiment of the present invention, the displaying module 40 executes to obtain the target query data corresponding to the target query request according to the target query view, and displays the target query data, including:
acquiring first target query data corresponding to the target query request according to the first target query view, and displaying the first target query data; and/or the presence of a gas in the gas,
and acquiring second target query data corresponding to the target query request according to the second target query view, and displaying the second target query data.
In an embodiment of the present invention, the calculating module 30 performs calculating the target view subset corresponding to the target query request based on a dynamic selection policy according to the target query request, including:
calculating a query field and a view aggregation mode corresponding to the target query request based on a greedy algorithm according to the target query request; and acquiring a corresponding target view subset from a data warehouse according to the query field and the view aggregation mode.
In an embodiment of the present invention, the obtaining, by the computing module 30, a corresponding target view subset from a data warehouse according to the query field and the view aggregation manner includes:
and combining the query field and the view aggregation mode into a standard query statement according to a self-adaptive splicing algorithm, and acquiring a corresponding target view subset from a data warehouse according to the standard query statement.
In an embodiment of the present invention, before the obtaining module obtains the current query view currently used by the user, the obtaining module further performs:
acquiring a preset number of candidate views according to the historical query probability distribution of the user; the candidate view comprises a subset of target views.
In an embodiment of the invention, the apparatus further comprises:
a feedback module: the method comprises the steps of counting the time consumption of the generated target query view and the data volume of the acquired target query data, adjusting a selection strategy according to the time consumption and the data volume, and using the adjusted selection strategy for calculating a target view subset next time.
In another embodiment, the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the data query method described in the above embodiments. The computer-readable storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (Electrically EraSable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage device includes any medium that stores or transmits information in a form readable by a device (e.g., a computer, a cellular phone), and may be a read-only memory, a magnetic or optical disk, or the like.
The computer-readable storage medium provided by the embodiment of the invention can realize the acquisition of the current query view currently used by a user; receiving a target query request of a user, and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request; replacing the target view subset with a failure view subset in the current query view to generate a target query view; and acquiring target query data corresponding to the target query request according to the target query view, and displaying the target query data. A data query method applied in an OLAP system is provided, which comprises the steps of obtaining a current query view currently used by a user and a target view subset calculated according to a target query request of the user, then the target view subset replaces the failure view subset in the current view subset to generate a target query view, obtaining corresponding target query data according to the target query view fast matching database table, displaying the target query data to a user, storing the calculated target view subset in advance based on view aggregation, and then replacing the failure view subset in the current query view, and not calculating all query views again in real time when each query is needed any more, thereby improving the query performance of data, greatly reducing the load of a computer, shortening the response time of data query and improving the experience of a user for querying mass data. In addition, the computer-readable storage medium provided by the invention can also provide view aggregation selection of flexibly configurable target query views, different target query views are obtained through different view aggregation modes, and then target query data with different dimensions and different levels are displayed, so that more comprehensive target query data are provided.
The computer-readable storage medium provided in the embodiments of the present invention can implement the embodiments of the data query method, and for specific function implementation, reference is made to the description in the method embodiments, which is not repeated herein.
In addition, in another embodiment, the present invention further provides a server, as shown in fig. 4, the server includes a processor 403, a memory 405, an input unit 407, a display unit 409, and the like. Those skilled in the art will appreciate that the structural elements shown in fig. 4 do not constitute a limitation of all servers and may include more or fewer components than those shown, or some combination of components. The memory 405 may be used to store the computer program 401 and the functional modules, and the processor 403 executes the computer program 401 stored in the memory 405, thereby executing various functional applications of the device and data processing. The memory 405 may be an internal memory or an external memory, or include both internal and external memories. The memory may comprise read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a usb-disk, a magnetic tape, etc. The disclosed memory includes, but is not limited to, these types of memory. The memory 405 disclosed herein is provided by way of example only and not by way of limitation.
The input unit 407 is used for receiving input of signals and receiving keywords input by a user. The input unit 407 may include a touch panel and other input devices. The touch panel can collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel by using any suitable object or accessory such as a finger, a stylus and the like) and drive the corresponding connecting device according to a preset program; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., play control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like. The display unit 409 may be used to display information input by a user or information provided to a user and various menus of the computer device. The display unit 409 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 403 is a control center of the computer device, connects various parts of the entire computer using various interfaces and lines, and performs various functions and processes data by operating or executing software programs and/or modules stored in the memory 403 and calling data stored in the memory. One or more processors 403 shown in fig. 4 can execute, implement, or perform the functions of acquisition module 10, calculation module 20, generation module 30, and presentation module 40 shown in fig. 3.
In one embodiment, the server includes one or more processors 403, and one or more memories 405, one or more computer programs 401, wherein the one or more computer programs 401 are stored in the memory 405 and configured to be executed by the one or more processors 403, and the one or more computer programs 401 are configured to perform the data query method described in the above embodiments.
The server provided by the embodiment of the invention can realize the acquisition of the current query view currently used by a user; receiving a target query request of a user, and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request; replacing the target view subset with a failure view subset in the current query view to generate a target query view; and acquiring target query data corresponding to the target query request according to the target query view, and displaying the target query data. By providing a data query method applied in an OLAP system, by acquiring a current query view currently used by a user and a target view subset calculated according to a target query request of the user, then the target view subset replaces the failure view subset in the current view subset to generate a target query view, obtaining corresponding target query data according to the target query view fast matching database table, displaying the target query data to a user, storing the calculated target view subset in advance based on view aggregation, and then replacing the failure view subset in the current query view, and not calculating all query views again in real time when each query is needed any more, thereby improving the query performance of data, greatly reducing the load of a computer, shortening the response time of data query and improving the experience of a user for querying mass data. In addition, the server provided by the invention can also provide view aggregation selection of flexibly configurable target query views, and different target query views are obtained in different view aggregation modes, so that target query data with different dimensions and different levels are displayed, and more comprehensive target query data are provided.
The server provided in the embodiment of the present invention can implement the embodiment of the data query method provided above, and for specific function implementation, reference is made to the description in the embodiment of the method, which is not described herein again.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (9)

1. A method for querying data, comprising:
acquiring a current query view currently used by a user;
receiving a target query request of a user, and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request;
replacing the target view subset with a failure view subset in the current query view to generate a target query view;
acquiring target query data corresponding to the target query request according to the target query view, and displaying the target query data;
and counting the time consumption of the generated target query view and the data volume of the acquired target query data, adjusting a selection strategy according to the time consumption and the data volume, and using the adjusted selection strategy for calculating the target view subset next time.
2. The method of claim 1, wherein the replacing the target view subset for the failed view subset in the current query view, generating a target query view comprises:
acquiring a first target view subset in the target view subset, replacing a failure view subset in the current query view with the first target view subset, and generating a first target query view;
and acquiring a second target view subset in the target view subset, and replacing the second target view subset with the failed view subset in the current query view to generate a second target query view.
3. The method according to claim 2, wherein the obtaining target query data corresponding to the target query request according to the target query view and displaying the target query data comprises:
acquiring first target query data corresponding to the target query request according to the first target query view, and displaying the first target query data; and/or the presence of a gas in the gas,
and acquiring second target query data corresponding to the target query request according to the second target query view, and displaying the second target query data.
4. The method according to claim 1, wherein the calculating a target view subset corresponding to the target query request based on a dynamic selection policy according to the target query request comprises:
calculating a query field and a view aggregation mode corresponding to the target query request based on a greedy algorithm according to the target query request; and acquiring a corresponding target view subset from a data warehouse according to the query field and the view aggregation mode.
5. The method of claim 4, wherein obtaining the corresponding subset of target views from the data repository according to the query field and the view aggregation manner comprises:
and combining the query field and the view aggregation mode into a standard query statement according to a self-adaptive splicing algorithm, and acquiring a corresponding target view subset from a data warehouse according to the standard query statement.
6. The method of claim 1, wherein before obtaining the current query view currently used by the user, further comprising:
acquiring a preset number of candidate views according to the historical query probability distribution of the user; the candidate view comprises a subset of target views.
7. A data query apparatus, comprising:
an acquisition module: the method comprises the steps of obtaining a current query view currently used by a user;
a calculation module: the system comprises a user interface, a target view subset and a view subset, wherein the user interface is used for receiving a target query request of a user and calculating a target view subset corresponding to the target query request based on a dynamic selection strategy according to the target query request;
a generation module: the target view subset is used for replacing the failure view subset in the current query view, and a target query view is generated;
a display module: the query view is used for acquiring target query data corresponding to the target query request according to the target query view and displaying the target query data;
a feedback module: the method comprises the steps of counting the time consumption of the generated target query view and the data volume of the acquired target query data, adjusting a selection strategy according to the time consumption and the data volume, and using the adjusted selection strategy for calculating a target view subset next time.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the data query method of any one of claims 1 to 6.
9. A server, comprising:
one or more processors;
a memory;
one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs configured to perform the data query method of any of claims 1-6.
CN201810931277.4A 2018-08-15 2018-08-15 Data query method and device, computer storage medium and server Active CN109376171B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810931277.4A CN109376171B (en) 2018-08-15 2018-08-15 Data query method and device, computer storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810931277.4A CN109376171B (en) 2018-08-15 2018-08-15 Data query method and device, computer storage medium and server

Publications (2)

Publication Number Publication Date
CN109376171A CN109376171A (en) 2019-02-22
CN109376171B true CN109376171B (en) 2020-10-16

Family

ID=65404527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810931277.4A Active CN109376171B (en) 2018-08-15 2018-08-15 Data query method and device, computer storage medium and server

Country Status (1)

Country Link
CN (1) CN109376171B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112015787A (en) * 2020-08-28 2020-12-01 支付宝(杭州)信息技术有限公司 Data query method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1763744A (en) * 2004-08-24 2006-04-26 微软公司 Partially materialized views
CN101477524A (en) * 2008-12-11 2009-07-08 金蝶软件(中国)有限公司 System performance optimization method and system based on materialized view
CN101556602A (en) * 2009-04-08 2009-10-14 王珊 Memory OLAP What-if analytical method based on a difference table
CN107590275A (en) * 2017-09-27 2018-01-16 北京奇虎科技有限公司 A kind of data query method and apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9659043B2 (en) * 2013-02-07 2017-05-23 Enigma Technologies, Inc. Data system and method
US9734206B2 (en) * 2015-04-14 2017-08-15 International Business Machines Corporation Intermediate window results in a streaming environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1763744A (en) * 2004-08-24 2006-04-26 微软公司 Partially materialized views
CN101477524A (en) * 2008-12-11 2009-07-08 金蝶软件(中国)有限公司 System performance optimization method and system based on materialized view
CN101556602A (en) * 2009-04-08 2009-10-14 王珊 Memory OLAP What-if analytical method based on a difference table
CN107590275A (en) * 2017-09-27 2018-01-16 北京奇虎科技有限公司 A kind of data query method and apparatus

Also Published As

Publication number Publication date
CN109376171A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
US10534635B2 (en) Personal digital assistant
Kamat et al. Distributed and interactive cube exploration
US20210374174A1 (en) Method and apparatus for recommending multimedia resource, electronic device and storage medium
JP7317879B2 (en) METHOD AND DEVICE, ELECTRONIC DEVICE, STORAGE MEDIUM AND COMPUTER PROGRAM FOR RECOGNIZING VIDEO
CN109614347B (en) Processing method and device for multi-level cache data, storage medium and server
US20150032730A1 (en) Data Analysis Engine
US20140330821A1 (en) Recommending context based actions for data visualizations
US9613131B2 (en) Adjusting search results based on user skill and category information
CN111506803B (en) Content recommendation method and device, electronic equipment and storage medium
US8489533B2 (en) Inferring view sequence and relevance data
CN110659349A (en) Log query method, device, equipment and computer readable storage medium
US20170083566A1 (en) Partitioning advisor for online transaction processing workloads
US11567936B1 (en) Platform agnostic query acceleration
CN113190741B (en) Search method, search device, electronic equipment and storage medium
CN111026670B (en) Test case generation method, test case generation device and storage medium
CN109376171B (en) Data query method and device, computer storage medium and server
US10503823B2 (en) Method and apparatus providing contextual suggestion in planning spreadsheet
US11341197B2 (en) Recommendation system based on adjustable virtual indicium
US20200380037A1 (en) Information Retrieval Precision Evaluation Method, System and Device and Computer-Readable Storage Medium
US20140244570A1 (en) Optimizing and managing execution of hybrid flows
CN109408544B (en) Data aggregation method and device based on engine, storage medium and server
CN115965089A (en) Machine learning method for interface feature display across time zones or geographic regions
CN113515701A (en) Information recommendation method and device
CN112199561A (en) Application search method and device
US20140071158A1 (en) Interface Integrating Key Peformance Indicator (KPI) to Custom Control

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
GR01 Patent grant
GR01 Patent grant