CN113032694B - Scene-based query method and device, storage medium and computer equipment - Google Patents

Scene-based query method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN113032694B
CN113032694B CN202110574678.0A CN202110574678A CN113032694B CN 113032694 B CN113032694 B CN 113032694B CN 202110574678 A CN202110574678 A CN 202110574678A CN 113032694 B CN113032694 B CN 113032694B
Authority
CN
China
Prior art keywords
query
vector
feature vector
feature
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110574678.0A
Other languages
Chinese (zh)
Other versions
CN113032694A (en
Inventor
王梦雅
高理强
黄健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Koubei Network Technology Co Ltd
Original Assignee
Zhejiang Koubei Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Koubei Network Technology Co Ltd filed Critical Zhejiang Koubei Network Technology Co Ltd
Priority to CN202110574678.0A priority Critical patent/CN113032694B/en
Publication of CN113032694A publication Critical patent/CN113032694A/en
Application granted granted Critical
Publication of CN113032694B publication Critical patent/CN113032694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries

Abstract

The application discloses a scene-based query method and device, a storage medium and computer equipment, wherein the method comprises the following steps: responding to a query request, and acquiring a request vector corresponding to the query request, wherein the request vector comprises a query feature vector, a user feature vector and a scene feature vector, and the scene feature vector comprises a position feature vector and/or a time feature vector; and screening target shops in the candidate shops according to the matching degree between each feature vector contained in the request vector and the shop vector corresponding to the candidate shops. According to the method and the system, scene characteristics such as positions and time and query characteristics and user characteristics corresponding to the query request can be effectively fused for store recall, the target store recall effect is improved, personalized query requirements of different local living users in different scenes are favorably met, the matching degree of the store recall result and the query scene is high, and the user experience is improved.

Description

Scene-based query method and device, storage medium and computer equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a scene-based query method and apparatus, a storage medium, and a computer device.
Background
Under the background of big data, how to provide personalized services for users based on historical behavior data of the users is a problem that needs to be solved urgently when big data application falls to the ground at present. The recall is an important part for a search recommendation system, because the quality of the recall directly affects the upper limit of the effect of the subsequent steps, and in the recall stage, a part related to the current user preference is selected from a massive information set as a candidate set according to the characteristics of users and contents (such as shops, commodities, advertisements and the like) and then submitted to a sorting link.
In the prior art, in the recall stage, generally, the matching degree between the historical behaviors of the user and the search keywords and the candidate stores is calculated according to the historical behavior data of the user and the search keywords input by the user, so that recommended stores are screened out from the candidate stores according to a matching program and are displayed to the user. However, in practical applications, the search recommendation method often results in higher similarity of recommendation results for each search, that is, the results displayed by the user when performing the same or similar keyword search are substantially the same, the recommendation effect is poor, and the requirements of the user for diversified and personalized searches in different situations, for example, the requirements of different types of recommended meals at different time intervals, cannot be met.
Disclosure of Invention
In view of this, the present application provides a scene-based query method and apparatus, a storage medium, and a computer device.
According to an aspect of the present application, there is provided a scenario-based query method, including:
responding to a query request, and acquiring a request vector corresponding to the query request, wherein the request vector comprises a query feature vector, a user feature vector and a scene feature vector, and the scene feature vector comprises a position feature vector and/or a time feature vector;
and screening target shops in the candidate shops according to the matching degree between each feature vector contained in the request vector and the shop vector corresponding to the candidate shops.
Optionally, the obtaining of the request vector corresponding to the query request specifically includes:
acquiring query characteristics and query users corresponding to the query request, and a target query position and/or target query time corresponding to a current query scene, wherein the target query time comprises at least one of query time interval characteristics, query season characteristics and query daily work characteristics;
the query feature vector corresponding to the query feature is obtained from a pre-trained sample query feature vector, the user feature vector matched with the query user is obtained from a pre-trained sample user feature vector, the position feature vector matched with the target query position is obtained from a pre-trained sample position feature vector, and/or the time feature vector matched with the target query time is obtained from a pre-trained sample time feature vector.
Optionally, before the obtaining the request vector corresponding to the query request, the method further includes:
constructing a sample positive case pair and a sample negative case pair according to historical query data, wherein any sample positive case pair or any sample negative case pair comprises two matched node characteristics and a characteristic edge type formed by connecting corresponding nodes, and the characteristic edge type comprises a behavior edge, a similar edge and a co-occurrence edge;
constructing feature nodes in an abnormal graph and feature edges formed by connecting the feature nodes according to the sample positive example pair and the sample negative example pair, and calculating the feature edge weight corresponding to each feature edge in the abnormal graph based on the historical query data, wherein the feature nodes comprise query nodes, user nodes, candidate shop nodes, position nodes and/or time nodes;
training the abnormal composition graph by using a preset neural network model to obtain a characteristic node vector corresponding to each characteristic node in the abnormal composition graph, wherein the characteristic node vector comprises a sample query characteristic vector, a sample user characteristic vector, a candidate shop characteristic vector, a sample position characteristic vector and/or a sample time characteristic vector.
Optionally, the historical query data comprises transactional behavior data and non-transactional behavior data; the constructing of the sample positive case pair and the sample negative case pair according to the historical query data specifically comprises:
constructing the sample right case pair according to the transaction behavior data, wherein the transaction behavior comprises click behavior or payment behavior;
and constructing a sample negative example pair corresponding to the behavior edge and the co-occurrence edge according to the non-transaction behavior data, and generating the sample negative example pair corresponding to the similar edge in a negative sampling mode.
Optionally, the calculating, based on the historical query data, a feature edge weight corresponding to each feature edge in the abnormal graph specifically includes:
acquiring characteristic edge historical data corresponding to each characteristic edge in the historical query data respectively, wherein the behavior edges comprise transaction behavior edges between any user or any query word and any store, transaction behavior edges between any user or any query word and any scene, transaction behavior edges between any scene and any store, and transaction behavior edges between any two scenes, the similar edges comprise similar edges between any two stores and similar edges between any two users, and the co-occurrence edges comprise co-occurrence edges between any two positions;
and calculating the characteristic edge weight corresponding to each characteristic edge according to the characteristic edge historical data.
Optionally, the screening a target store in the candidate stores according to the matching degree between the request vector and the store vector corresponding to the candidate store specifically includes:
respectively calculating the query vector, the user feature vector and the feature matching degree between the scene feature vector and the shop vector, and determining the shop matching degree between the request vector and the candidate shop according to the feature matching degree;
and acquiring the target shops corresponding to the shop matching degree meeting a preset query condition in the candidate shops, wherein the candidate shops comprise candidate tradable places and/or candidate going-to positions, and the target shops comprise target tradable places and/or target going-to positions.
Optionally, the query request includes a query page entry action or a query module trigger action.
Optionally, the screening a target store in the candidate stores according to the matching degree between the request vector and the store vector corresponding to the candidate store specifically includes:
inputting the query feature vector, the user feature vector and the scene feature vector into a preset query model to obtain a target shop corresponding to the request vector;
the preset query model is obtained by training by taking historical query features, historical user features and historical scene features contained in historical query data as input values in advance and taking historical trading shops contained in the historical query data as output values.
According to another aspect of the present application, there is provided a scene-based query apparatus, including:
the device comprises a request vector acquisition module, a query processing module and a processing module, wherein the request vector acquisition module is used for responding to a query request and acquiring a request vector corresponding to the query request, the request vector comprises a query feature vector, a user feature vector and a scene feature vector, and the scene feature vector comprises a position feature vector and/or a time feature vector;
and the target shop screening module is used for screening target shops in the candidate shops according to the matching degree between each feature vector contained in the request vector and the shop vector corresponding to the candidate shops.
Optionally, the request vector obtaining module specifically includes:
the characteristic obtaining unit is used for obtaining a query characteristic corresponding to the query request, a query user, and a target query position and/or target query time corresponding to the current query scene, wherein the target query time comprises at least one of a query time interval characteristic, a query season characteristic and a query day working characteristic;
the vector obtaining unit is used for obtaining the query feature vector corresponding to the query feature from a pre-trained sample query feature vector, obtaining the user feature vector matched with the query user from a pre-trained sample user feature vector, obtaining the position feature vector matched with the target query position from a pre-trained sample position feature vector, and/or obtaining the time feature vector matched with the target query time from a pre-trained sample time feature vector.
Optionally, the apparatus further comprises:
the sample generation module is used for constructing a sample positive example pair and a sample negative example pair according to historical query data before the request vector corresponding to the query request is obtained, wherein any sample positive example pair or any sample negative example pair comprises two matched node characteristics and a characteristic edge type formed by connecting corresponding nodes, and the characteristic edge type comprises a behavior edge, a similar edge and a co-occurrence edge;
the abnormal figure construction module is used for constructing feature nodes in an abnormal figure and feature edges formed by connecting the feature nodes according to the sample positive example pair and the sample negative example pair, and calculating the feature edge weight corresponding to each feature edge in the abnormal figure based on the historical query data, wherein the feature nodes comprise query nodes, user nodes, candidate shop nodes, position nodes and/or time nodes;
the training module is used for training the abnormal picture by using a preset neural network model to obtain a characteristic node vector corresponding to each characteristic node in the abnormal picture, wherein the characteristic node vector comprises a sample query characteristic vector, a sample user characteristic vector, a candidate shop characteristic vector, a sample position characteristic vector and/or a sample time characteristic vector.
Optionally, the historical query data comprises transactional behavior data and non-transactional behavior data; the sample generation module specifically includes:
the positive example pair generating unit is used for constructing the sample positive example pair according to the transaction behavior data, wherein the transaction behavior comprises click behavior or payment behavior;
and the negative example pair generating unit is used for constructing a sample negative example pair corresponding to the behavior edge and the co-occurrence edge according to the non-transaction behavior data and generating the sample negative example pair corresponding to the similar edge in a negative sampling mode.
Optionally, the heteromorphic image construction module specifically includes:
the data acquisition unit is used for acquiring characteristic edge historical data corresponding to each characteristic edge in the historical query data, wherein the behavior edges comprise transaction behavior edges between any user or any query word and any shop, transaction behavior edges between any user or any query word and any scene, transaction behavior edges between any scene and any shop, and transaction behavior edges between any two scenes, the similar edges comprise similar edges between any two shops and similar edges between any two users, and the co-occurrence edges comprise co-occurrence edges between any two positions;
and the weight calculation unit is used for calculating the characteristic edge weight corresponding to each characteristic edge according to the characteristic edge historical data.
Optionally, the targeted store screening module specifically includes:
the calculating unit is used for respectively calculating the query vector, the user feature vector and the feature matching degree between the scene feature vector and the shop vector, and determining the shop matching degree between the request vector and the candidate shop according to the feature matching degree;
the screening unit is used for acquiring the target shops corresponding to the shop matching degrees meeting the preset query conditions in the candidate shops, wherein the candidate shops comprise candidate tradable places and/or candidate going-to positions, and the target shops comprise target tradable places and/or target going-to positions.
Optionally, the query request includes a query page entry action or a query module trigger action.
Optionally, the targeted store screening module specifically includes:
the model recalling unit is used for inputting the query feature vector, the user feature vector and the scene feature vector into a preset query model to obtain a target shop corresponding to the request vector;
the preset query model is obtained by training by taking historical query features, historical user features and historical scene features contained in historical query data as input values in advance and taking historical trading shops contained in the historical query data as output values.
According to yet another aspect of the present application, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described scenario-based query method.
According to yet another aspect of the present application, there is provided a computer device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, the processor implementing the above-mentioned scene-based query method when executing the program.
By means of the technical scheme, the scene-based query method and device, the storage medium and the computer equipment provided by the application respond to the query request, the system obtains the request vector corresponding to the query request and including the query feature vector, the user feature vector and the scene feature vectors such as position and time, so that the matching degree between the request vector and the shop vectors of the candidate shops is calculated, and the target shop with high matching degree is screened out from the candidate shops according to the matching degree. Compared with the query scheme in the prior art, the method and the device for the shop recall have the advantages that the scene characteristics such as position and time, the query characteristics corresponding to the query request and the user characteristics can be effectively fused for the shop recall, the target shop recall effect is improved, the personalized query requirements of different local living users in different scenes are favorably met, the matching degree of the shop recall result and the query scene is higher, and the user experience is improved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart illustrating a scenario-based query method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another scenario-based query method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart illustrating a feature vector training method according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a heteromorphic graph provided by an embodiment of the present application;
fig. 5 shows a schematic structural diagram of a scene-based query device according to an embodiment of the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In this embodiment, a method for querying based on a scene is provided, as shown in fig. 1, the method includes:
step 101, responding to a query request, and acquiring a request vector corresponding to the query request, wherein the request vector comprises a query feature vector, a user feature vector and a scene feature vector, and the scene feature vector comprises a position feature vector and/or a time feature vector;
and 102, screening target shops in the candidate shops according to the matching degree between each feature vector contained in the request vector and the shop vector corresponding to the candidate shops.
The method can be applied to the recall stage of a system for search recommendation, query recommendation and the like, and particularly can be applied to search websites and search software based on local life scenes, for example, food shop search in a certain city.
In this embodiment of the application, the query request may specifically be a recommendation page entry request generated by user triggering, for example, the user clicks an entry page link or opens a software/web page to enter a local life recommendation page, the query request may also be a query page entry request generated by the user through an action of triggering a query module or a query component, for example, a food recommendation request generated by an operation of clicking a link by the user to enter a "food" column, and the query request may also be generated based on keyword input and a search action of the user, for example, a hot pot recommendation request generated by inputting "hot pot" by the user and performing a search. In response to the query request, the system may obtain a request vector corresponding to the query request, where the request vector may specifically include a query feature vector for reflecting a query action feature, a user feature vector for reflecting a user feature of a user initiating the query request, and a scene feature vector for reflecting a current query scene. In different application scenarios, for example, based on the keyword input by the user and the query request generated by the search action, the query feature vector may be generated based on the keyword input by the user, and for example, by the user triggering the query request generated by the food query module, the query feature vector may be generated based on the keyword of "food". The user feature vector may be specifically generated based on personal features such as historical transaction behaviors of the user, personal information of the user, and the like. The scene feature vector may be specifically generated based on a current query scene, for example, based on information such as a current query position, a current query time, and a current query weather, where the current query position is, for example, an office building a, a residential area B, and the like, the current query time is lunch time, afternoon tea time, and the like, and the current query weather is sunny days, rainy days, and the like.
Further, after the request vector is determined, the matching degree between the request vector and the store vector corresponding to the existing candidate store is calculated according to the request vector and the store vector corresponding to the existing candidate store, for example, the matching degree between the query feature vector, the user feature vector and the scene feature vector included in the request vector and the store vector may be calculated after feature fusion, or the matching degree between the query feature vector, the user feature vector and the scene feature vector and the store vector may be calculated respectively, then the obtained matching degree results are weighted and summed according to the weights of different feature vectors, the matching degree between the request vector and the store vector is determined, so that a target store with a high matching degree is screened out from the candidate stores according to the matching degree, and the target store is directly recommended and output, or the target store is recommended and output after further processing. According to the query method provided by the embodiment of the application, the scene characteristics are taken as consideration factors of a store recall stage, and the finally obtained target store is matched with the query characteristics and the personal characteristics of the user and also matched with the current query scene such as the query position, the query time and other scene characteristics, so that the recall result meets the constraint conditions of the query scene, and meets the query requirements of different users and different scenes in local life, such as breakfast preference of the user in the morning, lunch preference of the user in the working days of the workplace, dinner preference of the user to a shopping center on weekends and the like.
By applying the technical scheme of the embodiment, in response to the query request, the system acquires the request vector corresponding to the query request and including the query feature vector, the user feature vector, the scene feature vector such as the position and the time, so that the matching degree between the request vector and the shop vector of the candidate shop is calculated, and the target shop with higher matching degree is screened from the candidate shop according to the matching degree. Compared with the scheme in the prior art, the method and the system for searching the target shop can combine scene characteristics such as positions and time and the query characteristics and the user characteristics corresponding to the query request to recall the shop, greatly improve the recall effect of the target shop, help to meet personalized query requirements of different local life users in different scenes, and improve user experience.
Further, as a refinement and an extension of the specific implementation of the above embodiment, in order to fully describe the specific implementation process of the embodiment, another scenario-based query method is provided, as shown in fig. 2, the method includes:
step 201, responding to a query request, obtaining query characteristics and query users corresponding to the query request, and a target query position and/or target query time corresponding to a current query scene, wherein the target query time comprises at least one of query time interval characteristics, query season characteristics and query day work characteristics;
in the embodiment of the present application, optionally, the query request includes a query result generated based on a search term input operation, a query page entry action, or a query module trigger operation. For example, a food recommendation request generated by the operation that a user clicks an incoming page link or opens a software/webpage to enter a local life recommendation page, a food recommendation request generated by the operation that the user clicks the link to enter a food column, a hot pot recommendation request generated by the operation that the user inputs a hot pot and searches, and the like. In response to a query request, the system acquires a query user corresponding to the query request, query features, such as query keywords input by the user and query keywords corresponding to a page link clicked by the user, and acquires a target query position and a target query time corresponding to a current query scene, wherein the target query position can be the type and number of an area to which the current position belongs, such as an office building A, the target query time can include query period features, such as breakfast periods, lunch periods, dinner periods, afternoon tea periods and night periods, can also include query season features, such as spring, summer, autumn and winter, can also include query day working features, such as working days, rest days and holidays, and can also include query weather features, such as sunny days, rainy days, snow days and the like.
Step 202, obtaining the query feature vector corresponding to the query feature from a pre-trained sample query feature vector, obtaining the user feature vector matching the query user from a pre-trained sample user feature vector, obtaining the location feature vector matching the target query location from a pre-trained sample location feature vector, and/or obtaining the time feature vector matching the target query time from a pre-trained sample time feature vector;
in the above embodiment, after the query feature, the user feature, the location feature, and the time feature are obtained, based on a sample query feature vector, a sample user feature vector, a sample location feature vector, and a sample time feature vector that are trained by using historical query data in advance, the corresponding sample feature may be used as a query feature vector matching the query feature, a user feature vector matching the query user, a location feature vector matching the target query location, and a time feature vector matching the target query time. For example, the sample position feature vector includes sample position feature vectors corresponding to an office building a, an office building B, a residential area a, and a residential area B, assuming that the target position feature is the office building a, it is sufficient to directly use the sample position feature vector corresponding to the office building a as the position feature vector corresponding to the target query position, and the determination manner of the time feature vector and the position feature vector is similar and is not described again.
In addition, before executing the query method, as shown in fig. 3, the embodiment of the present invention further includes the following steps (the following steps may be executed once before executing the query method for the first time):
step 301, constructing a sample positive case pair and a sample negative case pair according to historical query data, wherein any sample positive case pair or any sample negative case pair comprises two matched node characteristics and a characteristic edge type formed by connecting corresponding nodes, and the characteristic edge type comprises a behavior edge, a similar edge and a co-occurrence edge;
step 302, constructing feature nodes in an abnormal composition graph and feature edges formed by connecting the feature nodes according to the sample positive example pair and the sample negative example pair, and calculating the feature edge weight corresponding to each feature edge in the abnormal composition graph based on the historical query data, wherein the feature nodes comprise query nodes, user nodes, candidate shop nodes, position nodes and/or time nodes;
step 303, training the abnormal image by using a preset neural network model to obtain a feature node vector corresponding to each feature node in the abnormal image, wherein the feature node vector comprises a sample query feature vector, a sample user feature vector, a candidate shop feature vector, and a sample position feature vector and/or a sample time feature vector.
Optionally, the historical query data comprises transactional behavior data and non-transactional behavior data; step 301 may specifically include: constructing the sample right case pair according to the transaction behavior data, wherein the transaction behavior comprises click behavior or payment behavior; and constructing a sample negative example pair corresponding to the behavior edge and the co-occurrence edge according to the non-transaction behavior data, and generating the sample negative example pair corresponding to the similar edge in a negative sampling mode.
In the above embodiment, a sample regular example pair is constructed according to transaction behavior data included in historical query data, where the transaction behavior data is specifically historical data generated by clicking or payment behaviors of a user, the sample regular example pair is used for constructing a heterogeneous graph in a subsequent step, the heterogeneous graph includes feature nodes and feature edges formed by connecting some two feature nodes, as shown in fig. 4, the feature nodes may include user nodes (the user nodes may also include query nodes, not shown in the figure), candidate store nodes, location nodes, time nodes, and category nodes, in addition, the time nodes may specifically include time period feature nodes, season feature nodes, workday feature nodes, and the like, the feature edges may specifically include behavior edges, similar edges, and co-occurrence edges, and specifically, the sample regular example pair may be generated based on historical transaction data of any user for any store, for example, the sample positive example pair is (user a, action side, store a), which indicates that the user a clicks the store a or generates a payment behavior to the store a, and in addition to the above transaction behavior side between any user and any store, the action side may include a transaction behavior side between any user and any scene, which may be generated based on a transaction behavior generated by any user in any scene, and the action side may also include a transaction behavior side between any scene and any store, a transaction behavior side between any two scenes, and the like. The embodiment further comprises the steps of constructing a sample negative example pair according to the non-transaction behavior data, wherein the non-transaction behavior data are shop data which are shown to the user in historical query and search behaviors of the user and are not clicked or pay behaviors are not generated by the user, constructing the sample negative example pair containing the behavior sides and the co-occurrence side types according to the non-transaction behavior data, and generating the sample negative example pair corresponding to the similar sides through a negative sampling method.
Further, constructing a heterogeneous graph according to the sample positive example pair and the sample negative example pair, wherein the heterogeneous graph comprises feature nodes describing different users, different candidate shops, different position features, different scene features and different category features, forming feature edges based on the connection relationship between the feature nodes established by the sample positive example pair and the sample negative example pair, and calculating the feature edge weight of each feature edge. Optionally, the step 302 "calculating a feature edge weight corresponding to each feature edge in the abnormal graph based on the historical query data" specifically includes: acquiring feature edge historical data corresponding to each feature edge in the historical query data; and calculating the characteristic edge weight corresponding to each characteristic edge according to the characteristic edge historical data. In this embodiment, feature edge history data related to the feature edge and the feature node connected to the feature edge is obtained based on each feature edge, and then the feature edge weight corresponding to each feature edge is calculated based on the feature edge history data corresponding to each feature edge.
Taking FIG. 4 as an example, regarding the behavior edge: for a characteristic edge between any user and any shop, the weight of the characteristic edge can be determined based on the number of clicks/payments of any user to any shop (or the ratio of the number of clicks/payments to all shops); for a feature edge between any user and any category, the weight of the feature edge can be determined based on the number of clicks/payments made by any user for any category (or the number is a proportion of the number of clicks/payments made for all categories); for a characteristic edge between any query word and any store, determining the weight of the characteristic edge based on the number of clicks/payments of any store in the recommended behaviors of any query word (or the ratio of the number to the number of clicks/payments of all stores); for a characteristic edge between any query word and any scene, determining the weight of the characteristic edge based on the number of times of inputting the any query word in any scene (or the proportion of the number of times to the total number of queries in any scene); for a characteristic edge between any user and any position, the weight of the characteristic edge can be determined based on the number of clicks/payments made by any user at any position (or the number is a proportion of the number of clicks/payments made by any user at all positions); for a characteristic edge between any scene and any shop, the weight of the characteristic edge can be determined based on the number of times of click/payment behaviors of all users to any shop in any scene (or the ratio of the number of times to the number of times of click/payment behaviors of all users to all shops in any scene); for a characteristic edge between any scene and any position, the weight of the characteristic edge can be determined based on the number of clicks/payments generated by all users at any position in any scene (or the number is proportional to the number of clicks/payments of all users to all shops in any scene); for a characteristic edge between any scene and any category, the weight of the characteristic edge can be determined based on the number of clicks/payments of all users to shops related to any category in any scene (or the number is the proportion of the number of clicks/payments of all users to all shops in any scene); for a characteristic edge between any location and any category, the characteristic edge may be based on the number of clicks/payments made by all users for the store associated with any category at any location (or the number may be proportional to the number of clicks/payments made by all users for all stores at any location).
Regarding similar edges: for the similar edge between any two shops, the weight of the similar edge can be determined based on the number of times of clicking/paying actions of any two shops simultaneously contained in the historical query actions; for similar edges between any two users, the degree of similarity may be determined based on the historical click/payment behavior of the any two users.
In addition, for the co-occurrence edge between any two positions, the determination can be made based on the number of people who simultaneously include click/payment behaviors generated for relevant shops corresponding to any two positions in the historical query behaviors, or the number of people who simultaneously generate click/payment behaviors under any two positions.
Furthermore, after the heterogeneous graph is constructed, a preset neural network model can be used for training the heterogeneous graph, cosine distances are used for depicting weights among all feature nodes, Softmax cross entropy Loss is used as target training, all feature node vectors in the graph are obtained, and therefore content such as sample user feature vectors, candidate shop feature vectors, sample position feature vectors and sample time feature vectors can be described.
Step 203, respectively calculating the query vector, the user feature vector and the feature matching degree between the scene feature vector and the shop vector, and determining the shop matching degree between the request vector and the candidate shop according to the feature matching degree;
step 204, obtaining the target shop of which the shop matching degree meets a preset query condition in the candidate shops, wherein the candidate shop comprises a candidate tradable place and/or a candidate going-to position, and the target shop comprises a target tradable place and/or a target going-to position.
In steps 203 and 204, feature matching degrees between the query vector and the store vector corresponding to the candidate stores, between the user feature vector and the store vector, between the position feature vector and the store vector, between the time feature vector and the store vector are calculated respectively, and the store matching degrees between the request vector and the store vector are calculated by performing weighted summation or averaging on the feature matching degrees, so that a plurality of previous candidate stores with matching degrees higher than a threshold value or higher are selected as target stores.
The stores in the present embodiment are not limited to physical stores such as supermarkets and restaurants that can perform business activities, and may include places such as entertainment, social contact, and play, for example, parks and scenic spots, and places that can be recommended or provided in all local life scenes.
By applying the technical scheme of the embodiment, the vectors of the user characteristics, the shop characteristics and the scene characteristics can be learned by constructing the scene-based heterogeneous graph, different strategies do not need to be formulated manually, a complex model does not need to be called on line, the distance between the user scene and the item is directly calculated through vector recall to recall, different personalized and scene recall sets can be rapidly and automatically obtained for different users under different scenes, and therefore the final search efficiency and the user experience are improved. During recall, the user characteristic vector, the query characteristic vector and the scene characteristic vector are used as request vectors to recall, the recall effect of the target shop is greatly improved, the personalized query requirements of different users in local life under different scenes are favorably met, and the user experience is improved.
In addition, in the embodiment of the application, model training can be performed based on scene feature data, user feature data, query term feature data and transaction behavior data contained in historical query data as training samples to obtain a query model which can output a target store after inputting the scene feature, the query term feature and the user feature, so that store query is realized by using the query model. Correspondingly, step 102 may specifically include: inputting the query feature vector, the user feature vector and the scene feature vector into a preset query model to obtain a target shop corresponding to the request vector; the preset query model is obtained by training by taking historical query features, historical user features and historical scene features contained in historical query data as input values in advance and taking historical trading shops contained in the historical query data as output values.
Further, as a specific implementation of the method in fig. 1, an embodiment of the present application provides a query device based on a scene, and as shown in fig. 5, the query device includes:
a request vector obtaining module 41, configured to, in response to a query request, obtain a request vector corresponding to the query request, where the request vector includes a query feature vector, a user feature vector, and a scene feature vector, and the scene feature vector includes a location feature vector and/or a time feature vector;
and a targeted shop screening module 42, configured to screen targeted shops in the candidate shops according to a matching degree between each feature vector included in the request vector and a shop vector corresponding to a candidate shop.
Optionally, the request vector obtaining module 41 specifically includes (not shown in the figure):
the characteristic obtaining unit is used for obtaining a query characteristic corresponding to the query request, a query user, and a target query position and/or target query time corresponding to the current query scene, wherein the target query time comprises at least one of a query time interval characteristic, a query season characteristic and a query day working characteristic;
the vector obtaining unit is used for obtaining the query feature vector corresponding to the query feature from a pre-trained sample query feature vector, obtaining the user feature vector matched with the query user from a pre-trained sample user feature vector, obtaining the position feature vector matched with the target query position from a pre-trained sample position feature vector, and/or obtaining the time feature vector matched with the target query time from a pre-trained sample time feature vector.
Optionally, the device further comprises (not shown in the figures):
the sample generation module is used for constructing a sample positive example pair and a sample negative example pair according to historical query data before the request vector corresponding to the query request is obtained, wherein any sample positive example pair or any sample negative example pair comprises two matched node characteristics and a characteristic edge type formed by connecting corresponding nodes, and the characteristic edge type comprises a behavior edge, a similar edge and a co-occurrence edge;
the abnormal figure construction module is used for constructing feature nodes in an abnormal figure and feature edges formed by connecting the feature nodes according to the sample positive example pair and the sample negative example pair, and calculating the feature edge weight corresponding to each feature edge in the abnormal figure based on the historical query data, wherein the feature nodes comprise query nodes, user nodes, candidate shop nodes, position nodes and/or time nodes;
the training module is used for training the abnormal picture by using a preset neural network model to obtain a characteristic node vector corresponding to each characteristic node in the abnormal picture, wherein the characteristic node vector comprises a sample query characteristic vector, a sample user characteristic vector, a candidate shop characteristic vector, a sample position characteristic vector and/or a sample time characteristic vector.
Optionally, the historical query data comprises transactional behavior data and non-transactional behavior data; the sample generation module specifically includes (not shown in the figure):
the positive example pair generating unit is used for constructing the sample positive example pair according to the transaction behavior data, wherein the transaction behavior comprises click behavior or payment behavior;
and the negative example pair generating unit is used for constructing a sample negative example pair corresponding to the behavior edge and the co-occurrence edge according to the non-transaction behavior data and generating the sample negative example pair corresponding to the similar edge in a negative sampling mode.
Optionally, the heteromorphic image construction module specifically includes (not shown in the figure):
the data acquisition unit is used for acquiring characteristic edge historical data corresponding to each characteristic edge in the historical query data, wherein the behavior edges comprise transaction behavior edges between any user or any query word and any shop, transaction behavior edges between any user or any query word and any scene, transaction behavior edges between any scene and any shop, and transaction behavior edges between any two scenes, the similar edges comprise similar edges between any two shops and similar edges between any two users, and the co-occurrence edges comprise co-occurrence edges between any two positions;
and the weight calculation unit is used for calculating the characteristic edge weight corresponding to each characteristic edge according to the characteristic edge historical data.
Optionally, the targeted shop screening module 42 specifically includes (not shown in the figure):
the calculating unit is used for respectively calculating the query vector, the user feature vector and the feature matching degree between the scene feature vector and the shop vector, and determining the shop matching degree between the request vector and the candidate shop according to the feature matching degree;
the screening unit is used for acquiring the target shops corresponding to the shop matching degrees meeting the preset query conditions in the candidate shops, wherein the candidate shops comprise candidate tradable places and/or candidate going-to positions, and the target shops comprise target tradable places and/or target going-to positions.
Optionally, the query request includes a query page entry action or a query module trigger action.
Optionally, the targeted shop screening module 42 specifically includes (not shown in the figure):
the model recalling unit is used for inputting the query feature vector, the user feature vector and the scene feature vector into a preset query model to obtain a target shop corresponding to the request vector;
the preset query model is obtained by training by taking historical query features, historical user features and historical scene features contained in historical query data as input values in advance and taking historical trading shops contained in the historical query data as output values.
It should be noted that other corresponding descriptions of the functional units related to the scene-based query device provided in the embodiment of the present application may refer to corresponding descriptions in the methods in fig. 1 to fig. 3, and are not described herein again.
Based on the method shown in fig. 1 to 3, correspondingly, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for querying based on a scene as shown in fig. 1 to 3 is implemented.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Based on the above methods shown in fig. 1 to fig. 3 and the virtual device embodiment shown in fig. 5, in order to achieve the above object, an embodiment of the present application further provides a computer device, which may specifically be a personal computer, a server, a network device, and the like, where the computer device includes a storage medium and a processor; a storage medium for storing a computer program; a processor for executing a computer program to implement the above-described scenario-based query method as shown in fig. 1 to 3.
Optionally, the computer device may also include a user interface, a network interface, a camera, Radio Frequency (RF) circuitry, sensors, audio circuitry, a WI-FI module, and so forth. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., a bluetooth interface, WI-FI interface), etc.
It will be appreciated by those skilled in the art that the present embodiment provides a computer device architecture that is not limiting of the computer device, and that may include more or fewer components, or some components in combination, or a different arrangement of components.
The storage medium may further include an operating system and a network communication module. An operating system is a program that manages and maintains the hardware and software resources of a computer device, supporting the operation of information handling programs, as well as other software and/or programs. The network communication module is used for realizing communication among components in the storage medium and other hardware and software in the entity device.
Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by software plus a necessary general hardware platform, and also can respond to a query request through hardware implementation, and the system obtains a request vector corresponding to the query request and including a query feature vector, a user feature vector, and a scene feature vector such as a position and a time, thereby calculating a matching degree between the request vector and a shop vector of a candidate shop, and selecting a target shop with a high matching degree from the candidate shops according to the matching degree. Compared with the scheme in the prior art, the method and the system for searching the target shop can combine scene characteristics such as positions and time and the query characteristics and the user characteristics corresponding to the query request to recall the shop, greatly improve the recall effect of the target shop, help to meet personalized query requirements of different users in local life in different scenes, and improve user experience.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (12)

1. A method for querying based on a scene is characterized by comprising the following steps:
constructing and training an abnormal graph according to historical query data, wherein the weight of a characteristic edge corresponding to each characteristic edge in the abnormal graph is calculated according to the historical query data, the characteristic edge is formed by connecting characteristic nodes, the characteristic nodes comprise query nodes, user nodes, candidate shop nodes and position nodes and/or time nodes, the type of the characteristic edge comprises a co-occurrence edge, and the co-occurrence edge comprises a co-occurrence edge between any two positions; the weight of the co-occurrence edge between any two positions is determined based on the number of people who simultaneously contain click/payment behaviors generated on related shops corresponding to any two positions in the historical query behaviors or the number of people who simultaneously generate click/payment behaviors under any two positions;
responding to a query request, and acquiring a request vector corresponding to the query request from a pre-trained sample feature vector, wherein the request vector comprises a query feature vector, a user feature vector and a scene feature vector, the scene feature vector comprises a position feature vector and/or a time feature vector, and the sample feature vector comprises each feature node vector in a trained abnormal graph;
and screening target shops in the candidate shops according to the matching degree between each feature vector contained in the request vector and the shop vector corresponding to the candidate shops.
2. The method according to claim 1, wherein the obtaining of the request vector corresponding to the query request specifically includes:
acquiring query characteristics and query users corresponding to the query request, and a target query position and/or target query time corresponding to a current query scene, wherein the target query time comprises at least one of query time interval characteristics, query season characteristics and query daily work characteristics;
the query feature vector corresponding to the query feature is obtained from a pre-trained sample query feature vector, the user feature vector matched with the query user is obtained from a pre-trained sample user feature vector, the position feature vector matched with the target query position is obtained from a pre-trained sample position feature vector, and/or the time feature vector matched with the target query time is obtained from a pre-trained sample time feature vector.
3. The method according to claim 2, wherein the constructing and training the heteromorphic graph according to the historical query data specifically comprises:
constructing a sample positive case pair and a sample negative case pair according to historical query data, wherein any sample positive case pair or any sample negative case pair comprises two matched node characteristics and a characteristic edge type formed by connecting corresponding nodes, and the characteristic edge type comprises a behavior edge, a similar edge and a co-occurrence edge;
constructing feature nodes in the abnormal graph and feature edges formed by connecting the feature nodes according to the sample positive example pair and the sample negative example pair, and calculating the feature edge weight corresponding to each feature edge in the abnormal graph based on the historical query data;
training the abnormal composition graph by using a preset neural network model to obtain a characteristic node vector corresponding to each characteristic node in the abnormal composition graph, wherein the characteristic node vector comprises a sample query characteristic vector, a sample user characteristic vector, a candidate shop characteristic vector, a sample position characteristic vector and/or a sample time characteristic vector.
4. The method of claim 3, wherein the historical query data includes transactional behavior data and non-transactional behavior data; the constructing of the sample positive case pair and the sample negative case pair according to the historical query data specifically comprises:
constructing the sample right case pair according to the transaction behavior data, wherein the transaction behavior comprises click behavior or payment behavior;
and constructing a sample negative example pair corresponding to the behavior edge and the co-occurrence edge according to the non-transaction behavior data, and generating the sample negative example pair corresponding to the similar edge in a negative sampling mode.
5. The method according to claim 3, wherein the calculating a feature edge weight corresponding to each feature edge in the abnormal graph based on the historical query data specifically comprises:
acquiring characteristic edge historical data corresponding to each characteristic edge in the historical query data respectively, wherein the behavior edges comprise transaction behavior edges between any user or any query word and any store, transaction behavior edges between any user or any query word and any scene, transaction behavior edges between any scene and any store, and transaction behavior edges between any two scenes, and the similar edges comprise similar edges between any two stores and similar edges between any two users;
and calculating the characteristic edge weight corresponding to each characteristic edge according to the characteristic edge historical data.
6. The method according to any one of claims 1 to 5, wherein the screening of the target stores of the candidate stores according to the matching degree between the request vector and the store vector corresponding to the candidate stores comprises:
respectively calculating the query feature vector, the user feature vector and the feature matching degree between the scene feature vector and the shop vector, and determining the shop matching degree between the request vector and the candidate shop according to the feature matching degree;
and acquiring the target shops corresponding to the shop matching degree meeting a preset query condition in the candidate shops, wherein the candidate shops comprise candidate tradable places and/or candidate going-to positions, and the target shops comprise target tradable places and/or target going-to positions.
7. The method of claim 1, wherein the query request comprises a query result based on a search term input operation, a query page entry action, or a query module trigger operation.
8. The method according to claim 1, wherein the screening of target stores in the candidate stores according to the matching degree between the request vector and the store vector corresponding to the candidate stores comprises:
inputting the query feature vector, the user feature vector and the scene feature vector into a preset query model to obtain a target shop corresponding to the request vector;
the preset query model is obtained by training by taking historical query features, historical user features and historical scene features contained in historical query data as input values in advance and taking historical trading shops contained in the historical query data as output values.
9. A scenario-based query apparatus, comprising:
a request vector obtaining module, configured to obtain, in response to a query request, a request vector corresponding to the query request from a pre-trained sample feature vector, where the request vector includes a query feature vector, a user feature vector, and a scene feature vector, the scene feature vector includes a location feature vector and/or a time feature vector, and the sample feature vector includes feature node vectors in a trained heteromorphic graph;
the target shop screening module is used for screening target shops in the candidate shops according to the matching degree between each feature vector contained in the request vector and the shop vector corresponding to the candidate shops;
the apparatus is for: constructing and training an abnormal graph according to historical query data, wherein the weight of a characteristic edge corresponding to each characteristic edge in the abnormal graph is calculated according to the historical query data, the characteristic edge is formed by connecting characteristic nodes, the characteristic nodes comprise query nodes, user nodes, candidate shop nodes and position nodes and/or time nodes, the type of the characteristic edge comprises a co-occurrence edge, and the co-occurrence edge comprises a co-occurrence edge between any two positions; and determining the weight of the co-occurrence edge between any two positions based on the number of people who simultaneously contain click/payment behaviors generated on the related shops corresponding to any two positions in the historical query behaviors or the number of people who simultaneously generate click/payment behaviors under any two positions.
10. The apparatus of claim 9, wherein the request vector obtaining module specifically includes:
the characteristic obtaining unit is used for obtaining a query characteristic corresponding to the query request, a query user, and a target query position and/or target query time corresponding to the current query scene, wherein the target query time comprises at least one of a query time interval characteristic, a query season characteristic and a query day working characteristic;
the vector obtaining unit is used for obtaining the query feature vector corresponding to the query feature from a pre-trained sample query feature vector, obtaining the user feature vector matched with the query user from a pre-trained sample user feature vector, obtaining the position feature vector matched with the target query position from a pre-trained sample position feature vector, and/or obtaining the time feature vector matched with the target query time from a pre-trained sample time feature vector.
11. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method of any of claims 1 to 8.
12. A computer device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, characterized in that the processor implements the method of any one of claims 1 to 8 when executing the computer program.
CN202110574678.0A 2021-05-26 2021-05-26 Scene-based query method and device, storage medium and computer equipment Active CN113032694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110574678.0A CN113032694B (en) 2021-05-26 2021-05-26 Scene-based query method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110574678.0A CN113032694B (en) 2021-05-26 2021-05-26 Scene-based query method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN113032694A CN113032694A (en) 2021-06-25
CN113032694B true CN113032694B (en) 2021-11-09

Family

ID=76455864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110574678.0A Active CN113032694B (en) 2021-05-26 2021-05-26 Scene-based query method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN113032694B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115114537B (en) * 2022-08-29 2022-11-22 成都航空职业技术学院 Interactive virtual teaching aid implementation method based on file content identification

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190051A (en) * 2018-11-29 2019-01-11 广东省科技基础条件平台中心 A kind of user behavior analysis method and the resource recommendation method based on the analysis method
CN111061946A (en) * 2019-11-15 2020-04-24 汉海信息技术(上海)有限公司 Scenario content recommendation method and device, electronic equipment and storage medium
CN111310008A (en) * 2020-03-20 2020-06-19 北京三快在线科技有限公司 Search intention recognition method and device, electronic equipment and storage medium
CN111523933A (en) * 2020-04-21 2020-08-11 北京嘀嘀无限科技发展有限公司 Method and device for predicting order taking probability, electronic equipment and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110852755B (en) * 2019-11-06 2022-05-17 支付宝(杭州)信息技术有限公司 User identity identification method and device for transaction scene

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190051A (en) * 2018-11-29 2019-01-11 广东省科技基础条件平台中心 A kind of user behavior analysis method and the resource recommendation method based on the analysis method
CN111061946A (en) * 2019-11-15 2020-04-24 汉海信息技术(上海)有限公司 Scenario content recommendation method and device, electronic equipment and storage medium
CN111310008A (en) * 2020-03-20 2020-06-19 北京三快在线科技有限公司 Search intention recognition method and device, electronic equipment and storage medium
CN111523933A (en) * 2020-04-21 2020-08-11 北京嘀嘀无限科技发展有限公司 Method and device for predicting order taking probability, electronic equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
A Dual Heterogeneous Graph Attention Network to Improve Long-Tail Performance for Shop Search in E-Commerce;Xichuan Niu等;《KDD "20: Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining》;20200831;第3405-3415页 *

Also Published As

Publication number Publication date
CN113032694A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
TW201305944A (en) Providing social product recommendations
CN107808314B (en) User recommendation method and device
KR101998400B1 (en) System and method for recommending mobile commerce information using big data
CN110750697B (en) Merchant classification method, device, equipment and storage medium
CN108429776A (en) Method for pushing, device, client, interactive device and the system of network object
WO2016036225A1 (en) Crowdfunding intermediary service method and system using loan
CN111626767B (en) Resource data issuing method, device and equipment
CN112700307A (en) Commodity recommendation method based on data analysis
CN107071864A (en) A kind of method, equipment and system for being used to connect WAP
CN113032694B (en) Scene-based query method and device, storage medium and computer equipment
CN109829593B (en) Credit determining method and device for target object, storage medium and electronic device
KR101998399B1 (en) Mobile commerce system and service method using big data
CN112036987A (en) Method and device for determining recommended commodities
US20210110410A1 (en) Methods, systems, and apparatuses for providing data insight and analytics
CN114155067B (en) User portrait establishing method and system
CN116091171A (en) Member statistics and management system
CN103778551A (en) Commodity information prompting method and device thereof
CN115423555A (en) Commodity recommendation method and device, electronic equipment and storage medium
CN109858900A (en) A kind of payment information method for pushing, device and terminal device
CN113158032B (en) Information pushing method and device
CN110347923B (en) Traceable fast fission type user portrait construction method
CN113254775A (en) Credit card product recommendation method based on client browsing behavior sequence
CN112465586A (en) Intelligent exhibition information interaction system
KR20200137500A (en) Server for matching merchandise experience user
KR102473802B1 (en) Keyword analysis method and online advertisement provision method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant