A method and device for determining similar stores
By generating store feature vectors and using neural network models and graph embedding algorithms, the problem of insufficient accuracy and comprehensiveness in finding similar stores in the existing technology is solved, and more accurate and comprehensive matching of similar stores is achieved.
Patent Information
- Application Number
- CN202010230637.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-03-27
AI Technical Summary
The existing similar store search methods based on store names and business categories have low accuracy and insufficient comprehensiveness, and cannot effectively match the store's operating status and development stage.
By obtaining user historical data, store feature vectors are generated, using neural network models and graph embedding algorithms to dynamically characterize store features, and then determine similar stores.
It improves the accuracy and comprehensiveness of similar stores, makes the obtained similar stores more consistent with user behavior and operating reality, and provides a more dynamic and accurate store matching.
Smart Images

Figure CN113450174B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for determining similar stores. Background Art
[0002] With the development of e-commerce, more and more merchants have begun to move into e-commerce platforms. In order to improve the competitive advantage of merchant stores, merchant stores usually need to pay attention not only to the operating conditions of their own stores, but also to the operating conditions of other similar stores in order to formulate operating strategies that are conducive to the development of the stores.
[0003] At present, the commonly used methods for finding similar stores mainly include: finding similar stores based on keywords corresponding to the store names; finding similar stores based on similarity calculations based on the store business categories.
[0004] In the process of realizing the present invention, the inventors found that there are at least the following problems in the prior art: due to the low correlation between the store name and the types of goods sold in the store, the similar stores searched based on the store name keywords have a large deviation from the actual similar stores and low accuracy; the number of stores obtained based on the store business categories is large, and only the product category itself is considered, but the actual operating conditions, development stage, etc. of the stores cannot be matched. Summary of the invention
[0005] In view of this, the present invention provides a method and device for determining similar stores, which can generate a feature vector for describing a store based on the user's click and browse behavior of the store, and then determine one or more similar stores according to the similarity of the feature vector. Since the feature vector can characterize the store more dynamically, the obtained similar stores are more accurate and comprehensive.
[0006] To achieve the above object, according to a first aspect of the present invention, a method for determining similar stores is provided, comprising:
[0007] Obtaining user history data, where the user history data indicates one or more stores operated by the user and the time of the operation;
[0008] According to the operation time, the store is divided into one or more first store sequences, wherein the store sequence includes one or more of the stores;
[0009] Obtain one or more first store pairs in each of the first store sequences, wherein the first store and the second store included in the first store pair are two different stores in the same first store sequence;
[0010] Based on the first store pair, using a neural network model, determining a feature vector of the first store;
[0011] One or more similar stores corresponding to the first store are determined according to the similarity of the feature vectors of the first store.
[0012] Optionally, the neural network model includes: an input layer, a hidden layer, and an output layer; wherein,
[0013] The input layer is used to obtain the first store and the second store in the first store pair;
[0014] The hidden layer is used to generate a feature vector of the first store;
[0015] The output layer is used to predict similar stores of the first store based on the feature vector of the first store, and to update the feature vector of the first store when the predicted similar store is inconsistent with the second store.
[0016] Optionally, it also includes:
[0017] After obtaining one or more first store pairs in each of the first store sequences, calculating the number of the first store pairs in all the first store sequences;
[0018] constructing a store association graph according to the first store pairs and the number of the first store pairs, wherein the nodes of the store association graph indicate the stores, and the edges of the store association graph indicate the number of the store pairs;
[0019] According to the store association graph, based on a graph embedding algorithm, one or more second store sequences of preset length are generated for each of the stores, wherein the second store sequence includes the stores and a second store pair is obtained from each of the second store sequences, wherein the second store pair includes two different stores in the same second store sequence;
[0020] The store corresponds to one or more stores adjacent to the node;
[0021] Based on the second store pair, a neural network model is used to determine a feature vector of the first store in the second store pair.
[0022] Optionally, it also includes:
[0023] When the number of stores in the first store sequence is not within a threshold range, the first store sequence is deleted.
[0024] Optionally, the algorithm adopted by the neural network model is the Word2Vec algorithm.
[0025] Optionally, the graph embedding algorithm is any one of the following: Node2Vec algorithm, DeepWalk algorithm, Line algorithm.
[0026] Optionally, the similarity of the feature vectors of the stores is calculated according to any one of the following: cosine distance, Jaccard distance, and Euclidean distance.
[0027] To achieve the above object, according to a second aspect of the present invention, a similar store determination device is provided, comprising: a data acquisition module, a store sequence acquisition module, a store pair acquisition module, a feature vector determination module, and a similar store determination module; wherein:
[0028] The data acquisition module is used to acquire user history data, where the user history data indicates one or more stores operated by the user and the operation time;
[0029] The store sequence acquisition module is used to divide the store into one or more first store sequences according to the operation time, and the first store sequence includes one or more of the stores;
[0030] The store pair acquisition module is used to acquire one or more first store pairs in each of the first store sequences, wherein the first store and the second store included in the first store pair are two different stores in the same first store sequence;
[0031] The feature vector determination module is used to determine the feature vector of the first store based on the first store pair using a neural network model;
[0032] The similar store determination module is used to determine one or more similar stores corresponding to the first store according to the similarity of the feature vector of the first store.
[0033] Optionally, the neural network model includes: an input layer, a hidden layer, and an output layer; wherein,
[0034] The input layer is used to obtain the first store and the second store in the first store pair;
[0035] The hidden layer is used to generate a feature vector of the first store;
[0036] The output layer is used to predict similar stores of the first store based on the feature vector of the first store, and to update the feature vector of the first store when the predicted similar store is inconsistent with the second store.
[0037] Optionally, the store pair acquisition module is further used to:
[0038] After obtaining one or more first store pairs in each of the first store sequences, calculating the number of the first store pairs in all the first store sequences;
[0039] constructing a store association graph according to the first store pairs and the number of the first store pairs, wherein the nodes of the store association graph indicate the stores, and the edges of the store association graph indicate the number of the store pairs;
[0040] According to the store association graph, based on a graph embedding algorithm, one or more second store sequences of preset length are generated for each of the stores, wherein the second store sequence includes the store and one or more stores adjacent to a node corresponding to the store;
[0041] Obtaining a second store pair in each of the second store sequences, wherein the second store pair includes two different stores in the same second store sequence;
[0042] The feature vector determination module is further used to determine the feature vector of the first store in the second store pair based on the second store pair using a neural network model.
[0043] Optionally, the store sequence acquisition module is further used to:
[0044] When the number of stores in the first store sequence is not within a threshold range, the first store sequence is deleted.
[0045] Optionally, the algorithm adopted by the neural network model is the Word2Vec algorithm.
[0046] Optionally, the graph embedding algorithm is any one of the following: Node2Vec algorithm, DeepWalk algorithm, Line algorithm.
[0047] Optionally, the similarity of the feature vectors of the stores is calculated according to any one of the following: cosine distance, Jaccard distance, and Euclidean distance.
[0048] To achieve the above object, according to a third aspect of the present invention, there is provided an electronic device for determining store similarity, comprising: one or more processors; a storage device for storing one or more programs;
[0049] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described in the similar store determination method.
[0050] To achieve the above objective, according to a fourth aspect of the present invention, there is provided a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, any of the methods described above in the similar store determination method is implemented.
[0051] The above invention has the following advantages or beneficial effects: based on the history of users clicking and browsing stores, a feature vector for describing stores is generated based on a neural network algorithm, and then one or more similar stores are determined based on the similarity of the feature vectors. Since the feature vector can more dynamically characterize the store, the similar stores obtained are more accurate and comprehensive. In addition, training samples are generated through a graph embedding algorithm, which further optimizes the feature vector for describing stores obtained through the neural network algorithm, making the similar stores obtained based on the similarity of the feature vectors more accurate and comprehensive.
[0052] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0054] Figure 1 is a schematic diagram of the main process of a method for determining similar stores according to an embodiment of the present invention;
[0055] Figure 2 is a schematic diagram of the main structure of a neural network model according to an embodiment of the present invention;
[0056] Figure 3 is a schematic diagram of the main process of another method for determining similar stores according to an embodiment of the present invention;
[0057] Figure 4a is a schematic diagram of the main structure of a store association graph according to an embodiment of the present invention;
[0058] Figure 4b is a schematic diagram of obtaining a neighbor sequence of a vertex by using a biased random walk method according to an embodiment of the present invention;
[0059] Figure 5 is a schematic diagram of main modules of a device for determining similar stores according to an embodiment of the present invention;
[0060] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0061] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0063] Figure 1 is a schematic diagram of the main process of the method for determining similar stores according to an embodiment of the present invention; Figure 1 As shown, the method for determining similar stores may specifically include the following steps:
[0064] Step S101, obtaining user history data, wherein the user history data indicates one or more stores operated by the user and the operation time.
[0065] User operations include but are not limited to browsing, clicking, exposure, searching, adding to cart, purchasing and other behaviors. The corresponding user history data is the history of users browsing stores, clicking stores, searching stores, adding store products to shopping carts, purchasing store products, etc. within a period of one month or three months. For example, if the user history data is the history of users browsing stores on the e-commerce platform within one month, the specific user history data obtained is as follows:
[0066] User 1: [Shop 1, Shop 2, Shop 3, Shop 3, Shop 4…]
[0067] User 2: [Shop 1, Shop 2]
[0068] User 3: [Shop 2, Shop 3…]
[0069] The order of the stores is the order in which the user actually browses the stores. Therefore, it is understandable that the historical data of the same user may record one or more stores that appear repeatedly. The order of stores browsed by different users may be the same or different.
[0070] Step S102: dividing the store into one or more first store sequences according to the operation time, wherein the store sequence includes one or more of the stores.
[0071] The so-called similar stores refer to alternative stores that users may consider purchasing products from. Therefore, it is understandable that the stores that users browse and click on within a period of time can be regarded as stores that can provide the same products or product substitutes to a certain extent, that is, they have certain similarities. In the actual implementation process, for different categories of products, users spend different amounts of time browsing product details pages or obtaining information such as user reviews of products. Therefore, according to different product categories, the historical data of the same user can be divided according to certain time intervals (such as 30 minutes, 15 minutes), etc., to obtain the first store sequence browsed by one or more users in chronological order within a certain period of time. The specific examples are as follows:
[0072] User 1: [Shop 1, Shop 2, Shop 3]
[0073] User 1: [Shop 3, Shop 4]
[0074] User 2: [Shop 1, Shop 2]
[0075] User 3: [Shop 2, Shop 3]
[0076] In an optional embodiment, when the number of stores in the first store sequence is not within a threshold interval, the first store sequence is deleted. It is understandable that the number of stores and the store sequence browsed by different users in the same time interval are uncertain. Therefore, in order to ensure the validity of the store sequence and avoid interference with the calculation of similar stores caused by malicious large-scale browsing of stores or a small number of browsed stores, the first store sequence whose number of stores is not within the threshold interval is deleted, and the threshold interval can be set according to actual needs, such as [2-100], [3-50], etc. Specifically, the threshold interval of [2-100] is used as an example for explanation, and only the first store sequence whose number of stores is neither less than 2 nor greater than 100 is retained.
[0077] Step S103, obtaining one or more first store pairs in each of the first store sequences, wherein the first store and the second store included in the first store pair are two different stores in the same first store sequence. It is understandable that, in order to ensure that the two stores selected from the first store sequence are different, the same stores in the first store sequence can be deduplicated, or deduplication can be performed when selecting store pairs in pairs, so as to ensure that the two stores in the first store pair are different.
[0078] Specifically, still taking the above-mentioned first store sequence as an example for explanation, the first store pairs obtained from the first store sequence and the number of first store pairs in all first store sequences are specifically shown in the following Table 1:
[0079] Table 1 The first store pairs and quantity
[0080] First shop pair Number of first store pairs [Shop 1, Shop 2] 2 [Shop 1, Shop 3] 1 [Shop 2, Shop 3] 2 [Shop 3, Shop 4] 1
[0081] Specifically, the first store pair [Store 1, Store 2] is taken as an example for explanation, wherein Store 1 is defaulted to be the first store, Store 2 is defaulted to be the second store, and vice versa.
[0082] Step S104: Based on the first store pair, a neural network model is used to determine a feature vector of the first store.
[0083] The feature vector of a store is a vector used to describe or characterize the store. Since the feature vector is obtained based on user historical data or user behavior, the feature vector can more accurately represent the store from the perspective of user behavior. The corresponding similar stores are also stores that are strongly associated with user behavior.
[0084] In an optional implementation, the neural network model includes: an input layer, a hidden layer, and an output layer; wherein the input layer is used to obtain the first store and the second store in the first store pair; the hidden layer is used to generate a feature vector of the first store; the output layer is used to predict similar stores of the first store based on the feature vector of the first store, and update the feature vector of the first store when the predicted similar store is inconsistent with the second store. It can be understood that the number of hidden layers in the neural network model can be set to one, two, or more according to actual needs.
[0085] Specifically, see Figure 2 , the algorithm used by the neural network model is the Word2Vec algorithm as an example. The neural network model is the skip-gram model, which includes an input (Input Vector), a hidden layer (Hidden Layer), and an output layer (Output Layer). Assuming that the input layer vector is x, the size is n*1, then the mapping relationship between the hidden layer vector h and the input layer vector x is shown in the following formula:
[0086] h=W T ·x+b
[0087] Where W is a matrix of size n*m, b is a vector of size m*1, W and b are randomly generated at the beginning; n refers to the size of the input vector x (such as Figure 2 300 in ), and m is just the total number of input vectors x (e.g. Figure 210000 in ). On this basis, the vector (x, y) corresponding to the first store pair is input into the input layer, where x is the vector corresponding to one store in the first store pair, and y is the vector corresponding to the other store in the first store pair, that is, y is used as the label or output corresponding to x in the neural network model, and the neural network model is trained and optimized, that is, the values of the hidden layer vector parameters W and b are updated. It can be understood that when the neural network model is first used for training, vectors x and y are randomly generated to represent different vectors for different stores. On the basis of obtaining the hidden layer vector h based on the input vector x, the output layer is obtained, and then the output layer result is subjected to a softmax operation. The softmax function is shown in the following formula:
[0088]
[0089] Where x is a vector, x_j is the jth element in the vector, and the output of the softmax layer is the predicted probability value The loss is calculated based on the true label of the predicted value, and the loss function is set to cross entropy, as follows:
[0090]
[0091] After calculating the loss, perform gradient descent in the reverse direction to derive the weights (the specific formula is as follows), set the derivative to 0, that is, the direction of the fastest gradient descent, update the weights W and b, and then perform the forward hidden layer output layer softmax calculation to iteratively update the weights W and b until the loss meets the requirements, determine W and b, and then determine the hidden layer vector h = W T x+b is the feature vector of the store corresponding to vector x, that is, the hidden layer vector h is used as the feature vector of the store to obtain similar stores.
[0092]
[0093] In an optional embodiment, after obtaining one or more first store pairs in each of the first store sequences, the number of the first store pairs in all the first store sequences is calculated; a store association graph is constructed according to the first store pairs and the number of the first store pairs, the nodes of the store association graph indicate the stores, and the edges of the store association graph indicate the number of the store pairs; according to the store association graph, based on a graph embedding algorithm, one or more second store sequences of preset length are generated for each of the stores, the second store sequence includes the store and one or more stores adjacent to the node corresponding to the store; the second store pair in each of the second store sequences is obtained, the second store pair includes two different stores in the same second store sequence; based on the second store pairs, a neural network model is used to determine the feature vector of the store.
[0094] That is to say, by using the graph embedding algorithm to process the first store pair, generating the second store pair, and using the second store pair as a training sample for training based on the neural network model, not only the diversity of the samples is guaranteed, but also the validity of the samples is guaranteed, so that the feature vector of the store determined based on the neural network model can more accurately describe the store.
[0095] In an optional implementation, the graph embedding algorithm is any one of the following: Node2Vec algorithm, DeepWalk algorithm, Line algorithm. In the embodiment of the present invention, the Node2Vec algorithm is preferably used to obtain the second store sequence by biased random walk, and then obtain the second store pair.
[0096] Step S105: determining one or more similar stores corresponding to the first store according to the similarity of the feature vector of the first store.
[0097] It is understandable that the similarity of the feature vectors of the stores can be calculated according to any of the following methods: cosine distance, Jaccard distance, and Euclidean distance. Specifically, taking the cosine distance (i.e., cosine similarity) as an example, the vector With vector The cosine distance can be calculated by the following formula:
[0098]
[0099] On this basis, the cosine similarity is calculated for the feature vector of each store and the feature vectors of all other stores. The stores can be sorted in descending order according to the size of the cosine similarity, and then the top 20, 30 or 100 stores are selected as the final similar stores according to actual needs.
[0100] Based on the above embodiment, based on the history of users clicking and browsing stores, a feature vector for describing stores is generated based on a neural network algorithm, and then one or more similar stores are determined based on the similarity of the feature vectors. Since the feature vector can more dynamically characterize the store, the similar stores obtained are more accurate and comprehensive. In addition, training samples are generated through a graph embedding algorithm, which further optimizes the feature vector for describing stores obtained through the neural network algorithm, making the similar stores obtained based on the similarity of the feature vectors more accurate and comprehensive.
[0101] See also Figure 3 Based on the above embodiment, the embodiment of the present invention provides another method for determining similar stores, which may specifically include the following steps:
[0102] Step S301, obtaining user history data, wherein the user history data indicates one or more stores operated by the user and the operation time.
[0103] Step S302: dividing the store into one or more first store sequences according to the operation time, wherein the store sequence includes one or more of the stores.
[0104] Step S303: Obtain one or more first store pairs in each of the first store sequences, wherein the first store and the second store included in the first store pair are two different stores in the same first store sequence.
[0105] Step S304, calculate the number of the first store pairs in all the first store sequences. Specifically, still referring to Table 1, the calculated first store pairs and their corresponding numbers are: the number of [store 1, store 2] is 2, the number of [store 1, store 3] is 1, the number of [store 2, store 3] is 2, and the number of [store 3, store 4] is 1.
[0106] Step S305: construct a store association graph according to the first store pairs and the number of the first store pairs, wherein the nodes of the store association graph indicate the stores, and the edges of the store association graph indicate the number of the store pairs.
[0107] Specifically, see Figure 4a According to the first store pair and the number of first store pairs in Table 1, the store association diagram is constructed as follows: Figure 4a As shown, the nodes of the store association graph are store 1, store 2, store 3, and store 4. Since the number of the first store pair [store 1, store 2] is 2, there is an edge between store 1 and store 2 and the weight of the edge is 2; and since the first store pair [store 2, store 4] has never appeared, that is, the corresponding number is 0, there is no edge between store 2 and store 4.
[0108] Step S306, according to the store association graph, based on the graph embedding algorithm, generate one or more second store sequences of preset length for each of the stores, the second store sequence including the store and one or more stores adjacent to the node corresponding to the store.
[0109] It is understandable that the graph embedding algorithms that can be used include but are not limited to the Node2Vec algorithm, the DeepWalk algorithm, and the Line algorithm. However, in the embodiment of the present invention, only the Node2Vec algorithm is used as an example for explanation. The calculation process is as follows:
[0110] Taking the store association graph constructed in the above steps as input, a biased random walk method is used to obtain the sequence of neighboring nodes (i.e. stores) corresponding to the nodes in the store association graph. Given the current node v, the probability P that the next node in the neighboring node sequence is node x can be calculated by the following formula:
[0111]
[0112] where Z is the normalization constant, is the unnormalized transition probability from vertex v to vertex x. Assuming that the current random walk reaches the current vertex v via the edge (t,v), let
[0113]
[0114]
[0115] where ω vx is the weight of the edge between vertex v and x, d tx is the distance of the shortest path from vertex t to vertex x. p and q are parameters. p is used to control the probability of revisiting the vertex just visited. q controls whether the walk is outward or inward. If q>1, the random walk tends to visit vertices close to t (biased towards BFS). If q<1, it tends to visit vertices far away from t (biased towards DFS). For details, see Figure 4b , which describes the α corresponding to each vertex when deciding the next vertex to visit when visiting from t to v. pq , where p = 100, q = 0.5, then for each node in the store association graph, one or more node neighboring sequences with a preset length (such as 6) are generated, namely, the second store sequence. The specific example is as follows:
[0116] [Shop 13333, Shop 5, Shop 339, Shop 20, Shop 9999…]
[0117] [Shop 13333, Shop 255, Shop 33, Shop 10, Shop 91…]
[0118] [Shop 33, Shop 5, Shop 339, Shop 10, Shop 999…]
[0119] [Shop 233, Shop 44, Shop 33, Shop 30, Shop 44…]
[0120] Step S307, obtaining a second store pair in each second store sequence, wherein the second store pair includes two different stores in the same second store sequence. Specifically, still taking the above second store sequence as an example, obtaining a second store pair from the second store sequence in a pairwise manner, the specific example is as follows:
[0121] [Store 33, store 5], [Store 33, store 339], [Store 5, store 33], [Store 5, store 339], [Store 5, store 10], [Store 339, store 33], [Store 339, store 5], [Store 339, store 10], [Store 339, store 999], [Store 10, store 5], [Store 10, store 339], [Store 10, store 999], [Store 10, store 1], [Store 999, store 339], [Store 999, store 10], [Store 999, store 1], [Store 1, store 10], [Store 1, store 999]
[0122] Among them, the first store in the second store pair is the first store by default, and the second store is the second store. Taking the second store pair [store 33, store 5] as an example, store 33 is the first store, and store 5 is the second store. It can be understood that, if the neural network model used to determine the characteristic vector of the store allows, three or more stores can be arbitrarily selected from the second store sequence to generate a store combination, so as to use the neural network model for training, and then obtain the characteristic vector corresponding to the store. In the embodiment of the present invention, only two-by-two combinations are used to obtain the second store pair as an example for explanation.
[0123] Step S308: Based on the second store pair, use a neural network model to determine a feature vector of the first store in the second store pair.
[0124] Step S309: determining one or more similar stores corresponding to the first store according to the similarity of the feature vector of the first store.
[0125] See also Figure 5 Based on the above embodiments, the embodiment of the present invention provides a similar store determination device 500, characterized by comprising: a data acquisition module 501, a store sequence acquisition module 502, a store pair acquisition module 503, a feature vector determination module 504, and a similar store determination module 505; wherein,
[0126] The data acquisition module 501 is used to acquire user history data, where the user history data indicates one or more stores operated by the user and the operation time;
[0127] The store sequence acquisition module 502 is used to divide the store into one or more first store sequences according to the operation time, and the first store sequence includes one or more of the stores;
[0128] The store pair acquisition module 503 is used to acquire one or more first store pairs in each of the first store sequences, wherein the first store and the second store included in the first store pair are two different stores in the same first store sequence;
[0129] The feature vector determination module 504 is used to determine the feature vector of the first store based on the first store pair using a neural network model;
[0130] The similar store determining module 505 is used to determine one or more similar stores corresponding to the first store according to the similarity of the feature vector of the first store.
[0131] In an optional implementation, the neural network model includes: an input layer, a hidden layer, and an output layer; wherein,
[0132] The input layer is used to obtain the first store and the second store in the first store pair;
[0133] The hidden layer is used to generate a feature vector of the first store;
[0134] The output layer is used to predict similar stores of the first store based on the feature vector of the first store, and to update the feature vector of the first store when the predicted similar store is inconsistent with the second store.
[0135] In an optional implementation, the store pair acquisition module 503 is further used to:
[0136] After obtaining one or more first store pairs in each of the first store sequences, calculating the number of the first store pairs in all the first store sequences;
[0137] constructing a store association graph according to the first store pairs and the number of the first store pairs, wherein the nodes of the store association graph indicate the stores, and the edges of the store association graph indicate the number of the store pairs;
[0138] According to the store association graph, based on a graph embedding algorithm, one or more second store sequences of preset length are generated for each of the stores, wherein the second store sequence includes the store and one or more stores adjacent to a node corresponding to the store;
[0139] Obtaining a second store pair in each of the second store sequences, wherein the second store pair includes two different stores in the same second store sequence;
[0140] The feature vector determination module is further used to determine the feature vector of the first store in the second store pair based on the second store pair using a neural network model.
[0141] In an optional implementation, the store sequence acquisition module 502 is further configured to:
[0142] When the number of stores in the first store sequence is not within a threshold range, the first store sequence is deleted.
[0143] In an optional implementation, the algorithm adopted by the neural network model is the Word2Vec algorithm.
[0144] In an optional implementation, the graph embedding algorithm is any one of the following: Node2Vec algorithm, DeepWalk algorithm, Line algorithm.
[0145] In an optional implementation, the similarity of the feature vectors of the stores is calculated according to any one of the following: cosine distance, Jaccard distance, and Euclidean distance.
[0146] Figure 6 An exemplary system architecture 600 is shown to which the method for determining similar stores or the apparatus for determining similar stores according to the embodiments of the present invention can be applied.
[0147] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0148] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0149] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0150] The server 605 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (similar stores) to the terminal device.
[0151] It should be noted that the method for determining similar stores provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the device for determining similar stores is generally set in the server 605 .
[0152] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0153] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0154] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0155] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0156] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0157] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0158] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0159] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, they may be described as: a processor including a data acquisition module, a store sequence acquisition module, a store pair acquisition module, a feature vector determination module, and a similar store determination module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the data acquisition module may also be described as "a module for acquiring user history data, wherein the user history data indicates one or more stores operated by the user and the operation time".
[0160] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining user history data, the user history data indicating one or more stores operated by the user and the operation time; dividing the stores into one or more first store sequences according to the operation time, the store sequence including one or more stores; obtaining one or more first store pairs in each of the first store sequences, the first store pairs including two different stores in the same first store sequence; based on the first store pairs, using a neural network model, determining the feature vector of the store; and determining one or more similar stores corresponding to the store according to the similarity of the feature vectors of the stores.
[0161] According to the technical solution of the embodiment of the present invention, based on the history of users clicking and browsing stores, a feature vector for describing stores is generated based on a neural network algorithm, and then one or more similar stores are determined based on the similarity of the feature vectors. Since the feature vector can more dynamically characterize the store, the similar stores obtained are more accurate and comprehensive. In addition, training samples are generated through a graph embedding algorithm, which further optimizes the feature vector for describing stores obtained through the neural network algorithm, making the similar stores obtained based on the similarity of the feature vectors more accurate and comprehensive.
[0162] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for determining similar stores, characterized in that: include: Obtaining user history data, where the user history data indicates one or more stores operated by the user and the time of the operation; According to the operation time, the store is divided into one or more first store sequences, wherein the store sequence includes one or more of the stores; Obtain one or more first store pairs in each of the first store sequences, and calculate the number of the first store pairs in all the first store sequences, wherein the first store and the second store included in the first store pair are two different stores in the same first store sequence; constructing a store association graph according to the first store pairs and the number of the first store pairs, wherein the nodes of the store association graph indicate the stores, and the edges of the store association graph indicate the number of the store pairs; According to the store association graph, based on the graph embedding algorithm, one or more second store sequences of preset length are generated for each of the stores, the second store sequence includes the store and a second store pair obtained from each of the second store sequences, the second store pair includes two different stores in the same second store sequence; one or more stores adjacent to the corresponding node of the store; based on the first store pair and the second store pair, a neural network model is used to determine the feature vector of the first store; One or more similar stores corresponding to the first store are determined according to the similarity of the feature vectors of the first store.
2. The method for determining similar stores according to claim 1, characterized in that: The neural network model includes: an input layer, a hidden layer, and an output layer; wherein, The input layer is used to obtain the first store and the second store in the first store pair; The hidden layer is used to generate a feature vector of the first store; The output layer is used to predict similar stores of the first store based on the feature vector of the first store, and to update the feature vector of the first store when the predicted similar store is inconsistent with the second store.
3. The method for determining similar stores according to claim 1, characterized in that: Also includes: When the number of stores in the first store sequence is not within a threshold range, the first store sequence is deleted.
4. The method for determining similar stores according to claim 1, characterized in that: The algorithm adopted by the neural network model is the Word2Vec algorithm.
5. The method for determining similar stores according to claim 1, characterized in that: The graph embedding algorithm is any one of the following: Node2Vec algorithm, DeepWalk algorithm, Line algorithm.
6. The method for determining similar stores according to claim 1, characterized in that: The similarity of the feature vectors of the stores is calculated according to any one of the following methods: cosine distance, Jaccard distance, and Euclidean distance.
7. A device for determining similar stores, characterized in that: include: Data acquisition module, store sequence acquisition module, store pair acquisition module, feature vector determination module, similar store determination module; wherein, The data acquisition module is used to acquire user history data, where the user history data indicates one or more stores operated by the user and the operation time; The store sequence acquisition module is used to divide the store into one or more first store sequences according to the operation time, and the first store sequence includes one or more of the stores; The store pair acquisition module is used to acquire one or more first store pairs in each of the first store sequences, wherein the first store and the second store included in the first store pair are two different stores in the same first store sequence; and is also used to calculate the number of the first store pairs in all the first store sequences after acquiring one or more first store pairs in each of the first store sequences; construct a store association graph according to the first store pairs and the number of the first store pairs, wherein the nodes of the store association graph indicate the stores, and the edges of the store association graph indicate the number of the store pairs; according to the store association graph, based on a graph embedding algorithm, generate one or more second store sequences of preset length for each of the stores, wherein the second store sequence includes the store and one or more stores adjacent to the node corresponding to the store; and acquire a second store pair in each of the second store sequences, wherein the second store pair includes two different stores in the same second store sequence; The feature vector determination module is used to determine the feature vector of the first store based on the first store pair and the second store pair using a neural network model; The similar store determination module is used to determine one or more similar stores corresponding to the store according to the similarity of the feature vector of the first store.
8. The device for determining similar stores according to claim 7, characterized in that: The neural network model includes: an input layer, a hidden layer, and an output layer; wherein, The input layer is used to obtain the first store and the second store in the first store pair; The hidden layer is used to generate a feature vector of the first store; The output layer is used to predict similar stores of the first store based on the feature vector of the first store, and to update the feature vector of the first store when the predicted similar store is inconsistent with the second store.
9. The device for determining similar stores according to claim 7, characterized in that: The store sequence acquisition module is further used to: When the number of stores in the first store sequence is not within a threshold range, the first store sequence is deleted.
10. The device for determining similar stores according to claim 7, characterized in that: The algorithm adopted by the neural network model is the Word2Vec algorithm.
11. The device for determining similar stores according to claim 7, characterized in that: The graph embedding algorithm is any one of the following: Node2Vec algorithm, DeepWalk algorithm, Line algorithm.
12. The device for determining similar stores according to claim 7, characterized in that: The similarity of the feature vectors of the stores is calculated according to any one of the following methods: cosine distance, Jaccard distance, and Euclidean distance.
13. An electronic device for determining store similarity, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
