CN107622059A - A kind of method and system for improving database search efficiency - Google Patents

A kind of method and system for improving database search efficiency Download PDF

Info

Publication number
CN107622059A
CN107622059A CN201610551982.2A CN201610551982A CN107622059A CN 107622059 A CN107622059 A CN 107622059A CN 201610551982 A CN201610551982 A CN 201610551982A CN 107622059 A CN107622059 A CN 107622059A
Authority
CN
China
Prior art keywords
search
database
mysql
sphinx
redis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610551982.2A
Other languages
Chinese (zh)
Inventor
王申召
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TVM Beijing Technology Co Ltd
Original Assignee
TVM Beijing 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 TVM Beijing Technology Co Ltd filed Critical TVM Beijing Technology Co Ltd
Priority to CN201610551982.2A priority Critical patent/CN107622059A/en
Publication of CN107622059A publication Critical patent/CN107622059A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The invention discloses a kind of method and system for improving database search efficiency, this method includes:S101, set up a web site basic database using MySQL;S102, the synchronization map using Redis Database MySQL databases;S103, using Sphinx establish the search engine based on MySQL;Whether S104, inquiry have searching request, and S104 is returned if nothing;S105, Sphinx search engines are scanned for, S108 is turned to if having search result;S106, Redis databases are scanned for, S108 is turned to if having search result;S107, MySQL database is scanned for;S108, output search result, turn to S104.Technical solution of the present invention improves the speed of database information retrieval, reduces the cost of overall technical architecture, improves the efficiency of site search.

Description

A kind of method and system for improving database search efficiency
Technical field
The present invention relates to Internet technical field, more particularly to a kind of method and system for improving database search efficiency.
Background technology
Internet development is rapid, it has also become the important component of people's life and the important load of human civilization communication development Body, economic, politics, culture, social life various aspects are penetrated into, change the manner of intercourse and the mode of thinking of people.No matter It is that the change that internet gives people is huge either in social life field in industrial circle.
As the core of internet data record, database also penetrates into the various aspects of society, is widely developed And application.Database is the set for the related data got up according to certain structure and regular weaves, is from the overall point of view Establish, tissue, description and storage are carried out by certain data model.Its structure based on the associate naturally between data, so as to All necessary access paths are provided, and data are no longer directed to a certain application, but towards full tissue, there is overall structuring Feature.
Database be used for data storage and processing, storage be belong to enterprise, operating divisions, organization and individual it is relevant The set of data, it is the general data processing system of a unit or an application field.Data in database are for crowd Multi-user shares its information and established, and has had been extricated from the limitation and restriction of specific procedure.Different users can be by each From usage use database in data;Multiple users can simultaneously in shared data bank data resource, i.e., different use Family can access the same data in database simultaneously.Data sharing not only meets each user and the information content is wanted Ask, while also meet the requirement of each user-to-user information communication.
Database is important e-sourcing, is the information technology for adapting to internet development, has the characteristics that:
1), the data in the structured database of data are not disorderly and unsystematic, not theed least concerned, and they have certain Institutional framework, belonging to the data of identity set has similar feature.
2), data tool sharing.Between each department of a unit, there is substantial amounts of duplicate message.Use number Seek to be managed collectively these information according to the purpose in storehouse, reduce redundancy, each department is enjoyed identical data jointly.
3), the independence of data.The independence of data refers to the independence between data record and data management software.Data And its structure should have independence, without that should go to change application program.
4), the integrality of data.The integrality of data refers to the correctness for ensureing data in database.Data may be caused Incorrect reason is a lot, and data base management system is by being checked to manage them data character.
5), the flexibility of data.Data base management system is not that data are simply accumulated, its base in recording data information There is many management functions on plinth, such as input, export, inquire about, edit-modify.
6), the security of data.According to the responsibility of user, the people of different stage has different authorities to database, number The security of data is able to ensure that according to base management system.
With the extensive use of database technology, information content increases has reached unprecedented height with spread speed.Letter Ceasing the variation of the media types of issue makes the redundancy more and more higher of information, and the lifetime of information resources is shorter and shorter, gives people Door selection in the ocean of information obtains information and brought than difficulty bigger in the past.In information-intensive society, retrieval technique for Effective application of data is more and more important, is mainly reflected in:
1), information retrieval technique can quickly search required information.Efficient information retrieval technique can save the time And cost, required information is accurately and rapidly obtained, working efficiency is improved, accomplishes to get twice the result with half the effort, realize the effective of information resources Utilize.
2), efficient retrieval technology can systematically understand the accumulation of existing data in time, and it is newest dynamic to grasp business State and development trend, correct decision-making is made in good time, carried out work is obtained most fast, maximally effective progress.
3), efficient retrieval can hold newest information in time, promote continuing to bring out for new business and application.
4) science decision, is contributed to.With the high speed development of modern information technologies, the electronization of information resources, diversification And the networking of service condition has become reality.Either country, department or enterprise will all rely more heavily on data Etc. rapid exchange, propagation and the utilization of information.Intellectual technology has become the means of policies.Knowledge and information have become Science, democracy, the source of Rational Decision.And information retrieval then be obtain information important channel, be science decision necessity before Carry.
Existing database technology is due to by data structure, internal memory, I/O handling capacities, index, lock or deadlock etc. Factor have impact on recall precision, database can not fully meet query demand, reduce the search efficiency of website.
The content of the invention
The present invention provides a kind of method and system for improving database search efficiency, using mapping database and search of increasing income Engine performs searching service, improves the speed of information retrieval, reduces the cost of overall technical architecture, improves website and search The efficiency of rope, the demand of internet shopping Industry Quick Development is adapted to.
Technical scheme provides a kind of method for improving database search efficiency, comprises the following steps:
S101, set up a web site basic database using MySQL;
S102, the synchronization map using Redis Database MySQL databases;
S103, using Sphinx establish the search engine based on MySQL;
Whether S104, inquiry have searching request, and S104 is returned if nothing;
S105, Sphinx search engines are scanned for, S108 is turned to if having search result;
S106, Redis databases are scanned for, S108 is turned to if having search result;
S107, MySQL database is scanned for;
S108, output search result, turn to S104.
Further, the MySQL database not timing is updated.
Further, the MySQL database and Redis databases periodically synchronize renewal.
Further, the Sphinx search engines periodically synchronize renewal with MySQL database.
Further, the Sphinx search engines are stored and run in server memory.
Further, the search condition of the MySQL database, Redis databases and Sphinx search engines follows phase Same form.
Further, the search result of the MySQL database, Redis databases and Sphinx search engines follows phase Same matching principle and principle of ordering.
Technical scheme additionally provides a kind of system for improving database search efficiency, including:Administrative unit, MySQL database, Redis databases and search engine, wherein,
Administrative unit is used for the synchronized update for managing MySQL database, Redis databases and search engine, management search Task;
MySQL database, Redis databases and search engine are used for data storage and perform search mission.
Further, MySQL database, Redis databases and search engine periodically synchronize renewal.
Further, search engine is stored and run in server memory.
Technical solution of the present invention improves the speed of database information retrieval, reduces the cost of overall technical architecture, carries The high efficiency of site search, has adapted to the demand of internet shopping Industry Quick Development.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification Obtain it is clear that or being understood by implementing the present invention.The purpose of the present invention and other advantages can be by the explanations write Specifically noted structure is realized and obtained in book, claims and accompanying drawing.
Below by drawings and examples, technical scheme is described in further detail.
Brief description of the drawings
Accompanying drawing is used for providing a further understanding of the present invention, and a part for constitution instruction, the reality with the present invention Apply example to be used to explain the present invention together, be not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the method flow diagram that database search efficiency is improved in the embodiment of the present invention one;
Fig. 2 is the system construction drawing that database search efficiency is improved in the embodiment of the present invention one.
Embodiment
The preferred embodiments of the present invention are illustrated below in conjunction with accompanying drawing, it will be appreciated that described herein preferred real Apply example to be merely to illustrate and explain the present invention, be not intended to limit the present invention.
Fig. 1 is the method flow diagram that database search efficiency is improved in the embodiment of the present invention one.As shown in figure 1, the flow Comprise the following steps:
Step S101, set up a web site basic database using MySQL.
Database based on MySQL database;
According to the needs of content update, MySQL database not timing is updated.
Step S102, using the synchronization map of Redis Database MySQL databases.
According to the setting of system, MySQL database and Redis databases periodically synchronize renewal;
Redis databases and the search condition of MySQL database follow identical form.
Step S103, the search engine based on MySQL is established using Sphinx.
According to the setting of system, Sphinx search engines periodically synchronize renewal with MySQL database;
Sphinx search engines and the search condition of MySQL database follow identical form;
Sphinx search engines are stored and performed search operaqtion in server memory.
Step S104, whether inquiry has searching request, and S104 is returned if nothing.
Step S105, Sphinx search engines are scanned for, S108 is turned to if having search result.
Sphinx search engines and the search result of MySQL database follow identical matching principle and principle of ordering.
Step S106, Redis databases are scanned for, S108 is turned to if having search result.
Redis databases and the search result of MySQL database follow identical matching principle and principle of ordering.
Step S107, MySQL database is scanned for, S108 is turned to if having search result.
Step S108, search result is exported, turns to S104.
In order to realize above method flow, the present embodiment additionally provides a kind of system for improving database search efficiency, Fig. 2 To improve the system construction drawing of database search efficiency in the embodiment of the present invention one.As shown in Fig. 2 the system includes:Management is single Member 201, MySQL database 202, Redis databases 203 and search engine 204, wherein,
Administrative unit is used for the synchronized update for managing MySQL database, Redis databases and search engine, management search Task;
MySQL database, Redis databases and search engine are used for data storage and perform search mission;
According to the needs of content update, MySQL database not timing is updated;MySQL database, Redis databases Renewal is periodically synchronized with search engine.
Search engine is stored and run in server memory.
The search condition of MySQL database, Redis databases and search engine follows identical form;
The search result of MySQL database, Redis databases and search engine follows identical matching principle and sequence is former Then.
Technical solution of the present invention is using mapping database and increases income search engine to perform searching service, improves information inspection The speed of rope, the cost of overall technical architecture is reduced, improve the efficiency of site search, it is fast to have adapted to internet shopping industry The demand of speed development.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program Product.Therefore, the present invention can use complete hardware embodiment, complete software embodiment or the reality for combining soft w parts and hardware aspect Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more The shape for the computer program product that usable storage medium is implemented on (including but is not limited to magnetic disk storage and optical memory etc.) Formula.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (10)

  1. A kind of 1. method for improving database search efficiency, it is characterised in that comprise the following steps:
    S101, set up a web site basic database using MySQL;
    S102, the synchronization map using Redis Database MySQL databases;
    S103, using Sphinx establish the search engine based on MySQL;
    Whether S104, inquiry have searching request, and S104 is returned if nothing;
    S105, Sphinx search engines are scanned for, S108 is turned to if having search result;
    S106, Redis databases are scanned for, S108 is turned to if having search result;
    S107, MySQL database is scanned for;
    S108, output search result, turn to S104.
  2. 2. according to the method for claim 1, it is characterised in that the MySQL database not timing is updated.
  3. 3. according to the method for claim 1, it is characterised in that the MySQL database and Redis databases are periodically carried out Synchronized update.
  4. 4. according to the method for claim 1, it is characterised in that the Sphinx search engines and MySQL database are regular Synchronize renewal.
  5. 5. according to the method for claim 1, it is characterised in that the Sphinx search engines are carried out in server memory Storage and operation.
  6. 6. according to the method for claim 1, it is characterised in that the MySQL database, Redis databases and Sphinx The search condition of search engine follows identical form.
  7. 7. according to the method for claim 1, it is characterised in that the MySQL database, Redis databases and Sphinx The search result of search engine follows identical matching principle and principle of ordering.
  8. 8. a kind of system for improving database search efficiency, it is characterised in that including administrative unit, MySQL database, Redis Database and search engine, wherein,
    Administrative unit is used for the synchronized update for managing MySQL database, Redis databases and search engine, manages search mission;
    MySQL database, Redis databases and search engine are used for data storage and perform search mission.
  9. 9. system according to claim 8, it is characterised in that MySQL database, Redis databases and search engine are determined Phase synchronizes renewal.
  10. 10. system according to claim 8, it is characterised in that search engine is stored and run in server memory.
CN201610551982.2A 2016-07-13 2016-07-13 A kind of method and system for improving database search efficiency Pending CN107622059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610551982.2A CN107622059A (en) 2016-07-13 2016-07-13 A kind of method and system for improving database search efficiency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610551982.2A CN107622059A (en) 2016-07-13 2016-07-13 A kind of method and system for improving database search efficiency

Publications (1)

Publication Number Publication Date
CN107622059A true CN107622059A (en) 2018-01-23

Family

ID=61087163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610551982.2A Pending CN107622059A (en) 2016-07-13 2016-07-13 A kind of method and system for improving database search efficiency

Country Status (1)

Country Link
CN (1) CN107622059A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033253A (en) * 2018-07-06 2018-12-18 中国电力财务有限公司 Data integrating method and device
CN109299157A (en) * 2018-08-27 2019-02-01 杭州安恒信息技术股份有限公司 A kind of data export method and device of distributed big single table
CN109739887A (en) * 2018-12-21 2019-05-10 平安科技(深圳)有限公司 Synchronous task searching method, system, device and readable storage medium storing program for executing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902730A (en) * 2012-09-10 2013-01-30 新浪网技术(中国)有限公司 Method and device for reading data based on data cache
CN105243147A (en) * 2015-10-22 2016-01-13 浪潮(北京)电子信息产业有限公司 Slow query log management method and system of MySQL database

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902730A (en) * 2012-09-10 2013-01-30 新浪网技术(中国)有限公司 Method and device for reading data based on data cache
CN105243147A (en) * 2015-10-22 2016-01-13 浪潮(北京)电子信息产业有限公司 Slow query log management method and system of MySQL database

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033253A (en) * 2018-07-06 2018-12-18 中国电力财务有限公司 Data integrating method and device
CN109299157A (en) * 2018-08-27 2019-02-01 杭州安恒信息技术股份有限公司 A kind of data export method and device of distributed big single table
CN109299157B (en) * 2018-08-27 2021-11-23 杭州安恒信息技术股份有限公司 Data export method and device for distributed big single table
CN109739887A (en) * 2018-12-21 2019-05-10 平安科技(深圳)有限公司 Synchronous task searching method, system, device and readable storage medium storing program for executing

Similar Documents

Publication Publication Date Title
Aksu et al. Distributed $ k $-Core View Materialization and Maintenance for Large Dynamic Graphs
CN104216893B (en) Partition management method, server and the system of multi-tenant shared data table
Halim et al. A MapReduce-based maximum-flow algorithm for large small-world network graphs
Dai et al. IOGP: An incremental online graph partitioning algorithm for distributed graph databases
CN110287391A (en) Multi-level trajectory data storage method, storage medium and terminal based on Hadoop
CN104111936A (en) Method and system for querying data
Ferraro Petrillo et al. Analyzing big datasets of genomic sequences: fast and scalable collection of k-mer statistics
CN106919590A (en) A kind of multi-business multiplexing processing method, device and system
Wang et al. Scalable data cube analysis over big data
CN107665219A (en) A kind of blog management method and device
CN107622059A (en) A kind of method and system for improving database search efficiency
CN111949315A (en) Management device and method for block chain account book data
Mukherjee Synthesis of non-replicated dynamic fragment allocation algorithm in distributed database systems
De Abreu et al. Choosing Between Graph Databases and RDF Engines for Consuming and Mining Linked Data.
Li et al. Bohr: similarity aware geo-distributed data analytics
Jiang et al. Alibaba hologres: A cloud-native service for hybrid serving/analytical processing
JP2012168781A (en) Distributed data-store system, and record management method in distributed data-store system
CN107346342A (en) A kind of file call method calculated based on storage and system
CN101329639A (en) Method for implementing application program sharing under graticule manufacturing environment
CN110716990A (en) Multi-data-source management system applied to data transaction
CN109446268A (en) A kind of method of data synchronization and device
CN111125090B (en) Data access method and device
Pomogalova et al. Identification Method for Endpoint Devices on Low-Power Wide-Area Networks Using Digital Object Architecture with Blockchain Technology Integration
CN108153770A (en) The method and system that a kind of search engine accelerates
CN110275885A (en) Multi-level track data storage device based on Hadoop

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180123