CN105574010A - Data querying method and device - Google Patents

Data querying method and device Download PDF

Info

Publication number
CN105574010A
CN105574010A CN201410536424.XA CN201410536424A CN105574010A CN 105574010 A CN105574010 A CN 105574010A CN 201410536424 A CN201410536424 A CN 201410536424A CN 105574010 A CN105574010 A CN 105574010A
Authority
CN
China
Prior art keywords
data
application server
database
data bus
actuator
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.)
Granted
Application number
CN201410536424.XA
Other languages
Chinese (zh)
Other versions
CN105574010B (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410536424.XA priority Critical patent/CN105574010B/en
Publication of CN105574010A publication Critical patent/CN105574010A/en
Application granted granted Critical
Publication of CN105574010B publication Critical patent/CN105574010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a data querying method and device. The method comprises the following steps: receiving a data querying request sent by an application server through a data bus, wherein data querying condition information is carried in the querying request; querying corresponding first data in a memory cache according to the data querying condition information through the data bus; if the first data is queried by the data bus, sending the first data to the application sever; and if the first data is not queried by the data bus, sending the data querying request to an actuator and querying the first data in a database according to the data querying condition information through the actuator. The data querying method and device provided by the invention has the advantages that a data bus is additionally arranged in a distributed database system, so that the distributed cache is increased, the consumption of data source linking number is reduced and the query performance of the application server is improved.

Description

Data enquire method and device
Technical field
The application relates to field of computer technology, particularly relates to a kind of data enquire method and device.
Background technology
Along with the develop rapidly of computer and network technologies, network access data scale increases increasingly.The mass data how process information explosion time generation produces, becomes problem demanding prompt solution.In traditional centralized data base system, application program is concentrated and is run on one computer, once this computing machine breaks down, then whole system is affected.In addition, centralized processing causes the scale of system and configures all underactions, and the expandability of system is poor.Visible, traditional centralized data base system cannot meet the application needs of large-scale data.
Distributed data base system grows up on the basis of centralized data base system, is the product that computer technology and network technology combine.Distributed data base is logically a unified entirety, is then be stored in respectively on different physical nodes physically.Application program by the connection of network can visiting distribution at the database of diverse location.The distributivity performance data in a database of distributed data base system are stored on the memory device of different computing machines, and user can be connected to by network and wherein any computing machine perform global application.The reliability of distributed data base system is high, and when in system, a certain computing machine breaks down, system can operate the identical copies on another computing machine, can not cause the paralysis of whole system because of place's fault.And distributed data base system can be selected to operate from the data trnascription that user is nearest according to distance, reduces communication cost, improves the performance of whole system.
But, distributed data base system in use, data in database are stored on the memory device of different computing machines, therefore application server is needed to be connected with multiple database, there is the problem of application server and database link number deficiency, causing user inefficiency or appearance exception when carrying out query manipulation.In prior art, database is split, or introduce memory cache, still can not solve the problem of data source link number deficiency.
Summary of the invention
The object of this invention is to provide a kind of data enquire method and device, to solve the problem of data source link number deficiency in large-scale distributed Database Systems.
First aspect, provides a kind of data enquire method, and described method comprises:
Data bus receives the data inquiry request that application server sends, and described inquiry request carries data query conditions information;
Described data bus inquires about the first corresponding data according to described querying condition information in memory cache;
If described data bus inquires described first data, then described first data are sent to described application server;
If described data bus does not inquire described first data, then described data inquiry request is sent to actuator, inquire about described first data for described actuator in a database according to described data query conditions information.
Second aspect, provides a kind of data query arrangement, and described device comprises:
Receiving element, receive the data inquiry request of application server transmission for data bus, described inquiry request carries data query conditions information;
First query unit, inquires about the first corresponding data for described data bus according to described querying condition information in memory cache;
Judging unit, for judging whether described data bus inquires described first data in memory cache.
Described first data for inquiring described first data when described data bus, are then sent to described application server by the first transmitting element;
Second transmitting element, for not inquiring described first data when described data bus, then sends to actuator by described data inquiry request;
Second query unit, inquires about described first data for described actuator in a database according to described data query conditions information.
The data enquire method that the application provides and device, by increasing the setting of data bus in distributed data base system, thus add distributed caching, through the forwarding of data bus, reduce the consumption of data source link number, improve the query performance of application server.
Accompanying drawing explanation
The data enquire method process flow diagram that Fig. 1 provides for the embodiment of the present application one;
Fig. 2 is single database mode profile formula Database Systems schematic diagram in prior art;
Fig. 3 is multiple database mode profile formula Database Systems schematic diagram in prior art;
Fig. 4 introduces distributed data base system schematic diagram after memory cache in prior art;
The distributed data base system schematic diagram that Fig. 5 provides for the embodiment of the present application one;
The data query arrangement schematic diagram that Fig. 6 provides for the embodiment of the present application two.
Embodiment
For making the object of the embodiment of the present application, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present application, technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment is some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making the every other embodiment obtained under creative work prerequisite, all belong to the scope of the application's protection.
The data enquire method that the embodiment of the present application provides and device, first application server sends data inquiry request to data bus, data bus is inquired about in memory cache according to querying condition information, if data bus does not inquire the Query Result meeting querying condition, then data inquiry request is sent to actuator, actuator is inquired about in a database according to data query conditions information.The present invention adds the setting of data bus in distributed data base system, through the forwarding of data bus, decreases the link number of application server and database, improves search efficiency.
Embodiment one
The data enquire method process flow diagram that Fig. 1 provides for the embodiment of the present application one.Described method specifically comprises:
Step 101, data bus receives the data inquiry request that application server sends, and described inquiry request carries data query conditions information.
The network environment that method in the present invention is run can be, but not limited to the distributed data base system under cloud computing environment.
In prior art distributed data base system, application server is directly connected with database, and single database mode profile formula Database Systems schematic diagram as shown in Figure 2.The link number of single database and the link of N platform application server is M × N.
In order to reduce link number, split database, database defines multiple database pattern database system after splitting, as shown in Figure 3.After single database splits into i database, total links total number of N platform application server and i database link is M × N × i, does not solve the problem of data source link number deficiency.
Even if introducing memory cache, because memory cache cannot send to application server feedback information, application server still needs to link with database, the links total number of N platform application server and i database link or M × N × i, the problem of data source link number deficiency can not be solved, as shown in Figure 4.
In order to solve the problem of data source link number deficiency, the present invention introduces data bus in distributed data base system, data bus in the present invention comprises memory cache and SQL (StructuredQueryLanguage, Structured Query Language (SQL)) actuator.Owing to introducing Q bar data bus, the links total number of N platform application server and i database link is Q × i (Q<M × N), decreases the consumption of database link number.As shown in Figure 5.
Described application server is upper-layer service system, for the treatment of the business that the demand of user is relevant.As, user accesses shopping website, and search meets the merchandise news etc. of certain condition.
Described data query conditions information is the condition of upper-layer service combination in any, as, user wants purchase price at the woollen overcoat of Ms's black of 1000 ~ 2000 yuans, search key can be " Ms "+" black "+" woollen cloth "+" overcoat "+" 1000 ~ 2000 yuan ", if want to expand hunting zone, can choose above partial key and carry out combination in any, the merchandise news so meeting above combination condition is searched to feeding back to user.
In the present embodiment, application server sends to described data bus by SQL the described data inquiry request carrying querying condition information.Data bus gathers the SQL query request of upper-layer service system, through the forwarding of described data bus, effectively can reduce the use of database link number.
Step 102, described data bus inquires about the first corresponding data according to described querying condition information in memory cache.
Be specially, described data bus accesses the query interface of described memory cache according to major key, and in described memory cache, inquiry meets the data of querying condition, and described first data are the data meeting querying condition.
Step 103, judges whether there are described first data in described memory cache.
Be specially, if described data bus inquires the data satisfied condition in memory cache, then continue to perform step 106, meeting the data feedback of querying condition to application server, using for upper-layer service system.Otherwise, perform step 104.
Step 104, described data bus does not inquire described first data, and described data inquiry request is sent to actuator.
If described data bus does not inquire the information meeting querying condition in memory cache, then described data inquiry request is sent to actuator, trigger actuator, continue to perform step 105.
Described actuator is SQL actuator, utilizes SOL to carry out query manipulation to database.
Step 105, described actuator inquires about described first data in a database according to described data query conditions information.
Be specially, described actuator is inquired about in a database according to described data query conditions Information Pull SQL.
Described database is mysql database, uses SQL accessing database.SQL actuator obtains inquiring about table name from inquiry request SQL, selects database, inquire about the data satisfied condition according to inquiry table name.
Described first data are sent to described application server by step 106.
If described data bus inquires the data satisfied condition in described memory cache, then described first data are sent to application server by data bus, meet upper-layer service system and use needs.
If described actuator inquires the data satisfied condition in a database, then the first data are sent to application server by actuator, meanwhile, are stored in memory cache by the data meeting described querying condition, upgrade buffer memory, are convenient to next user and search needs.
The data enquire method that the embodiment of the present application provides, first application server sends data inquiry request to data bus, data bus is inquired about in memory cache according to querying condition information, if data bus does not inquire the Query Result meeting querying condition, then data inquiry request is sent to actuator, actuator is inquired about in a database according to data query conditions information.The present invention adds the setting of data bus in distributed data base system, thus adds distributed caching, through the forwarding of data bus, reduces the consumption of data source link number, improves the query performance of application server.
Embodiment two
With above-mentioned data enquire method accordingly, a kind of data query arrangement that the embodiment of the present application also provides, the device schematic diagram that Fig. 3 provides for the embodiment of the present application two, this device comprises: receiving element 201, first query unit 202, judging unit 203, first transmitting element 204, second transmitting element 205, second query unit 206 and storage unit 207.
Described receiving element 201, receive the data inquiry request of application server transmission for data bus, described inquiry request carries data query conditions information.
Described first query unit 202, inquires about the first corresponding data for described data bus according to described querying condition information in memory cache.
Described judging unit 203, for judging whether described data bus inquires described first data in memory cache.
Described first data for inquiring described first data when described data bus, are then sent to described application server by described first transmitting element 204.
Described second transmitting element 205, for not inquiring described first data when described data bus, then sends to actuator by described data inquiry request.
Described second query unit 206, inquires about described first data for described actuator in a database according to described data query conditions information.
Described device also comprises storage unit 207, for described first data inquired are sent to described application server, and described first data is stored in described memory cache.
The device that the embodiment of the present application two provides implants the method that the embodiment of the present application one provides, and therefore, the specific works process of the device that the application provides, does not repeat again at this.
The data query arrangement that the embodiment of the present application provides, first application server sends data inquiry request to data bus, data bus is inquired about in memory cache according to querying condition information, if data bus does not inquire the Query Result meeting querying condition, then data inquiry request is sent to actuator, actuator is inquired about in a database according to data query conditions information.The present invention adds the setting of data bus in distributed data base system, thus adds distributed caching, through the forwarding of data bus, reduces the consumption of data source link number, improves the query performance of application server.
Professional should recognize further, in conjunction with object and the algorithm steps of each example of embodiment disclosed herein description, can realize with electronic hardware, computer software or the combination of the two, in order to the interchangeability of hardware and software is clearly described, generally describe composition and the step of each example in the above description according to function.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not think the scope exceeding the application.
The software module that the method described in conjunction with embodiment disclosed herein or the step of algorithm can use hardware, processor to perform, or the combination of the two is implemented.Software module can be placed in the storage medium of other form any known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
Above-described embodiment; the object of the application, technical scheme and beneficial effect are further described; be understood that; the foregoing is only the embodiment of the application; and be not used in the protection domain limiting the application; within all spirit in the application and principle, any amendment made, equivalent replacement, improvement etc., within the protection domain that all should be included in the application.

Claims (12)

1. a data enquire method, is characterized in that, described method comprises:
Data bus receives the data inquiry request that application server sends, and described inquiry request carries data query conditions information;
Described data bus inquires about the first corresponding data according to described querying condition information in memory cache;
If described data bus inquires described first data, then described first data are sent to described application server;
If described data bus does not inquire described first data, then described data inquiry request is sent to actuator, inquire about described first data for described actuator in a database according to described data query conditions information.
2. method according to claim 1, it is characterized in that, described actuator is inquired about described first data in a database according to described data query conditions information and is specially, and described actuator utilizes Structured Query Language (SQL) to inquire about described first data according to described data query conditions information in a database.
3. method according to claim 1, it is characterized in that, after described actuator inquires about described first data in a database according to described data query conditions information, also comprise: described first data inquired are sent to described application server, and described first data are stored in described memory cache.
4. method according to claim 1, is characterized in that, described data bus belongs to a data bus cluster, for increasing distributed caching.
5. method according to claim 1, is characterized in that, method according to claim 1, is characterized in that, described database belongs to a data-base cluster, for storing upper-layer service data message.
6. method according to claim 1, is characterized in that, described application server belongs to an application server cluster, for the treatment of upper-layer service.
7. a data query arrangement, is characterized in that, described device comprises:
Receiving element, receive the data inquiry request of application server transmission for data bus, described inquiry request carries data query conditions information;
First query unit, inquires about the first corresponding data for described data bus according to described querying condition information in memory cache;
Judging unit, for judging whether described data bus inquires described first data in memory cache.
Described first data for inquiring described first data when described data bus, are then sent to described application server by the first transmitting element;
Second transmitting element, for not inquiring described first data when described data bus, then sends to actuator by described data inquiry request;
Second query unit, inquires about described first data for described actuator in a database according to described data query conditions information.
8. device according to claim 7, it is characterized in that, described actuator is inquired about described first data in a database according to described data query conditions information and is specially, and described actuator utilizes Structured Query Language (SQL) to inquire about described first data according to described data query conditions information in a database.
9. device according to claim 7, is characterized in that, also comprises: storage unit, for described first data inquired are sent to described application server, and described first data is stored in described memory cache.
10. device according to claim 7, is characterized in that, described data bus belongs to a data bus cluster, for increasing distributed caching.
11. devices according to claim 7, is characterized in that, method according to claim 1, is characterized in that, described database belongs to a data-base cluster, for storing upper-layer service data message.
12. devices according to claim 7, is characterized in that, described application server belongs to an application server cluster, for the treatment of upper-layer service.
CN201410536424.XA 2014-10-13 2014-10-13 Data query method and device Active CN105574010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410536424.XA CN105574010B (en) 2014-10-13 2014-10-13 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410536424.XA CN105574010B (en) 2014-10-13 2014-10-13 Data query method and device

Publications (2)

Publication Number Publication Date
CN105574010A true CN105574010A (en) 2016-05-11
CN105574010B CN105574010B (en) 2020-06-02

Family

ID=55884157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410536424.XA Active CN105574010B (en) 2014-10-13 2014-10-13 Data query method and device

Country Status (1)

Country Link
CN (1) CN105574010B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239570A (en) * 2017-06-27 2017-10-10 联想(北京)有限公司 Data processing method and server cluster
CN107832401A (en) * 2017-11-01 2018-03-23 郑州云海信息技术有限公司 Database data access method, system, device and computer-readable recording medium
CN108777718A (en) * 2018-06-22 2018-11-09 阿里巴巴集团控股有限公司 A kind of operation system passes through client and accesses reads the method and apparatus for writing few system more
CN109933585A (en) * 2019-02-22 2019-06-25 京东数字科技控股有限公司 Data query method and data query system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081624A (en) * 2009-11-30 2011-06-01 中国移动通信集团北京有限公司 Data inquiring method and data inquiring server
US20120239681A1 (en) * 2011-03-14 2012-09-20 Splunk Inc. Scalable interactive display of distributed data
CN103064960A (en) * 2012-12-31 2013-04-24 华为技术有限公司 Method and equipment for database query
CN103365929A (en) * 2012-04-10 2013-10-23 阿里巴巴集团控股有限公司 Management method and management system of database connection
CN103441861A (en) * 2013-07-16 2013-12-11 杭州华为数字技术有限公司 Method and device for generating data records

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081624A (en) * 2009-11-30 2011-06-01 中国移动通信集团北京有限公司 Data inquiring method and data inquiring server
US20120239681A1 (en) * 2011-03-14 2012-09-20 Splunk Inc. Scalable interactive display of distributed data
CN103365929A (en) * 2012-04-10 2013-10-23 阿里巴巴集团控股有限公司 Management method and management system of database connection
CN103064960A (en) * 2012-12-31 2013-04-24 华为技术有限公司 Method and equipment for database query
CN103441861A (en) * 2013-07-16 2013-12-11 杭州华为数字技术有限公司 Method and device for generating data records

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239570A (en) * 2017-06-27 2017-10-10 联想(北京)有限公司 Data processing method and server cluster
CN107832401A (en) * 2017-11-01 2018-03-23 郑州云海信息技术有限公司 Database data access method, system, device and computer-readable recording medium
CN107832401B (en) * 2017-11-01 2021-07-16 郑州云海信息技术有限公司 Database data access method, system, device and computer readable storage medium
CN108777718A (en) * 2018-06-22 2018-11-09 阿里巴巴集团控股有限公司 A kind of operation system passes through client and accesses reads the method and apparatus for writing few system more
CN108777718B (en) * 2018-06-22 2021-03-23 创新先进技术有限公司 Method and device for accessing read-write-more-less system through client side by service system
CN109933585A (en) * 2019-02-22 2019-06-25 京东数字科技控股有限公司 Data query method and data query system
CN109933585B (en) * 2019-02-22 2021-11-02 京东数字科技控股有限公司 Data query method and data query system

Also Published As

Publication number Publication date
CN105574010B (en) 2020-06-02

Similar Documents

Publication Publication Date Title
Hu et al. Time-and cost-efficient task scheduling across geo-distributed data centers
US8838721B2 (en) File sharing system and file sharing method
CN103106249B (en) A kind of parallel data processing system based on Cassandra
US20200210496A1 (en) Distributed search method, index update method, system, server, and computer device
Amudhavel et al. Effective maintenance of replica in distributed network environment using DST
US8675518B2 (en) Message transport system using publication and subscription mechanisms
TWI671643B (en) Configuration change method, device and system
CN108566290A (en) service configuration management method, system, storage medium and server
TW202025685A (en) Cross-chain evidence preservation method and access method, apparatus, and electronic device
CN106326243B (en) Data processing method and device
CN103761102B (en) A kind of uniform data service platform and its implementation
CN111143382B (en) Data processing method, system and computer readable storage medium
CN105574010A (en) Data querying method and device
CN103218404A (en) Multi-dimensional metadata management method and system based on association characteristics
CN105812394A (en) Novel application of cloud computing to cross-border electronic commerce
CN103106585A (en) Real-time duplication eliminating method and device of product information
CN103823846A (en) Method for storing and querying big data on basis of graph theories
CN102999608A (en) System and method for tree table demonstration of large data
US20120221649A1 (en) Peer-to-peer collaboration of publishers in a publish-subscription environment
CN110737682A (en) cache operation method, device, storage medium and electronic equipment
CN113515545B (en) Data query method, device, system, electronic equipment and storage medium
CN102917009A (en) Method and system for collecting and storing stock data based on cloud computing technology
CN102982116A (en) Multi-media transfer method and system based on cloud
CN101808051A (en) Application integration gateway and control method thereof
CN110737747A (en) data operation method, device and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201010

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201010

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right