Summary of the invention
In order to improve the confidence level of businessman's ranking, filtering brushes single favorable comment and comments data with maliciously poor, and consumer can search
To the high-quality businessman for really needing searching, the present invention provides a kind of merchant recommendation methods based on user's history consumption data.
The technical scheme adopted by the invention is that:
A kind of merchant recommendation method based on user's history consumption data, comprising the following steps:
Step 1, user set search radius r, search key;
Step 2, equipment obtain user location P0, and with cycle T by keyword, radius r and P0It is sent to server;
Step 3, server are according to P0Businessman nearby is searched for, the businesses lists L within the scope of neighbouring radius r is obtainedin;
Step 4, selection LinIn first businessman m;
If step 5, m are not present, step 6 is gone to, otherwise calculates the average mark of m scoring:
The calculating process are as follows:
(5.1) businessman m nearest one month customer consumption data list L is obtainedm;
(5.2) by LmThe consumer record that middle user location and businessman m positional distance are greater than the set value d is deleted, and is calculated
To the number of users n and consumption number of times C of each useri, i=1,2 ..., n;
(5.3) it calculates businessman m and amounts to sales volume Ctotal, according to user account grade weights omegagWith nearest one month
Buy the scoring summation S for each user of interval computation that number dividesi, i=1,2 ..., n, wherein ωgIt is user account grade
Weight, ω1、ω2And ω3It is to buy the weight of time intervals, and count the scoring summation S that a nearest month businessman obtainstotal,
Are as follows:
(5.4) according to scoring total score StotalWith sales volume Ctotal, calculate the average mark S of businessman's scoringavg, are as follows:
(5.5) m is added to recommendation list LoutIn, and from LinDelete m, return step 4;
Step 6, server sort the list L of output from high to low according to the average mark of calculatingout, and by LoutIt returns to and sets
It is standby.
Further, in the step 1, user uses equipment, and the equipment (such as computer, mobile phone) can pass through GPS
Current specific location is obtained, and is able to access that internet, search radius r is that user is customized apart from size, and unit is kilometer,
Distance d ' is according to calculation of longitude & latitude between two positions;
D '=arccos (sin (y0)*sin(y1)+cos(y0)*cos(ye)*cos(x0-x1))*Re,
Wherein, ReIt is earth radius, (x0,y0) and (x1,y1) be respectively two location points latitude and longitude coordinates.
Further, in the step 2, cycle T is the time pre-defined, and unit is minute.
Further, in the step 3, obtained businesses lists LinIn businessman from the near to the remote arranged according to distance
Good sequence.
In the step 5, the information and customer consumption historical data of businessman has been stored in advance in the database, businessman
Information includes Name & Location (longitude and latitude) information, and customer consumption historical data includes consumption account grade, the name of consumer
Claim, consume position, consumption time and the scoring to businessman, the value d that customer consumption position differs setting with merchant location is used to
Judge whether customer consumption position meets with merchant location, unit is rice, and scoring range is 0-5 points every time, is all integer, most
The resulting average score of businessman retains a decimal afterwards.
Further, t1And t2Indicate the lower and upper limit of normal purchase time intervals, t3Indicate that excessively abnormal quantity purchase rises
Initial value exceeds t3User scoring all 0, different weights omegas1, ω2And ω3For the score conversion of corresponding purchase time intervals
Percentage, ω2>ω1≥ω3, ωgPercentage is converted for the corresponding score of different account grades, different consumption number of times sections are commented
Dividing with the product of corresponding consumption number of times interval weight and account grade respective weights is that corresponding real consumption time intervals are commented
Score value.
Technical concept of the invention are as follows: user's search key, server is according to equipment search radius obtained, user
Position and keyword obtain businesses lists, and the historical consumption data for being then based on user is poor to the brush list favorable comment and malice of businessman
Situations such as commenting is filtered, and to obtain user's scoring of relative efficiency, is finally counted according to the overall score of user and consumption number of times
The average mark of businessman is calculated, and is sorted with this, comprehensive score validity is improved.
In the search process of user, timing is detected user position by this algorithm, for example is within 1 minute the period, if with
Family position changes, and re-searches for businessman around, provides effective search result for user.
Beneficial effects of the present invention are mainly manifested in: filtering what some businessmans employed based on the historical consumption data of user
Brush single favorable comment situation and colleague's malice be poor comments situation, effective user's evaluation is obtained with this, thus based on these evaluate come
Calculate the ranking of businessman, the businessman that user can be helped accurately to have found out.
Specific embodiment
The invention will be further described below in conjunction with the accompanying drawings.
Referring to Figures 1 and 2, a kind of merchant recommendation method based on user's history consumption data sets search half in user
When diameter and search key, equipment obtains user position, and it is sent jointly to server, server root with keyword
According to keyword and position acquisition businesses lists, is then calculated according to the nearest one month historical consumption data of user and count businessman
Gained scoring finally calculates businessman's averaging of income scoring, and businesses lists according to marking and queuing and is returned to equipment, institute's commentary
Estimate method the following steps are included:
Step 1, user set search radius r, search key.As shown in Figure 1, user can on different devices,
Such as mobile phone, computer etc., it scans for.
In the present embodiment, 0.5 kilometer of search radius r value, keyword is dining room, current date value August 10 in 2018
Day.
Step 2, equipment obtain user current location P0(120.048749,30.234343), and with search radius r and close
Keyword sends jointly to server;
Step 3, server are according to P0The businessman that radius nearby is r is searched for, list L is obtainedin.As shown in Figure 1, it is assumed that
3 businessmans are searched, are m respectively1, m2And m3, and the distance relationship shown in Fig. 1 represents actual range distant relationships, Lin
As shown in table 1 (distance is calculated according to user current location and merchant location):
Table 1
Step 4-1, L is selectedinIn first businessman, m=m at this time1;
Step 5-1, the scoring average mark of m is calculated:
The comment list L of (5-1.1) acquisition mm, as shown in table 2:
Consumer's title |
Account grade |
Consume position |
Consumption time |
Scoring |
U1-1 |
1 |
120.049036,30.233672 |
On August 6th, 2018 |
5 |
U1-2 |
3 |
120.049019,30.23109 |
On August 6th, 2018 |
4 |
U1-3 |
6 |
120.04918,30.233555 |
On August 5th, 2018 |
2 |
… |
… |
… |
… |
… |
U1-n |
2 |
120.04918,30.233555 |
On July 11st, 2018 |
5 |
Table 2
(5-1.2) is by LmThe consumer record of middle user location and businessman m positional distance greater than 100 meters is deleted, and is calculated
To the number of users n=150 and consumption number of times C of each useri(i=1,2 ..., 150), as shown in table 3:
Table 3
(5-1.3) calculates m and amounts to sales volume Ctotal, according to user account grade weight and nearest purchase in one month time
The scoring summation S for each user of interval computation that number dividesi(i=1,2 ..., 150), and count a nearest month businessman and obtain
Scoring summation Stotal, are as follows:
Ctotal=2+3+5+ ...+20=350;
S1=25%*50%*5=0.625;
S2=80%*50%* (2+4+3)=3.6;
S3=50%*50%* (5+4+5)+50%*70%* (4+5)=6.55;
…
S150=0;
Stotal=0.625+3.6+6.55+ ...+0=1064;
The average score of (5-1.4) calculating m, it may be assumed that Savg=1064/350=3.0;
(5-1.5) is by m1It is added to Lout, and by m1From LinIt deletes, return step 4;
Step 4-2, L is selectedinIn first businessman, m=m at this time3;
Step 5-2, the scoring average mark of m is calculated:
The customer consumption historical data list L of (5-2.1) acquisition mm, as shown in table 4:
Consumer's title |
Account grade |
Consume position |
Consumption time |
Scoring |
U3-1 |
3 |
120.047267,30.235045 |
On August 9th, 2018 |
5 |
U3-2 |
2 |
120.048138,30.231714 |
On August 9th, 2018 |
1 |
U3-3 |
4 |
120.052594,30.232876 |
On August 8th, 2018 |
4 |
… |
… |
… |
… |
… |
U3-j |
5 |
120.047267,30.235045 |
On July 11st, 2018 |
5 |
Table 4
(5-2.2) is by LmThe consumer record of middle user location and businessman m positional distance greater than 100 meters is deleted, and is calculated
To the number of users n=120 and consumption number of times C of each useri(i=1,2 ..., 120), as shown in table 5:
Table 5
(5-2.3) calculates m and amounts to sales volume Ctotal, according to user account grade weight and nearest purchase in one month time
The scoring summation S for each user of interval computation that number dividesi(i=1,2 ..., 120), and count a nearest month businessman and obtain
Scoring summation Stotal, are as follows:
Ctotal=1+1+2+ ...+10=300;
S1=50%*50%*3=0.75;
S2=25%*50%*3=0.375;
S3=50%*50%* (4+4)=2;
…
S120=50%*50%* (4+3+3)+50%*70%* (3+3+3)+50%*30%* (4+3+3+4)=7.75;
Stotal=0.75+0.375+2+ ...+7.75=756;
The average score of (5-2.4) calculating m, it may be assumed that Savg=756/300=2.5;
(5-2.5) is by m3It is added to Lout, and from LinDelete m3, return step 4;
Step 4-3, L is selectedinIn first businessman, m=m at this time2;
Step 5-3, the scoring average mark of m is calculated:
The customer consumption historical data list L of (5-3.1) acquisition mm, as shown in table 6:
Consumer's title |
Account grade |
Consume position |
Consumption time |
Scoring |
U2-1 |
4 |
120.048758,30.230708 |
On August 9th, 2018 |
5 |
U2-2 |
1 |
120.048758,30.230708 |
On August 9th, 2018 |
1 |
U2-3 |
5 |
120.048758,30.230708 |
On August 9th, 2018 |
5 |
… |
… |
… |
… |
… |
U2-k |
7 |
120.048399,30.230333 |
On July 13rd, 2018 |
5 |
Table 6
(5-3.2) is by LmThe consumer record of middle user location and businessman m positional distance greater than 100 meters is deleted, and is calculated
To the number of users n=180 and consumption number of times C of each useri(i=1,2 ..., 180), as shown in table 7:
Table 7
(5-3.3) calculates m and amounts to sales volume Ctotal, according to user account grade weight and nearest purchase in one month time
The scoring summation S for each user of interval computation that number dividesi(i=1,2 ..., 180), and count a nearest month businessman and obtain
Scoring summation Stotal, are as follows:
Ctotal=1+1+2+ ...+10=330;
S1=50%*50%*5=1.25;
S2=0;
S3=50%*50%*5=1.25;
…
S180=80%*50%* (4+5)=3.6;
Stotal=1.25+0+1.25+ ...+3.6=1398;
The average score of (5-3.4) calculating m, it may be assumed that Savg=1398/330=4.2;
(5-3.5) is by m2It is added to Lout, and from LinMiddle deletion m2Return step 4;
Step 4-4, optional without businessman;
Step 5-4, step 6 is gone to;
Step 6, sort businesses lists according to average score, obtains LoutAnd export, as shown in Fig. 1 and table 8:
Businessman |
Distance (unit: kilometer) |
Position |
Average score |
m2 |
0.48 |
120.048758,30.230708 |
4.2 |
m1 |
0.08 |
120.047267,30.235045 |
3.0 |
m3 |
0.12 |
120.048758,30.230708 |
2.5 |
Table 8
In the present embodiment, setting value d takes 100.
In the present embodiment, user account grade is divided into 1-3 grades, corresponding ωg25%, 50% and 80% is taken respectively,
Different weight percentage, t can be taken under concrete condition1、t2And t3Respectively 4,7 and 15 can take different numbers in particular situations
Value, corresponding ω1、ω2And ω3Respectively 50%, 70% and 30% can take different conversion percentages in particular situations
Than.
In the present embodiment, since user can be moved to any position at any time, it is mutual that search equipment used need to have access at any time
The ability of networking avoids server that from can not obtaining user location and can not carry out so as to obtain position and access server
It calculates.
Those of ordinary skill in the art is it should be appreciated that the above content is intended merely to illustrate the present invention, and simultaneously
It is non-to be used as limitation of the invention, as long as all will in spirit of the invention to variation, the modification of above example
It falls within the scope of claims of the present invention.