CN109542612A - A kind of hot spot keyword acquisition methods, device and server - Google Patents

A kind of hot spot keyword acquisition methods, device and server Download PDF

Info

Publication number
CN109542612A
CN109542612A CN201710865548.6A CN201710865548A CN109542612A CN 109542612 A CN109542612 A CN 109542612A CN 201710865548 A CN201710865548 A CN 201710865548A CN 109542612 A CN109542612 A CN 109542612A
Authority
CN
China
Prior art keywords
keyword
access times
chained list
data block
hot spot
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
CN201710865548.6A
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.)
Alibaba Group Holding 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 CN201710865548.6A priority Critical patent/CN109542612A/en
Priority to PCT/CN2018/104799 priority patent/WO2019056958A1/en
Publication of CN109542612A publication Critical patent/CN109542612A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Abstract

The application provides a kind of hot spot keyword acquisition methods, device and server, this method comprises: obtaining keyword, and obtain the access times of the keyword in measurement period;It determines the access times section where the access times, inquires chained list corresponding with the access times section;Different access times sections correspond to different chained lists;Update position of the access times of the keyword in the chained list;It needs to be determined that reading the access times of keyword from chained list, determining hot spot keyword according to the access times of keyword when hot spot keyword.By the technical solution of the application, the load balancing of distributed system may be implemented, improve the stability and high efficiency of system, promote the entirety ability to the request of data of hot spot keyword.

Description

A kind of hot spot keyword acquisition methods, device and server
Technical field
This application involves internet area, especially a kind of hot spot keyword acquisition methods, device and server.
Background technique
Distributed system is one of the mainstream scheme for coping with big data storage demand instantly, in a distributed system, can be with Multiple database servers are disposed, each database server is for storing identical data.Application server is receiving client After holding the request of data sent, database server is determined using hash algorithm, and send data to the database server and ask It asks.Database server returns to application server after receiving request of data, by data corresponding with the request of data, with Make application server that the data are returned to client.
Due to hash algorithm be it is fixed, the request of data for obtaining same data can be positioned to same number According to library server, so as to cause cannot achieve load balancing, the stability of distributed system is poor.
For example, application server carries out hash processing to Data Identification, and database server is determined according to processing result, For all request of data of Data Identification A, it is positioned to database server A, is asked for all data of Data Identification B It asks, is positioned to database server B.If the request of data quantity of Data Identification A is much larger than the request of data number of Data Identification B Amount, then the processing pressure of database server A is larger, and the processing pressure of database server B is smaller, can not be in database service Load balancing is realized between device.
Summary of the invention
The application provides a kind of hot spot keyword acquisition methods, is applied to database server, comprising:
In measurement period, keyword is obtained, and obtain the access times of the keyword;
It determines the access times section where the access times, and inquires chain corresponding with the access times section Table;Wherein, different access times sections corresponds to different chained lists;
Update position of the access times of the keyword in the chained list;
It needs to be determined that reading the access times of keyword from chained list, and according to the visit of keyword when hot spot keyword Ask that number determines hot spot keyword.
The application provides a kind of hot spot keyword acquisition methods, is applied to database server, comprising:
In measurement period, obtains keyword and obtained corresponding with the keyword by the keyword query Hash table Data block location;The Hash table is used for the corresponding relationship of recording key and data block location;
Access times are inquired from the corresponding data block of the data block location, are obtained using the access times inquired The access times of the keyword update the access times of the keyword into the data block;
It needs to be determined that reading the access times of keyword from chained list, and according to the visit of keyword when hot spot keyword Ask that number determines hot spot keyword.
The application provides a kind of hot spot keyword acquisition methods, is applied to database server, comprising:
In measurement period, keyword is obtained, and obtain the access times of the keyword;
It determines the access times section where the access times, and inquires chain corresponding with the access times section Table;Wherein, different access times sections corresponds to different chained lists;
Update position of the access times of the keyword in the chained list;
When needing to delete the content in data block, according to the corresponding relationship in access times section and chained list, inquire excellent The minimum chained list of first grade, and the content in the last one data block of the minimum chained list of the priority is deleted;Wherein, preferentially The minimum chained list of grade is the corresponding chained list in the smallest access times section;
It needs to be determined that reading the access times of keyword from chained list, and according to the visit of keyword when hot spot keyword Ask that number determines hot spot keyword.
The application provides a kind of hot spot keyword acquisition device, is applied to database server, comprising:
Module is obtained, for keyword being obtained, obtaining the access times of the keyword in measurement period;
Determining module for determining the access times section where the access times, and inquires and the access time The corresponding chained list of number interval;Wherein, different access times sections corresponds to different chained lists;And update the keyword Position of the access times in the chained list;
The determining module is also used to it needs to be determined that reading the access time of keyword from chained list when hot spot keyword Number, and hot spot keyword is determined according to the access times of keyword.
The application provides a kind of hot spot keyword acquisition device, is applied to database server, comprising:
Module is obtained, in measurement period, obtains keyword, by the keyword query Hash table, is obtained pair The data block location answered;The Hash table is used for the corresponding relationship of recording key and data block location;From the data block position It sets in corresponding data block and inquires access times, the access times of the keyword are obtained using the access times inquired, The access times of the keyword are updated into the data block;
Determining module, for it needs to be determined that reading the access times of keyword, and root from chained list when hot spot keyword Hot spot keyword is determined according to the access times of the keyword of reading.
The application provides a kind of hot spot keyword acquisition device, is applied to database server, comprising:
Module is obtained, for obtaining keyword, and obtain the access times of the keyword in measurement period;
Determining module for determining the access times section where the access times, and inquires and the access time The corresponding chained list of number interval;Wherein, different access times sections corresponds to different chained lists;And update the keyword Position of the access times in the chained list;
Removing module, it is corresponding with chained list according to access times section for when needing to delete the content in data block Relationship inquires the minimum chained list of priority, and the content in the last one data block of the minimum chained list of the priority is deleted It removes;The minimum chained list of the priority is the corresponding chained list in the smallest access times section;
The determining module is also used to it needs to be determined that reading the access time of keyword from chained list when hot spot keyword Number, and hot spot keyword is determined according to the access times of the keyword of reading.
The application provides a kind of database server, and the database server includes:
Processor, for obtaining keyword, and obtain the access times of the keyword in measurement period;Determine institute The access times section where access times is stated, and inquires chained list corresponding with the access times section;Wherein, different Access times section corresponds to different chained lists;Update position of the access times of the keyword in the chained list;It is needing When determining hot spot keyword, the access times of keyword are read from chained list, and determine hot spot according to the access times of keyword Keyword.
The application provides a kind of database server, and the database server includes:
Processor obtains keyword, and by the keyword query Hash table in measurement period, obtain with The corresponding data block location of the keyword;Wherein, the Hash table is for recording key pass corresponding with data block location System;Access times are inquired from the corresponding data block of the data block location, and obtain institute using the access times inquired The access times of keyword are stated, and the access times of the keyword are updated into the data block;It needs to be determined that hot spot When keyword, the access times of keyword are read from chained list, and determine hot spot keyword according to the access times of keyword.
The application provides a kind of database server, and the database server includes:
Processor, for obtaining keyword, and obtain the access times of the keyword in measurement period;Determine institute The access times section where access times is stated, and inquires chained list corresponding with the access times section;Wherein, different Access times section corresponds to different chained lists;Update position of the access times of the keyword in the chained list;It is needing When deleting the content in data block, according to the corresponding relationship in access times section and chained list, the minimum chained list of priority is inquired, And the content in the last one data block of the minimum chained list of the priority is deleted;Wherein, the minimum chain of the priority Table is the corresponding chained list in the smallest access times section;It needs to be determined that reading keyword from chained list when hot spot keyword Access times, and hot spot keyword is determined according to the access times of keyword.
Based on the above-mentioned technical proposal, in the embodiment of the present application, database server can count hot spot keyword, and will Hot spot keyword is notified to application server, so that application server carries out at load balancing the request of data of hot spot keyword Reason improves the stability and high efficiency of system to realize the load balancing of distributed system, promotes the number to hot spot keyword According to the entirety ability of request.Moreover, by dividing multiple chained lists, and delete in the data block of the minimum chained list of priority Hold, to retain the data of most worthy.
Detailed description of the invention
It, below will be to the application in order to clearly illustrate the embodiment of the present application or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is only some embodiments as described in this application, for those of ordinary skill in the art, can also be according to this Shen Please these attached drawings of embodiment obtain other attached drawings.
Fig. 1 is the application scenarios schematic diagram in a kind of embodiment of the application;
Fig. 2A and Fig. 2 B is the flow chart of the hot spot keyword acquisition methods in a kind of embodiment of the application;
Fig. 3 is the example data structure of the Hash table and chained list in a kind of embodiment of the application;
Fig. 4 is the flow chart of the hot spot keyword acquisition methods in the application another embodiment;
Fig. 5 is the flow chart of the hot spot keyword acquisition methods in the application another embodiment;
Fig. 6 is the structure chart of the hot spot keyword acquisition device in a kind of embodiment of the application;
Fig. 7 is the structure chart of the hot spot keyword acquisition device in the application another embodiment;
Fig. 8 is the structure chart of the hot spot keyword acquisition device in the application another embodiment.
Specific embodiment
In the term that the embodiment of the present application uses merely for the sake of for the purpose of describing particular embodiments, rather than limit this Shen Please.The "an" of singular used in the application and claims, " described " and "the" are also intended to including most shapes Formula, unless context clearly shows that other meanings.It is also understood that term "and/or" used herein refers to comprising one A or multiple associated any or all of project listed may combine.
It will be appreciated that though various letters may be described using term first, second, third, etc. in the embodiment of the present application Breath, but these information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, In the case where not departing from the application range, the first information can also be referred to as the second information, and similarly, the second information can also be with The referred to as first information.Depending on context, in addition, used word " if " can be construed to " ... when " or " when ... " or " in response to determination ".
A kind of hot spot keyword acquisition methods are proposed in the embodiment of the present application, this method can be applied to distributed system. It is shown in Figure 1, it is the application scenarios schematic diagram of the embodiment of the present application, distributed system may include multiple database services Device, multiple application servers.With two database servers in Fig. 1, it is illustrated for three application servers.Actually answering In, the quantity of the quantity of database server, application server can also be more, to the quantity of this database server, answer With no restrictions with the quantity of server.
In order to realize load balancing between database server, then database server is available crucial to hot spot Word, and hot spot keyword is notified to application server, so that application server bears the request of data of hot spot keyword It carries equilibrium treatment and avoids the processing of certain database servers so as to realize the load balancing between database server Pressure is larger, and the processing pressure of other database servers is smaller.
In the embodiment of the present application, in order to obtain hot spot keyword, then database server can count the access of keyword Number, and determine whether the keyword is hot spot keyword based on the access times of keyword.For example, when the access time of keyword When number is greater than preset times threshold value, it is determined that the keyword is hot spot keyword, when the access times of keyword are no more than default When frequency threshold value, it is determined that the keyword is not hot spot keyword.
In the embodiment of the present application, keyword (Key) is the unique identification of the data stored in database server, using clothes When business device sends request of data to database server, which can carry keyword, and database server is receiving To after the request of data, pass through this keyword, so that it may number corresponding with the keyword is inquired from database server According to, and this data is returned into application server.Wherein, which can include but is not limited to: Data Identification, Yong Hubiao Knowledge, commodity sign etc., with no restrictions to this keyword, as long as being based on the keyword, database server can inquire local The data of storage.For example, being based on Data Identification, database server can inquire number corresponding with the Data Identification According to based on user identifier, database server can inquire data corresponding with the user identifier.Based on commodity sign, number Data corresponding with the commodity sign can be inquired according to library server.And so on.
In order to count the access times of keyword, measurement period is can be set in database server, and in each statistics week The access times of statistics keyword in phase.It is then within 0-1 seconds 1 measurement period for example, the duration of measurement period is 1 second, 1-2 seconds It is 1 measurement period, and so on.In 0-1 seconds this measurement period, database server counts the access time of keyword Number, determines whether the keyword is hot spot keyword based on the access times of keyword.In 1-2 seconds this measurement period, number The access times for counting keyword again according to library server determine whether the keyword is hot spot based on the access times of keyword Keyword.And so on.
In one example, the access times of data block storage keyword, each key can be used in database server Word occupies a data block, and if data block 1 stores the access times of keyword 1, data block 2 stores the access times of keyword 2, And so on.In addition, database server is likely to be received the request of data of a large amount of keywords, such as hundreds of thousands in measurement period It is even up to a million, when each keyword occupies a data block, then mass data block is occupied, in order to store the access of keyword Number can occupy mass data block.
But hot spot keyword obtains this function, the only miscellaneous function of database server, database server is not It can be this function distribution mass data block, that is, not be available the access times of mass data block storage keyword, then obtain Hot spot keyword.(Least Recently Used, least recently used) algorithm it is proposed to this end that LRU, i.e., based on a small amount of number According to block, using the access times of lru algorithm storage keyword.
For example, database server is " acquisition of hot spot keyword " 100 data blocks of function distribution (with 100 data blocks For be illustrated, in practical application, the data block of distribution can be more, without limitation).
In measurement period, if what is received for the 1-101 times is the request of data of keyword 1, recorded in data block 1 The access times of keyword 1, and data block 1 is updated to the first data block of LRU chained list.If what is received for the 102nd time is to close The request of data of key word 2, then in data block 2 recording key 2 access times, and data block 2 is updated to LRU chained list Data block 1 is updated to the 2nd data block of LRU chained list by first data block.And so on, if what is received for the 200th time is to close The request of data of key word 100, then in data block 100 recording key 100 access times, and data block 100 is updated to Data block 99 is updated to the 2nd data block of LRU chained list by the first data block of LRU chained list, and so on, more by data block 1 New is the 100th data block (the last one data block of LRU chained list) of LRU chained list.
If what is received for the 201st time is the request of data of keyword 101, due to without available block, number The content of the last one data block record, i.e., the keyword recorded in deletion data block 1 are deleted from LRU chained list according to library server Data block 1 is updated to the first number of LRU chained list by 1 access times, the access times of recording key 101 in data block 1 According to block, data block 100 is updated to the 2nd data block of LRU chained list, data block 99 is updated to the 3rd data of LRU chained list Block, and so on.
Obviously, before the request of data for receiving keyword 101, the access times of the keyword 1 recorded in data block 1 It being the largest, keyword 1 may be hot spot keyword, and after the request of data for receiving keyword 101, remember in data block 1 The access times of the keyword 1 of record are deleted, and causing the access times of hot spot keyword that can not remain into measurement period terminates, It is hot spot keyword that keyword 1, which can not just be counted,.
For above-mentioned discovery, in the embodiment of the present application, multiple access times sections, each access times section can be divided A corresponding chained list, and different access times sections corresponds to different chained lists.Wherein, the chained list can include but is not limited to LRU chained list, for the convenience of description, subsequent be illustrated by taking chained list as an example.
For example, chained list 1 corresponds to access times section 1, and the access times section 1 corresponds to (access times 1- access Number 100);Chained list 2 corresponds to access times section 2, and the access times section 2 corresponds to (access times 101- access time Number 200);Chained list 3 corresponds to access times section 3, and the access times section 3 corresponds to (access times 201- is infinitely great), It is more than or equal to access times 201.Certainly, above-mentioned example is carried out by taking three chained lists, three access times sections as an example Illustrate, in practical applications, quantity, the quantity in access times section of chained list can also be more, with no restrictions to this quantity. In addition, the corresponding numerical value in above-mentioned access times section, also the only example of the application, without limitation.
Under above-mentioned application scenarios, referring to fig. 2 shown in A, for the hot spot keyword acquisition side proposed in the embodiment of the present application The flow chart of method, this method can be applied to database server, and this method may include:
Step 201, in measurement period, keyword is obtained, and obtain the access times of the keyword.
In one example, in each measurement period, the available keyword of database server, and obtain the pass The access times of key word, for the convenience of description, subsequent be illustrated by taking a measurement period as an example.
In one example, application server (such as APP server), can after the request of data for receiving client transmission To determine database server using hash algorithm, and request of data is sent to the database server.Database server exists After receiving the request of data, keyword is parsed from the request of data.
Wherein, which can include but is not limited to: Data Identification, user identifier, commodity sign etc., to this keyword With no restrictions, as long as being based on the keyword, database server can inquire the data being locally stored.For example, being based on Data Identification, database server can inquire data corresponding with the Data Identification, be based on user identifier, database service Device can inquire data corresponding with the user identifier.
Wherein, which can be terminal device (such as PC (Personal Computer, personal computer), notebook Computer, mobile terminal etc.) APP, be also possible to the browser of terminal device, with no restrictions to the type of this client, own The client of application server is able to access that, in the application protection scope.
Wherein, application server, which can be, provides the server of service for client, and the application server can be from Database server gets the data of client request, and sends the data to client.As application server can be Data platform, electric business platform etc., with no restrictions to the type of this application server.
Wherein, database server can be the server of storing data, and database server is receiving application service After the request of data that device is sent, keyword is parsed from the request of data, goes out number corresponding with the keyword from local search According to sending the data to application server, then return data to client.
Referring to fig. 2 shown in B, for the process of " access times for obtaining the keyword ", may include:
Step 2011, the corresponding data block location of the keyword is obtained.
In one example, for the process of " obtaining the corresponding data block location of the keyword ", may include but unlimited In such as under type: mode one, the corresponding relationship that can recorde keyword and access times due to data block, database clothes Business device can successively traverse each data block, if record has the keyword, the data of the data block in the data block traversed Block position is exactly the corresponding data block location of the keyword.Mode two, database server can store Hash table, the Hash table Corresponding relationship for recording key and data block location;Based on this Hash table, database server can pass through the key Word inquires the Hash table, if there are the keyword, available data block corresponding with keyword positions in the Hash table It sets.
In mode two, since database server does not need successively to traverse each data block, it is only necessary to Hash table is stored, Data block location corresponding with keyword can be inquired from Hash table, so that the traversal of database server be avoided to grasp Make, mitigates the processing pressure of database server, save the time of traversing operation.
It is shown in Figure 3, it is the example data structure of Hash table and chained list, which can include but is not limited to HashMap (Hash figure) table, the chained list can include but is not limited to N grades of LRU chained list.
In one example, Hash table is used for the corresponding relationship of recording key and data block location, database server After receiving request of data, keyword can be parsed from the request of data, and pass through the keyword query Hash table.If The keyword is not present in the Hash table, then database server is the keyword selection data block, by the access of the keyword Number is recorded in the data block of selection, and record in Hash table the data block location of the data block of the keyword and selection Corresponding relationship.If there are the keyword in the Hash table, database server can obtain and the keyword from Hash table Corresponding data block location.
In one example, N grades of chained lists refer to N number of chained list, the corresponding access times section of each chained list, such as chained list 1 Corresponding access times section 1 (access times 1- access times 100), corresponding 2 (the access times 101- of access times section of chained list 2 Access times 200), the corresponding access times section 3 (access times 201- is infinitely great) of chained list 3, this case can indicate: work as number When being located at the access times section 1 according to the access times of the keyword recorded in block, then the data block belongs to chained list 1;Work as number When being located at the access times section 2 according to the access times of the keyword recorded in block, then the data block belongs to chained list 2;Work as number When being located at the access times section 3 according to the access times of the keyword recorded in block, then the data block belongs to chained list 3.
In one example, for mode one, data block is used for the access times of recording key, the keyword, for Mode two, data block are used for the access times of recording key, and certainly, data block also can recorde keyword.It retouches for convenience State, by data block recording key, the keyword access times for.
For mode two, the example of " obtaining the corresponding data block location of the keyword " can be with are as follows: database server exists After the request of data for receiving keyword 1, Hash table is inquired by keyword 1.If keyword 1 is not present in Hash table, count It is that keyword 1 chooses data block (such as unappropriated data block or the currently data block that discharges according to library server;It is unoccupied Data block refer to: there are no the access times of recording key, keyword for data block;The data block currently discharged refers to: number According to the access times of block recording key, keyword, but the content recorded in this data block is deleted, subsequent process Introduce deletion process).
It is assumed to be keyword 1 and chooses data block 80, then access time of the data block 80 for recording key 1, keyword 1 Number, and in Hash table the data block location of recording key 1 and data block 80 corresponding relationship.
After database server receives the request of data of keyword 1 again, Hash table is inquired by keyword 1, by Keyword 1 is had existed in Hash table, therefore, it is right with keyword 1 that database server can be obtained directly from Hash table The data block location answered, it is, the data block location of data block 80.
Step 2012, access times are inquired from the corresponding data block of the data block location.
Access times due to data block for recording key, keyword, database server is obtaining data Behind block position, access times can be inquired from the corresponding data block of the data block location.
Step 2013, the access times of keyword are obtained using the access times inquired.
Wherein, for the process of " access times that inquire is utilized to obtain the access times of keyword ", may include but Be not limited to such as under type: the access times for determining the keyword are that the access times inquired add default value (such as 1);Alternatively, The corresponding resource information of the keyword is obtained, and determines the weighted value of the keyword according to the resource information, and determines the key The access times of word are the access times weighting weight values inquired.
Step 2014, the access times of the keyword are updated into the corresponding data block of the data block location.
Wherein, the data block is recorded when being last update data block in the access times inquired from data block In the access times of keyword the access times are known as to the first access of keyword for the convenience of description, in subsequent process Number.The keyword in the data block is recorded when being that this updates the data block in the access times of the keyword currently obtained Access times, for the convenience of description, the access times to be known as to the second access times of keyword in subsequent process.Obviously, When needing to update the data block next time, the second access times have also reformed into the of the keyword being recorded in the data block One access times.
In one example, after obtaining keyword (such as keyword 1) every time, (such as from the corresponding data block of data block location Data block 80) in read the first access times of keyword 1, and the first access times are added 1, obtain the second access times.Example Such as, after the 100th acquisition keyword 1, the first access times 99 of keyword 1 are read from data block 80, by the first access Number 99 plus 1 obtains the second access times 100, and the second access times 100 is updated into data block 80.It is obtained at the 101st time After obtaining keyword, the first access times 100 of keyword 1 are read from data block 80, and by the first access times 100 plus 1, are obtained It updates to the second access times 101, and by the second access times 101 into data block 80.And so on.
It in another example, can be from the corresponding data of data block location after obtaining keyword (such as keyword 1) every time The first access times of the keyword 1 are read in block (such as data block 80), and first access times are weighted into weight values, thus To the second access times.For example, be illustrated so that weighted value is 5 as an example, then it, can be from number after the 100th acquisition keyword 1 According to the first access times 495 for reading keyword 1 in block 80, the first access times 495 are weighted into weight values 5, obtain the second access Number 500, and the second access times 500 are updated into data block 80.It, can be from data after the 101st acquisition keyword The first access times 500 of keyword 1 are read in block 80, and the first access times 100 are weighted into weight values 5, obtain the second access Number 505, and the second access times 505 are updated into data block 80.And so on.
In order to obtain the weighted value (such as above-mentioned weighted value 5) of keyword (such as keyword 1), after obtaining keyword 1 every time, The corresponding resource information of available keyword 1, and determine according to the resource information weighted value of keyword 1.Alternatively, first After secondary acquisition keyword 1, the corresponding resource information of available keyword 1, and determine according to the resource information power of keyword 1 Weight values;Then, which is recorded data block 80, after obtaining keyword 1 again, can be directly read from data block 80 To the weighted value.
In one example, which can include but is not limited to: the data size of keyword corresponding data, and/ Or, the processing time of keyword corresponding requests.Based on this, for the mistake of " determining the weighted value of keyword according to resource information " Journey can include but is not limited to such as under type:, can basis if resource information includes the data size of keyword corresponding data The relationship of data size and pre-set dimension determines the weighted value of keyword.If resource information includes the place of keyword corresponding requests The time is managed, then the weighted value of keyword can be determined according to the relationship of processing time and preset time.If resource information includes closing It the data size of key word corresponding data and the processing time of keyword corresponding requests, then can be according to data size and pre-set dimension Relationship, determine the first sub- weighted value of keyword;According to the relationship of processing time and preset time, the second of keyword is determined Sub- weighted value;The weighted value of keyword is determined according to the first sub- weighted value and the second sub- weighted value.
Wherein, for the process of " according to the relationship of data size and pre-set dimension, determining the weighted value of keyword ", packet It includes: rule of thumb configuring pre-set dimension, if the data size of keyword corresponding data is less than or equal to pre-set dimension, determine keyword Weighted value be 1.If the data size of keyword corresponding data is greater than pre-set dimension, determine that the weighted value of keyword is " logarithm Round up according to size divided by pre-set dimension ", if data are having a size of 8, when pre-set dimension is 5, weighted value is " to take upwards to 8/5 It is whole ", i.e., weighted value is 2;Data size is 11, and when pre-set dimension is 5, weighted value is " rounding up to 11/5 ", i.e. weighted value It is 3.
Wherein, for the process of " according to the relationship of processing time and preset time, determining the weighted value of keyword ", packet It includes: rule of thumb configuring preset time, if the processing time of keyword corresponding requests is less than or equal to preset time, determine keyword Weighted value be 1.If the processing time of keyword corresponding requests is greater than preset time, determine that the weighted value of keyword is " to place The reason time rounds up divided by preset time ", such as handling the time is 8, and when preset time is 5, weighted value is " to take upwards to 8/5 It is whole ", i.e., weighted value is 2;Handling the time is 11, and when preset time is 5, weighted value is " rounding up to 11/5 ", i.e. weighted value It is 3.
Wherein, for the mistake of " according to the relationship of data size and pre-set dimension, determining the first sub- weighted value of keyword " Journey, if may include: the data size of keyword corresponding data less than or equal to pre-set dimension, it is determined that the first son of the keyword Weighted value is 1.If the data size of keyword corresponding data is greater than pre-set dimension, it is determined that the sub- weighted value of the first of the keyword For " rounding up to data size divided by pre-set dimension ".
Wherein, for the mistake of " according to the relationship of processing time and preset time, determining the second sub- weighted value of keyword " Journey, if may include: the processing time of keyword corresponding requests less than or equal to preset time, it is determined that the second son of the keyword Weighted value is 1.If the processing time of keyword corresponding requests is greater than preset time, it is determined that the sub- weighted value of the second of the keyword For " rounding up to the processing time divided by preset time ".
Wherein, for the mistake of " determining the weighted value of keyword according to the first sub- weighted value and the second sub- weighted value " Journey, the weighted value that may include: determining keyword is that the first sub- weighted value adds the second sub- weighted value.
For example, pre-set dimension 5, the processing time is 11, preset time 5, then the first sub- weight if data size is 8 Value is " rounding up to 8/5 ", i.e., the first sub- weighted value is 2;Second sub- weighted value is " rounding up to 11/5 ", i.e., the second son Weighted value is 3;Therefore, the weighted value of keyword is 2+3=5.
In the above-described embodiments, the data size of keyword corresponding data refers to: assuming that application server request is to close The corresponding data A of key word 1, then the data size of 1 corresponding data of keyword is the size of data A.Since database server is deposited Data A is contained, therefore, database server can know the size of data A.
In the above-described embodiments, the processing time of keyword corresponding requests refers to: assuming that application server request is to close The corresponding data A of key word 1, then the processing time of 1 corresponding requests of keyword is to receive from database server for keyword 1 request of data, until database server returns to this period for carrying the response of data A to application server, moreover, data Library server can analyze out the size of this period.
Step 202, the access times area where the access times (access times got in step 201) is determined Between, and inquire chained list (such as LRU chained list) corresponding with the access times section.
Assuming that the access times of the keyword got are 105, it is determined that access times 105 are located at access times section 2, And the corresponding chained list 2 in access times section 2.Assuming that the access times of the keyword got are 260, it is determined that access times 206 Positioned at access times section 3, and access times section 3 corresponds to chained list 3.
Step 203, position of the access times of trasaction key in chained list (i.e. the corresponding chained list in access times section), First data block as the data block where the access times of keyword can be updated to the chained list.
Assuming that the access times of keyword 1 are 105, then it can be by the data block 80 where the access times 105 of keyword 1 It is updated to the first data block of chained list 2.Assuming that the access times of keyword 1 are 260, then it can be by the access times of keyword 1 Data block 80 where 260 is updated to the first data block of chained list 3.
Assuming that chained list 1 includes successively data block 1, data block 2, data block 80, data block 3- data block 79, chained list 2 is successively Including data block 81- data block 90, chained list 3 successively includes data block 91- data block 100.
Further, in step 201, it is assumed that the access times for recording data block 80 are updated from 100 to 105, in step In rapid 202, determine that chained list is that data block 80 can be updated to the first data block of chained list 2 in step 203 by chained list 2. That is, chained list 1 successively include data block 1- data block 79, chained list 2 successively include data block 80- data block 90, chained list 3 according to Secondary includes data block 91- data block 100.
In another example in step 201, it is assumed that the access times for recording data block 60 are updated from 50 to 51, in step 202 In, determine that chained list is chained list 1, i.e. the chained list of data block 60 does not change, in step 203, can be by data block 60 are updated to the first data block of chained list 1.That is, chained list 1 can successively include data block 60, data block 1- data block 59, data block 61- data block 79, chained list 2 can successively include data block 80- data block 90, and chained list 3 can successively include data Block 91- data block 100.
In another example in step 201, it is assumed that the access times for recording data block 90 are updated from 199 to 208, in step In 202, determine that chained list is chained list 3, i.e. the chained list of data block 90 is changed, in step 203, can be by data block 90 It is updated to the first data block of chained list 3.That is, chained list 1 can successively include data block 60, data block 1- data block 59, Data block 61- data block 79, chained list 2 can successively include data block 80- data block 89, and chained list 3 can successively include data block 90- data block 100.
In one example, in measurement period, the content in data block is if desired deleted, then can inquire priority Minimum chained list, and the content in the last one data block of the minimum chained list of the priority is deleted;Wherein, described preferential The minimum chained list of grade is the corresponding chained list in the smallest access times section.
Wherein, database server is when receiving the request of data of application server transmission, if the request of data carries Keyword be new key (not recording the access times of the keyword in i.e. all data blocks), and all data blocks are equal It is occupied, it is determined that need to delete the content in a data block.
Wherein, multiple chained lists in the embodiment of the present application, all have priority, and the minimum chained list of priority is the smallest visit Ask time intervals corresponding chained list, the chained list of highest priority is the largest the corresponding chained list in access times section, access times When section is bigger, then the priority of the corresponding chained list in access times section is higher.
For example, since access times section 3 (access times 201- is infinitely great) is greater than 2 (access times of access times section 101- access times 200), accordingly, it is determined that the priority of the corresponding chained list 3 in access times section 3 is right higher than access times section 2 The priority for the chained list 2 answered.Since access times section 2 is greater than access times section 1 (access times 1- access times 100), Hence, it can be determined that the priority of the corresponding chained list 2 in access times section 2 is higher than the excellent of the corresponding chained list 1 in access times section 1 First grade.In conclusion the priority of chained list 1 can be minimum, the priority of chained list 3 can with highest, and the priority bit of chained list 2 in It is intermediate.
Assuming that chained list 1 successively includes data block 1- data block 79, chained list 2 successively includes data block 80- data block 90, chained list 3 successively include data block 91- data block 100, then: when needing to delete the content in data block, can inquire priority most Low chained list 1, and by content (such as access of keyword, keyword in the last one data block (such as data block 79) of chained list 1 Number etc.) it deletes.In this way, data block 79 can recorde the access times of new key and new key.Then, by data block 79 are updated to the first data block of chained list 1.That is, chained list 1 can successively include data block 79, data block 1- data block 78, chained list 2 successively includes data block 80- data block 90, and chained list 3 successively includes data block 91- data block 100.
After the content (such as access times of keyword, keyword) in the data block 79 by chained list 1 is deleted, may be used also With from the corresponding relationship for the data block location for deleting the keyword in data block 79 and data block 79 in Hash table, and in Hash table The corresponding relationship of the data block location of middle record new key and data block 79.
In conclusion each data block of the high chained list of priority, wherein the access times recorded are larger, and priority is low Each data block of chained list, wherein the access times recorded are smaller, for example, each data block of the chained list 3 of highest priority, wherein remembering The access times of record are more than or equal to 201, such as can be 10000, and each data block of the minimum chained list 3 of priority, wherein recording Access times be less than or equal to 100, such as can be 1, therefore, when needing to delete the content in data block, be delete priority Keyword in minimum chained list 1, so that the small keyword of access times is deleted, and the big keyword of access times will not be by It deletes, it is possible to be that the keyword of hot spot keyword will not be deleted, so as to retain the access times of hot spot keyword Terminate to measurement period, in this way, the validity of statistical data can be improved when counting hot spot keyword.
Step 204, it needs to be determined that when hot spot keyword, from reading keyword in chained list (such as the data block from chained list) Access times, and hot spot keyword is determined according to the access times of keyword.
Wherein, after measurement period, then it needs to be determined that hot spot keyword, executes " according to the access times of keyword Determine hot spot keyword " process, it is then possible to enter next measurement period, and re-execute above-mentioned steps 201- step Rapid 203.Alternatively, when receiving the instruction for determining hot spot keyword, then it needs to be determined that hot spot keyword, execute " according to The access times of keyword determine hot spot keyword " process, it is then possible to enter next measurement period, and hold again Row above-mentioned steps 201- step 203.
Wherein it is determined that the hot spot keyword can also be notified to application server after hot spot keyword.
For example, database server can be successively from each data block (such as data block 1- data after measurement period Block 100) in read keyword access times, if the access times of keyword be greater than preset times threshold value (can be rule of thumb Configured), then it can determine that the keyword is hot spot keyword, if the access times of keyword are not more than preset times threshold Value, then can determine the keyword not is hot spot keyword.
In one example, for " access times of keyword being read from chained list, and according to the access times of keyword Determine hot spot keyword " process, can include but is not limited to: according to the chained list that the chained list of highest priority is minimum to priority Sequence, successively traverse chained list data block;The chained list of highest priority is the largest the corresponding chained list in access times section, excellent The minimum chained list of first grade is the corresponding chained list in the smallest access times section.Then, if the pass recorded in the data block traversed The access times of key word are greater than preset times threshold value, it is determined that the keyword is hot spot keyword;Otherwise, it determines the keyword is not It is hot spot keyword.Traverse in the presence of be not hot spot keyword chained list after, stop the data block for traversing next chained list.
For example, it is assumed that chained list 1 successively includes data block 1- data block 79, chained list 2 successively includes data block 80- data block 90, chained list 3 successively includes data block 91- data block 100, and preset times threshold value is 210, then: according to the chain of highest priority For table to the sequence of the minimum chained list of priority, database server first traverses each data block (such as data block 91- number of chained list 3 According to block 100), then each data block (such as data block 80- data block 90) of chained list 2 is traversed, then traverse each data block of chained list 1 (such as data block 1- data block 79).
Assuming that the access times recorded in data block 91- data block 99 are greater than preset times threshold value, and remember in data block 100 The access times of record are not more than preset times threshold value, then the keyword recorded in data block 91- data block 99 is hot spot keyword, And the keyword recorded in data block 100 is not hot spot keyword.Moreover, because traversing in the presence of the chain for not being hot spot keyword Therefore table 3 stops the data block for traversing next chained list, i.e., no longer traverses each data block of chained list 2, also no longer traverse chain Each data block of table 1 terminates traversal.
Obviously, in the above method, each data block of chained list 3 is only traversed, and no longer traverses each data of chained list 2 Block, no longer traverses each data block of chained list 1, to mitigate the processing pressure of database server, saves database server Resource, can accelerate data block traversal process, save processing the time.
In one example, after measurement period, the content in the data block of all chained lists can also be removed, and clear Except all the elements in Hash table, in this way, data block, Hash table, chained list return to original state, i.e., in the initial state, weight It is new to execute above-mentioned steps 201- step 203, this process is repeated no more.
In one example, above-mentioned execution sequence is intended merely to facilitate description to provide example, in practical applications, Sequence is executed between can also changing the step, with no restrictions to this execution sequence.Moreover, in other embodiments, and it is different The fixed sequence for showing and describing according to this specification is come the step of executing correlation method, step included by method can be than this It is more or less described in specification.In addition, single step described in this specification, it in other embodiments may quilt Multiple steps are decomposed into be described;Multiple steps described in this specification may also be merged into other embodiments Single step is described.
In one example, database server is after getting hot spot keyword, hot spot keyword can be notified to Application server.Application server, can be in the corresponding data of local cache hot spot keyword after getting hot spot keyword. In this way, application server receive client transmission the request of data for hot spot keyword after, can be from local search It is sent to client to the corresponding data of hot spot keyword, and by the corresponding data of hot spot keyword, without using database clothes Business device obtains the corresponding data of hot spot keyword.
In another example, application server can also change after getting hot spot keyword for hot spot key The hash algorithm of word avoids all navigating to the same database server for the request of data of hot spot keyword, thus real Existing load balancing, improves the stability of distributed system.For example, application server receive client transmission for hot spot After the request of data of keyword, by periodically changing hash algorithm, so that request of data 1- request of data 100 is sent to database Server A, request of data 101- request of data 200 are sent to database server B, and so on, to realize that database takes Load balancing between business device.
For example, after application server often receives 100 for the request of data of hot spot keyword, so that it may change hash Algorithm realizes the load balancing between database server to change database server.
In another example, database server, can also be in database server after getting hot spot keyword HotZone storage region (divide in advance for storing the region of hot spot data) corresponding number of caching hot spot keyword According to.In this way, database server receive application server transmission the request of data for hot spot keyword after, Ke Yizhi It connects and inquires the corresponding data of hot spot keyword from HotZone storage region, and the corresponding data of hot spot keyword are sent to Application server, the data storage medium without using database server obtain the corresponding data of hot spot keyword, thus plus Fast data acquisition speed.
In conclusion then an example of data acquisition can be with are as follows: application server is sent receiving client Carrying keyword request of data after, first from the corresponding data of the local search keyword;If local, there are the keywords pair The data answered, then the corresponding data of the keyword are directly sent to client by application server;If local be not present the key The corresponding data of word, then application server sends the request of data for carrying the keyword to database server.Database service Device inquires the key from HotZone storage region after receiving the request of data of carrying keyword of application server transmission The corresponding data of word;If HotZone storage region, there are the corresponding data of the keyword, database server is from HotZone Storage region obtains the corresponding data of the keyword, and the corresponding data of the keyword are sent to application server;If The corresponding data of the keyword are not present in HotZone storage region, then can obtain from the data storage medium of database server The corresponding data of the keyword are taken, and the corresponding data of the keyword are sent to application server.
In one example, application server can also be the number after the corresponding data of local cache hot spot keyword According to setting expired time, after expired time arrival, then from the local data for deleting caching.Database server is in HotZone After storage region caches the corresponding data of hot spot keyword, expired time can also be set for the data, be reached in expired time Afterwards, then the data of caching are deleted from HotZone storage region.
Based on the above-mentioned technical proposal, in the embodiment of the present application, database server can count hot spot keyword, and will Hot spot keyword is notified to application server, so that application server carries out at load balancing the request of data of hot spot keyword Reason improves the stability and high efficiency of system to realize the load balancing of distributed system, promotes the number to hot spot keyword According to the entirety ability of request.Moreover, because database server does not need successively to traverse each data block, it is only necessary to store Hash table, so that it may data block location corresponding with keyword is inquired from Hash table, to avoid database server Traversing operation mitigates the processing pressure of database server, saves the time of traversing operation.It is needing to delete in data block Rong Shi is the keyword deleted in the minimum chained list of priority, so that the small keyword of access times is deleted, and access times Big keyword will not be deleted, it is possible to be that the keyword of hot spot keyword will not be deleted, so as to by hot spot key The access times of word, which remain into measurement period, to be terminated, and when counting hot spot keyword, the validity of statistical data can be improved.It can Only to traverse each data block of the high chained list of priority, and each data block of the low chained list of priority is no longer traversed, just united Hot spot keyword is counted out, to mitigate the processing pressure of database server, saves the resource of database server, saving processing Time.
It is shown in Figure 4 based on similarly applying conceiving with the above method, for another hot spot keyword acquisition methods Flow chart, this method can be applied to database server, and this method may include:
Step 401, in measurement period, keyword is obtained, and by the keyword query Hash table, is obtained and the key The corresponding data block location of word.Wherein, which therefore can for the corresponding relationship of recording key and data block location To obtain data block location corresponding with the keyword from the Hash table.
Step 402, access times are inquired from the corresponding data block of the data block location, and utilize the access inquired Number obtains the access times of keyword, and the access times of the keyword are updated into the data block.
Step 403, it needs to be determined that reading the access times of keyword from chained list, and according to pass when hot spot keyword The access times of key word determine hot spot keyword.
In one example, after through keyword query Hash table, if the keyword is not present in Hash table, for The keyword selection data block;The access times of the keyword are recorded in the data block of selection, and are recorded in Hash table The corresponding relationship of the data block location of the keyword and the data block of selection.
It in one example, can for the process of " obtaining the access times of keyword using the access times inquired " To include but is not limited to such as under type: the access times for determining keyword are that the access times inquired add default value;Alternatively, The corresponding resource information of keyword is obtained, the weighted value of keyword is determined according to resource information, and determines the access time of keyword Number weights weight values for the access times inquired;Wherein, which includes the data size of keyword corresponding data, and/ Or, the processing time of keyword corresponding requests.
Wherein, for process shown in Fig. 4, similar with process shown in Fig. 2A, it is no longer repeated herein.
It is shown in Figure 5 based on similarly applying conceiving with the above method, for another hot spot keyword acquisition methods Flow chart, this method can be applied to database server, and this method may include:
Step 501, in measurement period, keyword is obtained, and obtain the access times of the keyword.
Step 502, it determines the access times section where the access times, and inquires corresponding with the access times section Chained list;Wherein, different access times sections can correspond to different chained lists.
Step 503, position of the access times of the keyword in the chained list is updated.
Step 504, when needing to delete the content in data block, according to the corresponding relationship in access times section and chained list, The minimum chained list of priority is inquired, and the content in the last one data block of the minimum chained list of priority is deleted;Wherein, The minimum chained list of priority is the corresponding chained list in the smallest access times section.
Step 505, it needs to be determined that reading the access times of keyword from chained list, and according to pass when hot spot keyword The access times of key word determine hot spot keyword.
In one example, for " access times of keyword being read from chained list, and according to the access times of keyword Determine hot spot keyword " process, can include but is not limited to: according to the chained list that the chained list of highest priority is minimum to priority Sequence, successively traverse chained list data block;Wherein, the chained list of highest priority is the largest the corresponding chain in access times section Table, the minimum chained list of priority are the corresponding chained lists in the smallest access times section;If the pass recorded in the data block traversed The access times of key word are greater than preset times threshold value, it is determined that the keyword is hot spot keyword;Otherwise, it determines the keyword is not It is hot spot keyword;Traverse in the presence of be not hot spot keyword chained list after, stop the data block for traversing next chained list.
Wherein, for process shown in Fig. 5, similar with process shown in Fig. 2A, it is no longer repeated herein.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of hot spot keyword acquisition dress It sets, is applied to database server, as shown in fig. 6, being the structure chart of hot spot keyword acquisition device.
Module 601 is obtained, for obtaining keyword, and obtain the access times of keyword in measurement period;
Determining module 602 for determining the access times section where the access times, and inquires and the access The corresponding chained list of time intervals;Wherein, different access times sections corresponds to different chained lists;And update the keyword Position of the access times in the chained list;
The determining module 602 is also used to it needs to be determined that reading the access of keyword from chained list when hot spot keyword Number, and hot spot keyword is determined according to the access times of keyword.
The acquisition module 601, specifically for obtaining the pass during obtaining the access times of the keyword The corresponding data block location of key word, and access times are inquired from the corresponding data block of the data block location, and utilize and look into The access times ask out obtain the access times of the keyword;
Wherein, the acquisition module 601, specifically in the process for obtaining the corresponding data block location of the keyword In, by the keyword query Hash table, obtain data block location corresponding with the keyword;Wherein, the Hash table Corresponding relationship for recording key and data block location;
During obtaining the access times of the keyword using the access times inquired, the keyword is determined Access times be that the access times inquired add default value;Alternatively, obtaining the corresponding resource information of the keyword, and root The weighted value of the keyword is determined according to the resource information, and determines that the access times of the keyword are the access inquired Number adds the weighted value;Wherein, the resource information includes: the data size of the keyword corresponding data, and/or, institute State the processing time of keyword corresponding requests.
In one example, the hot spot keyword acquisition device further includes (not regarding out in figure):
Removing module, for when needing to delete the content in data block, inquiring the minimum chained list of priority, and by institute The content stated in the last one data block of the minimum chained list of priority is deleted;
The determining module 602, specifically for during the access times according to keyword determine hot spot keyword, According to the chained list of highest priority to the sequence of the minimum chained list of priority, the data block of chained list is successively traversed;If traversing The access times of the keyword recorded in data block are greater than preset times threshold value, it is determined that the keyword is hot spot keyword;It is no Then, determining the keyword not is hot spot keyword;Traverse in the presence of be not hot spot keyword chained list after, it is next to stop traversal The data block of a chained list;
Wherein, the chained list of the highest priority is the largest the corresponding chained list in access times section, and the priority is most Low chained list is the corresponding chained list in the smallest access times section.
Based on similarly applying conceiving with the above method, a kind of database server, institute are also provided in the embodiment of the present application Stating database server includes: processor, for obtaining keyword, and obtain the access of the keyword in measurement period Number;It determines the access times section where the access times, and inquires chained list corresponding with the access times section; Wherein, different access times sections corresponds to different chained lists;The access times of the keyword are updated in the chained list Position;It needs to be determined that reading the access times of keyword from chained list, and according to the access of keyword time when hot spot keyword Number determines hot spot keyword.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of machine readable storage medium, It can be applied to database server, several computer instructions, the computer be stored on the machine readable storage medium Instruction, which is performed, to be handled as follows: in measurement period, obtaining keyword, and obtain the access times of the keyword; It determines the access times section where the access times, and inquires chained list corresponding with the access times section;It is different Access times section correspond to different chained lists;Update position of the access times of the keyword in the chained list;It is needing When determining hot spot keyword, the access times of keyword are read from chained list, and determine heat according to the access times of keyword Point keyword.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of hot spot keyword acquisition dress It sets, is applied to database server, as shown in fig. 7, being the structure chart of hot spot keyword acquisition device.
Module 701 is obtained, is obtained in measurement period, obtaining keyword by the keyword query Hash table Corresponding data block location;The Hash table is used for the corresponding relationship of recording key and data block location;From the data block The corresponding data block in position inquires access times, and the access times of the keyword are obtained using the access times inquired, The access times of the keyword are updated into the data block;
Determining module 702, for it needs to be determined that read the access times of keyword from chained list when hot spot keyword, And hot spot keyword is determined according to the access times of the keyword of reading.
Based on similarly applying conceiving with the above method, a kind of database server, institute are also provided in the embodiment of the present application Stating database server includes: processor, for obtaining keyword, and breathe out by the keyword query in measurement period Uncommon table, obtains data block location corresponding with the keyword;Wherein, the Hash table is for recording key and data block position The corresponding relationship set;Access times are inquired from the corresponding data block of the data block location, and utilize the access inquired Number obtains the access times of the keyword, and the access times of the keyword are updated into the data block;It is needing When determining hot spot keyword, the access times of keyword are read from chained list, and determine heat according to the access times of keyword Point keyword.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of machine readable storage medium, It can be applied to database server, several computer instructions, the computer be stored on the machine readable storage medium Instruction, which is performed, to be handled as follows: in measurement period, keyword is obtained, and pass through the keyword query Hash table, Obtain data block location corresponding with the keyword;The Hash table is for recording key pass corresponding with data block location System;Access times are inquired from the corresponding data block of the data block location, and obtain institute using the access times inquired The access times of keyword are stated, and the access times of the keyword are updated into the data block;It needs to be determined that hot spot When keyword, the access times of keyword are read from chained list, and determine hot spot keyword according to the access times of keyword.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of hot spot keyword acquisition dress It sets, is applied to database server, as shown in figure 8, being the structure chart of hot spot keyword acquisition device.
Module 801 is obtained, for keyword being obtained, obtaining the access times of keyword in measurement period;
Determining module 802 for determining the access times section where the access times, and inquires and the access The corresponding chained list of time intervals;Wherein, different access times sections corresponds to different chained lists;And update the keyword Position of the access times in the chained list;
Removing module 803, for when needing to delete the content in data block, according to pair in access times section and chained list It should be related to, inquire the minimum chained list of priority, by the content in the last one data block of the minimum chained list of the priority It deletes;The minimum chained list of priority is the corresponding chained list in the smallest access times section;
The determining module 802 is also used to it needs to be determined that reading the access of keyword from chained list when hot spot keyword Number, and hot spot keyword is determined according to the access times of the keyword of reading.
Based on similarly applying conceiving with the above method, a kind of database server, institute are also provided in the embodiment of the present application Stating database server includes: processor, for obtaining keyword, and obtain the access of the keyword in measurement period Number;It determines the access times section where the access times, and inquires chained list corresponding with the access times section; Wherein, different access times sections corresponds to different chained lists;The access times of the keyword are updated in the chained list Position;When needing to delete the content in data block, according to the corresponding relationship in access times section and chained list, priority is inquired Minimum chained list, and the content in the last one data block of the minimum chained list of the priority is deleted;Wherein, described preferential The minimum chained list of grade is the corresponding chained list in the smallest access times section;It needs to be determined that being read from chained list when hot spot keyword The access times of keyword are taken, and determine hot spot keyword according to the access times of keyword.
Based on similarly applying conceiving with the above method, the embodiment of the present application also provides a kind of machine readable storage medium, It can be applied to database server, several computer instructions, the computer be stored on the machine readable storage medium Instruction, which is performed, to be handled as follows: in measurement period, obtaining keyword, and obtain the access times of the keyword; It determines the access times section where the access times, and inquires chained list corresponding with the access times section;It is different Access times section correspond to different chained lists;Update position of the access times of the keyword in the chained list;It is needing When deleting the content in data block, according to the corresponding relationship in access times section and chained list, the minimum chain of priority is inquired Table, and the content in the last one data block of the minimum chained list of the priority is deleted;Wherein, the priority is minimum Chained list is the corresponding chained list in the smallest access times section;It needs to be determined that reading keyword from chained list when hot spot keyword Access times, and determine hot spot keyword according to the access times of keyword.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity, Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment The combination of any several equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this The function of each unit can be realized in the same or multiple software and or hardware when application.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application Apply the form of example.Moreover, it wherein includes computer usable program code that the embodiment of the present application, which can be used in one or more, The computer implemented in computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of program product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application Figure and/or block diagram describe.It is generally understood that being realized by computer program instructions each in flowchart and/or the block diagram The combination of process and/or box in process and/or box and flowchart and/or the block diagram.It can provide these computer journeys Sequence instruct to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor with A machine is generated, so that the instruction generation executed by computer or the processor of other programmable data processing devices is used for Realize the dress for the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram It sets.
Moreover, these computer program instructions also can store be able to guide computer or other programmable datas processing set In standby computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates Manufacture including command device, the command device are realized in one process of flow chart or multiple processes and/or block diagram one The function of being specified in a box or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing devices, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer Or the instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram The step of function of being specified in one box or multiple boxes.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal Replacement, improvement etc., should be included within the scope of the claims of this application.

Claims (24)

1. a kind of hot spot keyword acquisition methods, which is characterized in that be applied to database server, comprising:
In measurement period, keyword is obtained, and obtain the access times of the keyword;
It determines the access times section where the access times, and inquires chained list corresponding with the access times section; Wherein, different access times sections corresponds to different chained lists;
Update position of the access times of the keyword in the chained list;
It needs to be determined that reading the access times of keyword from chained list, and according to the access of keyword time when hot spot keyword Number determines hot spot keyword.
2. the method according to claim 1, wherein
The process of the access times for obtaining the keyword, specifically includes:
Obtain the corresponding data block location of the keyword;
Access times are inquired from the corresponding data block of the data block location;
The access times of the keyword are obtained using the access times inquired.
3. according to the method described in claim 2, it is characterized in that,
The process for obtaining the corresponding data block location of the keyword, specifically includes:
By the keyword query Hash table, data block location corresponding with the keyword is obtained;
Wherein, the Hash table is used for the corresponding relationship of recording key and data block location.
4. according to the method described in claim 3, it is characterized in that,
It is described by the keyword query Hash table after, the method also includes:
If the keyword is not present in the Hash table, for the keyword selection data block;
The access times of the keyword are recorded in the data block of selection, and record the keyword in the Hash table With the corresponding relationship of the data block location of the data block of the selection.
5. according to the method described in claim 2, it is characterized in that,
The access times that the utilization inquires obtain the process of the access times of the keyword, specifically include:
The access times for determining the keyword are that the access times inquired add default value;Alternatively,
The corresponding resource information of the keyword is obtained, and determines the weighted value of the keyword according to the resource information, and The access times for determining the keyword are that the access times inquired add the weighted value.
6. according to the method described in claim 5, it is characterized in that, the resource information includes: the keyword corresponding data Data size, and/or, the processing time of the keyword corresponding requests;
The process of the weighted value that the keyword is determined according to the resource information, specifically includes:
According to the relationship of the data size and pre-set dimension, the weighted value of the keyword is determined;Alternatively,
According to the relationship of the processing time and preset time, the weighted value of the keyword is determined;Alternatively,
According to the relationship of the data size and pre-set dimension, the first sub- weighted value of the keyword is determined;
According to the relationship of the processing time and preset time, the second sub- weighted value of the keyword is determined;
The weighted value of the keyword is determined according to the described first sub- weighted value and the second sub- weighted value.
7. according to the method described in claim 2, it is characterized in that, the access times that the utilization inquires obtain the key After the access times of word, the method also includes:
The access times of the keyword are updated into the corresponding data block of the data block location.
8. the method according to claim 1, wherein the method also includes:
When needing to delete the content in data block, the minimum chained list of priority is inquired;
Content in the last one data block of the minimum chained list of the priority is deleted;
Wherein, the minimum chained list of priority is the corresponding chained list in the smallest access times section.
9. the method according to claim 1, wherein
The process of position of the access times for updating the keyword in the chained list, specifically includes:
Data block where the access times of the keyword is updated to the first data block of the chained list.
10. the method according to claim 1, wherein
The access times according to keyword determine the process of hot spot keyword, specifically include:
According to the chained list of highest priority to the sequence of the minimum chained list of priority, the data block of chained list is successively traversed;Wherein, institute The chained list for stating highest priority is the largest the corresponding chained list in access times section, and the minimum chained list of the priority is the smallest The corresponding chained list in access times section;
If the access times of the keyword recorded in the data block traversed are greater than preset times threshold value, it is determined that the keyword is Hot spot keyword;Otherwise, it determines the keyword is not hot spot keyword;
Traverse in the presence of be not hot spot keyword chained list after, stop the data block for traversing next chained list.
11. the method according to claim 1, wherein the method also includes:
After measurement period, the content in the data block of all chained lists is removed.
12. a kind of hot spot keyword acquisition methods, which is characterized in that be applied to database server, comprising:
In measurement period, keyword is obtained by the keyword query Hash table and obtains number corresponding with the keyword According to block position;The Hash table is used for the corresponding relationship of recording key and data block location;
Access times are inquired from the corresponding data block of the data block location, using described in the access times acquisition inquired The access times of keyword update the access times of the keyword into the data block;
It needs to be determined that reading the access times of keyword from chained list, and according to the access of keyword time when hot spot keyword Number determines hot spot keyword.
13. according to the method for claim 12, which is characterized in that
It is described by the keyword query Hash table after, the method also includes:
If the keyword is not present in the Hash table, for the keyword selection data block;
The access times of the keyword are recorded in the data block of selection, and record the keyword in the Hash table With the corresponding relationship of the data block location of the data block of the selection.
14. according to the method for claim 12, which is characterized in that
The access times that the utilization inquires obtain the process of the access times of the keyword, specifically include:
The access times for determining the keyword are that the access times inquired add default value;Alternatively,
The corresponding resource information of the keyword is obtained, the weighted value of the keyword is determined according to the resource information, and really The access times of the fixed keyword are that the access times inquired add the weighted value;The resource information includes keyword pair The data size of data is answered, and/or, the processing time of keyword corresponding requests.
15. a kind of hot spot keyword acquisition methods, which is characterized in that be applied to database server, comprising:
In measurement period, keyword is obtained, and obtain the access times of the keyword;
It determines the access times section where the access times, and inquires chained list corresponding with the access times section; Wherein, different access times sections corresponds to different chained lists;
Update position of the access times of the keyword in the chained list;
When needing to delete the content in data block, according to the corresponding relationship in access times section and chained list, priority is inquired Minimum chained list, and the content in the last one data block of the minimum chained list of the priority is deleted;Wherein, priority is most Low chained list is the corresponding chained list in the smallest access times section;
It needs to be determined that reading the access times of keyword from chained list, and according to the access of keyword time when hot spot keyword Number determines hot spot keyword.
16. according to the method for claim 15, which is characterized in that
The access times according to keyword determine the process of hot spot keyword, specifically include:
According to the chained list of highest priority to the sequence of the minimum chained list of priority, the data block of chained list is successively traversed;Wherein, institute The chained list for stating highest priority is the largest the corresponding chained list in access times section, and the minimum chained list of the priority is the smallest The corresponding chained list in access times section;
If the access times of the keyword recorded in the data block traversed are greater than preset times threshold value, it is determined that the keyword is Hot spot keyword;Otherwise, it determines the keyword is not hot spot keyword;
Traverse in the presence of be not hot spot keyword chained list after, stop the data block for traversing next chained list.
17. a kind of hot spot keyword acquisition device, which is characterized in that be applied to database server, comprising:
Module is obtained, for keyword being obtained, obtaining the access times of the keyword in measurement period;
Determining module for determining the access times section where the access times, and inquires and the access times area Between corresponding chained list;Wherein, different access times sections corresponds to different chained lists;And update the access of the keyword Position of the number in the chained list;
The determining module is also used to it needs to be determined that read the access times of keyword from chained list when hot spot keyword, and Hot spot keyword is determined according to the access times of keyword.
18. device according to claim 17, which is characterized in that
The acquisition module, specifically for obtaining the keyword pair during obtaining the access times of the keyword The data block location answered, and access times are inquired from the corresponding data block of the data block location, and using inquiring Access times obtain the access times of the keyword;
Wherein, the acquisition module is specifically used for passing through institute during the acquisition keyword corresponding data block location Keyword query Hash table is stated, data block location corresponding with the keyword is obtained;Wherein, the Hash table is closed for recording The corresponding relationship of key word and data block location;
During obtaining the access times of the keyword using the access times inquired, the visit of the keyword is determined Ask that number is that the access times inquired add default value;Alternatively, obtaining the corresponding resource information of the keyword, and according to institute The weighted value that resource information determines the keyword is stated, and determines that the access times of the keyword are the access times inquired Add the weighted value;Wherein, the resource information includes: the data size of the keyword corresponding data, and/or, the pass The processing time of key word corresponding requests.
19. device according to claim 17, which is characterized in that further include:
Removing module, for when needing to delete the content in data block, inquiring the minimum chained list of priority, and will be described excellent Content in the last one data block of the minimum chained list of first grade is deleted;
The determining module, specifically for during the access times according to keyword determine hot spot keyword, according to excellent The first highest chained list of grade successively traverses the data block of chained list to the sequence of the minimum chained list of priority;If the data block traversed The access times of the keyword of middle record are greater than preset times threshold value, it is determined that the keyword is hot spot keyword;Otherwise, it determines The keyword is not hot spot keyword;Traverse in the presence of be not hot spot keyword chained list after, stop traversing next chained list Data block;
Wherein, the chained list of the highest priority is the largest the corresponding chained list in access times section, and the priority is minimum Chained list is the corresponding chained list in the smallest access times section.
20. a kind of hot spot keyword acquisition device, which is characterized in that be applied to database server, comprising:
Module is obtained, is obtained corresponding in measurement period, obtaining keyword by the keyword query Hash table Data block location;The Hash table is used for the corresponding relationship of recording key and data block location;From the data block location pair Access times are inquired in the data block answered, the access times of the keyword are obtained using the access times inquired, by institute The access times for stating keyword are updated into the data block;
Determining module, for it needs to be determined that reading the access times of keyword from chained list, and according to reading when hot spot keyword The access times of the keyword taken determine hot spot keyword.
21. a kind of hot spot keyword acquisition device, which is characterized in that be applied to database server, comprising:
Module is obtained, for obtaining keyword, and obtain the access times of the keyword in measurement period;
Determining module for determining the access times section where the access times, and inquires and the access times area Between corresponding chained list;Wherein, different access times sections corresponds to different chained lists;And update the access of the keyword Position of the number in the chained list;
Removing module, for when needing to delete the content in data block, according to the corresponding relationship in access times section and chained list, The minimum chained list of priority is inquired, the content in the last one data block of the minimum chained list of the priority is deleted;Institute Stating the minimum chained list of priority is the corresponding chained list in the smallest access times section;
The determining module is also used to it needs to be determined that read the access times of keyword from chained list when hot spot keyword, and Hot spot keyword is determined according to the access times of the keyword of reading.
22. a kind of database server, which is characterized in that the database server includes:
Processor, for obtaining keyword, and obtain the access times of the keyword in measurement period;Determine the visit It asks the access times section where number, and inquires chained list corresponding with the access times section;Wherein, different access Time intervals correspond to different chained lists;Update position of the access times of the keyword in the chained list;It needs to be determined that When hot spot keyword, the access times of keyword are read from chained list, and determine hot spot key according to the access times of keyword Word.
23. a kind of database server, which is characterized in that the database server includes:
Processor obtains keyword, and by the keyword query Hash table in measurement period, obtain with it is described The corresponding data block location of keyword;Wherein, the Hash table is used for the corresponding relationship of recording key and data block location;From Access times are inquired in the corresponding data block of the data block location, and obtain the key using the access times inquired The access times of word, and the access times of the keyword are updated into the data block;It needs to be determined that hot spot keyword When, the access times of keyword are read from chained list, and determine hot spot keyword according to the access times of keyword.
24. a kind of database server, which is characterized in that the database server includes:
Processor, for obtaining keyword, and obtain the access times of the keyword in measurement period;Determine the visit It asks the access times section where number, and inquires chained list corresponding with the access times section;Wherein, different access Time intervals correspond to different chained lists;Update position of the access times of the keyword in the chained list;It is needing to delete When content in data block, according to the corresponding relationship in access times section and chained list, the minimum chained list of priority is inquired, and will Content in the last one data block of the minimum chained list of the priority is deleted;Wherein, the minimum chained list of the priority is The corresponding chained list in the smallest access times section;It needs to be determined that reading the access of keyword from chained list when hot spot keyword Number, and hot spot keyword is determined according to the access times of keyword.
CN201710865548.6A 2017-09-22 2017-09-22 A kind of hot spot keyword acquisition methods, device and server Pending CN109542612A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710865548.6A CN109542612A (en) 2017-09-22 2017-09-22 A kind of hot spot keyword acquisition methods, device and server
PCT/CN2018/104799 WO2019056958A1 (en) 2017-09-22 2018-09-10 Trending keyword acquisition method, device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710865548.6A CN109542612A (en) 2017-09-22 2017-09-22 A kind of hot spot keyword acquisition methods, device and server

Publications (1)

Publication Number Publication Date
CN109542612A true CN109542612A (en) 2019-03-29

Family

ID=65810693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710865548.6A Pending CN109542612A (en) 2017-09-22 2017-09-22 A kind of hot spot keyword acquisition methods, device and server

Country Status (2)

Country Link
CN (1) CN109542612A (en)
WO (1) WO2019056958A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768894A (en) * 2019-09-02 2020-02-07 上海掌门科技有限公司 Method and equipment for deleting session message
CN111355580A (en) * 2020-05-25 2020-06-30 腾讯科技(深圳)有限公司 Data interaction method and device based on Internet of things
CN111464629A (en) * 2020-03-31 2020-07-28 中国建设银行股份有限公司 Hot spot data determination method and device
CN112487326A (en) * 2020-11-27 2021-03-12 杭州安恒信息技术股份有限公司 Data caching method, system, storage medium and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102937993A (en) * 2012-11-09 2013-02-20 北京小米科技有限责任公司 Method and device for accessing keywords
CN103178989A (en) * 2013-02-18 2013-06-26 中兴通讯股份有限公司 Method and device for calculating visit hotness
CN103559313A (en) * 2013-11-20 2014-02-05 北京奇虎科技有限公司 Searching method and device
US20160357851A1 (en) * 2015-06-05 2016-12-08 Mr. Buzz, Inc. dba WeOtta Natural Language Search With Semantic Mapping And Classification

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101482756B1 (en) * 2013-08-07 2015-01-14 네이버 주식회사 Method and system for recommending keyword based semantic area
CN104750873A (en) * 2015-04-22 2015-07-01 百度在线网络技术(北京)有限公司 Popular search term push method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102937993A (en) * 2012-11-09 2013-02-20 北京小米科技有限责任公司 Method and device for accessing keywords
CN103178989A (en) * 2013-02-18 2013-06-26 中兴通讯股份有限公司 Method and device for calculating visit hotness
CN103559313A (en) * 2013-11-20 2014-02-05 北京奇虎科技有限公司 Searching method and device
US20160357851A1 (en) * 2015-06-05 2016-12-08 Mr. Buzz, Inc. dba WeOtta Natural Language Search With Semantic Mapping And Classification

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768894A (en) * 2019-09-02 2020-02-07 上海掌门科技有限公司 Method and equipment for deleting session message
CN111464629A (en) * 2020-03-31 2020-07-28 中国建设银行股份有限公司 Hot spot data determination method and device
CN111355580A (en) * 2020-05-25 2020-06-30 腾讯科技(深圳)有限公司 Data interaction method and device based on Internet of things
CN111355580B (en) * 2020-05-25 2020-09-11 腾讯科技(深圳)有限公司 Data interaction method and device based on Internet of things
CN112487326A (en) * 2020-11-27 2021-03-12 杭州安恒信息技术股份有限公司 Data caching method, system, storage medium and equipment
CN112487326B (en) * 2020-11-27 2024-03-19 杭州安恒信息技术股份有限公司 Data caching method, system, storage medium and equipment

Also Published As

Publication number Publication date
WO2019056958A1 (en) 2019-03-28

Similar Documents

Publication Publication Date Title
CN107395659A (en) A kind of method and device of service handling and common recognition
CN109542612A (en) A kind of hot spot keyword acquisition methods, device and server
CN107450979A (en) A kind of block chain common recognition method and device
CN108683695A (en) Hot spot access processing method, cache access agent equipment and distributed cache system
CN106649401A (en) Data writing method and device of distributed file system
CN110162292A (en) Voice broadcast method and device
CN103970870A (en) Database query method and server
US9135630B2 (en) Systems and methods for large-scale link analysis
CN110472004B (en) Method and system for multi-level cache management of scientific and technological information data
CN109299222A (en) Verification of data method and device
CN104794228A (en) Search result providing method and device
CN104657435A (en) Storage management method for application data and network management system
CN109284305A (en) A kind of update method of data, apparatus and system
CN108228110A (en) A kind of method and apparatus for migrating resource data
CN107545050A (en) Data query method and device, electronic equipment
CN108399175B (en) Data storage and query method and device
CN101635001B (en) Method and apparatus for extracting information from a database
CN108470043A (en) A kind of acquisition methods and device of business result
KR101243289B1 (en) Information searching system for social network Service
CN109255001A (en) Maintaining method and device, the electronic equipment in interface instance library
CN110334073A (en) A kind of metadata forecasting method, device, terminal, server and storage medium
CN106250327B (en) One kind hot spot recognition methods and device in key-value storage
CN109376174A (en) A kind of method and apparatus selecting database
CN112307272B (en) Method, device, computing equipment and storage medium for determining relation information between objects
CN108256694A (en) Based on Fuzzy time sequence forecasting system, the method and device for repeating genetic algorithm

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: 20190329

RJ01 Rejection of invention patent application after publication