CN109977259A - A kind of data query method, apparatus and electronic equipment - Google Patents
A kind of data query method, apparatus and electronic equipment Download PDFInfo
- Publication number
- CN109977259A CN109977259A CN201910245145.0A CN201910245145A CN109977259A CN 109977259 A CN109977259 A CN 109977259A CN 201910245145 A CN201910245145 A CN 201910245145A CN 109977259 A CN109977259 A CN 109977259A
- Authority
- CN
- China
- Prior art keywords
- inquiry system
- query result
- inquiry
- data
- query
- 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
Links
Abstract
The embodiment of the invention provides a kind of data query method, apparatus and electronic equipment, it may include: while sending inquiry request to the first inquiry system and the second inquiry system respectively;So that the first inquiry system and the second inquiry system when being respectively received inquiry request, return to query result corresponding with user identifier;Wherein, the first inquiry system and the second inquiry system are stored with identical storing data;First inquiry system is kylin kylin;Second inquiry system is moral Shandong according to druid;When receiving the query result of the first inquiry system return at the first time, the query result that the first inquiry system is returned is as query result;Alternatively, the query result for returning to the second inquiry system is as query result when receiving the query result of the second inquiry system return at the first time.It is time-consuming to can reduce inquiry for the data query method, apparatus and electronic equipment provided through the embodiment of the present invention.
Description
Technical field
The present invention relates to Internet technical fields, more particularly to a kind of data query method, apparatus and electronic equipment.
Background technique
User can check the video data of oneself uploaded videos, such as playback volume, the comment amount of video after uploaded videos.
In the prior art, by being based on the inquiry mode of kylin (kylin), the video data for the video that inquiry is uploaded for user.
However, inventor has found in the implementation of the present invention, at least there are the following problems for the prior art:
Due to being influenced by resource when inquiring etc., when so that being inquired by the inquiry mode based on kylin, at certain
A little status inquiries take a long time, such as the resource of query engine of kylin is occupied by other query tasks.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of data query method, apparatus and electronic equipment, to reduce inquiry
It is time-consuming.Specific technical solution is as follows:
In a first aspect, the embodiment of the invention provides a kind of data query methods, comprising:
Inquiry request is sent to the first inquiry system and the second inquiry system respectively simultaneously;So that first inquiry system
With second inquiry system when being respectively received the inquiry request, returns and marked with the user for including in the inquiry request
Know corresponding query result;Wherein, first inquiry system and second inquiry system are stored with identical storing data;
First inquiry system is kylin kylin;Second inquiry system is moral Shandong according to druid;
When receiving the query result that first inquiry system returns at the first time, first inquiry system is returned
The query result returned is as query result;
Alternatively, described second is inquired when receiving the query result that second inquiry system returns at the first time
The query result that system returns is as query result.
Optionally, it is described and meanwhile respectively send inquiry request to the first inquiry system and the second inquiry system before, institute
State method further include:
Video data is obtained, the video data includes recommended amounts, playback volume, comment amount and the powder amount that rises of each video;
The video data is stored in default hive table, and generates done file;
It checks the done file, and cube is constructed and according to hive table by the video data according to the hive table
Import the druid, wherein the cube stores the video data for the kylin.
Optionally, the inquiry request further includes time range mark;
It is returned in the query result for returning to first inquiry system as query result, or by second inquiry system
After the query result returned is as query result, the method also includes:
The time range is identified the target query data in corresponding time range to count, is obtained when described
Between statistical data in range, the target query data are the data in the query result.
Optionally, it is looked into the query result for returning to first inquiry system as query result, or by described second
After the query result that inquiry system returns is as query result, the method also includes:
Determine information to be packaged, the information to be packaged includes user's name;
By the query result and the information combination to be packaged, data splitting is obtained;
The data splitting is fed back into the corresponding user of the user identifier.
Second aspect, the embodiment of the invention provides a kind of data query devices, comprising:
Sending module, for sending inquiry request to the first inquiry system and the second inquiry system respectively simultaneously;So that institute
The first inquiry system and second inquiry system are stated when being respectively received the inquiry request, is returned and the inquiry request
In include the corresponding query result of user identifier;Wherein, first inquiry system and second inquiry system are stored with
Identical storing data;First inquiry system is kylin kylin;Second inquiry system is moral Shandong according to druid;
First determining module, for inciting somebody to action when receiving the query result that first inquiry system returns at the first time
The query result that first inquiry system returns is as query result;Alternatively, receiving second inquiry at the first time
When the query result that system returns, the query result that second inquiry system is returned is as query result.
Optionally, described device further include:
Obtain module, for it is described simultaneously respectively to the first inquiry system and the second inquiry system send inquiry request it
Before, video data is obtained, the video data includes recommended amounts, playback volume, comment amount and the powder amount that rises of each video;
Memory module, for the video data to be stored in default hive table;
Generation module, for generating done file;
Module is checked, for checking the done file;
Import modul, for constructing cube according to the hive table and the video data being imported institute according to hive table
State druid, wherein the cube stores the video data for the kylin.
Optionally, the inquiry request further includes time range mark;
Described device further include:
Statistical module, in the query result for returning to first inquiry system as query result, or will be described
After the query result that second inquiry system returns is as query result, the time range is identified in corresponding time range
Target query data counted, obtain the statistical data in the time range, the target query data are described
Data in query result.
Optionally, described device further include:
Second determining module, for determining information to be packaged, the information to be packaged includes user's name;
Composite module obtains data splitting for combining the query result and the information to be packaged;
Feedback module, for the data splitting to be fed back to the corresponding user of the user identifier.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, including processor, communication interface, memory and
Communication bus, wherein the processor, the communication interface, the memory are completed each other by the communication bus
Communication;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes method described in first aspect
Step.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable
Instruction is stored in storage medium, when run on a computer, so that computer executes the step of method described in first aspect
Suddenly.
At the another aspect that the present invention is implemented, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced
Product, when run on a computer, so that computer executes method and step described in first aspect.
Data query method, apparatus provided in an embodiment of the present invention and electronic equipment, can be simultaneously from the first inquiry system
Video data is searched with the second inquiry system, if when receiving the query result of the first inquiry system return at the first time, it will
The query result that first inquiry system returns is as query result;Alternatively, being returned receiving the second inquiry system at the first time
Query result when, using the second inquiry system return query result be used as query result, so, it is possible raising inquiry velocity.
Certainly, it implements any of the products of the present invention or method must be not necessarily required to reach all the above advantage simultaneously.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described.
Fig. 1 is the flow chart of data query method provided in an embodiment of the present invention;
Fig. 2 is the flow chart that video data is stored in the embodiment of the present invention;
Fig. 3 is the flow chart of specific embodiment provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of data query device provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is described.
After user's uploaded videos, the demand for the case where knowing about oneself uploaded videos.Such as to each video passed thereon,
It checks daily video data, or checks playback volume, etc. of the video at any time in range.
In existing inquiry mode, inquired by a kind of inquiry system kylin (kylin), in this way, when being inquired
The influence of the resource of the inquiry system etc., so that in some cases, inquiry duration is longer.In order to reduce inquiry time-consuming, this hair
Bright embodiment provides a kind of querying method of competition mechanism, by saving video data to two even more than inquiry system
In, in this way, when receiving inquiry request, while the corresponding video of inquiry request is searched from two or more inquiry systems
The video data preferentially found from the inquiry system of one of them is determined as target query data, so, it is possible by data
Improve inquiry velocity.In addition, in the embodiment of the present invention, when one of inquiry system is unavailable, can from another or
Inquired during person is multiple, can to avoid in existing inquiry mode pass through a kind of kylin inquiry when, made if kylin is unavailable
At the case where can not inquiring.
The scheme provided in order to illustrate the embodiments of the present invention more clearly, first below to number provided in an embodiment of the present invention
It is described in detail according to querying method.Data query method provided in an embodiment of the present invention can be applied to server.
The embodiment of the invention provides a kind of data query methods, as shown in Figure 1, may include:
S101, while inquiry request is sent to the first inquiry system and the second inquiry system respectively;So that the first inquiry system
System and the second inquiry system return to look into corresponding with the user identifier for including in inquiry request when being respectively received inquiry request
Ask result.
Wherein, the first inquiry system and the second inquiry system are stored with identical storing data;First inquiry system is Qi
Unicorn kylin;Second inquiry system is moral Shandong according to druid.
Inquiry request may include user identifier.Such as User ID (identification, identity), user's name etc..
Inquiry request is the video data for inquiring the video about user, which can be the video of user's upload
Deng.Video data may include recommended amounts, playback volume, comment amount and/or the powder amount etc. that rises.
User can send inquiry request to server by accession page, ask in this way, server can receive inquiry
It asks.
The video data for saving user and user is respectively corresponded in first inquiry system and the second inquiry system.Such as
In one inquiry system or the second inquiry system, the video data of each user saves in one file respectively;Or first
In inquiry system or the second inquiry system, the video data of all users is all saved in one file, can be in this document
Including multiple subfiles, the video data correspondence of each user is stored in a subfile.In this way, can be according to user identifier
Corresponding file or subfile are searched, to obtain the corresponding video data of user identifier.
After first inquiry system and the second inquiry system are respectively received inquiry request, search that the inquiry request is corresponding to be looked into
It askes as a result, searching the corresponding video data of user identifier for including in inquiry request, and after finding query result, will look into
It askes result and returns to the server etc. for sending inquiry request.
S102 returns to the first inquiry system when receiving the query result of the first inquiry system return at the first time
Query result as query result;Alternatively, when receiving the query result of the second inquiry system return at the first time, by the
The query result that two inquiry systems return is as query result.
Different inquiry systems is influenced by inquiry mode, query resource etc., so that the inquiry of different inquiry systems
Performance is different, i.e. the speed of the first inquiry system and the second inquiry system return query result is different.Different inquiry systems exist
Different time, inquiry velocity mutual speed, such as at time point 1, the first inquiry system inquiry velocity is very fast, then when time point 1,
Using the query result found from the first inquiry system as query result.And when time point 2, the inquiry of the second inquiry system
Fast speed, then when time point 2, using the query result found from the second inquiry system as query result.
In the embodiment of the present invention, kylin is complete precomputation engine, by enumerating the combination of all dimensions, is established each
Kind cube carries out premature polymerization, the OLAP (Online Analysis Process, on-line analytical processing) based on HBase
Engine.Druid is then the premature polymerization (roll-up) of lightweight, while improving inquiry effect according to inverted index and bitmap
The time series data and storage engines of rate.Kylin is not high to real time data demand, but response time higher inquiry, and
Dimension is more, and when the relatively fixed ad hoc inquiry of demand, inquiry velocity is very fast, and in this case, kylin returns to inquiry faster
Request corresponding query result.Druid is the high and response time to requirement of real-time is short and dimension is less and demand is fixed
When the inquiry for situations such as simple aggregation class is inquired, inquiry velocity is very fast, and in this case, druid returns to inquiry request faster
Corresponding query result.It so may be implemented, when receiving the query result of kylin return in the ban, this that kylin is returned is looked into
Result is ask as query result, when receiving the query result of druid return in the ban, the query result that druid is returned is made
For query result.
Video data to be checked, selection are searched from the first inquiry system and the second inquiry system simultaneously in the embodiment of the present invention
The video data comparatively fast found from the first inquiry system or the second inquiry system is determined as target query data, target query
The data for including in data, that is, query result.It can be interpreted as in the embodiment of the present invention using competition mechanism, parallel query the
The video data preferentially found from the inquiry system of one of them is determined as mesh by one inquiry system and the second inquiry system
Mark inquiry data.
In the embodiment of the present invention, while video data is searched from the first inquiry system and the second inquiry system, if first
When time receives the query result of the first inquiry system return, the query result that the first inquiry system is returned is tied as inquiry
Fruit;Alternatively, when receiving the query result of the second inquiry system return at the first time, by the inquiry of the second inquiry system return
As a result it is used as query result, so, it is possible to improve inquiry velocity.
In a kind of optional embodiment, after getting the corresponding video data of user, video data can be fed back to
User, for example, can be by page presentation to user.
In a kind of optional embodiment of the embodiment of the present invention, what it is when user query is video counts in preset time range
According to when, from the first inquiry system or the second inquiry system obtain user video data after, can be to preset time model
Video data in enclosing is counted.
Specifically, inquiry request further includes time range mark.After step s 102, specifically it is being by the first inquiry
Unite return query result as query result, or using the second inquiry system return query result as query result after,
It can also include: that the target query data identified time range in corresponding time range count, obtain in time model
Interior statistical data is enclosed, target query data are the data in query result.
Wherein, preset time range may include in any time range, such as 1 week, in 2 weeks, in 1 month, in 2 months
Deng.Time range identifies the information that can be to discriminate between different time range, such as can be the number of time range.
In this way, when in the inquiry request that user sends including user identifier and time range identifies, it can be anti-to user
It presents the user and identifies the video data in corresponding time range in time range.
In a kind of optional embodiment, after step s 102, specifically in the inquiry knot for returning to the first inquiry system
Fruit as query result, or using the second inquiry system return query result as query result after, can also include:
Determine information to be packaged;Target query data and information to be packaged are combined, data splitting is obtained;And by number of combinations
According to feeding back to the corresponding user of user identifier.
Information to be packaged may include user's name and/or video name etc..Information to be packaged can also be referred to as
Title information (head information).
Alternatively, time range is identified the target in corresponding time range and is looked into after finding target query data
It askes data to be counted, obtains the statistical data in time range.The statistical data that statistics can be obtained and letter to be packaged
Breath combination, and the data feedback that combination is obtained is to user.
The data that so, it is possible to inquire user are more intuitive.
In a kind of optional embodiment, in order to which video counts can be obtained from the first inquiry system or the second inquiry system
According to storing video data into the first inquiry system and the second inquiry system.As shown in Fig. 2, provided in an embodiment of the present invention
Data query method can also include:
S201 obtains video data.
In the embodiment of the present invention, video counts that can daily on the day before preset time point or period obtaining user
According to, such as video data on the day before daily zero point obtains user.
The video of user may include one or more, such as tens even millions of.
Video data may include playback volume, recommended amounts, the powder amount that rises, comment amount, average playing duration and/or finish playing
Degree etc..
When video data includes a plurality of types of video datas, in a kind of optional embodiment, different appoint can be passed through
Business, obtains different types of video data respectively.In addition, the data source of the video data of each type is possible to be also not phase
With, in order to improve the speed of data acquisition, also avoid the influence of data acquisition between different type, the embodiment of the present invention can be with
The video data of each type is obtained parallel.
Video data is stored in default hive table, and generates done file by S202.
Wherein, done file is used to indicate video data to be stored and is all stored in hive table.
S203 checks done file, and constructs cube according to hive table and imported video data according to hive table
druid。
Wherein, cube stores video data for kylin.
Building cube may include: full dose building, incremental build, streaming building.Wherein, a kind of more commonly used mode is
Incremental build, incremental build can make cube only construct the data for increasing part in hive table newly every time, rather than total data, such as
This, can reduce construction cost.
Video data can be taken in real time, and importeding into after druid can look into immediately.Specifically, importing druid may include reality
When import and batch imports, can be using batch importing in a kind of optional implementation of the embodiment of the present invention by the way of.Specifically
Ground importing process is as follows: (1) according to the hive table of video data generate comma separated value (Comma-Separated Values,
Csv) file and distributed file system (Hadoop Distributed File System, hdfs) is uploaded to.(2) it constructs
The schema of druid data, schema can be understood as the set of database object, specifically can be json file, can be with
Specifying information including druid datasource (database connection pool), the path etc. including csv file in above-mentioned steps.
(3) index task (interface for calling druid) is constructed, to import data.
The video data stored into kylin and druid is consistent.The video data for the user that will be got is simultaneously
Import two kinds of storage systems.
The embodiment of the present invention is not restricted to storing to the mode of kylin and druid, arbitrarily may be implemented to store data
To kylin and druid mode in the protection scope of the embodiment of the present invention.
The embodiment of the invention also provides a specific embodiments, as shown in Figure 3, comprising:
S301, user send inquiry request to server by page request.
S302, server inquire kylin and druid after receiving inquiry request, i.e. parallel trigger kylin and
druid.It specifically, may include step S3021 and S3022, wherein S3021 inquires kylin;S3022 inquires druid.
In order to make server after receiving inquiry request, it is corresponding that the inquiry request can be searched from kylin and druid
Query result, server in advance will each video video data deposit kylin and druid in.Specifically, server is preparatory
Obtain user video data, such as each user each video recommended amounts, playback volume, comment amount and/or the powder amount that rises.So
The video data that will acquire afterwards is stored respectively to kylin and druid, and specifically storing process has carried out in the above-described embodiments
It is described in detail, here just repeats no more.In this way, can be inquired from kylin and druid in video data to be checked.
S303, judges whether kylin first returns to the corresponding video data of inquiry request, if kylin first returns to video data,
It is also understood that preferentially finding the corresponding video data of inquiry request from kylin, S304 is thened follow the steps;If kylin does not have
There are first returned data, i.e. expression druid elder generation returned data, while it is to be understood that preferentially finding inquiry request pair from druid
The video data answered, thens follow the steps S305.
S304, the video data returned using kylin, i.e., will find the corresponding video data of inquiry request from kylin
As target query data.
S305, the video data returned using druid, i.e., will find the corresponding video data of inquiry request from druid
As target query data.
S306 assembles information.
Specifically, the information such as user's name, video name and target query data assembling can be got up.
In addition, when user query be video data in preset time range when, from kylin or druid
After the video data for obtaining user, the video data in preset time range is counted.Specifically, inquiry request further includes
Time range mark.It can also include: that time range is identified into corresponding time range after finding target query data
Interior target query data are counted, and the statistical data in time range is obtained.
The information such as statistical data and user's name, video name are assembled.
S307 returns to assembling data.
By the data feedback after assembling to user.
In this way, terminating whole flow process.
In the embodiment of the present invention, the video data of user is stored into kylin and druid simultaneously, guarantee there are two parts of phases
Same data can be looked into.Kylin and druid is when inquiring data within the scope of any time, inquiry velocity mutual speed, and the present invention is real
The data query that competition mechanism is used in example is applied, when user selects some querying condition, such as sending to server includes inquiry
The inquiry request of condition, server concurrently inquire kylin and druid, if kylin first returns to video data, use kylin's
Video data, video data that is on the contrary then using druid.It so, it is possible to reduce inquiry time-consuming, improve page response speed, mention
Rise user experience.
In addition, if can also be can be used using another when kylin or druid is one of unstable or unavailable
Inquiry, avoid using a kind of inquiry system inquire when, once inquiry system is unavailable, cause entire data query unavailable,
It cannot respond to user's request.
The embodiment of the invention provides a kind of data query devices, as shown in Figure 4, comprising:
Sending module 401, for sending inquiry request to the first inquiry system and the second inquiry system respectively simultaneously;So that
First inquiry system and the second inquiry system are returned and are marked with the user for including in inquiry request when being respectively received inquiry request
Know corresponding query result;Wherein, the first inquiry system and the second inquiry system are stored with identical storing data;First inquiry
System is kylin kylin;Second inquiry system is moral Shandong according to druid;
First determining module 402, for when receiving the query result of the first inquiry system return at the first time, by the
The query result that one inquiry system returns is as query result;Alternatively, receiving the return of the second inquiry system at the first time
When query result, the query result that the second inquiry system is returned is as query result.
In the embodiment of the present invention, video data can be searched from the first inquiry system and the second inquiry system simultaneously, if
When receiving the query result of the first inquiry system return at the first time, the query result that the first inquiry system is returned is as looking into
Ask result;Alternatively, the second inquiry system is returned when receiving the query result of the second inquiry system return at the first time
Query result so, it is possible to improve inquiry velocity as query result.
Optionally, the device further include:
Module is obtained, for obtaining before sending inquiry request to the first inquiry system and the second inquiry system respectively simultaneously
Video data is taken, video data includes recommended amounts, playback volume, comment amount and the powder amount that rises of each video;
Memory module, for video data to be stored in default hive table;
Generation module, for generating done file;
Module is checked, for checking done file;
Import modul, for constructing cube according to hive table and video data being imported druid according to hive table,
In, cube stores video data for kylin.
Optionally, inquiry request further includes time range mark;
The device further include:
Statistical module, for being inquired in the query result for returning to the first inquiry system as query result, or by second
After the query result that system returns is as query result, time range is identified to the target query number in corresponding time range
According to being counted, the statistical data in time range is obtained, target query data are the data in query result.
Optionally, the device further include:
Second determining module, for determining that information to be packaged, information to be packaged include user's name;
Composite module obtains data splitting for combining query result and information to be packaged;
Feedback module, for data splitting to be fed back to the corresponding user of user identifier.
It should be noted that data query device provided in an embodiment of the present invention is the dress using above-mentioned data query method
It sets, then all embodiments of above-mentioned data query method are suitable for the device, and can reach the same or similar beneficial to effect
Fruit.
The embodiment of the invention also provides a kind of electronic equipment, as shown in figure 5, include processor 501, communication interface 502,
Memory 503 and communication bus 504, wherein processor 501, communication interface 502, memory 503 are complete by communication bus 504
At mutual communication.
Memory 503, for storing computer program;
Processor 501 when for executing the program stored on memory 503, realizes the side of above-mentioned data query method
Method step.
In the embodiment of the present invention, video data can be searched from the first inquiry system and the second inquiry system simultaneously, if
When receiving the query result of the first inquiry system return at the first time, the query result that the first inquiry system is returned is as looking into
Ask result;Alternatively, the second inquiry system is returned when receiving the query result of the second inquiry system return at the first time
Query result so, it is possible to improve inquiry velocity as query result.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..
Only to be indicated with a thick line in figure, it is not intended that an only bus or a type of bus convenient for indicating.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, abbreviation RAM), also may include
Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor
(Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific
Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array,
Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
In another embodiment provided by the invention, a kind of computer readable storage medium is additionally provided, which can
It reads to be stored with instruction in storage medium, when run on a computer, so that computer executes above-mentioned data query method
Method and step.
In the embodiment of the present invention, video data can be searched from the first inquiry system and the second inquiry system simultaneously, if
When receiving the query result of the first inquiry system return at the first time, the query result that the first inquiry system is returned is as looking into
Ask result;Alternatively, the second inquiry system is returned when receiving the query result of the second inquiry system return at the first time
Query result so, it is possible to improve inquiry velocity as query result.
In another embodiment provided by the invention, a kind of computer program product comprising instruction is additionally provided, when it
When running on computers, so that computer executes the method and step of above-mentioned data query method.
In the embodiment of the present invention, video data can be searched from the first inquiry system and the second inquiry system simultaneously, if
When receiving the query result of the first inquiry system return at the first time, the query result that the first inquiry system is returned is as looking into
Ask result;Alternatively, the second inquiry system is returned when receiving the query result of the second inquiry system return at the first time
Query result so, it is possible to improve inquiry velocity as query result.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or
It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or
Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or
It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with
It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk
Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device,
For electronic equipment, computer readable storage medium and computer program product embodiments, since it is substantially similar to method
Embodiment, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (9)
1. a kind of data query method characterized by comprising
Inquiry request is sent to the first inquiry system and the second inquiry system respectively simultaneously;So that first inquiry system and institute
The second inquiry system is stated when being respectively received the inquiry request, the user identifier pair for including in return and the inquiry request
The query result answered;Wherein, first inquiry system and second inquiry system are stored with identical storing data;It is described
First inquiry system is kylin kylin;Second inquiry system is moral Shandong according to druid;
When receiving the query result that first inquiry system returns at the first time, first inquiry system is returned
Query result is as query result;
Alternatively, when receiving the query result that second inquiry system returns at the first time, by second inquiry system
The query result of return is as query result.
2. the method according to claim 1, wherein described while being looked into respectively to the first inquiry system and second
Before inquiry system sends inquiry request, the method also includes:
Video data is obtained, the video data includes recommended amounts, playback volume, comment amount and the powder amount that rises of each video;
The video data is stored in default hive table, and generates done file;
It checks the done file, and cube is constructed according to the hive table and is imported the video data according to hive table
The druid, wherein the cube stores the video data for the kylin.
3. the method according to claim 1, wherein the inquiry request further includes time range mark;
In the query result for returning to first inquiry system as query result, or second inquiry system is returned
After query result is as query result, the method also includes:
The time range is identified the target query data in corresponding time range to count, is obtained in the time model
Interior statistical data is enclosed, the target query data are the data in the query result.
4. the method according to claim 1, wherein making in the query result for returning to first inquiry system
For query result, or after query result that second inquiry system is returned is as query result, the method also includes:
Determine information to be packaged, the information to be packaged includes user's name;
By the query result and the information combination to be packaged, data splitting is obtained;
The data splitting is fed back into the corresponding user of the user identifier.
5. a kind of data query device characterized by comprising
Sending module, for sending inquiry request to the first inquiry system and the second inquiry system respectively simultaneously;So that described
One inquiry system and second inquiry system are returned and are wrapped in the inquiry request when being respectively received the inquiry request
The corresponding query result of the user identifier included;Wherein, first inquiry system and second inquiry system are stored with identical
Storing data;First inquiry system is kylin kylin;Second inquiry system is moral Shandong according to druid;
First determining module will be described for when receiving the query result that first inquiry system returns at the first time
The query result that first inquiry system returns is as query result;Alternatively, receiving second inquiry system at the first time
When the query result of return, the query result that second inquiry system is returned is as query result.
6. device according to claim 5, which is characterized in that described device further include:
Module is obtained, before sending inquiry request to the first inquiry system and the second inquiry system respectively simultaneously for described in, is obtained
Video data is taken, the video data includes recommended amounts, playback volume, comment amount and the powder amount that rises of each video;
Memory module, for the video data to be stored in default hive table;
Generation module, for generating done file;
Module is checked, for checking the done file;
Import modul, for according to the hive table construct cube and according to hive table will the video data import described in
Druid, wherein the cube stores the video data for the kylin.
7. device according to claim 5, which is characterized in that the inquiry request further includes time range mark;
Described device further include:
Statistical module, in the query result for returning to first inquiry system as query result, or by described second
After the query result that inquiry system returns is as query result, the time range is identified into the mesh in corresponding time range
Mark inquiry data are counted, and obtain the statistical data in the time range, the target query data are the inquiries
As a result the data in.
8. device according to claim 5, which is characterized in that described device further include:
Second determining module, for determining information to be packaged, the information to be packaged includes user's name;
Composite module obtains data splitting for combining the query result and the information to be packaged;
Feedback module, for the data splitting to be fed back to the corresponding user of the user identifier.
9. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein described
Processor, the communication interface, the memory complete mutual communication by the communication bus;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes any side claim 1-4
Method step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910245145.0A CN109977259A (en) | 2019-03-28 | 2019-03-28 | A kind of data query method, apparatus and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910245145.0A CN109977259A (en) | 2019-03-28 | 2019-03-28 | A kind of data query method, apparatus and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109977259A true CN109977259A (en) | 2019-07-05 |
Family
ID=67081391
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910245145.0A Pending CN109977259A (en) | 2019-03-28 | 2019-03-28 | A kind of data query method, apparatus and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109977259A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112966031A (en) * | 2019-12-12 | 2021-06-15 | 北京奇艺世纪科技有限公司 | Data processing method and device, electronic equipment and computer readable storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020049756A1 (en) * | 2000-10-11 | 2002-04-25 | Microsoft Corporation | System and method for searching multiple disparate search engines |
CN101930472A (en) * | 2010-09-09 | 2010-12-29 | 南京中兴特种软件有限责任公司 | Parallel query method for distributed database |
CN102043834A (en) * | 2010-11-25 | 2011-05-04 | 北京搜狗科技发展有限公司 | Method for realizing searching by utilizing client and search client |
CN104750690A (en) * | 2013-12-25 | 2015-07-01 | 中国移动通信集团公司 | Query processing method, device and system |
US20160253417A1 (en) * | 2015-02-26 | 2016-09-01 | Cavium, Inc. | Apparatus and method for collecting responses to a plurality of parallel lookup queries from a flow of packets at a network switch |
CN108875042A (en) * | 2018-06-27 | 2018-11-23 | 中国农业银行股份有限公司 | A kind of mixing on-line analysing processing system and data query method |
US20190026335A1 (en) * | 2017-07-23 | 2019-01-24 | AtScale, Inc. | Query engine selection |
CN109299348A (en) * | 2018-11-28 | 2019-02-01 | 北京字节跳动网络技术有限公司 | A kind of data query method, apparatus, electronic equipment and storage medium |
-
2019
- 2019-03-28 CN CN201910245145.0A patent/CN109977259A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020049756A1 (en) * | 2000-10-11 | 2002-04-25 | Microsoft Corporation | System and method for searching multiple disparate search engines |
CN101930472A (en) * | 2010-09-09 | 2010-12-29 | 南京中兴特种软件有限责任公司 | Parallel query method for distributed database |
CN102043834A (en) * | 2010-11-25 | 2011-05-04 | 北京搜狗科技发展有限公司 | Method for realizing searching by utilizing client and search client |
CN104750690A (en) * | 2013-12-25 | 2015-07-01 | 中国移动通信集团公司 | Query processing method, device and system |
US20160253417A1 (en) * | 2015-02-26 | 2016-09-01 | Cavium, Inc. | Apparatus and method for collecting responses to a plurality of parallel lookup queries from a flow of packets at a network switch |
US20190026335A1 (en) * | 2017-07-23 | 2019-01-24 | AtScale, Inc. | Query engine selection |
CN108875042A (en) * | 2018-06-27 | 2018-11-23 | 中国农业银行股份有限公司 | A kind of mixing on-line analysing processing system and data query method |
CN109299348A (en) * | 2018-11-28 | 2019-02-01 | 北京字节跳动网络技术有限公司 | A kind of data query method, apparatus, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
连城: "大数据预聚合OLAP技术及应用场景探究", 《无线互联科技》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112966031A (en) * | 2019-12-12 | 2021-06-15 | 北京奇艺世纪科技有限公司 | Data processing method and device, electronic equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10868711B2 (en) | Actionable alert messaging network for automated incident resolution | |
CN108153670B (en) | Interface testing method and device and electronic equipment | |
JP6521973B2 (en) | Pattern matching across multiple input data streams | |
US20190295187A1 (en) | Calculating expertise confidence based on content and social proximity | |
US10489842B2 (en) | Large-scale recommendations for a dynamic inventory | |
CN111639078A (en) | Data query method and device, electronic equipment and readable storage medium | |
JP5916959B2 (en) | Dynamic data acquisition method and system | |
CN102411591A (en) | Method and equipment for processing information | |
CN105468764B (en) | A kind of data processing method, device and cluster service system | |
CN109063158B (en) | Method, device, system and medium for inquiring website access ranking information | |
US10346763B2 (en) | Dynamic query response with metadata | |
US20170185454A1 (en) | Method and Electronic Device for Determining Resource Consumption of Task | |
CN104243598A (en) | Information recommendation method and device | |
CN107480268A (en) | Data query method and device | |
CN109977135A (en) | A kind of data query method, apparatus and server | |
CN110209700A (en) | A kind of data stream association method, apparatus, electronic equipment and storage medium | |
CN108154024A (en) | A kind of data retrieval method, device and electronic equipment | |
CN109816410A (en) | The analysis method and device of advertisement major product audience | |
US20170331909A1 (en) | System and method of monitoring and tracking online source content and/or determining content influencers | |
CN109075987A (en) | Optimize digital assembly analysis system | |
CN110380890A (en) | A kind of CDN system service quality detection method and system | |
US10733244B2 (en) | Data retrieval system | |
CN109977259A (en) | A kind of data query method, apparatus and electronic equipment | |
CN109544207A (en) | A kind of information processing method, storage medium and server | |
CN110943876A (en) | URL state detection method, device, equipment and system |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190705 |
|
RJ01 | Rejection of invention patent application after publication |