A user portrait generation method, device and electronic equipment
By clustering user data using feature word vectors and determining selected feature vectors, personalized user profiles are generated, solving the problem of identical user profile dimensions in existing technologies and achieving a more accurate reflection of user behavior characteristics.
Patent Information
- Application Number
- CN202210729697.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-06-24
AI Technical Summary
Existing technologies fail to reflect individual differences when generating user profiles, resulting in profiles for each user having the same dimensions and failing to accurately reflect individual characteristics.
By acquiring user data, determining the feature word vectors of each data point, clustering them to obtain feature vector clusters, and determining selected feature vectors based on the distance between the center feature vectors of the feature vector clusters, clustering them to obtain selected feature vector clusters, and selecting the one containing the most selected feature vectors as the profile dimension to generate personalized user profiles.
It enables the generation of personalized user profiles, which can more accurately reflect users' behavioral characteristics and meet their personalized needs.
Smart Images

Figure CN115269817B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a user portrait generation method and device and electronic equipment. BACKGROUND
[0002] With the development of Web3.0 (the next generation of Internet, which is used to summarize various different directions and characteristics that may appear in a certain stage of the development of the Internet, including the transformation of the Internet itself into a generic database), more and more users engage in social activities, distributed finance, metaverse, games and other activities on the blockchain, thereby depositing a large amount of user data on the blockchain. How to generate a corresponding user portrait based on this user data has become a problem to be solved. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a user portrait generation method, device and electronic equipment to realize the generation of a user portrait. The specific technical solutions are as follows:
[0004] In a first aspect, the embodiments of the present application provide a user portrait generation method, which comprises:
[0005] obtaining user data of a plurality of users;
[0006] for each user, determining a feature word vector of each data in the user data of the user, wherein one data corresponds to data of the user completing one business activity;
[0007] clustering all feature word vectors corresponding to the user to obtain a feature vector cluster;
[0008] for each feature vector cluster of the user, determining a selected feature word vector of the feature vector cluster based on the distance between each feature word vector in the feature vector cluster and the center feature word vector of the feature vector cluster;
[0009] clustering the selected feature word vectors of all feature vector clusters corresponding to the user to obtain a selected feature word vector cluster;
[0010] selecting one selected feature word vector in the selected feature word vector cluster containing the most number of selected feature word vectors as the portrait dimension of the user;
[0011] generating a user portrait of the user based on the user data and the portrait dimension of the user.
[0012] Optionally, the determination of the feature word vector of each data in the user data of the user comprises:
[0013] determining user data corresponding to the user, the user data including at least one piece of data, each piece of data including a service blockchain identifier, a block identifier, an activity time, an activity content, and an activity result;
[0014] for each piece of data in the user data of the user, taking the service blockchain identifier as a feature word corresponding to the service blockchain identifier, taking the block identifier as a feature word corresponding to the block identifier, and taking the activity time as a feature word corresponding to the activity time;
[0015] performing semantic recognition on the activity result, and taking a result of the semantic recognition as a feature word corresponding to the activity result;
[0016] performing feature word extraction on the activity content to obtain a feature word corresponding to the activity content;
[0017] determining a feature word vector of the piece of data based on the feature word corresponding to the service blockchain identifier, the feature word corresponding to the block identifier, the feature word corresponding to the activity time, the feature word corresponding to the activity result, and the feature word corresponding to the activity content.
[0018] Optionally, the feature word extraction on the activity content to obtain the feature word corresponding to the activity content includes:
[0019] performing word segmentation on the activity content to obtain a plurality of first words;
[0020] determining a part of speech of each first word;
[0021] performing semantic recognition on the activity content to obtain a target semantic corresponding to the activity content;
[0022] for each first word, determining a similarity value between the first word and the target semantic based on the part of speech of the first word and the target semantic, wherein the similarity value indicates a degree to which the first word represents the target semantic;
[0023] sorting the first words based on the similarity values between the first words and the target semantic to obtain an activity word sequence, and determining the activity word sequence as the feature word corresponding to the activity content.
[0024] Optionally, the determination of the similarity value between the first word and the target semantic for each first word based on the part of speech of the first word and the target semantic includes:
[0025] performing word segmentation on the target semantic to obtain a plurality of second words;
[0026] determining a key word from the plurality of second words;
[0027] determine the part-of-speech of the key word;
[0028] for each first word, determine whether the part-of-speech of the first word is the same as the part-of-speech of the key word;
[0029] if the part-of-speech of the first word is the same as the part-of-speech of the key word, determine the weight of the first word as 1;
[0030] if the part-of-speech of the first word is not the same as the part-of-speech of the key word, determine whether there is a second word in the plurality of second words that has the same part-of-speech as the first word;
[0031] if there is a second word in the plurality of second words that has the same part-of-speech as the first word, determine the weight of the first word as: the number of second words that have the same part-of-speech as the first word / the total number of second words;
[0032] if there is no second word in the plurality of second words that has the same part-of-speech as the first word, determine the weight of the first word as: 1 / (N x the total number of second words), N is a number greater than 1;
[0033] for each first word, determine the similarity value between the first word and the target semantic based on the weight of the first word and the distance between the first word and the target semantic.
[0034] Optionally, the determining, for each feature vector cluster of the user, the selected feature vectors of the feature vector cluster based on the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, comprises:
[0035] determining, for each feature vector cluster of the user, the center feature vector of the feature vector cluster;
[0036] determining the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster;
[0037] calculating the mean and the mean square deviation of the distance of the feature vector cluster according to the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster;
[0038] determining the feature word vectors that have a distance not greater than a target threshold from the center feature vector of the feature vector cluster as the selected feature vectors of the feature vector cluster, wherein the target threshold is determined according to the mean, the mean square deviation of the distance of the feature vector cluster, the number of feature word vectors in the feature vector cluster and the total number of feature word vectors.
[0039] Optionally, the selecting comprises selecting one selected feature vector from the selected feature vector cluster with the largest number of selected feature vectors as the portrait dimension of the user, including:
[0040] The selecting comprises selecting one selected feature vector from the selected feature vector cluster with the largest number of selected feature vectors as the target feature vector;
[0041] All feature words in the target feature vector are selected as the portrait dimension of the user.
[0042] Alternatively, part of the feature words in the target feature vector are selected as the portrait dimension of the user according to a preset rule.
[0043] Optionally, the method further comprises:
[0044] According to the user identifier of the user, the user node and user identifier relationship table in the portrait blockchain is queried to determine whether the user identifier exists in the user node and user identifier relationship table.
[0045] In the case that the user identifier exists in the user node and user identifier relationship table, the target user node corresponding to the user identifier is determined.
[0046] A new linked list node is created in the linked list of the target user node, and the user portrait of the user is stored in the new linked list node.
[0047] In the case that the user identifier does not exist in the user node and user identifier relationship table, a new user node is created in the portrait blockchain, and the corresponding relationship between the new user node and the user identifier is updated to the user node and user identifier relationship table.
[0048] A linked list is established in the new user node, and the user portrait of the user is stored in a new linked list node of the linked list.
[0049] Optionally, the method further comprises:
[0050] A use request of a first user for a target user portrait is obtained, and the use request includes a second user identifier corresponding to the target user portrait of a second user;
[0051] According to the second user identifier, the user node and user identifier relationship table in the portrait blockchain is queried to determine the second user node corresponding to the second user identifier, and the second user node includes information of the second user.
[0052] According to the information of the second user, a request for the target user portrait being used is sent to the second user.
[0053] read the target user portrait upon receiving the authorization message of the second user feedback, and feed back the target user portrait to the first user;
[0054] feed back information of unauthorized use to the first user upon receiving the non-authorization message of the second user feedback.
[0055] Optionally, the method further comprises:
[0056] obtaining a user portrait of a specified user, and predicting preference information of the specified user based on the user portrait;
[0057] recommending a target product to the specified user based on the preference information.
[0058] In a second aspect, an embodiment of the present application provides a user portrait generation device, and the device comprises:
[0059] a data acquisition module configured to acquire user data of a plurality of users;
[0060] a feature determination module configured to determine, for each user, a feature word vector of each piece of data in the user data of the user, wherein one piece of data corresponds to data of the user completing one business activity;
[0061] a first clustering module configured to cluster all feature word vectors corresponding to the user to obtain a feature vector cluster;
[0062] a feature selection module configured to determine, for each feature vector cluster of the user, a selected feature word vector of the feature vector cluster based on a distance between each feature word vector in the feature vector cluster and a center feature word vector of the feature vector cluster;
[0063] a second clustering module configured to cluster selected feature word vectors of all feature vector clusters corresponding to the user to obtain a selected feature word vector cluster;
[0064] a dimension determination module configured to select one selected feature word vector cluster containing the largest number of selected feature word vectors as a portrait dimension of the user;
[0065] a portrait generation module configured to generate a user portrait of the user based on the user data of the user and the portrait dimension.
[0066] Optionally, the feature determination module comprises:
[0067] a first determination sub-module configured to determine user data corresponding to the user, wherein the user data comprises at least one piece of data, and each piece of data comprises a business blockchain identifier, a block identifier, an activity time, an activity content, and an activity result;
[0068] a second determining sub-module, configured to, for each piece of data in the user data of the user, take the service blockchain identifier as a feature word corresponding to the service blockchain identifier, take the block identifier as a feature word corresponding to the block identifier, and take the activity time as a feature word corresponding to the activity time;
[0069] a third determining sub-module, configured to perform semantic recognition on the activity result, and take a result of the semantic recognition as a feature word corresponding to the activity result;
[0070] a fourth determining sub-module, configured to perform feature word extraction on the activity content, and obtain a feature word corresponding to the activity content;
[0071] a fifth determining sub-module, configured to determine a feature word vector of the piece of data based on the feature word corresponding to the service blockchain identifier, the feature word corresponding to the block identifier, the feature word corresponding to the activity time, the feature word corresponding to the activity result, and the feature word corresponding to the activity content.
[0072] Optionally, the fourth determining sub-module includes:
[0073] a first tokenization unit, configured to perform tokenization on the activity content, and obtain a plurality of first words;
[0074] a first determining unit, configured to determine a part of speech of each first word;
[0075] a semantic recognition unit, configured to perform semantic recognition on the activity content, and obtain a target semantic corresponding to the activity content;
[0076] a similarity determining unit, configured to, for each first word, determine a similarity value between the first word and the target semantic based on the part of speech of the first word and the target semantic, where the similarity value indicates a degree to which the first word represents the target semantic;
[0077] a second determining unit, configured to sort each first word based on the similarity value between the first word and the target semantic, and obtain an activity word sequence, and determine the activity word sequence as the feature word corresponding to the activity content.
[0078] Optionally, the similarity determining unit is specifically configured to:
[0079] perform tokenization on the target semantic, and obtain a plurality of second words;
[0080] determine a key word from the plurality of second words;
[0081] determine a part of speech of the key word;
[0082] For each first word, determine whether the part of speech of the first word is the same as the part of speech of the key word;
[0083] If the part of speech of the first word is the same as the part of speech of the key word, determine the weight of the first word as 1;
[0084] If the part of speech of the first word is not the same as the part of speech of the key word, determine whether there is a second word in the plurality of second words whose part of speech is the same as the part of speech of the first word;
[0085] If there is a second word in the plurality of second words whose part of speech is the same as the part of speech of the first word, determine the weight of the first word as: the number of second words whose part of speech is the same as the part of speech of the first word / the total number of second words;
[0086] If there is no second word in the plurality of second words whose part of speech is the same as the part of speech of the first word, determine the weight of the first word as: 1 / (N x the total number of second words), N is a number greater than 1;
[0087] For each first word, determine the similarity value between the first word and the target semantic based on the weight of the first word and the distance between the first word and the target semantic.
[0088] Optionally, the feature selection module is specifically configured to:
[0089] For each feature vector cluster of the user, determine the center feature vector of the feature vector cluster;
[0090] Determine the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster;
[0091] According to the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, calculate the mean and mean square deviation of the distance of the feature vector cluster;
[0092] Determine the feature word vector whose distance from the center feature vector of the feature vector cluster is not greater than a target threshold as the selected feature vector of the feature vector cluster, wherein the target threshold is determined according to the mean and mean square deviation of the distance of the feature vector cluster, the number of feature word vectors in the feature vector cluster, and the total number of feature word vectors.
[0093] Optionally, the dimension determination module comprises:
[0094] The feature selection sub-module is configured to select one selected feature vector in the selected feature vector cluster containing the largest number of selected feature vectors as the target feature vector;
[0095] The first dimension determining sub-module is configured to determine all feature words in the target feature vector as the portrait dimensions of the user.
[0096] The second dimension determining sub-module is configured to select part of the feature words in the target feature vector as the portrait dimensions of the user according to a preset rule.
[0097] Optionally, the apparatus further comprises:
[0098] The first query module is configured to query a user node and user identifier relationship table in a portrait blockchain according to a user identifier of a user, and determine whether the user identifier exists in the user node and user identifier relationship table.
[0099] The node determining module is configured to determine a target user node corresponding to the user identifier in a case where the user identifier exists in the user node and user identifier relationship table.
[0100] The first portrait storage module is configured to create a new linked list node in a linked list of the target user node, and store the user portrait of the user in the new linked list node.
[0101] The node creating module is configured to create a new user node in the portrait blockchain in a case where the user identifier does not exist in the user node and user identifier relationship table, and update a corresponding relationship between the new user node and the user identifier to the user node and user identifier relationship table.
[0102] The second portrait storage module is configured to establish a linked list in the new user node, and store the user portrait of the user in a new linked list node of the linked list.
[0103] Optionally, the apparatus further comprises:
[0104] The request obtaining module is configured to obtain a use request of a first user for a target user portrait, the use request comprising a second user identifier of a second user corresponding to the target user portrait.
[0105] The second query module is configured to query a user node and user identifier relationship table in a portrait blockchain according to the second user identifier, and determine a second user node corresponding to the second user identifier, the second user node comprising information of the second user.
[0106] The request sending module is configured to send a request for use of the target user portrait to the second user according to the information of the second user.
[0107] An image feedback module is configured to read the target user image and feed the target user image to the first user when the authorization message of the second user feedback is received.
[0108] An information feedback module is configured to feed the information of unauthorized use to the first user when the non-authorization message of the second user feedback is received.
[0109] Optionally, the apparatus further comprises:
[0110] A preference prediction module is configured to acquire a user image of a specified user, and predict the preference information of the specified user based on the user image.
[0111] A product recommendation module is configured to recommend a target product to the specified user based on the preference information.
[0112] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.
[0113] The memory is configured to store a computer program.
[0114] The processor is configured to execute the program stored on the memory, and implement the method steps of any of the above.
[0115] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method steps of any of the above.
[0116] An embodiment of the present application further provides a computer program product comprising instructions which, when executed on a computer, cause the computer to perform the method steps of any of the above.
[0117] The user image generation method and device and the electronic device provided by the embodiment of the present application realize the personalized dimension user image generation.
[0118] Of course, implementing any product or method of the present application does not necessarily need to achieve all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS
[0119] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other embodiments can also be obtained from these drawings.
[0120] Figure 1 A flowchart of a user portrait generation method provided by an embodiment of the present application is shown in FIG. 1.
[0121] Figure 2 An analysis method provided by an embodiment of the present application is shown in FIG. 2.
[0122] Figure 3 A user portrait display provided by an embodiment of the present application is shown in FIG. 3.
[0123] Figure 4 A determination of a feature word vector provided by an embodiment of the present application is shown in FIG. 4.
[0124] Figure 5 A determination of an activity content feature word provided by an embodiment of the present application is shown in FIG. 5.
[0125] Figure 6 A determination of a similarity provided by an embodiment of the present application is shown in FIG. 6.
[0126] Figure 7 A user portrait storage provided by an embodiment of the present application is shown in FIG. 7.
[0127] Figure 8 A use of a user portrait provided by an embodiment of the present application is shown in FIG. 8.
[0128] Figure 9 A use of a user portrait provided by an embodiment of the present application is shown in FIG. 9.
[0129] Figure 10 A structure of an electronic device provided by an embodiment of the present application is shown in FIG. 10. DETAILED DESCRIPTION
[0130] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art based on the present application are within the scope of protection of the present application.
[0131] In the prior art, in the process of generating a user portrait, portrait dimensions of a user portrait are determined for all users, such as age, name, and behavior characteristics, and further user data under the determined portrait dimensions is collected to generate a corresponding user portrait for the user. In this method, the user portrait dimensions corresponding to each user are the same, and the user features are distinguished under the determined fixed dimensions, which cannot reflect the individual differences of the users.
[0132] To solve the above problems, the embodiment of the present application provides a user portrait generation method, after obtaining user data of a plurality of users, for each user, determining the feature word vector of each data in the user data of the user, clustering all the feature word vectors corresponding to the user to obtain a feature vector cluster, and for each feature vector cluster of the user, determining the selected feature vector of the feature vector cluster based on the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, clustering the selected feature vectors of all the feature vector clusters corresponding to the user to obtain a selected feature vector cluster, selecting one selected feature vector in the selected feature vector cluster containing the most number of selected feature vectors as the portrait dimension of the user, and then generating the user portrait of the user based on the user data and the portrait dimension of the user, to realize the generation of the user portrait with personalized dimensions.
[0133] The user portrait generation method provided by the present application will be described in detail below through specific embodiments.
[0134] The user portrait generation method provided by the embodiment of the present application can be applied to electronic devices such as terminals, servers and the like. The user portrait generation method provided by the embodiment of the present application can be applied in the blockchain scenario to generate user portraits with personalized dimensions for user data deposited on the blockchain.
[0135] Referring to Figure 1 , Figure 1 The user portrait generation method provided by the embodiment of the present application comprises:
[0136] S101, obtaining user data of a plurality of users.
[0137] With the development of Web3.0, more and more users engage in social activities, distributed finance, metaverse, games and other activities on the blockchain, thereby depositing a large amount of user data on the blockchain. In the embodiment of the present application, various behavior data deposited by users on the blockchain can be read, such as data deposited on mainstream public chains such as Ethereum, Solana (a one-stop experience consumption place integrating shopping, entertainment, leisure, tourism and culture), BSC (Balanced Score Card), involving distributed finance, NET (Non-Fungible Token) digital collectibles and metaverse activities.
[0138] In an example, user data of multiple users on the blockchain can be obtained by a crawler or the like, and the user data corresponding to each user includes at least one piece of data, and each piece of data contains behavior data of each dimension generated by the user on the blockchain, such as activity time, activity content, and the like. For the obtained user data of multiple users, the user data can be stored in the data warehouse in the form of a data wide table, so as to facilitate subsequent use of the user data. The wide table refers to a database table with more fields, and generally refers to a database table in which business theme related indicators, dimensions, and attributes are associated together.
[0139] In S102, for each user, a feature word vector of each piece of data in the user data of the user is determined.
[0140] The user data corresponding to each user includes at least one piece of data, and each piece of data corresponds to data of a business activity completed by the user. For each piece of data in the user data of each user, a feature word vector corresponding to the piece of data can be determined according to the dimension data contained in the piece of data, so as to obtain the feature word vector of each piece of data in the user data of the user, and the feature word vector contains the feature words of each piece of data in the user data of the user. For example, the dimension data contained in each piece of data can include activity time, activity content, and activity result, and the like.
[0141] In S103, all feature word vectors corresponding to the user are clustered to obtain a feature vector cluster.
[0142] After the feature word vector of each piece of data in the user data of the user is determined, any one of various clustering algorithms, such as a K-MEANS (k-means clustering algorithm) clustering algorithm, a mean shift clustering algorithm, a DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm, an EM (Expectation-maximization) clustering algorithm using a GMM (Gaussian Mixture Model), or a hierarchical clustering algorithm, can be used to cluster all feature word vectors corresponding to the user, cluster feature word vectors with similar feature words into a class, and obtain a feature vector cluster. For details of the implementation of clustering all feature word vectors corresponding to the user to obtain a feature vector cluster, refer to the implementation of the prior art.
[0143] S104, for each feature vector cluster of the user, determining a selected feature vector of the feature vector cluster based on a distance between each feature word vector in the feature vector cluster and a center feature vector of the feature vector cluster.
[0144] For each feature vector cluster of the user, the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster is calculated, and then it is determined whether to determine the feature word vector as the selected feature vector of the feature vector cluster according to the distance between each feature word vector and the center feature vector of the feature vector cluster. In the process of clustering all feature word vectors corresponding to the user described above, the center feature vector of each feature vector cluster has been determined.
[0145] In some embodiments, the implementation process of determining the selected feature vector of the feature vector cluster of the user based on the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster can include:
[0146] For each feature vector cluster of the user, determining the center feature vector of the feature vector cluster;
[0147] Determining the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster;
[0148] According to the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, calculating the mean and variance of the distance of the feature vector cluster;
[0149] Determining the feature word vector with a distance not greater than a target threshold from the center feature vector of the feature vector cluster as the selected feature vector of the feature vector cluster, wherein the target threshold is determined according to the mean and variance of the distance of the feature vector cluster, the number of feature word vectors in the feature vector cluster, and the total number of feature word vectors.
[0150] In the process of clustering all feature word vectors corresponding to the user described above, the center feature vector of each feature vector cluster has been determined, and thus the center feature vector of each feature vector cluster can be directly obtained. Since the clustering is implemented according to the distance between each feature word vector and the center feature vector of the feature vector cluster, the distance between each feature word vector and the center feature vector of the feature vector cluster has been determined in the clustering process, and thus for each feature vector cluster of the user, the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster can be directly obtained.
[0151] Further, according to the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, a distance mean and a mean square deviation corresponding to each distance are calculated to obtain the distance mean and the mean square deviation of the feature vector cluster, and then the feature word vector with a distance not greater than a target threshold from the center feature vector of the feature vector cluster is determined as a selected feature vector of the feature vector cluster, wherein the target threshold is determined according to the distance mean, the mean square deviation, the number of feature word vectors in the feature vector cluster, and the total number of feature word vectors, and the total number of feature word vectors is equivalent to one user.
[0152] In one example, the target threshold can be expressed as: distance mean + mean square deviation x (1 + number of feature word vectors in the feature vector cluster / total number of feature word vectors).
[0153] The selected feature vector of the feature vector cluster is determined in the above manner, regardless of the size of the feature vector cluster (i.e., the number of feature word vectors in the feature vector cluster), and the selected feature vector of the feature vector cluster can be determined, which ensures that the selected feature vector can comprehensively describe the user characteristics and avoids the loss of user portrait dimensions due to insufficient number of feature word vectors.
[0154] In addition, in terms of reflecting the degree of reaction of a feature to user characteristics, the feature vector cluster with a large number of feature word vectors can better reflect the overall characteristics of the user than the feature vector cluster with a small number of feature word vectors. The selected feature vector of the feature vector cluster with a large number of feature word vectors is more than the selected feature vector of the feature vector cluster with a small number of feature word vectors, which ensures the comprehensiveness of the user portrait dimensions and the keyness of the core dimensions.
[0155] Referring to Figure 1 S105, the selected feature vectors of all feature vector clusters corresponding to the user are clustered to obtain selected feature vector clusters.
[0156] The implementation process of this step can refer to the implementation process of clustering all feature word vectors corresponding to the user to obtain feature vector clusters described above, and details are not repeated here.
[0157] S106, one selected feature vector in the selected feature vector cluster with the largest number of selected feature vectors is selected as the portrait dimension of the user.
[0158] After the selected feature vector clusters are obtained, a selected feature vector cluster containing the most selected feature vectors is determined first, and the selected feature vector cluster is taken as a target selected feature vector cluster. Further, a central feature vector of the target selected feature vector cluster can be selected as the portrait dimension of the user, or a selected feature vector containing the most feature words in the target selected feature vector cluster can be selected as the portrait dimension of the user, or a random selected feature vector in the target selected feature vector cluster can be selected as the portrait dimension of the user, and the like.
[0159] In some embodiments, selecting a selected feature vector in the selected feature vector cluster containing the most selected feature vectors as the portrait dimension of the user can include:
[0160] selecting a selected feature vector in the selected feature vector cluster containing the most selected feature vectors as a target feature vector;
[0161] selecting all feature words in the target feature vector as the portrait dimension of the user;
[0162] or selecting part of the feature words in the target feature vector as the portrait dimension of the user according to a preset rule.
[0163] The central feature vector of the selected feature vector cluster containing the most selected feature vectors, the selected feature vector containing the most feature words, or the random selected feature vector can be selected as the target feature vector. Further, all feature words in the target feature vector can be selected as the portrait dimension of the user, or part of the feature words in the target feature vector can be selected as the portrait dimension of the user according to a preset rule. The preset rule can be the highest frequency of occurrence, or the highest frequency of occurrence and the highest weight, and the like.
[0164] All feature words in the target feature vector of the selected feature vector cluster containing the most selected feature vectors can be selected as the portrait dimension of the user, or part of the feature words in the target feature vector with the highest frequency of occurrence can be selected as the portrait dimension of the user, so that the determined portrait dimension of the user can meet the dimension richness and the comprehensiveness of the key dimension.
[0165] S107, generating a user portrait of the user based on the user data of the user and the portrait dimension.
[0166] After determining the portrait dimension of the user, the data value of each piece of data in the user data of the user in the portrait dimension can be collected, and a target analysis method can be used to analyze the data values in all portrait dimensions to generate the user portrait of the user. The detailed implementation process of using the target analysis method to analyze the data values in all portrait dimensions to generate the user portrait of the user can be the same as the prior art, and the embodiments of the present application will not be repeated here.
[0167] For example, the target analysis method can be any one of a plurality of analysis methods, such as Figure 2 As shown, the target analysis method can include supervised learning methods, unsupervised learning methods, or adaptive learning methods, etc., wherein the supervised learning method is, for example, a regression analysis method and a CNN (Convolutional Neural Network, Convolutional Neural Network) deep learning, etc., the unsupervised learning method is, for example, a clustering analysis method, and the adaptive learning method is, for example, a GAN (Generative Adversarial Network, Generative Adversarial Network) network prediction method, etc.
[0168] For example, as shown in Figure 3 Figure 3 The user portrait of the user Alice is shown in the figure, which includes portrait data (specific portrait data is not shown) of dimensions such as ordinary traders, liquidity providers, and market makers in the financial aspect, DAO (Data Access Object, Data Access Object) participants and StepN (Solana blockchain-based "mobile travel" application) participants in the social aspect, Ant digital product owners and digital collectible diamond hands in the collection aspect, metaverse primary analysis, Roblox (multiplayer online creative game) deep participants, and Sandbox (virtual software) land builders in the metaverse aspect, and DCL game masters and certain GameFi primary players in the game aspect, Figure 3 The specific portrait data of the dimensions is not shown in the figure.
[0169] In the embodiment of the present application, for each user, the feature word vector of each data in the user data of the user is analyzed, the feature word vector of each data in the user data of the user is determined, all feature word vectors corresponding to the user are clustered to obtain a feature vector cluster, for each feature vector cluster of the user, the selected feature vector of the feature vector cluster is determined based on the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, the selected feature vectors of all feature vector clusters corresponding to the user are further clustered to obtain a selected feature vector cluster, one selected feature vector in the selected feature vector cluster containing the largest number of selected feature vectors is selected as the portrait dimension of the user, and the obtained portrait dimension can more comprehensively represent the behavior characteristics of the user, so that the user portrait generated according to the portrait dimension can more accurately reflect the characteristics of the user, and the personalized dimension user portrait of thousands of people with thousands of dimensions is realized.
[0170] In some embodiments, referring to Figure 4 The step S102 of determining the feature word vector of each data in the user data of the user can include:
[0171] S401, determining the user data corresponding to the user.
[0172] In the embodiment of the present application, after obtaining the user data of the plurality of users, for each user, the user data corresponding to the user can be determined, the user data of each user includes at least one data, and each data can include a plurality of dimensions of data such as business blockchain identifier, block identifier, activity time, activity content and activity result. Wherein, the business blockchain identifier represents the identification information of the business blockchain generating the data, and the block identifier represents the identification information of the block in the business blockchain generating the data.
[0173] In one example, the user performs an activity on the business blockchain, completes an activity, and forms a data packet of all information of the activity (such as user identifier, business blockchain identifier, block identifier, activity time, activity content and activity result) into a data packet, the data packet corresponds to one data, that is, one data corresponds to the data of the user completing a business activity, and each data is analyzed to obtain the user identifier, business blockchain identifier, block identifier, activity time, activity content and activity result contained in the data.
[0174] In determining the user data corresponding to the user, all user data corresponding to the user can be determined, which can be all data of the user from the beginning of the user's activity on the blockchain to the present, or the data of the user in a preset time period, such as the last year, the last half year, etc., which can be set according to actual conditions, as long as the amount of data of the determined user data is rich and the time of generating the user data is closest to the current time.
[0175] Because the user behavior characteristics change over time, analyzing the user data closest to the current time can ensure that the portrait dimension matches the current behavior characteristics of the user, and thus the user portrait generated finally can more accurately reflect the current most real behavior characteristics of the user.
[0176] S402, for each piece of data in the user data of the user, the business blockchain identifier is taken as the feature word corresponding to the business blockchain identifier, the block identifier is taken as the feature word corresponding to the block identifier, and the activity time is taken as the feature word corresponding to the activity time.
[0177] S403, the semantic recognition result of the activity result is taken as the feature word corresponding to the activity result.
[0178] In an example, the semantic recognition model can be used to perform semantic recognition on the activity result in each piece of data, and the semantic recognition result is taken as the feature word corresponding to the activity result. The semantic recognition model can be obtained by pre-training according to sample text and the semantic recognition result corresponding to the sample text. Of course, any method capable of performing semantic recognition on the activity result to obtain a semantic recognition result is within the protection scope of the present application.
[0179] S404, the feature words corresponding to the activity content are extracted to obtain the feature words corresponding to the activity content.
[0180] S405, based on the feature words corresponding to the business blockchain identifier, the feature words corresponding to the block identifier, the feature words corresponding to the activity time, the feature words corresponding to the activity result, and the feature words corresponding to the activity content, the feature word vector of the piece of data is determined.
[0181] The feature words corresponding to the activity content in each piece of data are extracted to obtain the feature words corresponding to the activity content, and the feature words corresponding to the business blockchain identifier, the feature words corresponding to the block identifier, the feature words corresponding to the activity time, the feature words corresponding to the activity result, and the feature words corresponding to the activity content are combined to form a feature word vector, so as to obtain the feature word vector of the piece of data.
[0182] In the embodiment of the application, for each piece of data in the user data corresponding to each user, the service block chain identifier, the block identifier, the activity time, the activity content and the activity result corresponding to the feature words in the piece of data are determined respectively, the feature word vector composed of the feature words is determined as the feature word vector of the piece of data, so as to more accurately and comprehensively determine the portrait dimension of the user.
[0183] In some embodiments, referring to Figure 5 The feature word extraction on the activity content in the step S404 can include:
[0184] S501, performing word segmentation on the activity content to obtain a plurality of first words;
[0185] S502, determining the part of speech of each first word;
[0186] S503, performing semantic recognition on the activity content to obtain a target semantic corresponding to the activity content;
[0187] S504, for each first word, determining a similarity value of the first word and the target semantic based on the part of speech of the first word and the target semantic. The similarity value indicates the degree of the first word representing the target semantic.
[0188] S505, based on the similarity values of the first words and the target semantic, sorting the first words to obtain an activity word sequence, and determining the activity word sequence as the feature words corresponding to the activity content.
[0189] For the activity content of each piece of data, the activity content is first segmented to obtain a plurality of first words, and then the part of speech of each first word is determined, which can be a noun, a verb, an adjective, etc.
[0190] The way of performing semantic recognition on the activity content to obtain a target semantic corresponding to the activity content can be the same as the way of performing semantic recognition on the activity result to obtain the result of semantic recognition.
[0191] After determining the part of speech of each first word corresponding to the activity content and the target semantic corresponding to the activity content, the similarity value of each first word and the target semantic can be calculated to determine the degree of each first word representing the target semantic. Further, the first words can be sorted in descending order of the similarity values of the first words and the target semantic to obtain an activity word sequence, and the activity word sequence is determined as the feature words corresponding to the activity content.
[0192] In some embodiments, referring to Figure 6The step S504 comprises:
[0193] S601, performing word segmentation on the target semantics to obtain a plurality of second words;
[0194] S602, determining a key word from the plurality of second words;
[0195] S603, determining a part of speech of the key word;
[0196] S604, determining, for each first word, whether a part of speech of the first word is same as the part of speech of the key word;
[0197] S605, if the part of speech of the first word is same as the part of speech of the key word, determining that a weight of the first word is 1;
[0198] S606, if the part of speech of the first word is not same as the part of speech of the key word, determining whether there is a second word with the same part of speech as the first word in the plurality of second words;
[0199] S607, if there is a second word with the same part of speech as the first word in the plurality of second words, determining that the weight of the first word is: a number of the second words with the same part of speech as the first word / total number of the second words;
[0200] S608, if there is no second word with the same part of speech as the first word in the plurality of second words, determining that the weight of the first word is: 1 / (N*total number of the second words), N is a number greater than 1;
[0201] S609, for each first word, determining a similarity value between the first word and the target semantics based on the weight of the first word and a distance between the first word and the target semantics.
[0202] After determining the part-of-speech of each first word corresponding to the activity content and the target semantics corresponding to the activity content, the target semantics can be further segmented to obtain a plurality of second words, and a key word is determined from the plurality of second words. For example, the target semantics is to purchase a product, and the second words obtained after segmentation are "purchase" and "product". The contribution of "purchase" and "product" to the target semantics is calculated respectively. When the contribution of "purchase" to the target semantics is higher than the contribution of "product" to the target semantics, the key word of the target semantics is "purchase". The target semantics is to search for men's clothing products, and the second words obtained after segmentation are "search", "men's clothing", and "product". The contribution of "search", "men's clothing", and "product" to the target semantics is calculated respectively. When the contribution of "men's clothing" to the target semantics is higher than the contribution of "search" and "product" to the target semantics, the key word of the target semantics is "men's clothing", and so on. The specific implementation of calculating the contribution of segmentation to semantics and how to determine the key word can be referred to the implementation of the prior art.
[0203] In an example of the embodiment of the present application, the meaning of each first word is identified, and the distance between the meaning of the first word and the target semantics is calculated to obtain the distance between the first word and the target semantics. In the case of determining the weight of each first word, the product of the weight of the first word and the distance between the first word and the target semantics can be determined as the similarity value of the first word and the target semantics for each first word. For example, the distance between the meaning of the first word and the target semantics can be calculated by calculating the cosine distance or Euclidean distance between the meaning of the first word and the target semantics.
[0204] In the embodiment of the present application, the similarity value of each first word and the target semantics is determined according to the part-of-speech of the first word corresponding to the activity content and the target semantics of the activity content, which can more accurately determine the degree of representing the target semantics by each first word.
[0205] After generating the user portrait of the user, in order to return the ownership of the user portrait to the user, that is, the user is aware when the user portrait of the user is used, in some embodiments, on the basis of the above embodiment, the generated user portrait can also be stored in a portrait blockchain, and the identity information of the corresponding user is configured for the user portrait, so that the user has the right to act on the user portrait based on the identity information. The portrait blockchain can include a head node and a non-head node. The head node can also be referred to as a portrait node. The portrait node maintains a correspondence table of user nodes and user identifiers. The non-head node in the portrait blockchain can be a user node. Each user node corresponds to a user. Each user node corresponds to a linked list. The user portrait of the user is stored in the linked list. Based on this, in some embodiments, on the basis of the above embodiment, seeFigure 7 The method can further include the following steps:
[0206] S701, according to the user identifier of the user, querying the user node and user identifier relationship table in the portrait blockchain to determine whether the user identifier exists in the user node and user identifier relationship table.
[0207] When it is necessary to store the user portrait, a user portrait storage request is received, the user portrait storage request can include the user portrait and the user identifier of the corresponding user, and the user node and user identifier relationship table maintained by the portrait node in the portrait blockchain is queried to determine whether the user identifier corresponding to the user portrait to be stored exists in the user node and user identifier relationship table. If it exists, it indicates that the user portrait of the user has been stored, and the operations of steps 702 and 703 are performed; if it does not exist, it indicates that the user portrait of the user has not been stored, and the operations of steps 704 and 705 are performed.
[0208] S702, in the case where the user identifier exists in the user node and user identifier relationship table, determining the target user node corresponding to the user identifier.
[0209] S703, creating a new linked list node in the linked list of the target user node, and storing the user portrait of the user into the new linked list node.
[0210] In the case where the user identifier exists in the user node and user identifier relationship table, it indicates that the user portrait of the user has been stored, and the target user node corresponding to the user identifier can be determined through the user node and user identifier relationship table. The target user node can also store information (such as identity information, etc.) of the user to bind the user identity and the user portrait, and further create a new linked list node in the linked list of the target user node, and store the user portrait of the user into the new linked list node.
[0211] In an example, the user portrait can be stored in the form of a two-dimensional array, one dimension of the two-dimensional array representing the generation time of the user portrait, and the other dimension representing the user portrait. Storing the user portrait of the user into the new linked list node can be forming a two-dimensional array with the user portrait and the generation time of the user portrait, and then storing the two-dimensional array into the new linked list node.
[0212] S704, in the case where the user identifier does not exist in the user node and user identifier relationship table, creating a new user node in the portrait blockchain, and updating the corresponding relationship between the new user node and the user identifier to the user node and user identifier relationship table.
[0213] S705, a chain table is established in the new user node, and the user portrait of the user is stored in a new chain table node of the chain table.
[0214] In the case that the user identification does not exist in the user identification relationship table of the user node, it is indicated that the user portrait of the user has not been stored, a new user node can be created at the last of the portrait blockchain, the new user node corresponds to the user who needs to store the user portrait, the information of the user can also be stored in the new user node, and the corresponding relationship between the new user node and the user identification is updated to the user node and user identification relationship table maintained by the portrait node. Further, a chain table is established in the new user node, the chain table includes a new chain table node, and the user portrait of the user is stored in the new chain table node of the chain table.
[0215] In the embodiment of the application, the user portrait is stored on the portrait blockchain, each user node on the portrait blockchain corresponds to a user, and then the user portrait can be connected (or bound) with the user node on the portrait blockchain which uniquely represents the user, the user identity of the user portrait is given through the user node, so as to protect the security and privacy of the user portrait.
[0216] After storing the user portrait, whenever the user portrait needs to be used, the corresponding user portrait is found through the user node representing the user identity, and the identity information of the user is determined, and then the user can be notified that the user portrait is used according to the user identity, so as to protect the rights and privacy of the user. Based on this, in some embodiments, on the basis of the above-mentioned embodiments, see Figure 8 The above-mentioned method can further include the following steps:
[0217] S801, a use request of a target user portrait by a first user is acquired.
[0218] The use request includes: a second user identification of a second user corresponding to the target user portrait.
[0219] S802, according to the second user identification, the user node and user identification relationship table in the portrait blockchain is queried to determine the second user node corresponding to the second user identification.
[0220] When the use request of the target user portrait by the first user is acquired, it indicates that the first user needs to use the target user portrait, the user node and user identification relationship table maintained by the portrait node in the portrait blockchain is queried, and the second user node corresponding to the second user identification is determined through the user node and user identification relationship table, the second user node includes the information of the second user. Exemplarily, the information of the second user can be the identity information of the second user, and a message can be sent to the second user through the identity information.
[0221] S803, according to the second user's information, the target user portrait is used to send the request to the second user.
[0222] Wherein, the request that the target user portrait is used can contain: the user information of the first user using the target user portrait, and the purpose of using the target user portrait, etc.
[0223] S804, when receiving the second user feedback authorization message, read the target user portrait, and feed back the target user portrait to the first user.
[0224] S805, when receiving the second user feedback not authorized message, feedback to the first user unauthorized use information.
[0225] The second user receives the request that the target user portrait is used, according to the user information of the first user using the target user portrait contained in the request, and the purpose of using the target user portrait, etc., determine whether the first user is authorized to use the target user portrait. When receiving the second user feedback authorization message, it indicates that the second user authorizes the first user to use the target user portrait, at this time read the target user portrait, and feed back the target user portrait to the first user. When receiving the second user feedback not authorized message, it indicates that the second user does not authorize the first user to use the target user portrait, then feedback to the first user unauthorized use information.
[0226] In the embodiment of the application, when using the user portrait, the user's information contained in the user node stored by the user portrait is used to inform the user that the user portrait will be used, and the user portrait is allowed to be read and used only when the user authorization is obtained, so that the rights and privacy of the user are not infringed.
[0227] Exemplarily, in the embodiment of the present application, various behavior data of user A deposited on the blockchain can be obtained in the form of a crawler, the obtained data is stored in the data warehouse in the form of a data wide table, the data of user A is analyzed, the portrait dimension suitable for user A is determined, and then the user portrait of user A is generated according to the determined portrait dimension and the data of user A. The user portrait of user A is further stored in the portrait blockchain. When user B uses the user portrait of user A, the use request of user B for the user portrait of user A is received, the user node A storing the user portrait of user A is determined through the portrait node of the portrait blockchain, the information of user A stored in the user node A is used to send a notification to user A that the user portrait of user A is used, the information of user B and the purpose of use are indicated in the notification, user A determines whether to authorize user B to use the user portrait of user A according to the information of user B and the purpose of use contained in the notification, and feedbacks the response information of whether to authorize. In the case of receiving the authorization message, the user portrait of user A is read and fed back to user B. In the case of receiving the non-authorization message, the information of unauthorized use is directly fed back to user B.
[0228] On the basis of generating and storing the user portrait, the user portrait can also be used. Specifically, the generated user portrait can be applied to precise recommendation, personalized recommendation system, precise placement of products such as advertisements, or industry analysis scenarios. In the embodiment of the present application, the personalized recommendation scenario is taken as an example for description. In some embodiments, on the basis of the above embodiment, the above method can further include the following steps:
[0229] Obtaining the user portrait of a specified user, and predicting the preference information of the specified user based on the user portrait;
[0230] Based on the preference information, a target product is recommended to the specified user.
[0231] On the basis of generating and storing the user portrait, when the specified user accesses the product page data through the access port, the user portrait of the specified user can be obtained from the generated and stored user portrait, the user portrait of the specified user is further input into the user preference prediction model to predict the preference information of the specified user, and then the corresponding target product is recommended to the specified user according to the predicted preference information of the specified user. The user preference prediction model can be obtained by pre-training according to the user portrait of the user and the preference information of the user. The preference information of the specified user may, for example, be stable, robust or growing, and the corresponding target product may, for example, be a stable financial product, a robust financial product or a growing financial product. Or the preference information of the specified user may, for example, be a text type, a long video type or a short video type, and the corresponding target product may, for example, be a text type, a long video type or a short video type corresponding to a video program.
[0232] Corresponding to the user portrait generation method provided by the above-mentioned embodiment, the embodiment of the present application also provides a user portrait generation device, as shown in the figure, the device comprises: Figure 9
[0233] The data acquisition module 901 is configured to acquire user data of a plurality of users.
[0234] The feature determination module 902 is configured to determine, for each user, a feature word vector of each piece of data in the user data of the user, wherein one piece of data corresponds to data of the user completing one business activity.
[0235] The first clustering module 903 is configured to cluster all feature word vectors corresponding to the user to obtain a feature vector cluster.
[0236] The feature selection module 904 is configured to determine, for each feature vector cluster of the user, a selected feature vector of the feature vector cluster based on a distance between each feature word vector in the feature vector cluster and a center feature vector of the feature vector cluster.
[0237] The second clustering module 905 is configured to cluster the selected feature vectors of all feature vector clusters corresponding to the user to obtain a selected feature vector cluster.
[0238] The dimension determination module 906 is configured to select one selected feature vector in the selected feature vector cluster containing the largest number of selected feature vectors as a portrait dimension of the user.
[0239] The portrait generation module 907 is configured to generate a user portrait of the user based on the user data of the user and the portrait dimension.
[0240] In the embodiment of the present application, for each user, each piece of data in the user data of the user is analyzed to determine a feature word vector of each piece of data in the user data of the user, all feature word vectors corresponding to the user are clustered to obtain a feature vector cluster, for each feature vector cluster of the user, a selected feature vector of the feature vector cluster is determined based on a distance between each feature word vector in the feature vector cluster and a center feature vector of the feature vector cluster, further clustering the selected feature vectors of all feature vector clusters corresponding to the user to obtain a selected feature vector cluster, selecting one selected feature vector in the selected feature vector cluster containing the largest number of selected feature vectors as a portrait dimension of the user, the obtained portrait dimension can more comprehensively represent the behavior characteristics of the user, and further the user portrait generated according to the portrait dimension can more accurately reflect the characteristics of the user, realizing the personalized dimension user portrait of thousands of people with thousands of dimensions.
[0241] In some embodiments, the feature determination module 902 comprises:
[0242] a first determining sub-module, configured to determine user data corresponding to the user, the user data including at least one piece of data, each piece of data including a service blockchain identifier, a block identifier, an activity time, an activity content, and an activity result;
[0243] a second determining sub-module, configured to, for each piece of data in the user data of the user, take the service blockchain identifier as a feature word corresponding to the service blockchain identifier, take the block identifier as a feature word corresponding to the block identifier, and take the activity time as a feature word corresponding to the activity time;
[0244] a third determining sub-module, configured to perform semantic recognition on the activity result, and take a result of the semantic recognition as a feature word corresponding to the activity result;
[0245] a fourth determining sub-module, configured to perform feature word extraction on the activity content, and obtain a feature word corresponding to the activity content;
[0246] a fifth determining sub-module, configured to determine a feature word vector of the piece of data based on the feature word corresponding to the service blockchain identifier, the feature word corresponding to the block identifier, the feature word corresponding to the activity time, the feature word corresponding to the activity result, and the feature word corresponding to the activity content.
[0247] In some embodiments, the fourth determining sub-module described above includes:
[0248] a first tokenization unit, configured to perform tokenization on the activity content, and obtain a plurality of first words;
[0249] a first determining unit, configured to determine a part of speech of each first word;
[0250] a semantic recognition unit, configured to perform semantic recognition on the activity content, and obtain a target semantic corresponding to the activity content;
[0251] a similarity determining unit, configured to, for each first word, determine a similarity value between the first word and the target semantic based on the part of speech of the first word and the target semantic, where the similarity value indicates a degree of representation of the target semantic by the first word;
[0252] a second determining unit, configured to sort the first words based on the similarity values between the first words and the target semantic, and obtain an activity word sequence, and determine the activity word sequence as the feature word corresponding to the activity content.
[0253] In some embodiments, the similarity determining unit described above is specifically configured to:
[0254] perform tokenization on the target semantic, and obtain a plurality of second words;
[0255] determine a key word from the plurality of second words;
[0256] determine the part-of-speech of the key word;
[0257] for each first word, determine whether the part-of-speech of the first word is the same as the part-of-speech of the key word;
[0258] if the part-of-speech of the first word is the same as the part-of-speech of the key word, determine the weight of the first word as 1;
[0259] if the part-of-speech of the first word is not the same as the part-of-speech of the key word, determine whether there is a second word in the plurality of second words that has the same part-of-speech as the first word;
[0260] if there is a second word in the plurality of second words that has the same part-of-speech as the first word, determine the weight of the first word as: the number of second words that have the same part-of-speech as the first word / the total number of second words;
[0261] if there is no second word in the plurality of second words that has the same part-of-speech as the first word, determine the weight of the first word as: 1 / (N x the total number of second words), N is a number greater than 1;
[0262] for each first word, determine the similarity value between the first word and the target semantics based on the weight of the first word and the distance between the first word and the target semantics.
[0263] In some embodiments, the feature selection module 904 is specifically configured to:
[0264] for each feature vector cluster of the user, determine a center feature vector of the feature vector cluster;
[0265] determine the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster;
[0266] calculate the mean and variance of the distances of the feature vector cluster according to the distances between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster;
[0267] determine the feature word vectors that have a distance not greater than a target threshold from the center feature vector of the feature vector cluster as the selected feature word vectors of the feature vector cluster, wherein the target threshold is determined according to the mean and variance of the distances of the feature vector cluster, the number of feature word vectors in the feature vector cluster, and the total number of feature word vectors.
[0268] In some embodiments, the dimension determination module 906 includes:
[0269] The feature selection submodule is configured to select one selected feature vector from the selected feature vector cluster with the largest number of selected feature vectors as a target feature vector;
[0270] The first dimension determination submodule is configured to determine all feature words in the target feature vector as the portrait dimensions of the user.
[0271] The second dimension determination submodule is configured to select part of the feature words in the target feature vector as the portrait dimensions of the user according to a preset rule.
[0272] In some embodiments, the apparatus further includes:
[0273] The first query module is configured to query the user node and user identifier relationship table in the portrait blockchain according to the user identifier of the user, and determine whether the user identifier exists in the user node and user identifier relationship table.
[0274] The node determination module is configured to determine the target user node corresponding to the user identifier in the case where the user identifier exists in the user node and user identifier relationship table.
[0275] The first portrait storage module is configured to create a new linked list node in the linked list of the target user node, and store the user portrait of the user in the new linked list node.
[0276] The node creation module is configured to create a new user node in the portrait blockchain in the case where the user identifier does not exist in the user node and user identifier relationship table, and update the corresponding relationship between the new user node and the user identifier to the user node and user identifier relationship table.
[0277] The second portrait storage module is configured to establish a linked list in the new user node, and store the user portrait of the user in a new linked list node of the linked list.
[0278] In some embodiments, the apparatus further includes:
[0279] The request acquisition module is configured to acquire a use request of the first user for the target user portrait, and the use request includes a second user identifier of a second user corresponding to the target user portrait.
[0280] The second query module is configured to query the user node and user identifier relationship table in the portrait blockchain according to the second user identifier, and determine a second user node corresponding to the second user identifier, the second user node including information of the second user.
[0281] The request sending module is configured to send a request that the target user portrait is used to the second user according to the information of the second user.
[0282] An image feedback module is configured to read the target user image when the authorization message of the second user feedback is received, and feed back the target user image to the first user.
[0283] An information feedback module is configured to feed back the unauthorized information to the first user when the unauthorized message of the second user feedback is received.
[0284] In some embodiments, the apparatus further comprises:
[0285] A preference prediction module is configured to obtain a user image of a specified user, and predict the preference information of the specified user based on the user image;
[0286] A product recommendation module is configured to recommend a target product to the specified user based on the preference information.
[0287] The embodiment of the present application further provides an electronic device, as shown in the figure. Figure 10 The processor 111, the communication interface 112 and the memory 113 can communicate with each other through the communication bus 114,
[0288] The memory 113 is configured to store a computer program.
[0289] The processor 111 is configured to execute the program stored in the memory 113, and realize the steps of any one of the user image generation methods to achieve the same technical effects.
[0290] The communication bus mentioned above can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
[0291] The communication interface is configured to communicate between the electronic device and other devices.
[0292] The memory can include a random access memory (RAM) and a non-volatile memory (NVM), for example, at least one disk memory.
[0293] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0294] In another embodiment provided by the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any one of the user portrait generation methods described above, so as to achieve the same technical effects.
[0295] In another embodiment provided by the present application, a computer program product containing instructions is provided, and when the computer program product is run on a computer, the computer is caused to execute the steps of any one of the user portrait generation methods in the above embodiments, so as to achieve the same technical effects.
[0296] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, solid state disk (SSD)) and the like.
[0297] It is to be noted that, in the present text, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0298] Each of the embodiments in the present specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device / electronic device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiments.
[0299] The above only describes the preferred embodiments of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A user profiling method, characterized by, The method comprises: obtaining user data of a plurality of users; for each user, determining a feature word vector of each piece of data in the user data of the user, wherein a piece of data corresponds to data of the user completing a business activity; clustering all feature word vectors corresponding to the user to obtain feature vector clusters; for each feature vector cluster of the user, determining a selected feature vector of the feature vector cluster based on a distance between each feature word vector in the feature vector cluster and a center feature word vector of the feature vector cluster; clustering the selected feature vectors of all feature vector clusters corresponding to the user to obtain selected feature vector clusters; selecting one of the selected feature vector clusters containing the most number of selected feature vectors as a portrait dimension of the user; generating a user portrait of the user based on the user data of the user and the portrait dimension.
2. The method of claim 1, wherein, The determination of the feature word vector of each piece of data in the user data of the user comprises: determining user data corresponding to the user, the user data comprising at least one piece of data, each piece of data comprising a business blockchain identifier, a block identifier, an activity time, an activity content and an activity result; for each piece of data in the user data of the user, taking the business blockchain identifier as a feature word corresponding to the business blockchain identifier, taking the block identifier as a feature word corresponding to the block identifier, and taking the activity time as a feature word corresponding to the activity time; performing semantic recognition on the activity result to obtain a feature word corresponding to the activity result; performing feature word extraction on the activity content to obtain a feature word corresponding to the activity content; determining the feature word vector of the piece of data based on the feature word corresponding to the business blockchain identifier, the feature word corresponding to the block identifier, the feature word corresponding to the activity time, the feature word corresponding to the activity result and the feature word corresponding to the activity content.
3. The method of claim 2, wherein, The feature word extraction on the activity content to obtain a feature word corresponding to the activity content comprises: performing word segmentation on the activity content to obtain a plurality of first words; determining the part of speech of each first word; performing semantic recognition on the activity content to obtain a target semantic corresponding to the activity content; for each first word, determining a similarity value of the first word and the target semantic based on the part of speech of the first word and the target semantic, wherein the similarity value indicates a degree of representation of the first word to the target semantic; sorting the first words based on the similarity values of the first words and the target semantic to obtain an activity word sequence, and determining the activity word sequence as the feature word corresponding to the activity content.
4. The method of claim 3, wherein, The determination of the similarity value of each first word and the target semantic based on the part of speech of the first word and the target semantic comprises: performing word segmentation on the target semantic to obtain a plurality of second words; determining a key word from the plurality of second words; determining the part of speech of the key word; for each first word, determining whether the part of speech of the first word is the same as the part of speech of the key word; If the part of speech of the first word is the same as the part of speech of the key word, the weight of the first word is determined as 1; If the part of speech of the first word is not the same as the part of speech of the key word, it is determined whether there is a second word in the plurality of second words having the same part of speech as the first word; If there is a second word in the plurality of second words having the same part of speech as the first word, the weight of the first word is determined as: the number of second words having the same part of speech as the first word / the total number of second words; If there is no second word in the plurality of second words having the same part of speech as the first word, the weight of the first word is determined as: 1 / (N*total number of second words), N is a number greater than 1; For each first word, based on the weight of the first word and the distance between the first word and the target semantics, the similarity value between the first word and the target semantics is determined.
5. The method of claim 1, wherein, For each feature vector cluster of the user, the selected feature vectors of the feature vector cluster are determined based on the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, including: For each feature vector cluster of the user, the center feature vector of the feature vector cluster is determined; The distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster is determined; According to the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster, the mean and mean square deviation of the distance of the feature vector cluster are calculated; The feature word vectors having a distance not greater than a target threshold from the center feature vector of the feature vector cluster are determined as the selected feature vectors of the feature vector cluster, wherein the target threshold is determined according to the mean and mean square deviation of the distance of the feature vector cluster, the number of feature word vectors in the feature vector cluster, and the total number of feature word vectors.
6. The method of claim 1, wherein, The selected feature vector cluster containing the most selected feature vectors is selected as one of the selected feature vector clusters, and the selected feature vector in the selected feature vector cluster is selected as the portrait dimension of the user, including: The selected feature vector cluster containing the most selected feature vectors is selected as one of the selected feature vector clusters, and the selected feature vector in the selected feature vector cluster is selected as the target feature vector; All feature words in the target feature vector are selected as the portrait dimension of the user; Or, part of the feature words in the target feature vector are selected as the portrait dimension of the user according to a preset rule.
7. The method of claim 1, wherein, The method further includes: According to the user identifier of the user, the user node and user identifier relationship table in the portrait block chain is queried to determine whether the user identifier exists in the user node and user identifier relationship table; In the case that the user identifier exists in the user node and user identifier relationship table, the target user node corresponding to the user identifier is determined; A new linked list node is created in the linked list of the target user node, and the user portrait of the user is stored in the new linked list node; In the case that the user identifier does not exist in the user node and user identifier relationship table, a new user node is created in the portrait blockchain, and the correspondence between the new user node and the user identifier is updated to the user node and user identifier relationship table; A linked list is established in the new user node, and the user portrait of the user is stored in a new linked list node of the linked list.
8. The method of claim 7, wherein, The method further comprises: obtaining a use request of a first user for a target user portrait, the use request including a second user identifier corresponding to the second user of the target user portrait; According to the second user identifier, the user node and user identifier relationship table in the portrait blockchain is queried to determine the second user node corresponding to the second user identifier, and the second user node includes the information of the second user; According to the information of the second user, a request for using the target user portrait is sent to the second user; When receiving the authorization message fed back by the second user, the target user portrait is read and fed back to the first user; When receiving the non-authorization message fed back by the second user, the first user is fed back the information of unauthorized use.
9. The method of claim 1, wherein, The method further comprises: obtaining a user portrait of a specified user, and predicting the preference information of the specified user based on the user portrait; Based on the preference information, a target product is recommended to the specified user.
10. A user profiling apparatus, characterized by comprising: The device comprises: a data acquisition module for acquiring user data of a plurality of users; a feature determination module for determining, for each user, a feature word vector of each data in the user data of the user, wherein one data corresponds to data of the user completing one business activity; a first clustering module for clustering all feature word vectors corresponding to the user to obtain a feature vector cluster; a feature selection module for determining, for each feature vector cluster of the user, a selected feature vector of the feature vector cluster based on the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster; a second clustering module for clustering the selected feature vectors of all feature vector clusters corresponding to the user to obtain a selected feature vector cluster; a dimension determination module for selecting one selected feature vector cluster containing the most selected feature vectors as the portrait dimension of the user; a portrait generation module for generating a user portrait of the user based on the user data of the user and the portrait dimension.
11. The apparatus of claim 10, wherein, The feature determination module comprises: a first determination submodule for determining the user data corresponding to the user, the user data including at least one data, and each data including a business blockchain identifier, a block identifier, an activity time, an activity content, and an activity result; a second determination submodule for, for each data in the user data of the user, taking the business blockchain identifier as a feature word corresponding to the business blockchain identifier, taking the block identifier as a feature word corresponding to the block identifier, and taking the activity time as a feature word corresponding to the activity time; The third determining sub-module is configured to perform semantic recognition on the activity result, and take the result of the semantic recognition as a feature word corresponding to the activity result. The fourth determining sub-module is configured to perform feature word extraction on the activity content, and obtain a feature word corresponding to the activity content. The fifth determining sub-module is configured to determine a feature word vector of the data based on the feature word corresponding to the business block chain identifier, the feature word corresponding to the block identifier, the feature word corresponding to the activity time, the feature word corresponding to the activity result, and the feature word corresponding to the activity content.
12. The apparatus of claim 11, wherein, The fourth determining sub-module comprises: A first word segmentation unit configured to perform word segmentation on the activity content, and obtain a plurality of first words. A first determining unit configured to determine a part of speech of each first word. A semantic recognition unit configured to perform semantic recognition on the activity content, and obtain a target semantic corresponding to the activity content. A similarity determining unit configured to determine, for each first word, a similarity value between the first word and the target semantic based on the part of speech of the first word and the target semantic, wherein the similarity value indicates a degree to which the first word represents the target semantic. A second determining unit configured to sort each first word based on the similarity value between the first word and the target semantic, and obtain an activity word sequence, and determine the activity word sequence as the feature word corresponding to the activity content.
13. The apparatus of claim 12, wherein, The similarity determining unit is specifically configured to: perform word segmentation on the target semantic, and obtain a plurality of second words; determine a key word from the plurality of second words; determine a part of speech of the key word; determine, for each first word, whether the part of speech of the first word is the same as the part of speech of the key word; if the part of speech of the first word is the same as the part of speech of the key word, determine a weight of the first word as 1; if the part of speech of the first word is not the same as the part of speech of the key word, determine whether there is a second word with the same part of speech as the first word in the plurality of second words; if there is a second word with the same part of speech as the first word in the plurality of second words, determine the weight of the first word as: a number of second words with the same part of speech as the first word / total number of second words; if there is no second word with the same part of speech as the first word in the plurality of second words, determine the weight of the first word as: 1 / (N×total number of second words), N being a number greater than 1; determine, for each first word, a similarity value between the first word and the target semantic based on the weight of the first word and a distance between the first word and the target semantic.
14. The apparatus of claim 10, wherein, The feature selecting module is specifically configured to: determine, for each feature vector cluster of the user, a center feature vector of the feature vector cluster; determine a distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster; calculate a mean distance and a mean square deviation of the feature vector cluster according to the distance between each feature word vector in the feature vector cluster and the center feature vector of the feature vector cluster. The feature vector whose distance from the center feature vector of the feature vector cluster is not greater than a target threshold is determined as a selected feature vector of the feature vector cluster, wherein the target threshold is determined according to a mean distance of the feature vector cluster, a mean square deviation of the feature vector cluster, a number of feature word vectors in the feature vector cluster, and a total number of feature word vectors.
15. The apparatus of claim 10, wherein, The dimension determination module comprises: A feature selection sub-module is configured to select one selected feature vector in a selected feature vector cluster containing the largest number of selected feature vectors as a target feature vector; A first dimension determination sub-module is configured to take all feature words in the target feature vector as the portrait dimensions of the user; A second dimension determination sub-module is configured to select part of the feature words in the target feature vector as the portrait dimensions of the user according to a preset rule.
16. The apparatus of claim 10, wherein, The apparatus further comprises: A first query module is configured to query a user node and user identifier relationship table in a portrait blockchain according to a user identifier of a user to determine whether the user identifier exists in the user node and user identifier relationship table; A node determination module is configured to determine a target user node corresponding to the user identifier in a case where the user identifier exists in the user node and user identifier relationship table; A first portrait storage module is configured to create a new linked list node in a linked list of the target user node and store a user portrait of the user in the new linked list node; A node creation module is configured to create a new user node in the portrait blockchain in a case where the user identifier does not exist in the user node and user identifier relationship table, and update a corresponding relationship between the new user node and the user identifier to the user node and user identifier relationship table; A second portrait storage module is configured to establish a linked list in the new user node and store the user portrait of the user in a new linked list node of the linked list.
17. The apparatus of claim 16, wherein, The apparatus further comprises: A request acquisition module is configured to acquire a use request of a first user for a target user portrait, the use request comprising a second user identifier of a second user corresponding to the target user portrait; A second query module is configured to query a user node and user identifier relationship table in a portrait blockchain according to the second user identifier to determine a second user node corresponding to the second user identifier, the second user node containing information of the second user; A request sending module is configured to send a request for use of the target user portrait to the second user according to the information of the second user; A portrait feedback module is configured to read the target user portrait and feed back the target user portrait to the first user when an authorization message fed back by the second user is received; An information feedback module is configured to feed back unauthorized use information to the first user when a non-authorization message fed back by the second user is received.
18. The apparatus of claim 10, wherein, The apparatus further comprises: A preference prediction module is configured to acquire a user portrait of a specified user and predict preference information of the specified user based on the user portrait; A product recommendation module is configured to recommend a target product to the specified user based on the preference information.
19. An electronic device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-9. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-9. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-9.
20. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
User portrait generation method and device, computer equipment and storage medium
CN110544109A
User interest profiling method and related device
WO2021196474A1