User attribute analysis method and device

By classifying and encoding user behavior data and multi-attribute analysis, the problem of loss or confusion of user data feature information in the prior art is solved, and a more accurate and comprehensive user attribute analysis is achieved.

CN119848585APending Publication Date: 2025-04-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311337567.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-16
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the prior art, when processing user data, the same rules process different data types, resulting in loss of feature information or confusion between each other, which in turn makes user attributes inaccurate.

Method used

By classifying and encoding the behavior data in the user behavior sequence, a feature vector is generated, and multi-attribute analysis is performed based on the vector, ensuring that the feature information of different data types is accurately guaranteed to be retained and distinguished.

Benefits of technology

Effectively retain and distinguish characteristic information in user behavior data, avoid information loss or confusion, and improve the accuracy and comprehensiveness of user attribute analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848585A_ABST
    Figure CN119848585A_ABST
Patent Text Reader

Abstract

The invention discloses a user attribute analysis method and device, and relates to the technical field of computers. A specific embodiment of the user attribute analysis method comprises the following steps: in response to a received user behavior sequence of a target user, performing classified coding on behavior data included in the user behavior sequence to obtain a coding result; obtaining feature information of the coding result, and generating a corresponding feature vector; and performing multi-attribute analysis based on the feature vector to obtain the user attribute of the target user. According to the embodiment, the corresponding coding process is executed based on the category of the behavior data, the feature information in the behavior data can be reserved, mutual confusion of different feature information is avoided, and more comprehensive user attributes can be obtained by performing multi-attribute analysis on the feature vectors subjected to classification coding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for analyzing user attributes. Background Art

[0002] The Internet provides users with a variety of services, for example, users can shop online, watch movies, listen to music, etc. In order to provide users with more accurate services that better meet their needs, it is often necessary to determine the user attributes of the user, such as the user's interests, hobbies, consumption habits, etc. The existing technology usually uses a neural network model to analyze the acquired user data to obtain user attributes; among them, taking online shopping as an example, user data includes the category, quantity, price, etc. of the purchased goods.

[0003] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:

[0004] User data includes multiple data types. The existing technology uses the same rules to process user data of different data types, resulting in loss or confusion of feature information in the user data, making the obtained user attributes inaccurate. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and apparatus for analyzing user attributes, which can retain feature information in behavior data and avoid confusion between different feature information.

[0006] To achieve the above object, according to a first aspect of an embodiment of the present invention, a method for analyzing user attributes is provided, comprising:

[0007] In response to receiving a user behavior sequence of a target user, classifying and encoding the behavior data included in the user behavior sequence to obtain an encoding result;

[0008] Acquire feature information of the encoding result and generate a corresponding feature vector;

[0009] A multi-attribute analysis is performed based on the feature vector to obtain user attributes of the target user.

[0010] Optionally, the behavior data includes behavior data of a time type; and classifying and encoding the behavior data included in the user behavior sequence includes:

[0011] Determine a plurality of time coefficients according to a preset encoding dimension;

[0012] Four arithmetic operations are performed on each time coefficient and the behavior data of the time type, trigonometric function values ​​are obtained for each behavior data of the time type after the operation, and multiple trigonometric function values ​​are combined into a coding result.

[0013] Optionally, four arithmetic operations are performed on each time coefficient and the behavior data of the time type, trigonometric function values ​​are obtained for each behavior data of the time type after the operation, and multiple trigonometric function values ​​are combined into a coding result, including:

[0014] Determine a product result of each time coefficient and the behavior data;

[0015] Determine the sine and cosine of multiple product results;

[0016] The sine value and the cosine value are combined into an encoding result according to the arrangement order of the multiple time coefficients.

[0017] Optionally, the data type of the behavior data is a numerical type; and classifying and encoding the behavior data included in the user behavior sequence includes:

[0018] determining the log mean and log standard deviation of the behavioral data;

[0019] An encoding result is generated according to the logarithmic mean, the logarithmic standard deviation and a preset multiple.

[0020] Optionally, the data type of the behavior data is an enumeration type; and classifying and encoding the behavior data included in the user behavior sequence includes:

[0021] Converting the behavior data into a sparse vector according to the number of the enumeration types and the enumeration values ​​corresponding to the behavior data;

[0022] The sparse vector is subjected to feature extraction according to a preset fully connected network to obtain a corresponding encoding result.

[0023] Optionally, there are multiple encoding results, each encoding result is a plurality of encoding vectors with equal dimensions; acquiring feature information of the encoding result and generating a corresponding feature vector includes:

[0024] Acquire a feature sequence on the same dimension from a plurality of encoding vectors corresponding to the encoding results;

[0025] Multiple feature sequences corresponding to multiple dimensions are combined into a feature matrix;

[0026] Use the multi-head attention mechanism to obtain the feature information of the feature matrix corresponding to each encoding result;

[0027] The non-sequential information and multiple feature information of the target user are concatenated to obtain a feature vector.

[0028] Optionally, before performing multi-attribute analysis based on the feature vector, the method further includes:

[0029] Train the neural network model using the training data;

[0030] According to the analysis results of each attribute analysis task and the correlation between different attribute analysis tasks, the consistency loss between attribute analysis tasks is determined;

[0031] The neural network model is optimized using the consistency loss to obtain a multi-attribute analysis model, which is used to analyze user attributes.

[0032] According to a second aspect of an embodiment of the present invention, there is provided a device for analyzing user attributes, comprising:

[0033] An encoding module, configured to classify and encode the behavior data included in the user behavior sequence in response to receiving the user behavior sequence of the target user, and obtain an encoding result;

[0034] A generating module, used to obtain feature information of the encoding result and generate a corresponding feature vector;

[0035] The analysis module is used to perform multi-attribute analysis based on the feature vector to obtain user attributes of the target user.

[0036] Optionally, the behavior data includes behavior data of a time type; and classifying and encoding the behavior data included in the user behavior sequence includes:

[0037] Determine a plurality of time coefficients according to a preset encoding dimension;

[0038] Four arithmetic operations are performed on each time coefficient and the behavior data of the time type, trigonometric function values ​​are obtained for each behavior data of the time type after the operation, and multiple trigonometric function values ​​are combined into a coding result.

[0039] Optionally, four arithmetic operations are performed on each time coefficient and the behavior data of the time type, trigonometric function values ​​are obtained for each behavior data of the time type after the operation, and multiple trigonometric function values ​​are combined into a coding result, including:

[0040] Determine a product result of each time coefficient and the behavior data;

[0041] Determine the sine and cosine of multiple product results;

[0042] The sine value and the cosine value are combined into an encoding result according to the arrangement order of the multiple time coefficients.

[0043] Optionally, the data type of the behavior data is a numerical type; and classifying and encoding the behavior data included in the user behavior sequence includes:

[0044] determining the log mean and log standard deviation of the behavioral data;

[0045] An encoding result is generated according to the logarithmic mean, the logarithmic standard deviation and a preset multiple.

[0046] Optionally, the data type of the behavior data is an enumeration type; and classifying and encoding the behavior data included in the user behavior sequence includes:

[0047] Converting the behavior data into a sparse vector according to the number of the enumeration types and the enumeration values ​​corresponding to the behavior data;

[0048] The sparse vector is subjected to feature extraction according to a preset fully connected network to obtain a corresponding encoding result.

[0049] Optionally, there are multiple encoding results, each encoding result is a plurality of encoding vectors with equal dimensions; acquiring feature information of the encoding result and generating a corresponding feature vector includes:

[0050] Acquire a feature sequence on the same dimension from a plurality of encoding vectors corresponding to the encoding results;

[0051] Multiple feature sequences corresponding to multiple dimensions are combined into a feature matrix;

[0052] Use the multi-head attention mechanism to obtain the feature information of the feature matrix corresponding to each encoding result;

[0053] The non-sequential information and multiple feature information of the target user are concatenated to obtain a feature vector.

[0054] Optionally, the device further comprises:

[0055] Train the neural network model using the training data;

[0056] According to the analysis results of each attribute analysis task and the correlation between different attribute analysis tasks, the consistency loss between attribute analysis tasks is determined;

[0057] The neural network model is optimized using the consistency loss to obtain a multi-attribute analysis model, which is used to analyze user attributes.

[0058] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, including:

[0059] one or more processors;

[0060] a storage device for storing one or more programs,

[0061] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above embodiments.

[0062] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the above embodiments is implemented.

[0063] An embodiment of the above invention has the following advantages or beneficial effects: classifying and encoding the behavior data included in the user behavior sequence can retain the characteristic information in the behavior data and avoid confusion or loss of different characteristic information; performing multi-attribute analysis on the characteristic vector after classification and encoding can obtain more accurate and comprehensive user attributes; using trigonometric functions to encode time-type behavior data, limiting multiple time-type behavior data within a certain numerical range, and realizing normalization of behavior data; using logarithmic standard deviation and logarithmic mean to encode numerical type behavior data, so that the distribution of numerical type behavior data is more uniform, reducing the processing of behavior data Difficulty; By encoding enumerated behavior data through feature extraction of sparse vectors, more feature information can be extracted, and the amount of information of enumerated behavior data can be expanded, which is convenient for more comprehensive analysis of user attributes; splicing feature information with non-sequential information can supplement the feature information of non-sequential information, and performing multi-attribute analysis on the splicing results can analyze user attributes more comprehensively and accurately; according to the correlation between different attribute analysis tasks, the consistency loss between attribute analysis tasks is determined, and the neural network model is optimized with consistency loss as the goal, which can improve the accuracy and consistency of user attributes and avoid contradictions in the analyzed user attributes.

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

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

[0066] Figure 1 is a schematic diagram of the main process of the method for analyzing user attributes according to an embodiment of the present invention;

[0067] Figure 2 is a schematic diagram of classification coding according to a reference embodiment of the present invention;

[0068] Figure 3 is a schematic diagram of user multi-attribute analysis according to a reference embodiment of the present invention;

[0069] Figure 4is a schematic diagram of the main process of a method for analyzing user attributes according to a reference embodiment of the present invention;

[0070] Figure 5 is a schematic diagram of the main process of a method for analyzing user attributes according to another reference embodiment of the present invention;

[0071] Figure 6 is a schematic diagram of the main process of a method for analyzing user attributes according to yet another reference embodiment of the present invention;

[0072] Figure 7 is a schematic diagram of main modules of an apparatus for analyzing user attributes according to an embodiment of the present invention;

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

[0074] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

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

[0076] It should be noted that in the technical solution of the present invention, the collection, use, storage, sharing and transfer of user personal information involved are in compliance with the provisions of relevant laws and regulations, and it is necessary to inform the user and obtain the user's consent or authorization. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted.

[0077] The Internet provides users with a variety of services, for example, users can shop online, watch movies, listen to music, etc. In order to provide users with more accurate services that better meet their needs, it is often necessary to determine the user attributes of the user, such as the user's interests, hobbies, consumption habits, etc. The prior art usually uses a neural network model to analyze the acquired user data to obtain user attributes; taking online shopping as an example, user data includes the category, quantity, price, etc. of the purchased goods. When it is necessary to predict multiple user attributes of a user, multiple neural network models are usually required, and each neural network model is used to analyze a single user attribute.

[0078] User data includes multiple data types. The existing technology uses the same rules to process user data of different data types, which easily leads to the loss of feature information in the user data or confusion, making the user attributes obtained after analysis inaccurate. Using multiple neural network models to analyze multiple user attributes is too costly, and there are inconsistencies between multiple user attributes, indicating that the user attributes are not accurate enough.

[0079] In view of this, according to a first aspect of an embodiment of the present invention, a method for analyzing user attributes is provided.

[0080] Figure 1 FIG. 1 is a schematic diagram of the main process of the method for analyzing user attributes according to an embodiment of the present invention. Figure 1 As shown, the method for analyzing user attributes according to an embodiment of the present invention mainly includes the following steps S101 to S103.

[0081] Step S101, in response to receiving a user behavior sequence of a target user, classify and encode the behavior data included in the user behavior sequence to obtain an encoding result.

[0082] User behavior sequence is a collection of behavior data generated based on user behavior. For example, when a user buys goods online, the corresponding behavior data generated includes: the category, brand, quantity, price, purchase time, whether coupons are used, etc. of the purchased goods; for another example, when a user mails items through an online platform, the corresponding behavior data generated includes: the category, weight, quantity, mailing method, mailing time, shipping address, receiving address, etc. of the mailed items. The behavior data included in the user behavior sequence is divided into multiple data types, including: enumeration type (for example, product category, brand), time type (for example, purchase time, mailing time), numerical type (for example, product quantity, price, weight), etc.

[0083] After receiving the user behavior sequence of the target user, the behavior data in the user behavior sequence is classified according to the data type, and different encoding processes are performed on the behavior data of different data types. For example, the behavior data of enumeration types such as product categories and brands are encoded in a unique hot encoding. Specifically, the total number of enumeration types is used as the encoding length, and the corresponding position of the encoding is assigned according to the enumeration type corresponding to the behavior data, so that different enumeration types have different encodings, and the association and distinction between different enumeration types are strengthened; for time-type behavior data such as purchase time and mailing time, the current time point is used as the reference time point, and the time difference between the behavior data and the current time point is calculated, so that the behavior data is converted into a time length, which is convenient for judging the frequency of user behavior and the distance from the current time point, and for distinguishing the behavior data from the time dimension, and understanding the behavior habits corresponding to the behavior data; for numerical-type behavior data such as product quantity and price, the mean deviation, standard deviation, average and other statistical values ​​are calculated, and the behavior data is normalized according to the statistical values, and the behavior data is converted into a certain numerical range, which is convenient for subsequent analysis and processing.

[0084] Figure 2 is a schematic diagram of classification coding according to a reference embodiment of the present invention. Figure 2 As shown, the user behavior sequence includes: behavior data 201 (enumerated type commodity category), behavior data 202 (enumerated type commodity brand), behavior data 203 (time type purchase time), behavior data 204 (numerical type commodity price) and behavior data 205 (numerical type commodity quantity), each behavior data includes multiple data fields, for example, behavior data 201 includes commodity category J1, commodity category J2, commodity category J3, etc., the enumerated type behavior data 201 and behavior data 202 are input into the enumeration coding module, the time type behavior data 203 is input into the time coding module, and the numerical type behavior data 204 and behavior data 205 are input into the numerical coding module, so as to realize classification coding, wherein the encoding result of encoding the behavior data 201 is "[R11, R12, R13, ...]", and the other encoding results are deduced in the same way.

[0085] Executing corresponding encoding processes for behavioral data of different data types can retain the characteristic information in the behavioral data, avoid confusion or loss of different characteristic information, and facilitate more comprehensive and accurate analysis of user attributes.

[0086] According to a reference embodiment of the present invention, the behavior data includes behavior data of a time type; when the behavior data of the time type included in the user behavior sequence is classified and encoded, the corresponding number of time coefficients is determined according to the pre-set encoding dimension, and the time coefficient is used to encode the behavior data of the time type. For example, if the encoding dimension is 10, 10 time coefficients are generated. In order to control the numerical range of the time coefficient and better normalize the behavior data of the time type, the time coefficient is controlled within 0 to 1, and the corresponding 10 time coefficients are 0.1 to 1, and the difference between adjacent time coefficients is 0.1, or the time coefficient is controlled within -1 to 1, and the corresponding 10 time coefficients include: ±0.1, ±0.3, ±0.5, ±0.7, ±0.9. After obtaining the time coefficient, the time coefficient and the behavior data of the time type are subjected to four arithmetic operations (for example, multiplication, division, addition or subtraction), and different weights are generated on the behavior data of the time type through different time coefficients, so as to expand the characteristic information of the behavior data of the time type and highlight the difference between the characteristic information of different behavior data. Determine the trigonometric function values ​​of the time-type behavior data under the action of different time coefficients, that is, take the trigonometric function values ​​of the time-type behavior data after operation, such as sine value, cosine value, etc. The range of sine value or cosine value is between -1 and 1, which can effectively control the numerical range of the encoding result, avoid generating too large or too small encoding results, and combine multiple trigonometric function values ​​into the encoding result. Preferably, when the behavior data includes multiple data types, the encoding results corresponding to the behavior data of different data types are set to the same dimension, so as to facilitate unified processing of the encoding results.

[0087] Exemplarily, the preset coding dimension is 5, and the time-type behavior data includes: time1 and time2; the preset time coefficient calculation formula is: num / dim (num=1,2,...,dim), where dim represents the coding dimension, and num represents an integer between 1 and dim. Since the coding dimension is equal to 5, the corresponding time coefficients include: 0.2, 0.4, 0.6, 0.8, 1. It can be seen that even when the coding dimension increases, the time coefficient is always limited to between 0 and 1, which is convenient for determining the coding result and obtaining the characteristic information of the time-type behavior data; the time coefficient is added to the time-type behavior data, and the sine function is used. Determine the encoding result of the time type behavior data after adding the time coefficient, and obtain the encoding result corresponding to the time type behavior data t1 is "[sin(time1+0.2), sin(time1+0.4), sin(time1+0.6), sin(time1+0.8), sin(time1+1)]", and the encoding result corresponding to the time type behavior data t2 is "[sin(time2+0.2), sin(time2+0.4), sin(time2+0.6), sin(time2+0.8), sin(time2+1)]", and both encoding results are vectors with a dimension of 5. It should be noted that when using the tangent function or cotangent function to encode the time type behavior data, the range of the tangent value or cotangent value is controlled by setting a threshold to avoid obtaining an encoding result with a coding value that is too large or too small.

[0088] By setting the encoding dimension, the dimensions of the encoding results of different behavioral data are the same, and the numerical range of each encoding value in the encoding result is basically between -1 and 1, thereby achieving the normalization of time-type behavioral data and avoiding some encoding values ​​that are too large or too small from interfering with subsequent user attribute analysis.

[0089] According to another reference embodiment of the present invention, when performing four arithmetic operations on the time-type behavior data and each time coefficient, the time-type behavior data is multiplied by each time coefficient to determine the product of each time coefficient and the time-type behavior data; when determining the trigonometric function value, the sine value and cosine value of each product result are calculated; when combining multiple trigonometric function values ​​into a coding result, the multiple time coefficients are ordered, for example, from small to large or from large to small, and the sine value and cosine value of each product result are sorted according to the sorting result to obtain a coding result composed of sine values ​​and cosine values.

[0090] For example, the preset time coefficient ω k The calculation formula is:

[0091]

[0092] Among them, d represents the dimension of the encoding result, maxTime represents the maximum time length, and the maximum time length should be greater than the time span of the behavior data of multiple time types. For example, if the difference between the minimum and maximum values ​​of the behavior data of multiple time types is 5 years, the maximum time length should be greater than or equal to 5 years, and the value of the variable k is between 0 and d / 2. After calculating multiple time coefficients, multiply the behavior data of the time type by the time coefficient, and use the following formula to calculate the encoding result:

[0093]

[0094] in, Represents the encoding result, which is a coding vector of size d×1, ω1 to ω d / 2 represents d / 2 time coefficients, t represents the behavior data of the time type, and each behavior data of the time type corresponds to an encoding result.

[0095] Using the above time coefficient calculation formula, we can obtain a uniformly changing time coefficient and the coding results of multiple time-type behavior data within the time span. Using sine and cosine functions to calculate the coding value can effectively control the numerical range of the coding value, avoiding excessively large or small coding values ​​from interfering with subsequent user attribute analysis; interlacing and arranging the sine and cosine functions can make multiple coding values ​​corresponding to the same time coefficient close to each other, so that the coding values ​​in the coding results change regularly in order, which is convenient for improving the efficiency and accuracy of user attribute analysis.

[0096] According to another reference embodiment of the present invention, the data type of the behavior data is a numerical type; when classifying and encoding the behavior data included in the user behavior sequence, the logarithmic mean and logarithmic standard deviation of the behavior data are determined; the difference between each behavior data and the logarithmic mean is determined, and the difference is divided by the logarithmic standard deviation to generate the encoding result.

[0097] For example, for the behavior data x of the i-th numerical type i , the calculation formula of logarithmic mean is:

[0098]

[0099] in, represents the logarithmic mean, n represents the number of numerical behavior data, ∑lgx i It means taking the logarithm of each behavior data of numerical type and summing the logarithmic results of all behavior data of numerical type. The calculation formula of logarithmic standard deviation is:

[0100]

[0101] Among them, S(lgX) represents the logarithmic standard deviation, n represents the number of behavior data of numerical type, lgx i Indicates taking the logarithm of the behavior data of each numerical type. Represents the logarithmic mean. The calculation formula for generating the encoding result based on the logarithmic mean and logarithmic standard deviation is:

[0102]

[0103] Among them, x i ′ represents the behavior data x i The encoding result is represents the logarithmic mean, S(lgX) represents the logarithmic standard deviation, lgx i Represents the behavior data x i Taking the logarithm, 3 is the preferred multiple for calculating the encoding result, and other multiples may also be used here, such as 2 or 4, etc. Each behavior data of a numerical type corresponds to an encoding result.

[0104] Taking the logarithm of the behavior data and using the logarithmic mean and logarithmic standard deviation can reduce the numerical differences between the behavior data and make the distribution of different behavior data more even. For example, the behavior data of numerical type is price. The user purchased goods worth 10 yuan, 100 yuan and 1000 yuan. If 10, 100 and 1000 are directly used to analyze the user attributes without controlling the behavior data within a certain numerical range, the difficulty of data processing will increase. As the price increases, the difficulty of data processing increases. After taking the logarithm of the behavior data with base 10, "10, 100, 1000" is converted to "1, 2, 3" accordingly, making the distribution of the behavior data more even, facilitating subsequent data processing and improving data processing efficiency. On the basis of taking the logarithm of the behavior data, subtracting it from the logarithmic mean and dividing the subtraction result by the logarithmic standard deviation can concentrate the encoding results within an appropriate numerical range and obtain a better normalization effect.

[0105] According to another reference embodiment of the present invention, the data type of the behavior data is an enumeration type, which is a basic data type. The behavior data of the enumeration type is composed of a limited number of discrete enumeration values. For example, the behavior data used to indicate "whether user X purchased product Y" is of an enumeration type, including: "yes" or "no", and the behavior data used to indicate "the name of the product purchased by the user last month" is of an enumeration type, including the names of a limited number of products. When classifying and encoding the behavior data included in the user behavior sequence, the behavior data is converted into a sparse vector according to the number of enumeration types and the enumeration values ​​corresponding to the behavior data. For example, the enumeration types of behavior data A1 are B1 and C1, the enumeration types of behavior data A2 are B2 and C2, and the enumeration types of behavior data A3 are B3 and C3. Since the number of enumeration types is 6, the sparse vector corresponding to behavior data A1 is [1,0,0,1,0,0], the sparse vector corresponding to behavior data A2 is [0,1,0,0,1,0], and the sparse vector corresponding to behavior data A3 is [0,0,1,0,0,1], where each dimension of the sparse vector represents enumeration type B1, enumeration type B2, enumeration type B3, enumeration type C1, enumeration type C2, and enumeration type C3 from left to right.

[0106] When the number of enumeration types increases, the sparser the sparse vector becomes. Therefore, it is necessary to extract features from the sparse vector. Specifically, the sparse vector is extracted based on a pre-set fully connected network. For example, the sparse vector is input into the fully connected network, which is the encoding result corresponding to the fully connected network generation (Embedding). The fully connected network is obtained through model training and parameter iteration. Exemplarily, the behavior data of the enumeration type is a commodity category. Specifically, behavior data A4 is clothing, behavior data A5 is books, behavior data A6 is food, and so on. The sparse vectors obtained according to the enumeration type are "[1,0,0], [0,1,0], [0,0,1]", respectively. Each dimension of the sparse vector from left to right represents clothing, books, and food, respectively. The above sparse vector is input into a pre-trained embedding network. The pre-set feature dimensions in the embedding network include storage time, usage frequency, single purchase amount, etc. The embedding network extracts the correlation and difference of each behavior data according to the above feature dimensions, and obtains the encoding results corresponding to behavior data A4, behavior data A5, and behavior data A6, which are "[0.5, 0.9, 0.7], [0.8, 0.5, 0.3], [0.2, 0.2, 0.7]", respectively. In the encoding results, each dimension from left to right represents the storage time, usage frequency, and single purchase amount. It can be seen from the encoding results that the storage time of clothing is less than that of books but greater than that of food, the usage frequency of books is less than that of clothing but greater than that of food, and the single purchase amount of books is less than the single purchase amount of clothing and the single purchase amount of food.

[0107] By extracting features from sparse vectors, we can obtain the correlation and difference of feature dimensions beyond the enumeration type, expand the amount of information in the behavioral data, and facilitate a more comprehensive analysis of user attributes.

[0108] Step S102, obtaining feature information of the encoding result, and generating a corresponding feature vector.

[0109] After obtaining the encoding result, the attention mechanism or multi-head attention mechanism is used to obtain feature information such as weight information and timing information of the encoding result to form a feature vector. Exemplarily, the encoding result is input into a pre-trained multi-head attention model to determine the weight information and timing information corresponding to different encoding values ​​in the encoding result, and the feature vector of the encoding result is obtained according to the weight information and timing information.

[0110] Using the attention mechanism or multi-head attention mechanism to generate feature vectors can further obtain feature information in multiple dimensions, and then use the feature vectors as input parameters for multi-attribute analysis to improve the efficiency and accuracy of user attribute analysis.

[0111] According to a reference embodiment of the present invention, there are multiple user behavior sequences, and a corresponding encoding result is obtained according to each user behavior sequence. Therefore, there are multiple encoding results, and each encoding result is a plurality of encoding vectors with equal dimensions. When obtaining feature information of the encoding result, feature sequences on the same dimension are respectively obtained from the multiple encoding vectors corresponding to the encoding result, and the multiple feature sequences obtained according to the multiple dimensions are combined into a feature matrix. Exemplarily, the encoding result includes: encoding vector C1 "[d1, d2, d3]", encoding vector C2 "[d4, d5, d6]" and encoding vector C1 "[d5, d6]" Vector C3 "[d7,d8,d9]", each coding vector is a 3-dimensional vector, obtain the value of the first dimension of each coding vector to form a feature sequence "[d1,d4,d7]", obtain the value of the second dimension of each coding vector to form a feature sequence "[d2,d5,d8]", obtain the value of the third dimension of each coding vector to form a feature sequence "[d3,d6,d9]", and concatenate multiple feature sequences to obtain the feature matrix "[[d1,d4,d7],[d2,d5,d8],[d3,d6,d9]]". Each encoding result corresponds to a feature matrix. Each feature matrix is ​​input into a pre-trained multi-head attention model, and the multi-head attention mechanism is used to obtain the feature information of each feature matrix. The non-sequential information of the target user is converted into a vector, each dimension of the vector represents a non-sequential information, and the vector corresponding to the non-sequential information and the feature information corresponding to each encoding result are spliced. For example, the feature information corresponding to the encoding results of three user behavior sequences is: vector v1, vector v2, vector v3, and the vector corresponding to the non-sequential information is v4. The above multiple vectors are spliced ​​into a feature vector, where the non-sequential information of the target user includes: region, registration time, age, gender and other information.

[0112] For example, Figure 2 As shown, after obtaining the encoding results of multiple behavioral data, the multiple encoding results are fused and spliced, and the feature values ​​of the same dimension in the multiple encoding results are selected to form a feature sequence "[R11, R21, S11, T11, T21]" and so on, and the multiple feature sequences are combined into a feature matrix, and the feature matrix is ​​input into the multi-head attention model to generate the corresponding feature vector.

[0113] Figure 3 FIG. 1 is a schematic diagram of a user multi-attribute analysis according to a reference embodiment of the present invention. Figure 3 As shown, multiple user behavior sequences such as user behavior sequence 1, user behavior sequence 2 and user behavior sequence 3 of the target user are received, each user behavior sequence is input into the classification coding and fusion module to obtain the corresponding feature matrix, each feature matrix is ​​input into the multi-head attention model to obtain the corresponding feature information, and the multiple feature information and non-sequence information are concatenated to obtain the corresponding feature vector.

[0114] Step S103: performing multi-attribute analysis based on the feature vector to obtain target attributes of the target user.

[0115] After obtaining the feature vector, the feature vector is input into a pre-set multi-attribute analysis model. The multi-attribute analysis model is used to analyze user attributes from multiple aspects. After the analysis is completed, multiple user attributes of the target user are obtained at the same time. The user attributes represent the user's interest preferences and consumption habits. For example, users who often buy sports equipment have the user attribute of "loving sports", and users who often use credit cards to pay for orders have the user attribute of "having the habit of using credit cards". Exemplarily, the multi-attribute analysis model is a multi-gate multi-expert model (Multi-gate Mixture-of-Experts, MMOE). The multi-gate multi-expert model has multiple expert networks (i.e., neural networks). Different attribute analysis tasks are performed by combining different expert networks. In each attribute analysis task, the output results of the expert network are weighted and summed to obtain the results of multiple attribute analysis tasks (i.e., multiple user attributes). For example, the output result of an attribute analysis task is: the probability of user attribute w1 is 0.9, the probability of user attribute w2 is 0.6, and the probability of user attribute w3 is 0.5. Then, it is determined that the user attribute obtained by the attribute analysis task is w1, and multiple attribute analysis tasks obtain multiple user attributes. For example, Figure 3 As shown, the concatenated feature vector is input into a multi-attribute analysis model to obtain multiple user attributes. The multi-attribute analysis model is trained and optimized through a variety of loss functions, such as a cross entropy loss function, a consistency loss function, and the like.

[0116] Multi-attribute analysis is performed based on feature vectors, and multiple attribute analysis tasks are executed simultaneously to obtain multiple user attributes, avoiding the training of multiple attribute analysis models, reducing training costs, and ensuring the correlation and consistency between multiple user attributes, reducing the probability of contradictory user attributes, thereby improving the analysis efficiency and accuracy of user attributes.

[0117] According to a reference embodiment of the present invention, before performing multi-attribute analysis based on feature vectors, the method further includes: using behavior data annotated with multiple user attributes as training data, using the training data to train a neural network model, for example, training a multi-door multi-expert model, and setting multiple attribute analysis tasks during the model training process. Obtain the analysis results of each attribute analysis task, determine the correlation between different attribute analysis tasks, for example, set a correlation weight between every two user attributes, the larger the correlation weight, the stronger the correlation between the two user attributes (for example, set the correlation weight between age and date of birth to 10, and set the correlation weight between age and gender to 1), and for another example, determine the correlation between different attribute analysis tasks by determining the cosine similarity, correlation coefficient, etc. of different analysis results through a preset correlation. Determine the consistency loss between attribute analysis tasks according to a preset consistency loss formula. During the training process, the consistency loss is continuously reduced by modifying the weight and bias of the neural network model, thereby optimizing the neural network model, and the neural network model with the consistency loss meeting the requirements is used as the multi-attribute analysis model, and the multi-attribute analysis model is used to analyze user attributes.

[0118] For example, the analysis result of attribute analysis task t1 is vector p t1 , the analysis result of attribute analysis task t2 is vector p t2 , the calculation formula of the consistency loss between attribute analysis task t1 and attribute analysis task t2 is:

[0119]

[0120] Among them, W t1,t2 represents the correlation between attribute analysis task t1 and attribute analysis task t2, Indicates the i-th bit of the vector corresponding to the analysis result of attribute analysis task t1, represents the jth bit of the vector corresponding to the analysis result of attribute analysis task t2, D t1 The dimension of the vector corresponding to the analysis result of attribute analysis task t1, D t2 The dimension of the vector corresponding to the analysis result of attribute analysis task t2 is represented. The consistency loss is determined by the above calculation formula. When the correlation of attribute analysis tasks is strong, the corresponding consistency loss is low. When the correlation of attribute analysis tasks is weak, the corresponding consistency loss is high. On the basis of the original loss function of the neural network model, adding consistency loss can reduce the probability of contradictions in the analyzed user attributes, minimize the inconsistency of user attributes, and improve the efficiency and accuracy of user attribute analysis.

[0121] Figure 4FIG. 1 is a schematic diagram of the main process of a method for analyzing user attributes according to a reference embodiment of the present invention. Figure 4 As shown, the method for analyzing user attributes may include:

[0122] Step S401, in response to receiving a user behavior sequence of a target user, the data type of the behavior data included in the user behavior sequence is a numerical type and an enumeration type;

[0123] Step S402, determining the logarithmic mean and logarithmic standard deviation of the behavior data of numerical type;

[0124] Step S403, generating a coding result according to the logarithmic mean, the logarithmic standard deviation and a preset multiple;

[0125] Step S404, converting the behavior data of the enumeration type into a sparse vector according to the number of the enumeration type and the enumeration value corresponding to the behavior data;

[0126] Step S405, extracting features from the sparse vector according to a preset fully connected network to obtain a corresponding encoding result;

[0127] Step S406, obtaining feature information of the encoding result and generating a corresponding feature vector;

[0128] Step S407: performing multi-attribute analysis based on the feature vector to obtain user attributes of the target user.

[0129] The specific implementation content of the method for analyzing user attributes of the above-mentioned reference embodiment of the present invention has been described in detail in the method for analyzing user attributes described above, so the repeated content will not be described again here.

[0130] Figure 5 FIG. 1 is a schematic diagram of the main process of a method for analyzing user attributes according to another reference embodiment of the present invention. Figure 5 As shown, the method for analyzing user attributes may include:

[0131] Step S501, training the neural network model using training data;

[0132] Step S502, determining the consistency loss between attribute analysis tasks according to the analysis result of each attribute analysis task and the correlation between different attribute analysis tasks;

[0133] Step S503, using consistency loss to optimize the neural network model to obtain a multi-attribute analysis model;

[0134] Step S504, in response to receiving the user behavior sequence of the target user, the data type of the behavior data included in the user behavior sequence is a time type and an enumeration type;

[0135] Step S505, determining a plurality of time coefficients according to a preset coding dimension, and multiplying each time coefficient by the behavior data of the time type to obtain a product result;

[0136] Step S506, determining the sine values ​​and cosine values ​​of the multiple product results, and combining the sine values ​​and cosine values ​​into a coding result according to the arrangement order of the time coefficients;

[0137] Step S507, converting the behavior data of the enumeration type into a sparse vector according to the number of the enumeration type and the enumeration value corresponding to the behavior data;

[0138] Step S508, extracting features from the sparse vector according to a preset fully connected network to obtain a corresponding encoding result;

[0139] Step S509, obtaining a feature sequence on the same dimension from multiple encoding vectors corresponding to the encoding result;

[0140] Step S510, composing a plurality of feature sequences corresponding to a plurality of dimensions into a feature matrix;

[0141] Step S511, using a multi-head attention mechanism to obtain feature information of a feature matrix corresponding to each encoding result;

[0142] Step S512, concatenating the non-sequential information of the target user and multiple feature information to obtain a feature vector;

[0143] Step S513: input the feature vector into a multi-attribute analysis model to perform multi-attribute analysis to obtain multiple user attributes of the target user.

[0144] The specific implementation content of the method for analyzing user attributes of another reference embodiment of the present invention has been described in detail in the above-mentioned method for analyzing user attributes, so the repeated content will not be described again here.

[0145] Figure 6 FIG. 1 is a schematic diagram of the main process of a method for analyzing user attributes according to another reference embodiment of the present invention. Figure 6 As shown, the method for analyzing user attributes may include:

[0146] Step S601, in response to receiving a user behavior sequence of a target user, the data type of the behavior data included in the user behavior sequence is a time type, a numerical type, and an enumeration type;

[0147] Step S602, determine whether the behavior data is of time type, if so, jump to step S603, otherwise, jump to step S604;

[0148] Step S603, determining multiple time coefficients according to the preset coding dimension, performing four arithmetic operations on each time coefficient and the behavior data of the time type, obtaining trigonometric function values ​​for each of the behavior data of the time type after the operation, and combining the multiple trigonometric function values ​​into a coding result;

[0149] Step S604, determine whether the behavior data is a numerical type, if so, jump to step S605, otherwise, jump to step S606;

[0150] Step S605, determining the logarithmic mean and logarithmic standard deviation of the behavior data, and generating a coding result according to the logarithmic mean, logarithmic standard deviation and a preset multiple;

[0151] Step S606, determine whether the behavior data is an enumeration type, if so, jump to step S607, otherwise, jump to step S608;

[0152] Step S607, converting the behavior data into a sparse vector according to the number of enumeration types and the enumeration value corresponding to the behavior data, and performing feature extraction on the sparse vector according to a preset fully connected network to obtain a corresponding encoding result;

[0153] Step S608, obtaining feature information of the encoding result and generating a corresponding feature vector;

[0154] Step S609: Perform multi-attribute analysis based on the feature vector to obtain user attributes of the target user.

[0155] The specific implementation content of the method for analyzing user attributes in another reference embodiment of the present invention has been described in detail in the method for analyzing user attributes described above, so the repeated content will not be described again here.

[0156] Figure 7 is a schematic diagram of main modules of a device for analyzing user attributes according to an embodiment of the present invention, such as Figure 7 As shown, the device 700 for analyzing user attributes mainly includes:

[0157] The encoding module 701 is used for classifying and encoding the behavior data included in the user behavior sequence in response to receiving the user behavior sequence of the target user to obtain an encoding result;

[0158] A generating module 702 is used to obtain feature information of the encoding result and generate a corresponding feature vector;

[0159] The analysis module 703 is used to perform multi-attribute analysis based on the feature vector to obtain user attributes of the target user.

[0160] According to a reference embodiment of the present invention, the behavior data includes behavior data of a time type; classifying and encoding the behavior data included in the user behavior sequence includes:

[0161] Determine a plurality of time coefficients according to a preset encoding dimension;

[0162] Four arithmetic operations are performed on each time coefficient and the behavior data of the time type, trigonometric function values ​​are obtained for each behavior data of the time type after the operation, and multiple trigonometric function values ​​are combined into a coding result.

[0163] According to another reference embodiment of the present invention, four arithmetic operations are performed on each time coefficient and the behavior data of the time type, trigonometric function values ​​are obtained for each behavior data of the time type after the operation, and multiple trigonometric function values ​​are combined into a coding result, including:

[0164] Determine a product result of each time coefficient and the behavior data;

[0165] Determine the sine and cosine of multiple product results;

[0166] The sine value and the cosine value are combined into an encoding result according to the arrangement order of the multiple time coefficients.

[0167] According to another reference embodiment of the present invention, the data type of the behavior data is a numerical type; the behavior data included in the user behavior sequence is classified and encoded, including:

[0168] determining the log mean and log standard deviation of the behavioral data;

[0169] An encoding result is generated according to the logarithmic mean, the logarithmic standard deviation and a preset multiple.

[0170] According to another reference embodiment of the present invention, the data type of the behavior data is an enumeration type; the behavior data included in the user behavior sequence is classified and encoded, including:

[0171] Converting the behavior data into a sparse vector according to the number of the enumeration types and the enumeration values ​​corresponding to the behavior data;

[0172] The sparse vector is subjected to feature extraction according to a preset fully connected network to obtain a corresponding encoding result.

[0173] According to another reference embodiment of the present invention, there are multiple encoding results, each encoding result is a plurality of encoding vectors with equal dimensions; acquiring feature information of the encoding result and generating a corresponding feature vector includes:

[0174] Acquire a feature sequence on the same dimension from a plurality of encoding vectors corresponding to the encoding results;

[0175] Multiple feature sequences corresponding to multiple dimensions are combined into a feature matrix;

[0176] Use the multi-head attention mechanism to obtain the feature information of the feature matrix corresponding to each encoding result;

[0177] The non-sequential information and multiple feature information of the target user are concatenated to obtain a feature vector.

[0178] According to a reference embodiment of the present invention, the user attribute analysis device 700 further includes:

[0179] Train the neural network model using the training data;

[0180] According to the analysis results of each attribute analysis task and the correlation between different attribute analysis tasks, the consistency loss between attribute analysis tasks is determined;

[0181] The neural network model is optimized using the consistency loss to obtain a multi-attribute analysis model, which is used to analyze user attributes.

[0182] It should be noted that the specific implementation content of the device for analyzing user attributes in the embodiment of the present invention has been described in detail in the method for analyzing user attributes described above, so the repeated content will not be described again here.

[0183] According to the technical solution of the embodiment of the present invention, the behavior data included in the user behavior sequence is classified and encoded, which can retain the characteristic information in the behavior data and avoid confusion or loss of different characteristic information. Multi-attribute analysis is performed on the characteristic vector after classification and encoding, which can obtain more accurate and comprehensive user attributes. The time-type behavior data is encoded using trigonometric functions, and multiple time-type behavior data are limited to a certain numerical range to achieve normalization of the behavior data. The logarithmic standard deviation and logarithmic mean are used to encode the numerical behavior data, so that the distribution of the numerical behavior data is more uniform and the difficulty of processing the behavior data is reduced. The enumeration type behavior data is encoded by extracting features from sparse vectors, which can extract more characteristic information, expand the amount of information of the enumeration type behavior data, and facilitate a more comprehensive analysis of user attributes. The characteristic information is spliced ​​with non-sequential information to supplement the characteristic information of the non-sequential information. The splicing result is subjected to multi-attribute analysis, which can analyze the user attributes more comprehensively and accurately. According to the correlation between different attribute analysis tasks, the consistency loss between the attribute analysis tasks is determined, and the neural network model is optimized with the consistency loss as the goal, which can improve the accuracy and consistency of the user attributes and avoid contradictions between the analyzed user attributes.

[0184] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for executing business logic, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided by the first aspect of the embodiment of the present invention.

[0185] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0186] Figure 8 An exemplary system architecture 800 is shown to which the method for user attribute analysis or the apparatus for user attribute analysis according to the embodiments of the present invention may be applied.

[0187] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0188] The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 801, 802, 803, such as attribute analysis applications, attribute viewing applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0189] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0190] The server 805 may be a server that provides various services, such as a background management server (for example only) that supports the user attribute analysis request sent by the upstream terminal devices 801, 802, and 803. In response to receiving the user behavior sequence of the target user, the background management server may classify and encode the behavior data included in the user behavior sequence to obtain the encoding result; obtain the feature information of the encoding result to generate the corresponding feature vector; perform multi-attribute analysis based on the feature vector to obtain the target attribute of the target user; and feed back the user attribute analysis situation (for example only) to the terminal device.

[0191] It should be noted that the method for analyzing user attributes provided in the embodiment of the present invention is generally executed by the server 805, and accordingly, the device for analyzing user attributes is generally set in the server 805. The method for analyzing user attributes provided in the embodiment of the present invention can also be executed by the terminal devices 801, 802, and 803, and accordingly, the device for analyzing user attributes can be set in the terminal devices 801, 802, and 803.

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

[0193] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0194] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

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

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

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

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

[0199] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an encoding module, a generation module, and an analysis module, wherein the names of these modules do not constitute a limitation on the modules themselves in certain circumstances, for example, the encoding module may also be described as a "module for classifying and encoding the behavior data included in the user behavior sequence".

[0200] As another aspect, an embodiment of the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device implements the following method: in response to receiving a user behavior sequence of a target user, classify and encode the behavior data included in the user behavior sequence to obtain an encoding result; obtain feature information of the encoding result and generate a corresponding feature vector; perform multi-attribute analysis based on the feature vector to obtain the target attribute of the target user.

[0201] According to the technical solution of the embodiment of the present invention, the behavior data included in the user behavior sequence is classified and encoded, which can retain the characteristic information in the behavior data and avoid confusion or loss of different characteristic information. Multi-attribute analysis is performed on the characteristic vector after classification and encoding, which can obtain more accurate and comprehensive user attributes. The time-type behavior data is encoded using trigonometric functions, and multiple time-type behavior data are limited to a certain numerical range to achieve normalization of the behavior data. The logarithmic standard deviation and logarithmic mean are used to encode the numerical behavior data, so that the distribution of the numerical behavior data is more uniform and the difficulty of processing the behavior data is reduced. The enumeration type behavior data is encoded by extracting features from sparse vectors, which can extract more characteristic information, expand the amount of information of the enumeration type behavior data, and facilitate a more comprehensive analysis of user attributes. The characteristic information is spliced ​​with non-sequential information to supplement the characteristic information of the non-sequential information. The splicing result is subjected to multi-attribute analysis, which can analyze the user attributes more comprehensively and accurately. According to the correlation between different attribute analysis tasks, the consistency loss between the attribute analysis tasks is determined, and the neural network model is optimized with the consistency loss as the goal, which can improve the accuracy and consistency of the user attributes and avoid contradictions between the analyzed user attributes.

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

Claims

1. A method for analyzing user attributes, characterized in that: include: In response to receiving a user behavior sequence of a target user, classifying and encoding the behavior data included in the user behavior sequence to obtain an encoding result; Acquire feature information of the encoding result and generate a corresponding feature vector; A multi-attribute analysis is performed based on the feature vector to obtain user attributes of the target user.

2. The method according to claim 1, characterized in that: The behavior data includes behavior data of a time type; the behavior data included in the user behavior sequence is classified and encoded, including: Determine a plurality of time coefficients according to a preset encoding dimension; Four arithmetic operations are performed on each time coefficient and the behavior data of the time type, trigonometric function values ​​are obtained for each behavior data of the time type after the operation, and multiple trigonometric function values ​​are combined into a coding result.

3. The method according to claim 2, characterized in that Performing four arithmetic operations on each time coefficient and the behavior data of the time type, taking trigonometric function values ​​for each behavior data of the time type after the operation, and combining multiple trigonometric function values ​​into a coding result, including: Determine a product result of each time coefficient and the behavior data; Determine the sine and cosine of multiple product results; The sine value and the cosine value are combined into an encoding result according to the arrangement order of the multiple time coefficients.

4. The method according to claim 1, characterized in that: The data type of the behavior data is a numerical type; Classifying and encoding the behavior data included in the user behavior sequence includes: determining the log mean and log standard deviation of the behavioral data; An encoding result is generated according to the logarithmic mean, the logarithmic standard deviation and a preset multiple.

5. The method according to claim 1, characterized in that The data type of the behavior data is an enumeration type; the behavior data included in the user behavior sequence is classified and encoded, including: Converting the behavior data into a sparse vector according to the number of the enumeration types and the enumeration values ​​corresponding to the behavior data; The sparse vector is subjected to feature extraction according to a preset fully connected network to obtain a corresponding encoding result.

6. The method according to claim 1, characterized in that There are multiple encoding results, each encoding result is a plurality of encoding vectors with equal dimensions; acquiring feature information of the encoding result and generating a corresponding feature vector, including: Acquire a feature sequence on the same dimension from a plurality of encoding vectors corresponding to the encoding results; Multiple feature sequences corresponding to multiple dimensions are combined into a feature matrix; Use the multi-head attention mechanism to obtain the feature information of the feature matrix corresponding to each encoding result; The non-sequential information and multiple feature information of the target user are concatenated to obtain a feature vector.

7. The method according to claim 1, characterized in that Before performing multi-attribute analysis based on the feature vector, the method further includes: Train the neural network model using the training data; According to the analysis results of each attribute analysis task and the correlation between different attribute analysis tasks, the consistency loss between attribute analysis tasks is determined; The neural network model is optimized using the consistency loss to obtain a multi-attribute analysis model, which is used to analyze user attributes.

8. A device for analyzing user attributes, characterized in that: include: An encoding module, configured to classify and encode the behavior data included in the user behavior sequence in response to receiving the user behavior sequence of the target user, and obtain an encoding result; A generating module, used to obtain feature information of the encoding result and generate a corresponding feature vector; The analysis module is used to perform multi-attribute analysis based on the feature vector to obtain user attributes of the target user.

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

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