A method and system for recommending house rental information based on real-time data stream
By analyzing the correlation between user search terms and rental data and the access time, constructing the abnormal retrieval coefficient and misclick index, generating a data anomaly index, and filtering out normal access data, the problem of inaccurate recommendations caused by user misoperation is solved, and the accuracy of house rental information recommendations is improved.
Patent Information
- Application Number
- CN202510260004.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-03-06
AI Technical Summary
The existing house rental information recommendation system is affected by erroneous data caused by user misoperation, which reduces the accuracy of recommendation results.
By analyzing the correlation between user search terms and rental data and the access time, we construct the abnormal retrieval coefficient and misclick index, generate the data anomaly index, filter out normal access data, and update the user-item rating matrix to improve recommendation accuracy.
It effectively reduces the impact of erroneous data caused by user misoperation on the accuracy of recommendations and improves the accuracy of house rental information recommendations.
Smart Images

Figure CN120198194B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of house rental information recommendation, and in particular to a method and system for recommending house rental information based on real-time data stream. Background Art
[0002] Existing house rental information recommendation systems typically use big data to recommend personalized housing information to users. In order to respond to changes in users' immediate interests and preferences in real time and provide more accurate and timely recommendations, they usually use the data streams generated by users in real time to dynamically update the data in the recommendation model, such as updating the user-item rating matrix in the collaborative filtering algorithm.
[0003] However, when users search for housing information, due to user errors, such as incorrect search term input or accidental clicks, the user's real-time data stream contains useless erroneous data. Using these real-time data streams containing erroneous data to update the recommendation model will interfere with the recommendation model's judgment of the user's true interests, resulting in recommendation results that are inconsistent with the user's actual needs, and reducing the accuracy of recommending housing rental information to users. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of this application is to provide a method and system for recommending house rental information based on real-time data streams. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for recommending house rental information based on a real-time data stream, the method comprising the following steps:
[0006] Obtain each house rental information table accessed by each user within a preset time period before the current house information recommendation time, along with their respective access durations, as well as the search term and search time of each search; record the current house information recommendation time as the current time, and record the house rental information table as rental data;
[0007] By analyzing the correlation between the search terms of each user's search and all rental data before the current moment, the relevance of each user's search before the current moment is determined; between any search and the next search, the average distribution of the access time of all rental data accessed by each user is analyzed to determine the average browsing time of each user's search, and combined with the relevance, the abnormal search coefficient of each user's search before the current moment is determined;
[0008] Density clustering is performed on all rental data accessed by each user to obtain multiple clusters and the local density of each rental data. The average distribution of the access duration and local density of all rental data in the cluster where each rental data is located is analyzed respectively to determine the access level of each user to each rental data at the current moment, thereby determining the misclick coefficient of each user accessing each rental data at the current moment; based on the misclick coefficient and the abnormal search coefficient, the data anomaly index of each user accessing each rental data at the current moment is determined;
[0009] Based on the data anomaly index, a normal access set of each user is obtained to recommend rental information to each user at the current moment.
[0010] Preferably, the relevance of any search by each user before the current moment is the average of the correlation coefficients between the search term of any search by each user before the current moment and all the rental data before the current moment.
[0011] Preferably, the average browsing duration of any retrieval by each user is the average of the access durations of all rental data accessed by each user from any retrieval to the next retrieval.
[0012] Preferably, the abnormal search coefficient of any search by each user at the current moment is the inverse of the product of the relevance of any search by each user at the current moment and the average browsing time.
[0013] Preferably, the expression of the access degree of each user to each rental data at the current moment is: S i,u =s1 i,u ×s2 i,u Where S i,u Indicates the access degree of user i to the u-th rental data; s1 i,u represents the average access time of all rental data in the cluster where the u-th rental data accessed by user i is located; s2 i,u It represents the mean of the local density of all rental data in the cluster where the u-th rental data accessed by user i is located.
[0014] Preferably, the error click coefficient of each user accessing each rental data at the current moment is the inverse of the product of the access duration and access degree of each user accessing each rental data at the current moment.
[0015] Preferably, the method for determining the data anomaly index of each user accessing each rental data at the current moment is:
[0016] During the period from the jth retrieval to the next retrieval, the product of the misclick coefficient of each rental data accessed by each user and the abnormal retrieval coefficient of the jth retrieval is used as the data anomaly index of each user accessing each rental data. All rental data of each user before the current moment are traversed to obtain the data anomaly index of each user accessing each rental data at the current moment.
[0017] Preferably, the process of obtaining the normal access set of each user is:
[0018] Before the current moment, the data anomaly index of all rental data accessed by each user is used as the input of the threshold segmentation algorithm, and the segmentation threshold is output. All rental data with a data anomaly index less than the segmentation threshold are combined into a normal access set.
[0019] Preferably, the process of recommending rental information to each user at the current moment includes:
[0020] Obtain the user-item rating matrix for the previous housing recommendation moment, count the number of visits to each rental data item in each user's normal access dataset at the current moment, and update the number of visits to each rental data item in the user-item rating matrix for the previous housing recommendation moment based on the number of visits. Use the updated user-item rating matrix as input to the collaborative filtering algorithm, and output the latest user-item rating matrix as the user-item rating matrix for the current moment.
[0021] The user-item rating matrix at the current moment is used as the input of the recommendation algorithm, and a recommended list of house rental information for each user is output.
[0022] In the second aspect, an embodiment of the present application also provides a house rental information recommendation system based on real-time data stream, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-mentioned methods for recommending house rental information based on real-time data stream.
[0023] This application has at least the following beneficial effects:
[0024] This application constructs an abnormal retrieval coefficient by analyzing the correlation between search terms and rental data, as well as the access time of accessing rental data, and accurately evaluates whether there are search term input errors in the search terms used by users when browsing house rental information; further, by analyzing the similarity between house rental information accessed by users, as well as the access time when accessing similar information, a misclick index is constructed to accurately evaluate whether the house rental information browsed by users is the house rental information browsed by users by mistake; this application constructs a data anomaly index by combining the abnormal retrieval coefficient and the misclick index, obtains normal access data based on the data anomaly index, updates the user-item rating matrix in the recommendation system, and reduces the impact of useless error data contained in the real-time data stream of house rental information accessed by users due to erroneous operations such as user search term input errors or misclicks on the accuracy of rental information recommendations, thereby improving the accuracy of house rental information recommendations to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] Figure 1 A flowchart of a method for recommending house rental information based on real-time data streams provided in one embodiment of the present application;
[0027] Figure 2 A schematic diagram of the data anomaly index extraction process provided in one embodiment of the present application. DETAILED DESCRIPTION
[0028] To further illustrate the technical means and effectiveness of this application to achieve the intended invention objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of a method and system for recommending house rental information based on real-time data streams proposed in this application. In the following description, different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0029] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0030] The following describes in detail a specific solution of a method and system for recommending house rental information based on real-time data streams provided by the present application with reference to the accompanying drawings.
[0031] See also Figure 1 , which shows a flowchart of a method for recommending house rental information based on real-time data streams provided by one embodiment of the present application, the method comprising the following steps:
[0032] Step S1: Obtain each house rental information table visited by each user within a preset time period before the current house information recommendation time and their respective access time, as well as the search term and search time of each retrieval, record the current house information recommendation time as the current time, and record the house rental information table as rental data.
[0033] The house rental information recommendation system based on real-time data stream in this embodiment adopts a recommendation system based on collaborative filtering algorithm, which obtains each house rental information table visited by each user within a preset time before the current house information recommendation time and their respective access time, as well as the search terms and retrieval time of each retrieval; and obtains the user-item rating matrix of the previous house information recommendation time before the current time; for the sake of convenience of expression, the current house information recommendation time is recorded as the current time, and the house rental information table is recorded as rental data, and is applied to the following content expression.
[0034] It should be noted that the value of the preset duration is set manually. In this embodiment, the length of the time period between the current moment and the last house information recommendation moment is used as the value of the preset duration. The implementer can also set it by himself based on the specific situation. This embodiment does not impose any special restrictions.
[0035] Step S2: Determine the relevance of any search by each user before the current moment by analyzing the correlation between the search terms of any search by each user and all rental data; during the period from any search to the next search, analyze the average distribution of the access time of all rental data accessed by each user to determine the average browsing time of any search by each user, and determine the abnormal search coefficient of any search by each user before the current moment in combination with the correlation.
[0036] Since the house rental information that users want to browse usually has certain similarities, such as similar geographical locations or similar rental methods, when users browse house rental information due to entering incorrect search terms, the search terms they enter not only have a high correlation with the house rental information that the users have browsed in the past, but the browsing time of the house rental information under the search terms is also usually shorter. This is because when users find that the house rental information they browse is significantly different from their expectations, they will stop browsing.
[0037] Therefore, by analyzing the correlation between search terms and rental data, as well as the access time of rental data, we can determine the abnormal retrieval coefficient and judge whether search errors have occurred. This can avoid incorrect rental information recommendations to users due to search errors and improve the accuracy of house rental information recommendations. The specific process of determining the abnormal retrieval coefficient is as follows:
[0038] The average of the correlation coefficients between the search terms retrieved by each user before the current moment and all the rental data before the current moment is used as the correlation degree of each user's search before the current moment, which is used to characterize the correlation between the search terms and the house rental information. If the correlation coefficient is larger, the correlation degree is larger, indicating that the correlation between the search terms and the house rental information is greater, and the possibility of erroneous search is smaller; conversely, the smaller the correlation coefficient is, the smaller the correlation degree is, indicating that the correlation between the search terms and the house rental information is smaller, and the possibility of erroneous search is greater.
[0039] It should be noted that in this embodiment, the Jaccard similarity coefficient between the search term and the rental data is calculated as the correlation coefficient between the search term retrieved by each user at any time and all the rental data. In actual application, as other implementation methods, the implementer may also adopt other methods, and this embodiment does not impose any special restrictions.
[0040] The process of calculating the Jaccard similarity coefficient between the search term and the rental data is a well-known technology, and the specific calculation process will not be repeated here.
[0041] Furthermore, the average of the access time of all rental data accessed by each user from any retrieval to the next retrieval is taken as the average browsing time of each user in any retrieval; it is used to represent the average browsing time of all house rental information accessed by the user when searching with the current search term. The shorter the average browsing time, the shorter the user's browsing time under the current search term, and the greater the possibility of missearch under the current search term; conversely, the longer the average browsing time, the longer the user's browsing time under the current search term, and the smaller the possibility of missearch under the current search term.
[0042] Furthermore, the inverse of the product of the relevance of any search by each user before the current moment and the average browsing time is used as the abnormal search coefficient of any search by each user before the current moment.
[0043] According to the abnormal search coefficient of any search by each user before the current moment, it can be understood that the greater the relevance under the current search term and the longer the average browsing time, the less likely it is that a wrong search will occur when the current search term is used for retrieval; conversely, the smaller the relevance under the current search term and the shorter the average browsing time, the more likely it is that a wrong search will occur when the current search term is used for retrieval.
[0044] Step S3: Density clustering is performed on all rental data accessed by each user to obtain multiple clusters and the local density of each rental data. The average distribution of the access duration and local density of all rental data in the cluster where each rental data is located is analyzed respectively to determine the access degree of each user to each rental data at the current moment, so as to determine the misclick coefficient of each user accessing each rental data at the current moment; based on the misclick coefficient and the abnormal retrieval coefficient, the data anomaly index of each user accessing each rental data at the current moment is determined.
[0045] When users search for house rental information that they are interested in, their interests usually do not change significantly in the short term, which makes the house rental information browsed by the users have a high degree of similarity with the house rental information they have browsed in the past. When users browse a certain house rental information due to accidental clicks or changes in interests, it usually causes a large difference between the browsed house rental information and the house rental information they have browsed in the past. However, the house rental information that users browse due to changes in interests usually has a longer browsing time than the house rental information browsed due to accidental clicks.
[0046] Therefore, by analyzing the similarities between the house rental information accessed by users and the duration of access to similar information, we can determine the data anomaly index to eliminate the impact of accidental clicks on the accuracy of house rental information recommendations and improve the accuracy of house rental information recommendations. Specifically:
[0047] Density clustering is performed on all rental data accessed by each user to obtain multiple clusters and the local density of each rental data. The clustering process and the process of determining the metric distance of the clustering algorithm are as follows: each rental data accessed by each user is encoded. In this embodiment, each rental data of each user is converted into Unicode encoding, and the Euclidean distance between the Unicode encodings of different rental data is used as the metric distance.
[0048] It should be noted that, in this embodiment, the DBSCAN clustering algorithm is used to cluster all rental data. In actual application, as another implementation method, the implementer may also use the DPC density peak clustering algorithm. This embodiment does not impose any special restrictions on the selection of the clustering algorithm.
[0049] The calculation process of the Euclidean distance and the DBSCAN clustering algorithm are both well-known technologies, and their specific principles are not described in detail here.
[0050] The access level S of user u to the i-th rental data at the current moment i,u The expression is: S i,u =s1 i,u ×s2i,u Where s1 i,u represents the average access time of all rental data in the cluster where the u-th rental data accessed by user i is located; s2 i,u It represents the mean of the local density of all rental data in the cluster where the u-th rental data accessed by user i is located.
[0051] According to the access degree of each user to each rental data at the current moment, it can be understood that the greater the mean access time of all rental data in the cluster where the current rental data is located and the greater the mean local density, the greater the corresponding access degree, indicating that the user accesses the rental data in the cluster where the current rental data is located more frequently and the possibility of accidental clicks is very small; conversely, the smaller the mean access time of all rental data in the cluster where the current rental data is located and the smaller the mean local density, the smaller the corresponding access degree, indicating that the user accesses the rental data in the cluster where the current rental data is located less frequently and the possibility of accidental clicks is very high.
[0052] Furthermore, the inverse of the product of the access time and access degree of each user accessing each rental data at the current moment is used as the misclick coefficient of each user accessing each rental data at the current moment, which is used to characterize the possibility that the user accesses the current data due to misclick. The longer the access time and the greater the access degree, the smaller the misclick coefficient, indicating that the possibility that the user accesses the current data due to misclick is smaller; conversely, the shorter the access time and the smaller the access degree, the smaller the misclick coefficient, indicating that the possibility that the user accesses the current data due to misclick is smaller.
[0053] During the period from the jth retrieval to the next retrieval, the product of the misclick coefficient of each rental data accessed by each user and the abnormal retrieval coefficient of the jth retrieval is used as the data anomaly index of each user accessing each rental data. All rental data of each user before the current moment are traversed to obtain the data anomaly index of each user accessing each rental data at the current moment.
[0054] According to the data anomaly index of each user accessing each rental data at the current moment, it can be understood that if the misclick coefficient of accessing the current rental data is larger and the abnormal retrieval coefficient is larger, the obtained data anomaly coefficient is larger, indicating that the possibility that the user accessed the current data due to missearch or misclick is greater; conversely, if the misclick coefficient of accessing the current rental data is smaller and the abnormal retrieval coefficient is smaller, the obtained data anomaly coefficient is smaller, indicating that the possibility that the user accessed the current data due to missearch or misclick is smaller.
[0055] Preferably, the data anomaly index extraction process diagram provided in this embodiment is as follows Figure 2 shown.
[0056] Step S4: Based on the data anomaly index, a normal access set of each user is obtained to recommend rental information to each user at the current moment.
[0057] According to step S3, the data anomaly index of each user accessing each rental data is obtained. Furthermore, before the current moment, the data anomaly index of all rental data accessed by each user is used as the input of the threshold segmentation algorithm, and the segmentation threshold is output. All rental data with a data anomaly index less than the segmentation threshold are combined into a normal access set.
[0058] Obtain the user-item rating matrix from the MongoDB database for the time before the current housing recommendation. Count the number of times each user accesses each rental item in the normal access dataset at the current time. Update the number of times each rental item in the user-item rating matrix for the previous housing recommendation time is updated based on the number of accesses. Use the updated user-item rating matrix as input to the collaborative filtering algorithm, and output the latest user-item rating matrix as the current user-item rating matrix.
[0059] The user-item rating matrix at the current moment is used as the input of the Top-N recommendation criterion, and a recommended list of house rental information for each user is output.
[0060] The number of recommendations in the recommendation list of the Top-N recommendation criterion is set to 3, which can be set by the implementer. The collaborative filtering algorithm and the Top-N recommendation criterion are both well-known technologies, and the specific process will not be repeated here.
[0061] The house rental information recommendation list of each user is displayed on each user's search interface respectively, completing the house rental information recommendation for each user at the current moment.
[0062] Based on the same inventive concept as the above method, an embodiment of the present application also provides a house rental information recommendation system based on real-time data stream, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of any one of the above-mentioned methods for recommending house rental information based on real-time data stream are implemented.
[0063] It should be noted that the order in which the embodiments of the present application are presented is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the foregoing descriptions of specific embodiments of this specification are provided. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential sequence shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0064] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0065] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for recommending house rental information based on real-time data stream, characterized in that: The method comprises the following steps: Obtain each house rental information table accessed by each user within a preset time period before the current house information recommendation time, along with their respective access durations, as well as the search term and search time of each search; record the current house information recommendation time as the current time, and record the house rental information table as rental data; By analyzing the correlation between the search terms of each user's search and all rental data before the current moment, the relevance of each user's search before the current moment is determined; between any search and the next search, the average distribution of the access time of all rental data accessed by each user is analyzed to determine the average browsing time of each user's search, and combined with the relevance, the abnormal search coefficient of each user's search before the current moment is determined; Density clustering is performed on all rental data accessed by each user to obtain multiple clusters and the local density of each rental data. The average distribution of the access duration and local density of all rental data in the cluster where each rental data is located is analyzed respectively to determine the access level of each user to each rental data at the current moment, thereby determining the misclick coefficient of each user accessing each rental data at the current moment; based on the misclick coefficient and the abnormal search coefficient, the data anomaly index of each user accessing each rental data at the current moment is determined; Based on the data anomaly index, a normal access set of each user is obtained to recommend rental information to each user at the current moment.
2. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The relevance of any search by each user before the current moment is the average of the correlation coefficients between the search terms of any search by each user before the current moment and all the rental data before the current moment.
3. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The average browsing duration of any retrieval by each user is the average of the access durations of all rental data accessed by each user from any retrieval to the next retrieval.
4. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The abnormal search coefficient of any search by each user at the current moment is the inverse of the product of the relevance of any search by each user at the current moment and the average browsing time.
5. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The expression of the access degree of each user to each rental data at the current moment is: S i,u =s1 i,u ×s2 i,u Where S i,u Indicates the access degree of user i to the u-th rental data; s1 i,u represents the average access time of all rental data in the cluster where the u-th rental data accessed by user i is located; s2 i,u It represents the mean of the local density of all rental data in the cluster where the u-th rental data accessed by user i is located.
6. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The error click coefficient of each user accessing each rental data at the current moment is the inverse of the product of the access duration and the access degree of each user accessing each rental data at the current moment.
7. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The method for determining the data anomaly index of each user accessing each rental data at the current moment is: During the period from the jth retrieval to the next retrieval, the product of the misclick coefficient of each rental data accessed by each user and the abnormal retrieval coefficient of the jth retrieval is used as the data anomaly index of each user accessing each rental data. All rental data of each user before the current moment are traversed to obtain the data anomaly index of each user accessing each rental data at the current moment.
8. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The process of obtaining the normal access set of each user is as follows: Before the current moment, the data anomaly index of all rental data accessed by each user is used as the input of the threshold segmentation algorithm, and the segmentation threshold is output. All rental data with a data anomaly index less than the segmentation threshold are combined into a normal access set.
9. The method for recommending house rental information based on real-time data stream according to claim 1, characterized in that: The method of recommending rental information to each user at the current moment includes: Obtain the user-item rating matrix for the previous housing recommendation moment, count the number of visits to each rental data item in each user's normal access dataset at the current moment, and update the number of visits to each rental data item in the user-item rating matrix for the previous housing recommendation moment based on the number of visits. Use the updated user-item rating matrix as input to the collaborative filtering algorithm, and output the latest user-item rating matrix as the user-item rating matrix for the current moment. The user-item rating matrix at the current moment is used as the input of the recommendation algorithm, and a recommended list of house rental information for each user is output.
10. A house rental information recommendation system based on real-time data stream, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for recommending house rental information based on real-time data stream as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Recommendation model training method, recommendation method and device for behavior sparse scene
CN116362823A
House-renting recommendation method, electronic device and storage medium
US20220172310A1