Method, device, electronic device and storage medium for recommending scenic spots

By constructing the feature matrix and calculating the feature values ​​and feature vectors of the covariance matrix, and calculating the recommended values ​​of scenic spots in the existing technology, the problem of low accuracy in scenic spot recommendations is solved, and more accurate and comprehensive scenic spot recommendations are achieved.

CN113761346BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110197488.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-22
Publication Date
2025-02-21
Estimated Expiration
2041-02-22

AI Technical Summary

Technical Problem

The existing methods of recommendation of attractions are difficult to comprehensively evaluate attractions due to the use of single indicators, resulting in low accuracy of recommendation results and cannot meet the needs of users.

Method used

By receiving scenic spot query requests, obtaining target parameters, constructing feature matrix, calculating covariance matrix to obtain eigenvalues ​​and eigenvectors, calculating recommended values ​​based on the feature vectors and feature matrix, and determining the target recommended attractions.

Benefits of technology

It has achieved the evaluation of scenic spots from multiple dimensions, improved the accuracy of recommendation results, and better met the needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761346B_ABST
    Figure CN113761346B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device and storage medium for recommending scenic spots, and relates to the field of computer technology. A specific implementation of the method includes: receiving a scenic spot query request, obtaining a target parameter in the scenic spot query request to obtain corresponding scenic spot data to be recommended, and constructing a corresponding feature matrix based on the scenic spot data to be recommended; calculating the covariance matrix of the feature matrix, and then obtaining eigenvalues ​​and eigenvectors; determining that the maximum value in the eigenvalue is greater than a preset first threshold, then calculating the recommendation value corresponding to the scenic spot to be recommended based on the eigenvector and the feature matrix, and determining and sending the target recommended scenic spot from the scenic spots to be recommended based on the recommendation value. This implementation can solve the problem that since a single indicator is used to rank scenic spots when recommending scenic spots, it is difficult to comprehensively evaluate the scenic spots, so the recommendation results obtained are of low accuracy and cannot meet the needs of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic equipment and storage medium for recommending scenic spots. Background Art

[0002] It has become a common way for users to search for tourist attractions through the system to choose a place to visit. In order to facilitate the user's selection, the system usually recommends tourist attractions to the user. The existing method of recommending attractions usually ranks the attractions according to a certain indicator of the attractions, and then recommends them based on the ranking results. However, since a single indicator is used to rank the attractions when recommending attractions, it is difficult to comprehensively evaluate the attractions, so the recommendation results are less accurate and cannot meet the needs of users. Summary of the invention

[0003] In view of this, the embodiments of the present invention provide a method, device, electronic device and storage medium for recommending scenic spots, which can solve the problem that since a single indicator is used to rank scenic spots when recommending scenic spots, it is difficult to comprehensively evaluate the scenic spots, so the recommendation results are of low accuracy and cannot meet the needs of users.

[0004] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for recommending scenic spots is provided.

[0005] A method for recommending scenic spots in an embodiment of the present invention includes: receiving a scenic spot query request, obtaining target parameters in the scenic spot query request to obtain corresponding scenic spot data to be recommended, and constructing a corresponding feature matrix based on the scenic spot data to be recommended; calculating the covariance matrix of the feature matrix to obtain eigenvalues ​​and eigenvectors; determining that the maximum value of the eigenvalues ​​is greater than a preset first threshold, then calculating the recommendation value corresponding to the scenic spot to be recommended based on the eigenvector and the feature matrix, and determining the target recommended scenic spot from the scenic spots to be recommended based on the recommendation value and sending it.

[0006] In one embodiment, calculating the recommendation value of the scenic spot to be recommended according to the feature vector and the feature matrix includes:

[0007] Calculating the ratio of each eigenvalue to the sum of the eigenvalues, and selecting the target eigenvalue according to the size of each ratio;

[0008] The recommendation value of the scenic spot to be recommended is calculated according to the eigenvector corresponding to the target eigenvalue and the eigenmatrix.

[0009] In yet another embodiment, calculating the recommendation value of the scenic spot to be recommended according to the eigenvector corresponding to the target eigenvalue and the eigenmatrix includes:

[0010] Constructing a transformation matrix according to the eigenvector corresponding to the target eigenvalue;

[0011] Multiplying the conversion matrix by the feature matrix to obtain the score of the evaluation index corresponding to each of the recommended scenic spots;

[0012] The sum of the scores of the characteristic parameters corresponding to the scenic spots to be recommended is determined as the recommendation value corresponding to the scenic spots to be recommended.

[0013] In yet another embodiment, constructing a conversion matrix according to the eigenvector corresponding to the target eigenvalue includes:

[0014] The eigenvectors are normalized and then arranged in descending order according to the corresponding eigenvalues ​​to obtain the conversion matrix.

[0015] In yet another embodiment, screening the target feature value according to the size of each ratio includes:

[0016] Select T ratios with the largest values ​​from the ratios, wherein the sum of the T ratios is greater than a preset second threshold, and the sum of the ratios of the T ratios excluding the minimum value is less than the second threshold, and T is an integer greater than 0 and less than the number of the eigenvalues;

[0017] The eigenvalues ​​corresponding to the T ratios are determined as target eigenvalues.

[0018] In yet another embodiment, further comprising:

[0019] If it is determined that the maximum value among the characteristic values ​​is less than or equal to the first threshold, the user location parameter is obtained to obtain the recommended scenic spots whose distance from the user location is less than a preset distance threshold, and the target recommended scenic spots are determined and sent according to the distance between the recommended scenic spots and the user location.

[0020] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for recommending scenic spots is provided.

[0021] A device for recommending scenic spots in an embodiment of the present invention includes: an acquisition unit, which is used to receive a scenic spot query request, obtain the target parameters in the scenic spot query request to obtain corresponding scenic spot data to be recommended, and construct a corresponding feature matrix based on the scenic spot data to be recommended; a calculation unit, which is used to calculate the covariance matrix of the feature matrix, and then obtain eigenvalues ​​and eigenvectors; a determination unit, which is used to determine that the maximum value of the eigenvalues ​​is greater than a preset first threshold, then calculate the recommendation value corresponding to the scenic spot to be recommended according to the eigenvector and the feature matrix, and determine the target recommended scenic spot from the scenic spots to be recommended based on the recommendation value and send it.

[0022] In one embodiment, the determining unit is specifically configured to:

[0023] Calculate the ratio of each eigenvalue to the sum of the eigenvalues, and select the target eigenvalue according to the ratio of each eigenvalue;

[0024] The recommendation value of the scenic spot to be recommended is calculated according to the eigenvector corresponding to the target eigenvalue and the eigenmatrix.

[0025] In yet another embodiment, the determining unit is specifically configured to:

[0026] Constructing a transformation matrix according to the eigenvector corresponding to the target eigenvalue;

[0027] Multiplying the conversion matrix by the feature matrix to obtain the score of the evaluation index corresponding to each of the recommended scenic spots;

[0028] The sum of the scores of the characteristic parameters corresponding to the scenic spots to be recommended is determined as the recommendation value corresponding to the scenic spots to be recommended.

[0029] In yet another embodiment, the determining unit is specifically configured to:

[0030] The eigenvectors are normalized and then arranged in descending order according to the corresponding eigenvalues ​​to obtain the conversion matrix.

[0031] In yet another embodiment, the determining unit is specifically configured to:

[0032] Filtering T ratios with the largest values ​​from the ratios, wherein the sum of the T ratios is greater than a preset second threshold and the sum of the ratios of the T ratios excluding the minimum value is less than the second threshold, and T is an integer greater than 0 and less than the number of the eigenvalues;

[0033] The eigenvalues ​​corresponding to the T ratios are determined as target eigenvalues.

[0034] In another embodiment, the determination unit is further used to determine that if the maximum value among the characteristic values ​​is less than or equal to the first threshold, the user location parameter is obtained to obtain a recommended scenic spot whose distance from the user location is less than a preset distance threshold, and the target recommended scenic spot is determined and sent based on the distance between the recommended scenic spot and the user location.

[0035] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0036] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for recommending attractions provided by the embodiment of the present invention.

[0037] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0038] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the method for recommending scenic spots provided by the embodiment of the present invention is implemented.

[0039] An embodiment of the above invention has the following advantages or beneficial effects: in the embodiment of the present invention, after obtaining the characteristic matrix of the scenic spot to be recommended, the eigenvalues ​​and eigenvectors of the corresponding covariance matrix are calculated. Since a larger eigenvalue indicates that the data in the characteristic matrix can be used to evaluate the scenic spot to be recommended, the embodiment of the present invention first determines that the maximum value of the eigenvalue is greater than a preset first threshold value to ensure the effectiveness of the acquired data of the scenic spot to be recommended for the scenic spot recommendation; then the recommended value corresponding to the scenic spot to be recommended is calculated through the eigenvector and the characteristic matrix. Since when the eigenvalue is greater than the first threshold value, the correlation between the data in the characteristic matrix can be reduced based on the eigenvector, the data of the scenic spot to be recommended can more accurately reflect the value of the scenic spot recommendation, and the accuracy of the corresponding recommended value of the scenic spot to be recommended is ensured. Therefore, the method for recommending scenic spots in the embodiment of the present invention can not only evaluate the scenic spots from multiple dimensions, but also ensure the accuracy of the scenic spot recommendation, so as to better meet the needs of users.

[0040] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0042] Figure 1 is a schematic diagram of a main process of a method for recommending scenic spots according to an embodiment of the present invention;

[0043] Figure 2 is a schematic diagram of a main process of a method for calculating a recommendation value according to an embodiment of the present invention;

[0044] Figure 3 is a schematic diagram of main units of a device for recommending scenic spots according to an embodiment of the present invention;

[0045] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0046] Figure 5 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiment of the present invention. DETAILED DESCRIPTION

[0047] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0048] It should be pointed out that the embodiments of the present invention and the features in the embodiments may be combined with each other if there is no conflict.

[0049] An embodiment of the present invention provides a system for recommending scenic spots, which can be used in a scenario where scenic spots are recommended to users.

[0050] The embodiment of the present invention provides a method for recommending scenic spots, which can be executed by a server. Figure 1 As shown, the method includes the following steps.

[0051] S101: receiving a scenic spot query request, obtaining target parameters in the scenic spot query request, obtaining corresponding scenic spot data to be recommended, and constructing a corresponding feature matrix based on the scenic spot data to be recommended.

[0052] In this step, the user usually inputs a scenic spot query request through a client, etc. The scenic spot query request includes target parameters for determining the scenic spot data to be recommended. Specifically, the target parameters may include location parameters, scenic spot type (such as a park), the location of the scenic spot, etc. The parameters of each scenic spot can be pre-stored in the database, which may specifically include the scenic spot identification, location, type, evaluation information, grade, price, etc. Therefore, after obtaining the target parameters in the scenic spot query request, the scenic spot data to be processed can be filtered out from the database based on the target parameters. The format for storing the scenic spot parameters in the database can be a key-value format, where the key is the scenic spot identification and the value is the scenic spot parameter.

[0053] It should be noted that, usually, not all scenic spot parameters are suitable for scenic spot evaluation. In the embodiment of the present invention, evaluation indicators for scenic spot recommendation can be pre-set. In this step, the scenic spots to be recommended can be screened out by the target parameters, and then the data corresponding to each pair of recommended scenic spots and the evaluation indicators can be obtained from the parameters of the scenic spots to be recommended, that is, the data of the scenic spots to be recommended can be obtained. Among them, the evaluation indicators can include the historical sales volume of the scenic spot, the number of scenic spot evaluations, the price of the scenic spot, the score of the scenic spot, the star rating of the scenic spot, etc. Specifically, the historical sales volume of the scenic spot can be the number of tickets sold in the preset time period, the number of scenic spot evaluations can be the number of evaluations of the scenic spot in the preset time period, the price of the scenic spot can be the average price of all ticket types on sale in the preset time period, the score of the scenic spot can be the score in the preset time period, and the star rating of the scenic spot can be the level divided according to the national tourist scenic spot quality level.

[0054] After obtaining the data of the scenic spots to be recommended, a corresponding feature matrix can be constructed based on the data of the scenic spots to be recommended. Specifically, each pair of recommended scenic spot data can constitute a corresponding feature vector, and then the feature vectors corresponding to each recommended scenic spot data are spliced ​​to obtain a feature matrix. For example, assuming that there are 5 preset evaluation indicators, the feature vector of the scenic spot A to be recommended is (a1, a2, a3, a4, a5), and the feature vector of the scenic spot B to be recommended is (b1, b2, b3, b4, b5), and the feature matrix obtained after splicing can be shown in the following matrix.

[0055]

[0056] S102: Calculate the covariance matrix of the characteristic matrix, and then obtain the eigenvalues ​​and eigenvectors.

[0057] In data analysis, the degree of dispersion of data is usually expressed by variance. Let the evaluation index z correspond to d elements, and the value of the fth element is z f , then the dispersion degree of the corresponding value of the evaluation index can be expressed by the variance, as shown in Formula 1.

[0058]

[0059] Among them, Var(z) represents the variance, u z is the average value of the d elements of z. For ease of calculation, set u z If the value of is 0, Formula 1 can be simplified as shown in Formula 2.

[0060]

[0061] Since the larger the variance, the greater the amount of information in the data, the more important the evaluation index is, the analysis of the evaluation index in the embodiment of the present invention can be transformed into seeking a one-dimensional transformation basis, so that the variance value is maximized after the data corresponding to the evaluation index is converted into the coordinate representation on this transformation basis.

[0062] For the feature vector of the same scenic spot to be processed, variance can usually be used to analyze the dispersion of the evaluation index, but for the feature matrix corresponding to multiple scenic spots to be processed, covariance is usually used for analysis. The covariance of two variables represents the correlation between the two variables. In order to make the two variables express as much information as possible, it is usually hoped that the correlation between the two variables will become smaller and smaller. Assuming that the evaluation index z and the evaluation index s correspond to d elements respectively, the covariance of the evaluation index z and the evaluation index s can be expressed as shown in Formula 3.

[0063]

[0064] Among them, Cov(z, s) represents the covariance of z and s, u s is the average value of the d elements of s. For ease of calculation, set u s and u z If the value of is 0, Formula 3 can be simplified as shown in Formula 4.

[0065]

[0066] In the embodiment of the present invention, taking the feature matrix as X and expressed as Formula 5 as an example, the covariance matrix of the feature matrix can be shown as Formula 6.

[0067]

[0068]

[0069] Among them, m is the number of scenic spots to be recommended, a and b are evaluation indicators, a i represents the value of the evaluation index a corresponding to the i-th recommended scenic spot, b i represents the value of the evaluation index b corresponding to the i-th recommended scenic spot. Taking the evaluation index a and the evaluation index b as two variables, let Then C is a symmetric matrix, the elements on its diagonal are the variances of the two variables a and b, and the elements in the rth row, tth column and the tth row, rth column in C are the same, indicating the covariance of the two variables in the rth row and tth row in X, which is the covariance of the two variables a and b in Formula 6, and i, r, and t are all integers greater than 0 and less than or equal to m.

[0070] Generally, the smaller the correlation between two variables is, the more information the two variables can express. Therefore, in the embodiment of the present invention, a conversion basis can be sought to make the elements outside the diagonal of C equal to 0.

[0071] Specifically, the elements in the feature matrix X can be expressed as x j Indicates that, let basis w represent the projection orthogonal basis of feature matrix X, that is, project X under basis w. j The coordinates in basis w are expressed as Take y as an example, the variance can be shown as formula 7.

[0072]

[0073] Among them, That is the covariance C of the original feature matrix X. As shown in Formula 8, {w T ∧w} is the objective function, stw T The Lagrangian function is constructed with w=1 as the constraint condition, and the result is shown in Formula 9.

[0074]

[0075] L(w)=w T ∧w+λ(1-w T w) (9)

[0076] In Formula 9, λ is a parameter. Based on Formula 9, the derivative of w can be used to obtain Formula 10.

[0077] ∧w=λw (10)

[0078] Formula 10 is equivalent to the calculation formula for the eigenvalue and eigenvector of ∧, so it can be concluded that λ is the eigenvalue of ∧, that is, the eigenvalue of C. The variance in Formula 7 can be shown as Formula 11.

[0079] D(x)=w T ∧w=λw T w=λ (11)

[0080] Since the larger the variance, the more information the data reflects, that is, the larger D(x), the better, and the variance of X after projection on w is the eigenvalue of the covariance matrix C, so the maximum value of D(x) is the maximum eigenvalue of the covariance matrix C, that is, the eigenvector corresponding to the maximum eigenvalue of C in the best projection direction of X, the eigenvector corresponding to the second largest eigenvalue of C in the second best projection direction of X, and so on. It can be inferred that the transformation basis of X can be the eigenvector of C.

[0081] Assume that P is the transformation basis of the feature matrix X, and Y is the result of projecting the feature matrix X on the transformation basis P, that is, Y=PX. Then the covariance matrix G of Y can be expressed as shown in Formula 12.

[0082]

[0083] From the principle of formula 6, we can see that in order to minimize the correlation between variables in Y, G needs to be a diagonal matrix, that is, the transformation basis P needs to satisfy PCP T is a diagonal matrix. Since the covariance matrix C satisfies formula 13, it can be concluded that P = E T , that is to say, P is the matrix after the eigenvectors of the covariance matrix C are normalized.

[0084]

[0085] In Formula 13, λ1...λ n represents the eigenvalue of C.

[0086] Therefore, in the embodiment of the present invention, the covariance matrix of the feature matrix can be calculated, and then the eigenvalues ​​and eigenvectors of the covariance matrix can be calculated, and the eigenvectors are used as the transformation basis of the feature matrix, that is, the data of the scenic spots to be recommended represented by the feature matrix are projected to the transformation basis and then processed. In order to improve the accuracy of the scenic spot recommendation, after the eigenvector is obtained, the eigenvector is first normalized, and then the normalized eigenvectors are used to form a conversion matrix, that is, the transformation basis of the feature matrix.

[0087] S103: If it is determined that the maximum value among the eigenvalues ​​is greater than a preset first threshold, a recommendation value corresponding to the to-be-recommended scenic spot is calculated according to the eigenvector and the eigenmatrix, and a target recommended scenic spot is determined from the to-be-recommended scenic spots based on the recommendation value and sent.

[0088] Since the eigenvalue of the covariance matrix C is too small, it means that the amount of information reflected by the data in the characteristic matrix is ​​too small, and the data of the scenic spot to be recommended is not sufficient for evaluating the scenic spot to be recommended. Therefore, in the embodiment of the present invention, a first threshold value can also be set, and the maximum value of the eigenvalue of the covariance matrix C is compared with the first threshold value. If the maximum value of the eigenvalue of the covariance matrix C is less than or equal to the first threshold value, it means that the eigenvalue of the covariance matrix C is too small, and it is not suitable to use the data of the scenic spot to be recommended obtained in step S101 to evaluate the scenic spot to be recommended; if the maximum value of the eigenvalue of the covariance matrix C is greater than the first threshold value, it means that the eigenvalue of the covariance matrix C is large, and the data of the scenic spot to be recommended obtained in step S101 can be used to evaluate the scenic spot to be recommended, so in this step, it is necessary to first determine that the maximum value of the eigenvalue of the covariance matrix C is greater than the preset first threshold value. The specific value of the first threshold value can be determined according to the scene, for example, it can be 0.01.

[0089] After determining that the maximum value in the eigenvalue is greater than a preset first threshold, the eigenvector can be constructed into a transformation matrix, and the eigenmatrix can be projected under the transformation matrix to calculate the recommendation value corresponding to the recommended scenic spot, and then the target recommended scenic spot is determined and sent according to the recommendation value of the recommended scenic spot.

[0090] In this step, after determining the recommended values ​​of the recommended scenic spots, a preset number of recommended scenic spots with the largest recommended values ​​can be selected according to the recommended values ​​as target recommended scenic spots. After determining the target recommended scenic spots, they can be sent to the user, specifically to the user's client, for the user to view.

[0091] In an embodiment of the present invention, after determining that the maximum value in the characteristic value is less than or equal to the first threshold, the target recommended scenic spot can be determined according to the distance between the scenic spot and the user, specifically, it can be: obtaining the user location parameter to obtain the recommended scenic spot whose distance from the user location is less than the preset distance threshold, and determining the target recommended scenic spot according to the distance between the recommended scenic spot and the user location and sending it. The preset distance can be set according to demand, for example, set to 3km. In this step, the distance between the recommended scenic spot and the user can be sorted from small to large using a quick sort method, and the target recommended scenic spots can be recommended in order of distance from small to large. The range of the target recommended scenic spots and the number of target recommended scenic spots can also be expanded according to the actual application scenario.

[0092] In the embodiment of the present invention, after the characteristic matrix of the scenic spot to be recommended is obtained, the eigenvalues ​​and eigenvectors of the corresponding covariance matrix are calculated. Since when the eigenvalue is large, it means that the data in the characteristic matrix can be used to evaluate the scenic spot to be recommended, it is first determined that the maximum value of the eigenvalue is greater than a preset first threshold value to ensure the effectiveness of the acquired data of the scenic spot to be recommended for the scenic spot recommendation; then the recommended value corresponding to the scenic spot to be recommended is calculated through the eigenvector and the characteristic matrix. Since when the eigenvalue is greater than the first threshold value, the correlation between the data in the characteristic matrix can be reduced according to the eigenvector, the data of the scenic spot to be recommended can more accurately reflect the value of the scenic spot recommendation, and the accuracy of the corresponding recommended value of the scenic spot to be recommended can be ensured. Therefore, the method for recommending scenic spots in the embodiment of the present invention can not only evaluate the scenic spots from multiple dimensions, but also ensure the accuracy of the scenic spot recommendation, so as to better meet the needs of users.

[0093] Combine the following Figure 1 The embodiment shown in the figure specifically describes the method for calculating the recommendation value of the scenic spot to be recommended in the embodiment of the present invention. Figure 2 As shown, the method includes the following steps.

[0094] S201: Calculate the ratio of each eigenvalue to the sum of the eigenvalues, and select the target eigenvalue according to the size of each ratio.

[0095] Since the larger the eigenvalue of the covariance matrix C, the better the corresponding eigenvector is as the conversion basis of the eigenmatrix, in order to ensure the accuracy of the calculation of the recommended value of the recommended scenic spot, the eigenvalue of the covariance matrix C can also be screened in the embodiment of the present invention to avoid using the eigenvector corresponding to the smaller eigenvalue as the conversion basis, thereby achieving the purpose of dimensionality reduction.

[0096] In the embodiment of the present invention, the conversion basis P can be composed of the eigenvectors corresponding to the T largest eigenvalues ​​of C, so that the variance of the matrix Y obtained after X is converted by P is the largest, that is, Y=PX. Therefore, in the embodiment of the present invention, the problem of analyzing the data of the recommended scenic spots is transformed into an optimization goal: reducing X to T dimensions, and the goal is to select T unit orthogonal bases to form the conversion basis P, so that after X is transformed to this set of bases, the covariance between each evaluation index is 0, and the variance of the evaluation index is as large as possible. Under this constraint, the T largest eigenvalues ​​of C's eigenvalues ​​are equivalent to selecting the largest T variances in formula 11, representing the T evaluation indicators that best represent the characteristics of the scenic spots.

[0097] In this step, the ratio of each eigenvalue to the sum of the eigenvalues ​​can be calculated, that is, the ratio corresponding to each eigenvalue is calculated by formula 14.

[0098]

[0099] In formula 14, exp s represents the ratio corresponding to the sth eigenvalue, A represents the number of eigenvalues, and λ s represents the sth eigenvalue, represents the sum of all eigenvalues.

[0100] After obtaining the ratios corresponding to each eigenvalue, the target eigenvector can be screened out according to the size of the ratios. Specifically, this step can be performed as follows: screen the T ratios with the largest values ​​from the ratios, wherein the sum of the T ratios is greater than the preset second threshold, and the sum of the ratios of the T ratios after removing the minimum value is less than the second threshold, and T is an integer greater than 0 and less than the number of eigenvalues; the eigenvalues ​​corresponding to the T ratios are determined as the target eigenvalues. The size of the second threshold can be set as required.

[0101] Taking the second threshold of 80% as an example, the ratios of each eigenvalue can be arranged in descending order according to the size of the ratio, and then the top T ratios are determined in turn so that the top T ratios satisfy Formula 15 and Formula 16.

[0102]

[0103]

[0104] It means the sum of the first T-1 ratios after the ratios are arranged in descending order. It represents the sum of the first T ratios after the ratios are arranged in descending order.

[0105] After T ratios are determined, the eigenvalues ​​corresponding to these ratios can be determined as target eigenvalues.

[0106] S202: Calculate the recommendation value of the scenic spot to be recommended according to the eigenvector and the eigenmatrix corresponding to the target eigenvalue.

[0107] After the target eigenvalue is determined, the characteristic matrix of the target eigenvector can be determined. In this step, a conversion matrix can be constructed according to the eigenvector corresponding to the target eigenvalue, and then the conversion matrix is ​​multiplied by the characteristic matrix to obtain the score of the characteristic parameter corresponding to each scenic spot to be recommended; and then the sum of the scores of the characteristic parameters corresponding to each scenic spot to be recommended is determined as the recommendation value corresponding to each scenic spot to be recommended.

[0108] The eigenvectors corresponding to the target eigenvalues ​​can be first normalized, and then the normalized eigenvectors can be combined to obtain a transformation matrix. The eigenvectors can be combined in descending order according to the corresponding eigenvalues, and then the transformation matrix can be constructed by combining them in the arrangement, which is P. After the transformation matrix is ​​determined, the transformation matrix can be multiplied by the feature matrix, so that the feature matrix is ​​converted into a projection under the transformation matrix, thereby reducing the dimension of the feature matrix. The result obtained by multiplying the transformation matrix and the feature matrix is ​​equivalent to obtaining the score of the corresponding evaluation index of each scenic spot to be recommended, and then the scores of the corresponding evaluation index of each scenic spot to be recommended are summed to obtain the recommended value of each scenic spot to be recommended. Due to the dimensionality reduction processing of the transformation matrix, the number of evaluation indicators at this time may be less than the preset number of evaluation indicators.

[0109] In the embodiment of the present invention, by screening target feature values, valuable data is screened from the feature matrix, that is, data valuable for scenic spot recommendation in the scenic spot data to be recommended, and feature extraction is achieved in the recommended scenic spot data, which can not only improve the accuracy of recommendation value calculation, but also reduce the complexity of calculation.

[0110] In order to solve the problems existing in the prior art, the embodiment of the present invention provides a device 300 for recommending scenic spots, such as Figure 3 As shown, the device 300 includes:

[0111] The acquisition unit 301 is used to receive a scenic spot query request, acquire a target parameter in the scenic spot query request, obtain corresponding scenic spot data to be recommended, and construct a corresponding feature matrix based on the scenic spot data to be recommended;

[0112] A calculation unit 302 is used to calculate the covariance matrix of the characteristic matrix, and then obtain eigenvalues ​​and eigenvectors;

[0113] The determination unit 303 is used to determine that the maximum value of the characteristic value is greater than a preset first threshold, then calculate the recommendation value corresponding to the to-be-recommended scenic spot according to the characteristic vector and the characteristic matrix, and determine the target recommended scenic spot from the to-be-recommended scenic spots based on the recommendation value and send it.

[0114] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 The method of the illustrated embodiment is the same and will not be repeated here.

[0115] In an implementation manner of the embodiment of the present invention, the determining unit 303 is specifically configured to:

[0116] Calculate the ratio of each eigenvalue to the sum of the eigenvalues, and select the target eigenvalue according to the ratio of each eigenvalue;

[0117] The recommendation value of the scenic spot to be recommended is calculated according to the eigenvector corresponding to the target eigenvalue and the eigenmatrix.

[0118] In another implementation of the embodiment of the present invention, the determining unit 303 is specifically configured to:

[0119] Constructing a transformation matrix according to the eigenvector corresponding to the target eigenvalue;

[0120] Multiplying the conversion matrix by the feature matrix to obtain the score of the evaluation index corresponding to each of the recommended scenic spots;

[0121] The sum of the scores of the characteristic parameters corresponding to the scenic spots to be recommended is determined as the recommendation value corresponding to the scenic spots to be recommended.

[0122] In another implementation of the embodiment of the present invention, the determining unit 303 is specifically configured to:

[0123] The eigenvectors are normalized and then arranged in descending order according to the corresponding eigenvalues ​​to obtain the conversion matrix.

[0124] In another implementation of the embodiment of the present invention, the determining unit 303 is specifically configured to:

[0125] Filtering T ratios with the largest values ​​from the ratios, wherein the sum of the T ratios is greater than a preset second threshold and the sum of the ratios of the T ratios excluding the minimum value is less than the second threshold, and T is an integer greater than 0 and less than the number of the eigenvalues;

[0126] The eigenvalues ​​corresponding to the T ratios are determined as target eigenvalues.

[0127] In another implementation of the embodiment of the present invention, the determination unit is also used to determine that the maximum value of the characteristic value is less than or equal to the first threshold, then obtain the user location parameter to obtain a recommended scenic spot whose distance from the user location is less than a preset distance threshold, and determine the target recommended scenic spot and send it based on the distance between the recommended scenic spot and the user location.

[0128] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 or Figure 2 The method of the illustrated embodiment is the same and will not be repeated here.

[0129] In the embodiment of the present invention, after the characteristic matrix of the scenic spot to be recommended is obtained, the eigenvalues ​​and eigenvectors of the corresponding covariance matrix are calculated. Since when the eigenvalue is large, it means that the data in the characteristic matrix can be used to evaluate the scenic spot to be recommended, it is first determined that the maximum value of the eigenvalue is greater than a preset first threshold value to ensure the effectiveness of the acquired data of the scenic spot to be recommended for the scenic spot recommendation; then the recommendation value corresponding to the scenic spot to be recommended is calculated through the eigenvector and the characteristic matrix. Since when the eigenvalue is greater than the first threshold value, the correlation between the data in the characteristic matrix can be reduced according to the eigenvector, the data of the scenic spot to be recommended can more accurately reflect the value of the scenic spot recommendation, and the accuracy of the corresponding recommendation value of the scenic spot to be recommended can be ensured. Therefore, the method for recommending scenic spots in the embodiment of the present invention can not only evaluate the scenic spots from multiple dimensions, but also ensure the accuracy of the scenic spot recommendation, so as to better meet the needs of users.

[0130] According to an embodiment of the present invention, the embodiment of the present invention further provides an electronic device and a readable storage medium.

[0131] The electronic device of an embodiment of the present invention includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the data comparison method provided by the embodiment of the present invention.

[0132] Figure 4 An exemplary system architecture 400 is shown to which the method or apparatus for recommending attractions according to an embodiment of the present invention may be applied.

[0133] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0134] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0135] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0136] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as product information - only an example) to the terminal device.

[0137] It should be noted that the data comparison method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the data comparison device is generally set in the server 405 .

[0138] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0139] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 suitable for implementing an embodiment of the present invention. Figure 5 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0140] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0141] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0142] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0143] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0144] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0145] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, a calculation unit, and a determination unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the acquisition unit may also be described as a "unit of the function of the acquisition unit".

[0146] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the method for recommending scenic spots provided by the present invention.

[0147] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for recommending scenic spots, characterized in that: include: Receiving a scenic spot query request, acquiring a target parameter in the scenic spot query request to obtain corresponding scenic spot data to be recommended, and constructing a corresponding feature matrix based on the scenic spot data to be recommended; Calculating the covariance matrix of the characteristic matrix to obtain eigenvalues ​​and eigenvectors; If it is determined that the maximum value among the characteristic values ​​is greater than a preset first threshold, a recommendation value corresponding to the scenic spot to be recommended is calculated according to the characteristic vector and the characteristic matrix, and a target recommended scenic spot is determined from the scenic spots to be recommended based on the recommendation value and sent; If it is determined that the maximum value of the characteristic values ​​is less than or equal to the first threshold, the user location parameter is obtained to obtain the recommended scenic spots whose distance from the user location is less than a preset distance threshold, and the target recommended scenic spots are determined and sent according to the distance between the recommended scenic spots and the user location.

2. The method according to claim 1, characterized in that Calculating the recommendation value of the scenic spot to be recommended according to the feature vector and the feature matrix includes: Calculating the ratio of each eigenvalue to the sum of the eigenvalues, and selecting the target eigenvalue according to the size of each ratio; The recommendation value of the scenic spot to be recommended is calculated according to the eigenvector corresponding to the target eigenvalue and the eigenmatrix.

3. The method according to claim 2, characterized in that Calculating the recommendation value of the scenic spot to be recommended according to the eigenvector corresponding to the target eigenvalue and the eigenmatrix, including: Constructing a transformation matrix according to the eigenvector corresponding to the target eigenvalue; Multiplying the conversion matrix by the feature matrix to obtain the score of the evaluation index corresponding to each of the recommended scenic spots; The sum of the scores of the characteristic parameters corresponding to the scenic spots to be recommended is determined as the recommendation value corresponding to the scenic spots to be recommended.

4. The method according to claim 3, characterized in that Constructing a transformation matrix according to the eigenvector corresponding to the target eigenvalue, including: The eigenvectors are normalized and then arranged in descending order according to the corresponding eigenvalues ​​to obtain the conversion matrix.

5. The method according to claim 2, characterized in that: The target characteristic value is screened according to the size of each ratio, including: Filtering T ratios with the largest values ​​from the ratios, wherein the sum of the T ratios is greater than a preset second threshold and the sum of the ratios of the T ratios excluding the minimum value is less than the second threshold, and T is an integer greater than 0 and less than the number of the eigenvalues; The eigenvalues ​​corresponding to the T ratios are determined as target eigenvalues.

6. A device for recommending scenic spots, characterized in that: include: An acquisition unit, configured to receive a scenic spot query request, acquire a target parameter in the scenic spot query request, obtain corresponding scenic spot data to be recommended, and construct a corresponding feature matrix based on the scenic spot data to be recommended; A calculation unit, used to calculate the covariance matrix of the characteristic matrix, and then obtain the eigenvalues ​​and eigenvectors; a determination unit, configured to determine that the maximum value among the characteristic values ​​is greater than a preset first threshold value, calculate a recommendation value corresponding to the scenic spot to be recommended according to the characteristic vector and the characteristic matrix, determine a target recommended scenic spot from the scenic spots to be recommended based on the recommendation value, and send the target recommended scenic spot; The determination unit is further used to determine that if the maximum value of the characteristic values ​​is less than or equal to the first threshold, then obtain the user location parameter to obtain a recommended scenic spot whose distance from the user location is less than a preset distance threshold, and determine and send the target recommended scenic spot based on the distance between the recommended scenic spot and the user location.

7. The device according to claim 6, characterized in that The determining unit is specifically used for: Calculate the ratio of each eigenvalue to the sum of the eigenvalues, and select the target eigenvalue according to the ratio of each eigenvalue; The recommendation value of the scenic spot to be recommended is calculated according to the eigenvector corresponding to the target eigenvalue and the eigenmatrix.

8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Scenic spot recommendation method and device based on user information and storage medium

    CN110765361A

  • Data analysis method and device based on housing monitoring platform

    CN110837604A