The matching system of hotel's data and methodTechnical field
The present invention relates to matching system and the method for a kind of hotel data, particularly hotel's title and hotel's house type carry out the matching system of hotel's data of layering and matching and a kind of matching process of the hotel's data utilizing described matching system to realize particularly to relate to a kind of hotel's data to online tourism website.
Background technology
The similarity algorithm that existing online tourism website adopts when mating hotel's data is all mate based on the rule of " participle+dictionary+character " similarity, and promote matching degree by the near synonym in database, synon enriching, but, along with increase or the renewal of the near synonym in database, synonym entry, the similarity of some Keywords matching can be improved, but also can have influence on the similarity of other Keywords matching simultaneously.And, entry in database is overall, do not distinguish supplier, concrete business scenario is not distinguished yet, interference is mutually there is, particularly for the entry with relation of inclusion or cross reference, along with entry increasing number between entry, relation between entry can become increasingly complex, and the mutual interference between entry can be more serious.
Such as, in existing database, originally regular entry set is as " senior=administration ", " senior large bed room " this keyword and " between administrative large bed " match, if add regular entry " luxurious=senior " again, " senior large bed room " and " luxurious twin room " then may be caused to match, and then cause original best matching result change and be difficult to control forecasting, cause, when adding regular entry, interference is brought to the coupling of keyword.
Summary of the invention
The technical problem to be solved in the present invention is that the matching way of keyword in order to overcome hotel's data in prior art is more single, cause when adding regular entry, matching result can change and be difficult to control forecasting, and then the coupling of keyword is brought to the defect of interference, particularly hotel's title and hotel's house type carry out the matching system of hotel's data of layering and matching and a kind of matching process of the hotel's data utilizing described matching system to realize to provide a kind of hotel's data to online tourism website.
The present invention solves above-mentioned technical matters by following technical proposals:
The invention provides the matching system of a kind of hotel data, its feature is, described matching system has N number of matching unit, and each matching unit is all preset with a matching algorithm, and wherein N is positive integer, and N >=2;
A kth matching unit calculates the similarity of the keyword that each hotel data in a database and user input according to the matching algorithm preset, and chooses the maximum occurrences of similarity;
Described matching system also comprises a judge module and an output module, described judge module is for judging whether the maximum occurrences of described similarity is greater than a kth threshold value, if, then call described output module and export the hotel data corresponding with the maximum occurrences of described similarity, if not, be then k by k+1 assignment;
If k+1=N and described judge module judges that the maximum occurrences of the similarity that N number of matching unit calculates is not more than N threshold value, then from the similarity that described N number of matching unit calculates, choose a maximum similarity, and call the described output module output hotel data corresponding with described maximum similarity;
Wherein, kth threshold value is less than or equal to kth+1 threshold value, and k is positive integer, and 1≤k≤N-1, when described matching system receives the described keyword of user's input first, k value is 1.
The default matching algorithm of each matching unit is and utilizes the attainable algorithm of prior art, just repeats no more at this, and kth threshold value is less than or equal to kth+1 threshold value and just ensure that the matching accuracy rate of described matching system is more and more higher.
Certainly, the similarity result that also can be set to allow kth+1 matching unit to calculate is greater than or less than the similarity result that a kth matching unit calculates, namely each layer result is allowed to float a little, because net result is got in the similarity that a front k matching unit calculates and is chosen a maximum similarity result (concussion of anti-local), thus ensures that described matching system has certain fault-tolerance.
Preferably, if k+1=N and described judge module judges that the maximum occurrences of the similarity that N number of matching unit calculates is not more than N threshold value, also according to order from big to small, the similarity that described N number of matching unit calculates is sorted, and call the described output module output hotel data corresponding with a front m similarity, wherein m is positive integer and m >=2.
Preferably, the similarity assignment that a described kth matching unit calculates, when judging that the maximum occurrences of described similarity is not more than described kth threshold value, is also 0 by described judge module.
The object of the invention is to the matching process additionally providing a kind of hotel data, its feature is, it utilizes above-mentioned matching system to realize, and described matching process comprises the following steps:
S1, when described matching system receive first user input keyword time, be 1 by k assignment;
S2, a kth matching unit calculates the similarity of each hotel data in a database and described keyword, and chooses the maximum occurrences of similarity according to the matching algorithm preset;
S3, described judge module judges whether the maximum occurrences of described similarity is greater than a kth threshold value, if so, then performs step S4, if not, then perform step S5;
S4, call described output module and export hotel data corresponding with the maximum occurrences of described similarity, then process ends;
S5, be k by k+1 assignment, then return step S2;
In described matching process, if k+1=N and described judge module judges that the maximum occurrences of the similarity that N number of matching unit calculates is not more than N threshold value, then from the similarity that described N number of matching unit calculates, choose a maximum similarity, and call the described output module output hotel data corresponding with described maximum similarity.
Preferably, in described matching process, if k+1=N and described judge module judges that the maximum occurrences of the similarity that N number of matching unit calculates is not more than N threshold value, also according to order from big to small, the similarity that described N number of matching unit calculates is sorted, and call the described output module output hotel data corresponding with a front m similarity, wherein m is positive integer and m >=2.
Preferably, in described matching process, the similarity assignment that a described kth matching unit calculates, when judging that the maximum occurrences of described similarity is not more than described kth threshold value, is also 0 by described judge module.
Positive progressive effect of the present invention is: the present invention can carry out the layering and matching of multiple dimension to hotel's data of online tourism website, and the matched rule of every one deck can sets itself according to actual needs, and utilize multiple matching unit to carry out layering and matching and there is good serious forgiveness, thus the degree of accuracy of matching result can be improved, reduce the fault rate of coupling.
Accompanying drawing explanation
Fig. 1 is the module diagram of the matching system of hotel's data of a preferred embodiment of the present invention.
Fig. 2 is the process flow diagram of the matching process of hotel's data of a preferred embodiment of the present invention.
Embodiment
Mode below by embodiment further illustrates the present invention, but does not therefore limit the present invention among described scope of embodiments.
As shown in Figure 1, the disposal system of hotel of the present invention data has N number of matching unit 1, also comprises judge module 2 and output module 3, wherein N >=2.
Wherein, each matching unit 1 is all preset with a matching algorithm, concrete matching algorithm can be such as: remove the symbol such as space, bracket to certain keyword, when certain word is in braces, it is ignored, the near synonym of certain word only act on some specific suppliers of hotel etc., these matching algorithms are all the algorithms utilizing prior art to realize, and the concrete matching algorithm of each matching unit 1 can set according to the demand of reality, just repeats no more at this.
Matching system of the present invention can carry out coupling and output matching result to the keyword of user's input, concrete consistency operation is: after a certain keyword receiving user's input, be positive integer by parameter k(k, and 1≤k≤N-1) assignment is 1, the similarity of the keyword that kth (being the 1st when mating described keyword first) matching unit 1 can input according to each hotel data in the database of the matching algorithm calculating online tourism website of presetting and user, and therefrom choose the maximum occurrences of similarity, the maximum occurrences of the similarity be selected is in a database to there being specific hotel data.
Whether the maximal value of the described similarity that 2 judgements of described judge module are chosen is greater than a kth threshold value, if, then call described output module 3 and export the hotel data corresponding with the maximal value of the described similarity chosen, hotel's data of output are best matching result; If not, then illustrate that a described kth matching unit does not match suitable hotel's data, now, be just k by k+1 assignment, namely start kth+1 matching unit 1 to mate, action performed by kth+1 matching unit is substantially identical with a kth matching unit 1, just repeats no more at this, and wherein kth threshold value is less than or equal to kth+1 threshold value.
Work as k+1=N, and described judge module 2 is when judging that the maximum occurrences of the similarity calculated by N number of matching unit 1 chosen is not more than N threshold value, then from described N number of matching unit 1(and all matching units 1) choose a maximum similarity all similarities of calculating, and using hotel's data corresponding with the maximum similarity chosen in database as best matching result, call described output module 3 and export best matching result, namely export the hotel data corresponding with the maximum similarity chosen.
In the present embodiment, when described judge module 2 judges that the maximum occurrences of the similarity calculated by N number of matching unit 1 chosen is not more than N threshold value, can also sort to the similarity that described N number of matching unit calculates according to order from big to small, and call the described output module 3 output hotel data corresponding with a front m similarity, be about to the hotel data corresponding with a front m similarity export as Optimum Matching result, wherein m is positive integer and m >=2.
In the present embodiment, described judge module 2 is when judging that the maximum occurrences of the described similarity calculated by a kth matching unit 1 is not more than described kth threshold value, can also be 0 by the similarity assignment that a described kth matching unit calculates, it fails to match namely to assert a kth matching unit 1.
As shown in Figure 2, the matching process of the present invention's hotel's data of utilizing the matching system of hotel's data of the present embodiment to realize comprises the following steps:
Step 101, when described matching system receive first user input keyword time, be 1 by k assignment.
Step 102, a kth matching unit 1 calculates the similarity of each hotel data in a database and described keyword according to the matching algorithm preset, and chooses the maximum occurrences of similarity.
Step 103, described judge module 2 judge whether the maximum occurrences of described similarity is greater than a kth threshold value, if so, then perform step 104, if not, then perform step 105.
Step 104, call described output module 3 and export hotel data corresponding with the maximum occurrences of described similarity, then process ends.
Step 105, be k by k+1 assignment, then return step 102.
In the described matching process of the present embodiment, if k+1=N and described judge module 2 judges that the maximum occurrences of the similarity that N number of matching unit 1 calculates is not more than N threshold value, then from the similarity that described N number of matching unit 1 calculates, choose a maximum similarity, and call the described output module 3 output hotel data corresponding with described maximum similarity.
In described matching process, if k+1=N and described judge module 2 judges that the maximum occurrences of the similarity that N number of matching unit calculates is not more than N threshold value, also according to order from big to small, the similarity that described N number of matching unit calculates is sorted, and call the described output module 3 output hotel data corresponding with a front m similarity, wherein m is positive integer and m >=2.
In described matching process, the similarity assignment that a described kth matching unit calculates, when judging that the maximum occurrences of described similarity is not more than described kth threshold value, is also 0 by described judge module 2.
Although the foregoing describe the specific embodiment of the present invention, it will be understood by those of skill in the art that these only illustrate, protection scope of the present invention is defined by the appended claims.Those skilled in the art, under the prerequisite not deviating from principle of the present invention and essence, can make various changes or modifications to these embodiments, but these change and amendment all falls into protection scope of the present invention.