A user portrait generation method and device, electronic equipment and storage medium
By calculating the time weight of user data to generate user profiles, the problem of the lack of time characteristics in existing user profiles is solved, and user characteristics are effectively reflected over time, thus improving the effectiveness of user profiles.
Patent Information
- Application Number
- CN202210731109.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-06-24
AI Technical Summary
The user profiles generated by existing technologies lack time characteristics and cannot effectively reflect changes in user characteristics over time, resulting in low effectiveness.
By calculating time weights based on user data of target users, user profiles with time characteristics are generated, and time weights are used to represent the changes in the importance of user characteristics in different time periods.
The generated user profiles can reflect changes in user characteristics over time, thus improving the effectiveness of user profiles.
Smart Images

Figure CN114996348B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, and in particular to a user profile generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of internet technology, an increasing number of applications (such as social applications, distributed financial applications, metaverse applications, and games) are using blockchain technology. When users utilize the functions provided by these applications, the applications store the user's data within that application on the blockchain. For example, social applications store users' personal and social information on the blockchain. As a result, a large amount of user data has accumulated on the blockchain.
[0003] In related technologies, some companies collect a large amount of user data to create accurate user profiles when providing users with various services such as communication, social networking, online shopping, information, and entertainment, and then provide services to users based on these user profiles.
[0004] However, user profiles generated based on user data over a specific period can only describe the user's characteristics within that specific timeframe. As user characteristics change over time, these profiles cannot reflect the changing importance of those characteristics over time. Therefore, these user profiles lack temporal characteristics, resulting in low effectiveness for user profiles generated using related technologies. Summary of the Invention
[0005] The purpose of this disclosure is to provide a user profile generation method, apparatus, electronic device, and storage medium to generate user profiles with time characteristics, thereby improving the effectiveness of user profiles. The specific technical solution is as follows:
[0006] Firstly, in order to achieve the above objectives, embodiments of this disclosure provide a user profile generation method, the method comprising:
[0007] Based on the user information of the target user, determine the profile dimension corresponding to the target user, and use it as the target profile dimension;
[0008] Based on the user data of the target user in the target profile dimension, a user profile of the target user in the target profile dimension is generated as the initial user profile;
[0009] The time weight of the initial user profile is calculated based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0010] The calculated time weight and the initial user profile are determined as the final user profile of the target user, and are used as the target user profile.
[0011] In some embodiments, calculating the time weight of the initial user profile based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, includes:
[0012] Determine whether a user profile of the target user in the target profile dimension has been generated before generating the initial profile;
[0013] If no user profile of the target user in the target profile dimension has been generated before the initial profile is generated, the time weight of the initial user profile is calculated based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0014] If a user profile of the target user in the target profile dimension has been generated before the initial profile is generated, obtain the time weight of each user profile of the target user in the target profile dimension; determine the time weight at the inflection point in the trend of the time weight of each user profile according to the order of their generation time, and use it as the target time weight; calculate the time weight of the initial user profile based on the target time weight, the number of time weights of each user profile, the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0015] In some embodiments, calculating the time weight of the initial user profile based on the target time weight, the number of time weights for each user profile, the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period includes:
[0016] Based on the duration of the target time period corresponding to the user data of the target user, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, and the time weight of the first user profile in each user profile according to the order of their generation time, a reference time weight is calculated.
[0017] If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile increases from the target time weight according to the order of their generation time, the initial user profile's time weight is calculated based on the duration of the target time period corresponding to the target user's user data, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0018] If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight to the first user profile in the target time period according to the order of the generation time of each user profile, the time weight of the initial user profile is calculated based on the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0019] If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight according to the order of their generation time, the initial user profile's time weight is calculated based on the duration of the target time period corresponding to the target user's user data, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0020] If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile increases in the order of their generation time to the target time weight, the time weight of the initial user profile is calculated based on the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0021] In some embodiments, after determining that the calculated time weight and the initial user profile are the final user profile of the target user, the method further includes:
[0022] Upon receiving a usage request for the target user profile, the user identifier carried in the usage request is extracted as the user identifier, and the usage summary carried in the usage request is also extracted; wherein, the usage summary represents the usage scenario in which the user obtains the target user profile;
[0023] Based on the user identifier, the usage summary, and the user information of the target user, determine whether the user has the right to use the target user profile;
[0024] If the user does not have the right to use the target user profile, an alarm message is sent to the electronic device used by the target user to remind the target user of the user's request to use the target user profile.
[0025] If the user has the right to use the target user profile, the target user profile is sent to the electronic device used by the user.
[0026] In some embodiments, the user information of the target user includes: the Internet Protocol (IP) address of the electronic device used by the target user;
[0027] The step of determining whether a user has the right to use the target user profile based on the user identifier, the usage summary, and the target user's user information includes:
[0028] Based on the IP address of the electronic device used by the target user, an inquiry message targeting the target user profile is sent to the electronic device used by the target user; wherein the inquiry message carries the user identifier and the usage summary;
[0029] Upon receiving a confirmation authorization message from the electronic device used by the target user, it is determined that the user has the right to use the target user profile;
[0030] Upon receiving a deauthorization message from the electronic device used by the target user, it is determined that the user does not have the right to use the target user profile.
[0031] In some embodiments, the user information of the target user includes: a list of authorized users and an authorization summary for the target user profile; wherein, the list of authorized users includes user identifiers of each user authorized by the target user to use the target user profile; and the authorization summary indicates the usage scenario in which the target user authorizes the use of the target user profile.
[0032] The step of determining whether a user has the right to use the target user profile based on the user identifier, the usage summary, and the target user's user information includes:
[0033] Determine whether the authorized list contains the user identifier;
[0034] If the user identifier is not included in the authorized list, it is determined that the user does not have the right to use the target user profile;
[0035] If the authorized list contains the user identifier, calculate the difference between the usage summary and the authorization summary; if the difference is greater than a preset threshold, determine that the user does not have the right to use the target user profile; if the difference is not greater than the preset threshold, determine that the user has the right to use the target user profile.
[0036] In some embodiments, calculating the difference between the usage digest and the authorization digest includes:
[0037] Extract consecutive strings of a first preset length from the usage digest to obtain the strings contained in the usage digest;
[0038] For each extracted string, if the authorization digest contains a string that is identical to that string, the matching degree corresponding to that string is determined to be the first value;
[0039] If the authorization digest does not contain a string identical to the given string, extract consecutive strings of a second preset length from the given string to obtain each substring contained in the given string; for each substring contained in the given string, if the authorization digest does not contain a string identical to the given substring, determine the matching degree corresponding to the substring as a second value; if the authorization digest contains a string identical to the given substring, calculate the matching degree corresponding to the substring based on the number of characters contained in the substring, the number of characters contained in the given string, the number of characters contained in the authorization digest, and the number of times the string identical to the given substring appears in the authorization digest; calculate the sum of the matching degrees corresponding to each substring contained in the given string, and calculate the ratio of the sum to the number of each substring contained in the given string to obtain the matching degree corresponding to the given string;
[0040] Based on the matching degree of each string contained in the usage digest and the number of strings contained in the usage digest, the difference value between the usage digest and the authorization digest is calculated.
[0041] In some embodiments, after determining that the calculated time weight and the initial user profile are the final user profile of the target user, the method further includes:
[0042] According to the preset Distributed Identity Identifier (DID) generation rules and the user information of the target user, generate the DID of the target user as the target DID;
[0043] Based on the generation time of the specified user profile of the target user, the ID of the target user, and the target DID, a user identifier of the target user is generated as the target user identifier;
[0044] The target user identifier and the target user profile are recorded accordingly.
[0045] In some embodiments, generating a user identifier for the target user based on the generation time of the specified user profile of the target user, the target user's ID, and the target DID, as the target user identifier, includes:
[0046] The generation time of the specified user profile of the target user is hashed to obtain the hash value of the generation time of the specified user profile, and the ID of the target user is hashed to obtain the hash value of the ID of the target user.
[0047] The hash value of the generation time of the specified user profile and the hash value of the target user's ID are concatenated to obtain a hash value string;
[0048] Based on the hash string and the target DID, a user identifier for the target user is generated and used as the target user identifier.
[0049] In some embodiments, generating the user identifier of the target user based on the hash value string and the target DID, as the target user identifier, includes:
[0050] If the number of characters in the hash string is not greater than the number of characters in the target DID, for each character in the hash string, determine the position of the character in the hash string according to the order of the characters in the hash string from high to low; determine the character in the target DID that is at the same position as the character according to the order of the characters in the target DID from high to low, and obtain the character corresponding to the character in the target DID; calculate the remainder between the character and the corresponding character in the target DID to obtain the user identifier of the target user, which is used as the target user identifier.
[0051] If the number of characters in the hash string is greater than the number of characters in the target DID, the character that appears at the corresponding position in the target DID is determined according to the order of the characters in the hash string from most significant to least significant, and is designated as the first character. All other characters in the hash string besides the first character are designated as second characters. For each character in the target DID, the frequency of its occurrence is counted. For each first character, its position in the hash string is determined according to the order of the characters in the hash string from most significant to least significant. The character at the same position in the target DID as the first character is determined according to the order of the characters in the target DID from most significant to least significant, thus obtaining... The first character corresponds to the character in the target DID; the remainder between the first character and the character corresponding to the target DID is calculated as the first remainder; for each second character, the position of the second character in the hash value string is determined according to the order of the characters contained in the hash value string from low to high; the character in the corresponding sorting result that is at the same position as the second character is determined according to the order of the occurrence frequency of the characters contained in the target DID from high to low, thus obtaining the character corresponding to the second character in the target DID; the remainder between the second character and the character corresponding to the target DID is calculated as the second remainder; a user identifier of the target user containing the first remainder and the second remainder is generated as the target user identifier.
[0052] In some embodiments, the corresponding recording of the target user identifier and the target user profile includes:
[0053] Determine whether the target user identifier is included in the correspondence between the user identifier stored in the profile node and the user node; wherein, the profile node is the head node of the preset user blockchain; the user node is the non-head node of the user blockchain; a user node is used to store the user information of the corresponding user;
[0054] If the correspondence contains the target user identifier, determine the user node corresponding to the target user identifier to obtain the user node of the target user; create a new linked list node after the last linked list node of the profile blockchain with the user node of the target user as the head node, and store the target user profile in the newly created linked list node;
[0055] If the correspondence does not contain the target user identifier, a new user node is created after the last user node in the user blockchain as the target user's user node, and the target user identifier and the target user's user node are recorded in the correspondence. A profile blockchain is created with the target user's user node as the head node. The newly created profile blockchain contains a newly created linked list node in addition to the head node. The target user profile is stored in the newly created linked list node.
[0056] In some embodiments, storing the target user profile into the newly created linked list node includes:
[0057] Generate a two-dimensional array containing the target user profile and the generation time of the target user profile, and store the two-dimensional array in the newly created linked list node.
[0058] In some embodiments, prior to sending the target user profile to the electronic device used by the user, the method further includes:
[0059] In the correspondence between user identifiers and user nodes recorded in the profile node, the user node corresponding to the target user identifier is determined, and the user node of the target user is obtained;
[0060] In the correspondence between the user profile and the linked list node recorded in the user node of the target user, determine the linked list node corresponding to the target user profile;
[0061] The target user profile is obtained from the identified linked list nodes.
[0062] Secondly, in order to achieve the above objectives, embodiments of this disclosure provide a user profile generation apparatus, the apparatus comprising:
[0063] The profile dimension determination module is used to determine the profile dimension corresponding to the target user based on the user information of the target user, and use it as the target profile dimension.
[0064] The initial user profile generation module is used to generate a user profile of the target user in the target profile dimension based on the user data of the target user in the target profile dimension, as the initial user profile;
[0065] The time weight calculation module is used to calculate the time weight of the initial user profile based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0066] The target user profile generation module is used to determine the calculated time weight and the initial user profile as the final user profile of the target user, which is then used as the target user profile.
[0067] In some embodiments, the time weight calculation module is specifically used to determine whether a user profile of the target user in the target profile dimension has been generated before the initial profile is generated;
[0068] If no user profile of the target user in the target profile dimension has been generated before the initial profile is generated, the time weight of the initial user profile is calculated based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0069] If a user profile of the target user in the target profile dimension has been generated before the initial profile is generated, obtain the time weight of each user profile of the target user in the target profile dimension; determine the time weight at the inflection point in the trend of the time weight of each user profile according to the order of their generation time, and use it as the target time weight; calculate the time weight of the initial user profile based on the target time weight, the number of time weights of each user profile, the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0070] In some embodiments, the time weight calculation module is specifically used to calculate a reference time weight based on the duration of the target time period corresponding to the user data of the target user, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, and the time weight of the first user profile in each user profile according to the order of generation time of each user profile.
[0071] If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile increases from the target time weight according to the order of their generation time, the initial user profile's time weight is calculated based on the duration of the target time period corresponding to the target user's user data, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0072] If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight to the first user profile in the target time period according to the order of the generation time of each user profile, the time weight of the initial user profile is calculated based on the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0073] If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight according to the order of their generation time, the initial user profile's time weight is calculated based on the duration of the target time period corresponding to the target user's user data, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0074] If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile increases in the order of their generation time to the target time weight, the time weight of the initial user profile is calculated based on the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0075] In some embodiments, the apparatus further includes:
[0076] The extraction module is used to, after the target user profile generation module determines that the calculated time weight and the initial user profile are the final user profile of the target user as the target user profile, extract the user identifier carried in the usage request as the user identifier after receiving the usage request for the target user profile, and extract the usage summary carried in the usage request; wherein, the usage summary represents the usage scenario in which the user obtains the target user profile;
[0077] The right-to-use determination module is used to determine whether the user has the right to use the target user profile based on the user identifier, the usage summary and the user information of the target user.
[0078] The alarm message sending module is used to send an alarm message to the electronic device used by the target user if the user does not have the right to use the target user profile, so as to remind the target user of the user's request to use the target user profile this time;
[0079] The user profile sending module is used to send the target user profile to the electronic device used by the user if the user has the right to use the target user profile.
[0080] In some embodiments, the user information of the target user includes: the Internet Protocol (IP) address of the electronic device used by the target user;
[0081] The usage right determination module is specifically used to send an inquiry message based on the target user profile to the electronic device used by the target user according to the IP address of the electronic device used by the target user; wherein the inquiry message carries the user identifier and the usage summary;
[0082] Upon receiving a confirmation authorization message from the electronic device used by the target user, it is determined that the user has the right to use the target user profile;
[0083] Upon receiving a deauthorization message from the electronic device used by the target user, it is determined that the user does not have the right to use the target user profile.
[0084] In some embodiments, the user information of the target user includes: a list of authorized users and an authorization summary for the target user profile; wherein, the list of authorized users includes user identifiers of each user authorized by the target user to use the target user profile; and the authorization summary indicates the usage scenario in which the target user authorizes the use of the target user profile.
[0085] The right-to-use determination module is specifically used to determine whether the user identifier is included in the authorized list;
[0086] If the user identifier is not included in the authorized list, it is determined that the user does not have the right to use the target user profile;
[0087] If the authorized list contains the user identifier, calculate the difference between the usage summary and the authorization summary; if the difference is greater than a preset threshold, determine that the user does not have the right to use the target user profile; if the difference is not greater than the preset threshold, determine that the user has the right to use the target user profile.
[0088] In some embodiments, the right-of-use determination module is specifically used to extract continuous strings of a first preset length from the use digest to obtain the strings contained in the use digest;
[0089] For each extracted string, if the authorization digest contains a string that is identical to that string, the matching degree corresponding to that string is determined to be the first value;
[0090] If the authorization digest does not contain a string identical to the given string, extract consecutive strings of a second preset length from the given string to obtain each substring contained in the given string; for each substring contained in the given string, if the authorization digest does not contain a string identical to the given substring, determine the matching degree corresponding to the substring as a second value; if the authorization digest contains a string identical to the given substring, calculate the matching degree corresponding to the substring based on the number of characters contained in the substring, the number of characters contained in the given string, the number of characters contained in the authorization digest, and the number of times the string identical to the given substring appears in the authorization digest; calculate the sum of the matching degrees corresponding to each substring contained in the given string, and calculate the ratio of the sum to the number of each substring contained in the given string to obtain the matching degree corresponding to the given string;
[0091] Based on the matching degree of each string contained in the usage digest and the number of strings contained in the usage digest, the difference value between the usage digest and the authorization digest is calculated.
[0092] In some embodiments, the apparatus further includes:
[0093] The DID generation module is used to generate the DID of the target user as the target DID after the target user profile generation module determines the calculated time weight and the initial user profile as the final user profile of the target user.
[0094] The user identifier generation module is used to generate a user identifier for the target user based on the generation time of the specified user profile of the target user, the number of the target user, and the target DID, and use it as the target user identifier;
[0095] The recording module is used to record the target user identifier and the target user profile.
[0096] In some embodiments, the user identifier generation module is specifically used to perform hash processing on the generation time of the specified user profile of the target user to obtain the hash value of the generation time of the specified user profile, and to perform hash processing on the number of the target user to obtain the hash value of the number of the target user;
[0097] The hash value of the generation time of the specified user profile and the hash value of the target user's ID are concatenated to obtain a hash value string;
[0098] Based on the hash string and the target DID, a user identifier for the target user is generated and used as the target user identifier.
[0099] In some embodiments, the user identifier generation module is specifically configured to: if the number of characters contained in the hash string is not greater than the number of characters contained in the target DID, for each character in the hash string, determine the position of the character in the hash string according to the order of the characters in the hash string from high to low; determine the character in the target DID that is at the same position as the character according to the order of the characters in the target DID from high to low, and obtain the character corresponding to the character in the target DID; calculate the remainder between the character and the character corresponding to the character in the target DID to obtain the user identifier of the target user, which is used as the target user identifier;
[0100] If the number of characters in the hash string is greater than the number of characters in the target DID, the character that appears at the corresponding position in the target DID is determined according to the order of the characters in the hash string from most significant to least significant, and is designated as the first character. All other characters in the hash string besides the first character are designated as second characters. For each character in the target DID, the frequency of its occurrence is counted. For each first character, its position in the hash string is determined according to the order of the characters in the hash string from most significant to least significant. The character at the same position in the target DID as the first character is determined according to the order of the characters in the target DID from most significant to least significant, thus obtaining... The first character corresponds to the character in the target DID; the remainder between the first character and the character corresponding to the target DID is calculated as the first remainder; for each second character, the position of the second character in the hash value string is determined according to the order of the characters contained in the hash value string from low to high; the character in the corresponding sorting result that is at the same position as the second character is determined according to the order of the occurrence frequency of the characters contained in the target DID from high to low, thus obtaining the character corresponding to the second character in the target DID; the remainder between the second character and the character corresponding to the target DID is calculated as the second remainder; a user identifier of the target user containing the first remainder and the second remainder is generated as the target user identifier.
[0101] In some embodiments, the recording module is specifically used to determine whether the target user identifier is included in the correspondence between user identifiers and user nodes stored in the profile node; wherein, the profile node is the head node of a preset user blockchain; the user node is a non-head node of the user blockchain; and a user node is used to store the user information of the corresponding user.
[0102] If the correspondence contains the target user identifier, determine the user node corresponding to the target user identifier to obtain the user node of the target user; create a new linked list node after the last linked list node of the profile blockchain with the user node of the target user as the head node, and store the target user profile in the newly created linked list node;
[0103] If the correspondence does not contain the target user identifier, a new user node is created after the last user node in the user blockchain as the target user's user node, and the target user identifier and the target user's user node are recorded in the correspondence. A profile blockchain is created with the target user's user node as the head node. The newly created profile blockchain contains a newly created linked list node in addition to the head node. The target user profile is stored in the newly created linked list node.
[0104] In some embodiments, the recording module is specifically used to generate a two-dimensional array containing the target user profile and the generation time of the target user profile, and store the two-dimensional array in the newly created linked list node.
[0105] In some embodiments, the apparatus further includes:
[0106] The user node determination module is used to determine the user node corresponding to the target user identifier from the correspondence between the user identifier and the user node recorded in the profile node before the user profile sending module sends the target user profile to the electronic device used by the user.
[0107] The linked list node determination module is used to determine the linked list node corresponding to the target user profile in the correspondence between the user profile recorded in the user node of the target user and the linked list node.
[0108] The user profile acquisition module is used to obtain the target user profile from the determined linked list nodes.
[0109] This disclosure also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0110] Memory, used to store computer programs;
[0111] When a processor executes a program stored in memory, it implements any of the steps of the user profile generation method described above.
[0112] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the steps of the user profile generation method described above.
[0113] This disclosure also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the user profile generation methods described above.
[0114] This disclosure provides a user profile generation method, which involves determining a profile dimension corresponding to the target user based on the target user's user information, and using this dimension as the target profile dimension; generating a user profile of the target user in the target profile dimension based on the user data of the target user, and using this profile as the initial user profile; calculating the time weight of the initial user profile based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period; and determining the calculated time weight and the initial user profile as the final user profile of the target user, and using this profile as the target user profile.
[0115] Based on the above processing, the time weight of the initial user profile can represent the importance of user data in the target profile dimension within the target time period, that is, the importance of the user characteristics of the target user in the target profile dimension. Therefore, the time weight of each user profile of the target user generated at different times can represent the change in the importance of the user characteristics of the target user in the target profile dimension over time. In other words, it can generate user profiles with time characteristics, which can improve the effectiveness of user profiles.
[0116] Of course, implementing any product or method of this disclosure does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0117] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other embodiments can be obtained based on these accompanying drawings.
[0118] Figure 1 A flowchart of a user profile generation method provided in this embodiment of the disclosure;
[0119] Figure 2a A schematic diagram illustrating the principle of generating a user profile according to an embodiment of this disclosure;
[0120] Figure 2b A schematic diagram of a user profile provided in an embodiment of this disclosure;
[0121] Figure 3 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0122] Figure 4 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0123] Figure 5A flowchart of another user profile generation method provided in this disclosure embodiment;
[0124] Figure 6 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0125] Figure 7 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0126] Figure 8 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0127] Figure 9 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0128] Figure 10 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0129] Figure 11 A schematic diagram of a blockchain structure provided in this disclosure embodiment;
[0130] Figure 12 A flowchart of another user profile generation method provided in this disclosure embodiment;
[0131] Figure 13 A flowchart illustrating a user profile management method provided in this embodiment of the disclosure;
[0132] Figure 14 A flowchart of another user profile management method provided in this disclosure embodiment;
[0133] Figure 15 A flowchart of another user profile management method provided in this disclosure embodiment;
[0134] Figure 16 A structural diagram of a user profile generation device provided in an embodiment of this disclosure;
[0135] Figure 17 This is a structural diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0136] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art based on this disclosure are within the scope of protection of this disclosure.
[0137] In related technologies, some companies collect large amounts of user data to create precise user profiles when providing various services such as communication, social networking, online shopping, information, and entertainment, and then provide services based on these profiles. However, user profiles generated from user data over a specific period can only describe the user's characteristics within that specific timeframe. As user characteristics change over time, these profiles cannot represent the changing importance of those characteristics over time; therefore, they lack temporal characteristics, meaning the effectiveness of user profiles generated in these technologies is relatively low.
[0138] To solve the above problem, see Figure 1 , Figure 1 A flowchart of a user profile generation method provided in this disclosure embodiment, the method being applied to an electronic device, the method including the following steps:
[0139] S101: Based on the user information of the target user, determine the profile dimension corresponding to the target user, and use it as the target profile dimension.
[0140] S102: Based on the user data of the target user in the target profile dimension, generate a user profile of the target user in the target profile dimension as the initial user profile.
[0141] S103: Calculate the time weight of the initial user profile based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0142] S104: Determine the calculated time weights and initial user profiles as the final user profiles for the target users, and use them as the target user profiles.
[0143] Based on the user profile generation method provided in this disclosure, the time weight of the initial user profile can represent the importance of user data in the target profile dimension within the target time period, that is, the importance of user characteristics of the target user in the target profile dimension. Thus, the time weight of each user profile of the target user generated at different times can represent the change in the importance of user characteristics of the target user in the target profile dimension over time. In other words, it can generate user profiles with time characteristics, which can improve the effectiveness of user profiles.
[0144] In step S101, the target user is any user for whom a user profile needs to be generated; the target user can be an individual user. The target user's information includes basic information such as name, gender, age, and occupation. The electronic device acquires the target user's basic information and, based on this information, determines the target user category. For example, if the target user's basic information includes: gender: male, age: 40, then the target user category is determined to be: middle-aged male. Or, if the target user's basic information includes: gender: female, age: 23, then the target user category is determined to be: young female.
[0145] Then, the electronic device acquires the profile dimensions corresponding to the target user category, which serve as the target profile dimensions. The profile dimensions corresponding to a user category are determined based on the user data of the users included in that category. Profile dimensions represent the category of the application in which the user's behavior occurred; for example, profile dimensions may include: financial dimensions, social dimensions, collectibles dimensions, metaverse dimensions, and gaming dimensions, etc.
[0146] For example, the user category is young male, and this user category includes users 1, 2, 3, and 4. User data for user 1 includes social-related user data; user data for user 2 includes social-related user data and metaverse-related user data; user data for user 3 includes game-related user data and social-related user data; and user data for user 4 includes game-related user data and social-related user data.
[0147] The electronic device clusters the user data of users within this user category, resulting in profile dimensions for these user categories including: social dimension, gaming dimension, and metaverse dimension. Since metaverse-related user data is relatively scarce for each user, the electronic device determines that the profile dimensions for this user category include: social dimension and gaming dimension.
[0148] Regarding step S102, since various applications used by users store user data on the blockchain, electronic devices can obtain user data from mainstream public blockchains. These mainstream public blockchains can include Ethereum, Solana (a mainstream blockchain), BSC (Binance Smart Chain), and Polygon (another mainstream blockchain). These mainstream public blockchains are involved in distributed finance applications, NFT (Non-Fungible Token) digital collectible applications, metaverse applications, etc. Then, the electronic device can store the obtained user data in a pre-defined database as a wide data table. A wide data table refers to a data table that links together indicators, dimensions, and attributes related to a business theme.
[0149] The electronic device obtains user data of the target user in the target profile dimension from a preset database. The electronic device can process the obtained user data in the following ways to obtain the feature vector of the target user in the target profile dimension (which can be called the first feature vector).
[0150] Method 1: The electronic device encodes the acquired user data according to a preset encoding method to obtain the first feature vector. The preset encoding method can be one-hot encoding or word embedding encoding.
[0151] Method 2: The electronic device calculates the data value of each user data point in the target profile dimension based on the acquired user data. The data value of a user data point in a profile dimension can be the TF-IDF (Term Frequency – Inverse Document Frequency) value of that user data in that profile dimension. The electronic device generates a feature vector containing the data values of each user data point of the target user, thus obtaining the first feature vector.
[0152] For example, the target user's user data includes financial products purchased by the target user within one month, namely: Product A, Product B, and Product C. The electronic device calculates the TF-IDF value of Product A in the user data for the financial dimension, obtaining the data value 'a' for Product A; it also calculates the TF-IDF value of Product B in the user data for the financial dimension, obtaining the data value 'b' for Product B; and it calculates the TF-IDF value of Product C in the user data for the financial dimension, obtaining the data value 'c' for Product C. Furthermore, the electronic device determines the first feature vector as [a, b, c].
[0153] Then, based on the determined first feature vector and the preset user behavior analysis algorithm, the electronic device generates a user profile of the target user in the target profile dimension, thus obtaining the initial user profile.
[0154] For example, see Figure 2a , Figure 2a This is a schematic diagram illustrating the principle of generating a user profile according to an embodiment of this disclosure.
[0155] The preset user behavior analysis algorithms include: supervised learning analysis algorithms, such as regression analysis algorithms and CNN (Convolutional Neural Network) deep learning algorithms; unsupervised learning analysis algorithms, such as clustering analysis algorithms; and adaptive learning analysis algorithms, such as GAN (Generative Adversarial Network) prediction algorithms.
[0156] When the preset user behavior analysis algorithm is a clustering analysis algorithm, the electronic device can obtain the feature vectors of each preset user profile corresponding to the target profile dimension. Then, the electronic device can calculate the similarity between the feature vector of each preset user profile and the first feature vector, and determine the preset user profile with the larger similarity as the initial user profile of the target user in the target profile dimension.
[0157] When the preset user behavior analysis algorithm is a supervised learning algorithm, the electronic device can input the first feature vector into a pre-trained classification network model (e.g., a CNN model) to obtain the probability that the target user's user profile in the target profile dimension matches each preset user profile. Then, the electronic device can determine the preset user profile with the higher probability as the initial user profile of the target user in the target profile dimension. The classification network model is trained based on the sample feature vectors of sample users in the target profile dimension and the sample profiles of sample users in the target profile dimension.
[0158] For example, see Figure 2b , Figure 2b This is a schematic diagram of a user profile provided in an embodiment of this disclosure.
[0159] The user profile of Alice includes: a financial dimension user profile, such as ordinary traders, liquidity providers, market makers, etc.
[0160] User profiles in the social dimension, such as participants in DAO (Decentralized Autonomous Organization) and StepN (an application built on the Solana blockchain).
[0161] User profiles based on the collection dimension, such as owners of Ant Digital products, and digital collection diamond collectors.
[0162] User profiles in the metaverse dimension, such as basic metaverse analysis, Roblox (an application that provides social and gaming services) deep participants, and Sandbox (a blockchain-based gaming platform) land builders, etc.
[0163] User profiles in the gaming dimension, such as DCL (a blockchain-based gaming application) expert, or GameFi (a blockchain-based gaming application) beginner, etc.
[0164] Regarding step S103, since the initial user profile is generated based on user data over a period of time, the initial user profile can only represent the user characteristics of the target user within that period of time, and cannot represent the change in the importance of the user characteristics of the target user in the target profile dimension over time. In other words, the initial user profile does not have time characteristics.
[0165] The target time period is the time period corresponding to the user data obtained when generating the initial user profile. For example, if the target profile dimension is financial, and the electronic device obtains data on financial products purchased by the target user from May 1st to May 31st when generating the initial user profile, then the target time period is from May 1st to May 31st, and the duration of the target time period is 31 days.
[0166] If the target user made their first purchase of a financial product on May 10th and their last purchase on May 15th within the target time period, then the time interval between the first and last user action within the target time period is 5 days.
[0167] Electronic devices calculate the time weight of the initial user profile based on the duration of the target time period corresponding to the user data of the target user (which can be called the first duration) and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period (which can be called the second duration).
[0168] In one implementation, the electronic device can directly calculate the ratio of the second duration to the first duration as the time weight for the initial user profile.
[0169] In another implementation, Figure 1 Based on this, see Figure 3 Step S103 may include the following steps:
[0170] S1031: Determine whether a user profile of the target user in the target profile dimension has been generated before generating the initial profile. If not, proceed to step S1032; if yes, proceed to step S1033.
[0171] S1032: Calculate the time weight of the initial user profile based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0172] S1033: Obtain the time weights of each user profile of the generated target user in the target profile dimension.
[0173] S1034: Based on the order in which each user profile was generated, determine the time weight at the inflection point in the trend of time weight change for each user profile, and use it as the target time weight.
[0174] S1035: Calculate the time weight of the initial user profile based on the target time weight, the number of time weights for each user profile, the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0175] The initial user profile is generated based on user data of target users within the target time period. Before generating the initial profile, the electronic device determines whether it has already generated a user profile of the target user in the target profile dimension based on user data from other time periods.
[0176] If no user profile for the target user in the target profile dimension has been generated before generating the initial user profile, the electronic device calculates the time weight of the initial user profile based on the duration of the target time period corresponding to the target user's user data, and the duration between the time of the target user's first user action and the time of the last user action within the target time period. If a user profile for the target user in the target profile dimension has already been generated before generating the initial user profile, the electronic device calculates the time weight of the initial user profile based on the changing trend of the time weights of each user profile in the target profile dimension, the duration of the target time period corresponding to the target user's user data, and the duration between the time of the target user's first user action and the time of the last user action within the target time period.
[0177] If no user profile of the target user in the target profile dimension has been generated before the initial profile is generated, the electronic device calculates the time weight of the initial user profile based on the following formula (1).
[0178]
[0179] Q represents the time weight of the initial user profile; Δt represents the duration between the moment when the target user first engages in user behavior and the moment when the target user last engages in user behavior within the target time period; and T represents the duration of the target time period corresponding to the user data of the target user.
[0180] If user profiles for the target user in the target profile dimension have already been generated before generating the initial profile, the electronic device obtains the time weights of each of the generated user profiles in the target profile dimension. For example, the electronic device can obtain the time weights of a preset number of user profiles most recent to the current time. Then, the electronic device sorts the time weights of each user profile according to the order in which they were generated. Furthermore, based on the sorting result, the electronic device determines the time weight at the inflection point in the trend of the time weight change of each user profile, and uses this as the target time weight.
[0181] For example, the electronic device sorts the time weights of each user profile according to the order in which they were generated, resulting in the following sorting order: q1, q2, q3, q4. If q1 is greater than or equal to q2, q2 is greater than or equal to q3, but q3 is less than q4, then q3 is the target time weight (which can be denoted as qe) at the inflection point in the trend of the time weights of each user profile.
[0182] Furthermore, the electronic device calculates the time weight of the initial user profile based on the target time weight, the number of time weights for each user profile, the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0183] In some embodiments, step S1035 may include the following steps:
[0184] Step 1: Calculate the reference time weight based on the duration of the target time period corresponding to the user data of the target user, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, and the time weight of the first user profile in each user profile according to the order of their generation time.
[0185] Step 2: If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile increases from the target time weight according to the order of their generation time, the initial user profile's time weight is calculated based on the duration of the target time period corresponding to the target user's user data, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0186] Step 3: If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight to the first user profile in each user profile according to the order of their generation time, the initial user profile time weight is calculated based on the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile time weight.
[0187] Step 4: If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight according to the order of their generation time, calculate the initial user profile time weight based on the duration of the target time period corresponding to the user data of the target user, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0188] Step 5: If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile increases in order of generation time, the initial user profile time weight is calculated based on the duration between the time of the first user action and the time of the last user action within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0189] After obtaining the generated user profiles of the target user in the target profile dimension, the electronic device calculates the reference time weight based on the duration of the target time period corresponding to the user data of the target user, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, and the time weight of the first user profile in each user profile according to the order of generation time of each user profile, as follows (2).
[0190]
[0191] Δq represents the reference time weight; Δt represents the duration between the first and last user action within the target time period; T represents the duration of the target time period corresponding to the user data of the target user; and q1 represents the time weight of the first user profile in each user profile according to the order of their generation time.
[0192] Furthermore, the electronic device calculates the time weight of the initial user profile based on whether the reference time weight is less than the third value, and according to the order in which the user profiles were generated, the trend of the time weight of the first user profile to the target time weight. The third value can be 0.
[0193] If the reference time weight is not less than the third value, and according to the order of the generation time of each user profile, the time weight of the first user profile in each user profile is on the rise to the target time weight, it indicates that the user characteristics of the target user in the target profile dimension are on the rise at the current moment. That is, the time weight of the initial user profile of the target user in the target profile dimension at the current moment is greater than the time weight of the user profile of the most recent target profile dimension. This also indicates that the user characteristics of the target user in the target profile dimension can still represent the target user, and the target user's liking for the target profile dimension increases. The electronic device calculates the time weight of the initial user profile based on the following formula (3).
[0194]
[0195] Q represents the time weight of the initial user profile; Δt represents the duration between the moment when the target user first engages in user behavior and the moment when the target user last engages in user behavior within the target time period; T represents the duration of the target time period corresponding to the user data of the target user; M represents the number of time weights from the time weight of the first user profile to the target time weight, according to the order of the generation time of each user profile; K represents the number of user profiles; Δq represents the reference time weight.
[0196] If the reference time weight is not less than the third value, and according to the order of the generation time of each user profile, the time weight of the first user profile in each user profile is decreasing to the target time weight, it indicates that at the current moment, the time weight of each user profile of the target user changes from a decreasing trend to an increasing trend, and the time weight of the user characteristics of the target user in the target profile dimension increases. The electronic device calculates the time weight of the initial user profile based on the following formula (4).
[0197]
[0198] Q represents the time weight of the initial user profile; Δt represents the duration between the moment when the target user first engages in user behavior and the moment when the target user last engages in user behavior within the target time period; T represents the duration of the target time period corresponding to the user data of the target user; Δq represents the reference time weight; A represents the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0199] If the reference time weight is less than the third value, and according to the order of the generation time of each user profile, the time weight of the first user profile in each user profile is decreasing to the target time weight, it indicates that the user characteristics of the target user in the target profile dimension are decreasing at the current moment. That is, the time weight of the initial user profile of the target user in the target profile dimension at the current moment is not greater than the time weight of the user profile of the most recent target profile dimension, which also indicates that the target user's liking for the target profile dimension has decreased. The electronic device calculates the time weight of the initial user profile based on the above formula (3).
[0200] If the reference time weight is less than the third value, and according to the order of the generation time of each user profile, the time weight of the first user profile in each user profile is on an upward trend to the target time weight, it indicates that at the current moment, the time weight of each user profile of the target user changes from an upward trend to a downward trend, and the time weight of the user features of the target user in the target profile dimension becomes smaller. The electronic device calculates the time weight of the initial user profile based on the above formula (4).
[0201] Regarding step S104, the time weight of the initial user profile can represent the importance of user data in the target profile dimension within the target time period, that is, the importance of the user characteristics of the target user in the target profile dimension. Thus, the time weight of each user profile of the target user generated at different times can represent the change in the importance of the user characteristics of the target user in the target profile dimension over time.
[0202] Furthermore, the electronic device determines the calculated time weights and initial user profiles as the final target user profile for the target user.
[0203] In some embodiments, Figure 1 Based on this, see Figure 4 After step S104, the method may further include the following steps:
[0204] S105: Upon receiving a usage request for a target user profile, extract the user's identifier carried in the usage request as the user identifier, and extract the usage summary carried in the usage request.
[0205] The use of a summary indicates the use case where a user obtains a profile of the target user.
[0206] S106: Based on the user identifier, usage summary and target user information, determine whether the user has the right to use the target user profile. If not, proceed to step S107; if yes, proceed to step S108.
[0207] S107: Send an alarm message to the electronic device used by the target user to remind the target user of the user's request for use based on the target user profile.
[0208] S108: Send the target user profile to the electronic device used by the user.
[0209] The user is any user who is currently requesting the target user profile. The user can be a corporate user or an individual user. For example, a financial company requests the target user's user profile in the financial dimension in order to provide the user with targeted financial services based on the obtained user profile. Or, a game company requests the target user's user profile in the gaming dimension in order to provide the user with targeted gaming services based on the obtained user profile.
[0210] A user sends a usage request to an electronic device based on a target user profile. This usage request includes the target user's user identifier (i.e., user ID) and a usage summary, as well as the target user's user identifier (i.e., target user ID). A user's user identifier can be the user's name, a number assigned to the user, or a user identifier generated based on the user's DID, etc.
[0211] Upon receiving the usage request, the electronic device extracts the user identifier, usage summary, and target user identifier carried in the request. The usage summary indicates the scenario in which the user obtains the target user profile, such as obtaining the target user profile to provide financial services to the user.
[0212] The electronic device locally records the correspondence between a set of user identifiers and a set of user information. The device determines the user information corresponding to a target user identifier, thus obtaining the target user's user information (which can be called the target user information). The user identifier set contains at least one user identifier; the user information set contains at least one user information. There is a one-to-one correspondence between the user identifiers in the user identifier set and the user information in the user information set. For example, the correspondence between the user identifier set and the user information set includes: user identifier A corresponds to user information A, user identifier B corresponds to user information B, and user identifier C corresponds to user information C.
[0213] Furthermore, the electronic device determines whether the user has the right to use the target user profile based on the user identifier, usage summary, and target user information, and then processes the data according to the determination result.
[0214] An electronic device (which may be referred to as the first electronic device) can determine whether a user has the right to use the target user profile based on the following methods.
[0215] Method 1
[0216] The target user information also includes the IP (Internet Protocol) address of the electronic device (which may be referred to as a secondary electronic device) used by the target user.
[0217] Accordingly, step S106 may include the following steps:
[0218] Step 1: Send an inquiry message based on the target user profile to the target user's electronic device according to the IP address of the target user's electronic device.
[0219] The query message includes a user identifier and a usage summary.
[0220] Step 2: Upon receiving a confirmation authorization message from the electronic device used by the target user, determine that the user has the right to use the target user profile.
[0221] Step 3: Upon receiving a revocation message from the electronic device used by the target user, determine that the user does not have the right to use the target user profile.
[0222] The first electronic device sends an inquiry message to the second electronic device based on the IP address of the target user's second electronic device. This inquiry message carries the user identifier and usage summary. The second electronic device can be a terminal, server, etc.
[0223] The target user determines whether to authorize the user to use the target user profile based on the user identifier and usage summary carried in the query message. If the target user confirms authorization, they input a confirmation authorization command to the second electronic device. Upon receiving this command, the second electronic device sends a confirmation authorization message to the first electronic device. Upon receiving this message, the first electronic device confirms that the user has the right to use the target user profile.
[0224] If the target user determines that they do not authorize the user to use the target user profile, the target user can input a cancellation command into the second electronic device. Upon receiving the cancellation command, the second electronic device sends a cancellation message to the first electronic device. Upon receiving the cancellation message, the first electronic device determines that the user does not have the right to use the target user profile. Alternatively, if the target user determines that they do not authorize the user to use the target user profile, the target user can take no action. If the first electronic device does not receive a confirmation authorization message within a preset time period, it determines that the user does not have the right to use the target user profile.
[0225] Method 2
[0226] The target user information also includes: the list of authorized users and the authorization summary for the target user profile.
[0227] When generating a user profile, the electronic device can prompt the user to authorize other users to use that user profile, obtaining a list of authorized users. The device can also prompt the user to specify the usage scenario of the user profile, obtaining a summary of the authorization. For example, it can specify that the user profile is only for user habit analysis, or that the user profile is for all analyses. Then, the electronic device locally records the user's authorization list and authorization summary for the user profile.
[0228] Electronic devices obtain locally recorded authorization lists and authorization summaries for target user profiles, thus obtaining authorization lists and authorization summaries for target user profiles.
[0229] The electronic device determines whether the authorized list of the target user profile contains a user identifier. If the authorized list does not contain a user identifier, it determines that the user does not have the right to use the target user profile. If the authorized list contains a user identifier, it determines whether the usage summary and the authorization summary are the same. If the usage summary and the authorization summary are the same, it determines that the user has the right to use the target user profile. If the usage summary and the authorization summary are different, it determines that the user does not have the right to use the target user profile.
[0230] Method 3
[0231] The target user information also includes: the list of authorized users and the authorization summary for the target user profile; the list of authorized users includes the user identifiers of each user authorized by the target user to use the target user profile; the authorization summary indicates the usage scenario in which the target user authorizes the use of the target user profile.
[0232] Correspondingly, in Figure 4 Based on this, see Figure 5 Step S106 may include the following steps:
[0233] S1061: Determine whether the authorized list contains a user identifier. If not, proceed to step S1062; if yes, proceed to step S1063.
[0234] S1062: It is determined that the user does not have the right to use the target user profile.
[0235] S1063: Calculate the difference between the usage abstract and the licensed abstract.
[0236] S1064: If the difference value is greater than the preset threshold, it is determined that the user does not have the right to use the target user profile.
[0237] S1065: If the difference value is not greater than the preset threshold, determine that the user has the right to use the target user profile.
[0238] To more accurately determine whether a user has the right to use the target user profile, if the authorized list of the target user profile includes a user identifier, the electronic device calculates the difference between the usage summary and the authorized summary. For example, the electronic device can perform word segmentation on the usage summary and generate a feature vector based on the segmentation results. The electronic device can also perform word segmentation on the authorized summary and generate a feature vector based on the segmentation results. Then, the electronic device calculates the similarity between the feature vectors of the usage summary and the authorized summary, and calculates the difference between 1 and this similarity to obtain the difference between the usage summary and the authorized summary.
[0239] If the calculated difference value is greater than a preset threshold, it is determined that the user does not have the right to use the target user profile; if the calculated difference value is not greater than the preset threshold, it is determined that the user has the right to use the target user profile.
[0240] The preset threshold can be set by technicians based on experience; for example, the preset threshold could be 0.6, or it could be 0.5, but it is not limited to these. Alternatively, the preset threshold can also be learned from sample data.
[0241] In some embodiments, Figure 5 Based on this, see Figure 6Step S1063 may include the following steps:
[0242] S10631: Extract consecutive strings of a first preset length from the usage digest to obtain the strings contained in the usage digest.
[0243] S10632: For each extracted string, if the authorization digest contains a string that is the same as the string, determine the matching degree corresponding to the string as the first value.
[0244] S10633: If the authorization digest does not contain a string that is the same as the string, extract a continuous string of the second preset length from the string to obtain the substrings contained in the string.
[0245] S10634: For each substring contained in the string, if the authorization digest does not contain a string that is the same as the substring, determine the matching degree corresponding to the substring as the second value.
[0246] S10635: If the authorization digest contains a string that is the same as the substring, calculate the matching degree corresponding to the substring based on the number of characters contained in the substring, the number of characters contained in the string, the number of characters contained in the authorization digest, and the number of times the string that is the same as the substring appears in the authorization digest.
[0247] S10636: Calculate the sum of the matching scores of each substring contained in the string, and calculate the ratio of the sum to the number of each substring contained in the string to obtain the matching score of the string.
[0248] S10637: Calculate the difference between the usage digest and the authorization digest based on the matching degree of each string contained in the usage digest and the number of strings contained in the usage digest.
[0249] Electronic devices can extract strings from digests based on N-grams. N-gram is a method in NLP (Natural Language Processing) algorithms for extracting a sequence of N items from a given text. Items can be letters, words, etc. When N=1, it is called a unigram; when N=2, it is called a bigram; when N=3, it is called a trigram, and so on. N is a first preset length in this embodiment of the disclosure.
[0250] Taking a trigram (i.e., N=3) as an example, the electronic device starts from the first character in the usage digest, extracts the 1st to 3rd characters to obtain a string, extracts the 2nd to 4th characters to obtain a string, extracts the 3rd to 6th characters to obtain a string, and so on, until the (n-2)th to nth characters are extracted to obtain a string, thus obtaining multiple strings contained in the usage digest. n represents the number of characters contained in the usage digest.
[0251] For each string contained in the usage digest, it is determined whether the authorization digest contains a string that is the same as that string. If the authorization digest contains a string that is the same as that string, the electronic device determines the matching degree corresponding to that string as the first value, which can be 1.
[0252] If the authorization digest does not contain a string identical to the given string, the electronic device extracts a continuous string of a second preset length from the given string to obtain the substrings contained within the given string. The second preset length is less than the first preset length.
[0253] For example, if the string is "abc" and the second preset length is 1, then the substrings contained in the string are: a, b, c. If the second preset length is 2, then the substrings contained in the string are ab, bc. It should be noted that ac is not a continuous substring because it is not consecutive.
[0254] For each substring contained in the string, if the authorized digest does not contain a string that is the same as the substring, the electronic device determines the matching degree corresponding to the substring as a second value. The second value can be a small value, for example, the second value is 0.
[0255] If the authorization digest contains a string that is the same as the substring, the electronic device calculates the matching degree corresponding to the substring based on the following formula (5).
[0256]
[0257] d represents the matching degree of the substring; X represents the number of characters contained in the substring; Y represents the number of characters contained in the substring; P represents the number of characters contained in the authorization digest; C represents the number of times the same string as the substring appears in the authorization digest.
[0258] For each string contained in the digest, after calculating the matching degree corresponding to each substring contained in the string, the electronic device calculates the sum of the matching degrees corresponding to each substring contained in the string, and calculates the ratio of the sum to the number of substrings contained in the string to obtain the matching degree corresponding to the string.
[0259] Furthermore, after calculating the matching degree of each string contained in the usage digest, the electronic device calculates the difference between the usage digest and the authorization digest based on the following formula (6).
[0260]
[0261] b represents the difference between the used summary and the authorized summary; sum represents the summation function; d i This indicates the matching degree corresponding to the i-th string contained in the summary; sumd i This represents the sum of the matching scores for each string included in the digest; S represents the number of strings included in the digest.
[0262] The matching score for a substring represents the degree of difference between that substring and the authorization digest, and the matching score for a string represents the degree of difference between that string and the authorization digest. Accordingly, the difference value between the usage digest and the authorization digest calculated based on the matching scores of each string can represent the degree of difference between the usage digest and the authorization digest. The lower the degree of difference between the usage digest and the authorization digest, the lower the difference between the usage scenario of the target user profile represented by the usage digest and the usage scenario of the target user profile represented by the authorization digest. In other words, the higher the probability that the usage scenario of the target user profile represented by the usage digest is the same as that of the target user profile represented by the authorization digest, and the higher the probability that the user has the right to use the target user profile.
[0263] Therefore, when the difference between the use summary and the authorized summary is greater than a preset threshold, the electronic device determines that the user does not have the right to use the target user profile; when the difference between the use summary and the authorized summary is not greater than the preset threshold, the electronic device determines that the user has the right to use the target user profile.
[0264] In cases where a user lacks the right to use the target user profile, to avoid infringing on the user's rights and privacy and to improve the security of the user profile, the electronic device (i.e., the first electronic device) determines the target user information corresponding to the target user identifier, obtaining the target user information of the target user to which the target user profile belongs. The target user information may include the target user's name and the IP address of the electronic device used by the target user (i.e., the second electronic device). Then, based on the IP address of the second electronic device, the first electronic device sends an alarm message to the second electronic device used by the target user to notify the target user of the user's request to use the target user profile. The alarm message may carry the user identifier, usage summary, the identifier of the target user profile, and an identifier indicating that the user does not have the right to use the target user profile.
[0265] When a user has the right to use the target user profile, the first electronic device sends the target user profile to the electronic device used by the user (which can be referred to as the third electronic device). The third electronic device can be a terminal, server, etc. While sending the target user profile to the third electronic device, the first electronic device can also send a reminder message to the second electronic device to notify the target user of the user's usage of the target user profile. The reminder message may include a user identifier, a usage summary, an identifier for the target user profile, and an identifier indicating that the user has the right to use the target user profile.
[0266] Based on the above processing, it can be determined whether the user has the right to use the target user profile. If the user does not have the right to use the target user profile, an alarm message is sent to the electronic device used by the target user to remind the target user of the user's request to use the target user profile. If the user has the right to use the target user profile, the target user profile is sent to the electronic device used by the user. This can prevent the user profile from being used without the user's knowledge, thereby avoiding infringement on the user's rights and privacy and improving the security of the user profile.
[0267] After generating the target user profile, the electronic device can also obtain the target user's user identifier (i.e., the target user identifier) and record the target user identifier and the target user profile accordingly.
[0268] In one implementation, the electronic device can directly obtain a number pre-assigned to the target user as the target user identifier.
[0269] In another implementation, Figure 4 Based on this, see Figure 7 After step S104, the method may further include the following steps:
[0270] S109: Generate the target user's DID according to the preset DID generation rules and the target user's user information, and use it as the target DID.
[0271] S110: Based on the generation time of the specified user profile of the target user, the target user's ID and target DID, generate the user identifier of the target user as the target user identifier.
[0272] S111: Corresponds to the target user identifier and target user profile.
[0273] The target user's information includes: the target user's name, age, gender, occupation, and the number assigned to the target user.
[0274] Electronic devices generate a DID document for the target user based on preset DID (Decentralized Identifier) generation rules and the target user's user information. The preset DID generation rules can be the DID document generation method provided by the W3C (World Wide Web Consortium).
[0275] A DID document is a JSON-LD object (a method of representing and transmitting interconnected data based on JSON). A DID document consists of six parts: a DID identifier, a set of cryptographic materials (such as a public key), a set of cryptographic protocols, a set of server endpoints, a timestamp, and an optional JSON-LD signature used to prove that the DID document is valid.
[0276] Electronic devices obtain the DID identifier from the DID document and use it as the target DID for the target user.
[0277] If no user profile for the target user in the target profile dimension has been generated before generating the target user profile, then the specified user profile is the target user profile. If a user profile for the target user in the target profile dimension has been generated before generating the target user profile, then the specified user profile can be any of the generated user profiles, such as the user profile generated earliest.
[0278] Electronic devices can record user identifiers and user profiles for each user. When generating user identifiers for each user, electronic devices can also record user identifiers and user information for each user. This allows for the correspondence between user identifier sets and user information sets, enabling the association of user profiles and user information through user identifiers, thereby improving the security of user profiles.
[0279] In some embodiments, Figure 7 Based on this, see Figure 8 Step S110 may include the following steps:
[0280] S1101: Hash the generation time of the specified user profile of the target user to obtain the hash value of the generation time of the specified user profile, and hash the ID of the target user to obtain the hash value of the ID of the target user.
[0281] S1102: Concatenate the hash value of the generation time of the specified user profile and the hash value of the target user's ID to obtain a hash value string.
[0282] S1103: Generate the target user's identifier based on the hash string and the target DID, and use it as the target user identifier.
[0283] The electronic device obtains the generation time of a specified user profile of the target user and the target user's ID. It then hashes the generation time of the specified user profile to obtain a hash value, and hashes the target user's ID to obtain a hash value. Finally, the electronic device concatenates the hash values of the generation time of the specified user profile and the target user's ID to obtain a hash string.
[0284] In one implementation, the electronic device can concatenate the obtained hash value string and the target DID, and use the concatenated result as the target user identifier. Alternatively, when the hash value string and the target DID contain the same number of characters, the electronic device can calculate the weighted sum of each character in the hash value string and the corresponding character in the target DID to obtain the target user identifier.
[0285] In another implementation, Figure 8 Based on this, see Figure 9 Step S1103 may include the following steps:
[0286] S11031: If the number of characters in the hash string is not greater than the number of characters in the target DID, for each character in the hash string, determine the position of the character in the hash string according to the order of the characters in the hash string from high to low.
[0287] S11032: According to the order of characters in the target DID from high to low, determine the character in the target DID that is at the same position as the character, and obtain the character corresponding to the character in the target DID; calculate the remainder between the character and the corresponding character in the target DID to obtain the user identifier of the target user, which is used as the target user identifier.
[0288] S11033: If the number of characters in the hash string is greater than the number of characters in the target DID, determine the character that has a character at the corresponding position in the target DID according to the order of the characters in the hash string from high to low, and take it as the first character. Also determine the other characters in the hash string besides the first character, and take them as the second character.
[0289] S11034: For each character in the target DID, count the number of times that character appears.
[0290] S11035: For each first character, determine the position of the first character in the hash value string according to the order of characters in the hash value string from high to low; determine the character in the target DID that is at the same position as the first character according to the order of characters in the target DID from high to low, and obtain the character corresponding to the first character in the target DID; calculate the remainder between the first character and the character corresponding to the target DID, and use it as the first remainder.
[0291] S11036: For each second character, determine the position of the second character in the hash string according to the order of the characters contained in the hash string from low to high; determine the character in the corresponding sorting result that is at the same position as the second character according to the order of the occurrence frequency of the characters contained in the target DID from high to low, and obtain the character corresponding to the second character in the target DID; calculate the remainder between the second character and the character corresponding to the target DID, and obtain the second remainder.
[0292] S11037: Generate a user identifier for the target user that includes the first remainder and the second remainder, and use it as the target user identifier.
[0293] For example, if the hash string is [0, 2, 5, 3, 2, 2] and the target DID is [0, 1, 3, 5, 3, 3], and the number of characters in the hash string is the same as the number of characters in the target DID, the electronic device calculates the remainder of the first character (i.e., 0) in the hash string and the first character (i.e., 0) in the target DID in descending order of the high-order bits. If the remainder is 0, the remainder of the second character (i.e., 2) in the hash string and the first character (i.e., 1) in the target DID is calculated. This process continues until the remainder of the sixth character (i.e., 2) in the hash string and the sixth character (i.e., 3) in the target DID is calculated. If the remainder is 2, the target user identifier is obtained as [0, 0, 2, 3, 2, 2].
[0294] If the hash string is [0, 2, 5, 3, 2] and the target DID is [0, 1, 3, 5, 3, 3], and the number of characters in the hash string is less than the number of characters in the target DID, the electronic device calculates the remainder of the first character (i.e., 0) in the hash string and the first character (i.e., 0) in the target DID in descending order of the high-order bits. If the remainder is 0, the remainder of the second character (i.e., 2) in the hash string and the first character (i.e., 1) in the target DID is 0, and so on, until the remainder of the fifth character (i.e., 2) in the hash string and the fifth character (i.e., 3) in the target DID is 2. The target user identifier is then obtained as [0, 0, 2, 3, 2].
[0295] If the hash string is [0, 2, 5, 3, 2, 6, 9, 7] and the target DID is [1, 1, 3, 5, 3, 3], and the number of characters in the hash string is greater than the number of characters in the target DID, the electronic device determines, from the most significant bit to the least significant bit, that the characters present at the corresponding positions in the target DID include: 0, 2, 5, 3, 2, 6, which means the first character includes 0, 2, 5, 3, 2, 6. The electronic device also determines that the other characters in the hash string besides the first character include 9, which means the second character includes 9, 7.
[0296] Then, the electronic device calculates the remainder of the first character (i.e., 0) in the hash string and the first character (i.e., 0) in the target DID, and finds it to be 0. It calculates the remainder of the second character (i.e., 2) in the hash string and the first character (i.e., 1) in the target DID, and so on, until the remainder of the sixth character (i.e., 6) in the hash string and the sixth character (i.e., 3) in the target DID is found to be 0. The first remainders are: 0, 0, 2, 3, 0.
[0297] The electronic device determines that the number of occurrences of 3 in the target DID is 3, 1 is 2, and 5 is 1. Therefore, the sorting result based on the frequency of occurrence of the characters in the target DID from highest to lowest is: 3, 1, 5. The electronic device then determines the first second character (i.e., 7) based on the frequency of occurrence of the characters in the hash string from lowest to highest. The first character in the sorting result based on the frequency of occurrence of the characters in the target DID is 3. The electronic device calculates the remainder when dividing 3 by 7, which is 3. Finally, the electronic device determines the second second character (i.e., 9) based on the frequency of occurrence of the characters in the hash string from lowest to highest. The second character in the sorting result based on the frequency of occurrence of the characters in the target DID is 1. The remainder when dividing 9 by 1 is 0. Therefore, the second remainder includes: 3, 0.
[0298] Then, the electronic device concatenates the first remainder and the second remainder to obtain the target user identifier as: [0, 0, 2, 3, 0, 3, 0].
[0299] Based on the above processing, a target DID for the target user can be generated. This target DID is independent of any centralized registry, identity provider, or certificate authority; it is a globally unique identifier with characteristics of global uniqueness, high resolvability, encryption capability, and cryptographic verification. The target user identifier generated based on the target DID has high security, which further enhances the security of the user profile.
[0300] In one implementation, the electronic device can directly store the target user identifier and the corresponding target user profile in a preset database. Furthermore, the electronic device also records the correspondence between the target user identifier and the target user information, allowing for association between the target user identifier, target user information, and target user profile, thereby improving the security of the user profile.
[0301] In another implementation, to improve the security of user profiles, electronic devices can store target user profiles on a pre-defined blockchain. Correspondingly, in... Figure 7 Based on this, see Figure 10 Step S111 may include the following steps:
[0302] S1111: Determine whether the correspondence between the user identifier and the user node stored in the portrait node contains the target user identifier. If yes, proceed to step S1112; otherwise, proceed to step S1113.
[0303] Among them, the profile node is the head node of the preset user blockchain; the user node is the non-head node of the user blockchain; a user node is used to store the user information of the corresponding user.
[0304] S1112: Determine the user node corresponding to the target user identifier and obtain the target user's user node; create a new linked list node after the last linked list node of the profile blockchain with the target user's user node as the head node, and store the target user profile in the newly created linked list node.
[0305] S1113: Create a new user node after the last user node in the user blockchain as the target user's user node, and record the target user identifier and the target user's user node in the corresponding relationship; create a profile blockchain with the target user's user node as the head node; the newly created profile blockchain contains a newly created linked list node in addition to the head node; store the target user profile in the newly created linked list node.
[0306] The electronic device is equipped with a pre-defined blockchain, which includes a user blockchain and a profile blockchain. The head node of the user blockchain is the profile node, which records the correspondence between the user's identifier and the user node. The non-head nodes of the user blockchain are user nodes, each of which records the user's information and the correspondence between the user's profile and the linked list nodes.
[0307] The profile blockchain corresponds to the user. The head node of a user's profile blockchain is the user node of that user, and the non-head nodes in the profile blockchain are linked list nodes. The linked list nodes are used to store the user profile of the user.
[0308] For example, see Figure 11 , Figure 11 This is a schematic diagram of a blockchain structure provided in an embodiment of this disclosure. The user blockchain is: profile node - user node 1 - user node 2 - user node 3. User node 1 is the user node of user 1, user node 2 is the user node of user 2, and user node 3 is the user node of user 3.
[0309] The profile blockchain includes: the profile blockchain corresponding to user 1, namely user node 1 - chain node 1 - chain node 2 - chain node 3; the profile blockchain corresponding to user 2, namely user node 2 - chain node 4; and the profile blockchain corresponding to user 3, namely user node 3 - chain node 5 - chain node 6.
[0310] After generating the target user profile, the electronic device determines whether the correspondence between the user identifier and the user node stored in the profile node contains the target user identifier. If the correspondence stored in the profile node contains the target user identifier, it means that the target user's user profile has been generated, that is, the profile blockchain corresponding to the target user has been generated. Then, the electronic device determines the user node corresponding to the target user identifier in the correspondence, that is, the target user's user node. The profile blockchain with the target user's user node as the head node is the profile blockchain corresponding to the target user.
[0311] The electronic device creates a new linked list node after the last linked list node in the profile blockchain headed by the target user's user node, and stores the target user's profile in this newly created linked list node. The electronic device can also record the correspondence between the target user's profile and the newly created linked list node within the target user's user node.
[0312] If the mapping stored in the profile node does not contain the target user identifier, it indicates that no user profile for the target user has been generated, meaning no user node for the target user has been generated. In this case, the electronic device creates a new user node after the last user node in the user blockchain, serving as the target user's user node, and records the target user identifier and the target user's user node in the mapping. The mapping between user identifiers and user nodes represents the mapping between the user identifier set and the user information set. The electronic device can also record the mapping between the target user profile and the newly created linked list node in the target user's user node.
[0313] Then, the electronic device creates a new profile blockchain with the target user's user node as the head node. This new profile blockchain contains a head node (i.e., the target user's user node) and a new linked list node. The electronic device stores the target user's profile in this new linked list node.
[0314] In some embodiments, the step of an electronic device storing a target user profile into the newly created linked list node includes the following steps: generating a two-dimensional array containing the target user profile and the generation time of the target user profile, and storing the two-dimensional array into the newly created linked list node.
[0315] The electronic device generates a two-dimensional array containing the target user profile and the generation time of the target user profile. One dimension of this two-dimensional array is the generation time of the target user profile, and the other dimension is the target user profile. The electronic device then stores this two-dimensional array into a newly created linked list node.
[0316] Based on the above processing, the user profile of the target user is associated with a user node that uniquely represents the user in the profile blockchain. Through this user node, the user profile can be assigned the user's identity information. The user's identity information serves as the user's identifier, which means that the user profile can be associated with the user's identity information. Based on the user's identity information, the ownership of the user profile is bound to it. Therefore, when using the user profile, the user can be informed of the usage behavior of the user profile through this association. The user profile can only be used after the user authorizes the usage behavior, which ensures that the user's rights and privacy are not violated and can improve the security of the user profile.
[0317] In some embodiments, the electronic device may also obtain the target user profile before sending the target user profile to the electronic device used by the user.
[0318] In one implementation, if the electronic device directly stores the target user identifier and the target user profile in a preset database, then the electronic device directly retrieves the target user profile corresponding to the target user identifier from the preset database.
[0319] In another implementation, Figure 10 Based on this, see Figure 12 Before step S108, the method may further include the following steps:
[0320] S112: In the correspondence between user identifiers and user nodes recorded in the profile node, determine the user node corresponding to the target user identifier to obtain the user node of the target user.
[0321] S113: Determine the linked list node corresponding to the target user profile in the correspondence between the user profile and the linked list node recorded in the user node record of the target user.
[0322] S114: Obtain the target user profile from the determined linked list nodes.
[0323] If an electronic device stores the target user profile in the corresponding profile blockchain, the electronic device can determine the user node corresponding to the target user identifier from the correspondence between user identifiers and user nodes recorded in the profile node, and thus obtain the target user's user node.
[0324] Then, the electronic device can determine the profile blockchain with the user node of the target user as the head node, traverse the profile blockchain to obtain the linked list node that stores the profile of the target user in the profile blockchain, and retrieve the profile of the target user from the linked list node.
[0325] Alternatively, the electronic device can determine the linked list node corresponding to the target user profile from the correspondence between the user profile and the linked list node recorded in the user node of the target user, and obtain the target user profile from the determined linked list node.
[0326] See Figure 13 , Figure 13 A flowchart of another user profile management method provided in this embodiment of the disclosure.
[0327] Step 1: Obtain user data.
[0328] Since various applications used by users store user data on the blockchain, electronic devices can obtain individual user data from mainstream public blockchains. Then, the electronic devices can store this user data in a pre-defined database using a wide data table. Furthermore, the electronic devices can retrieve the target user's user data from this pre-defined database.
[0329] Step 2: Determine the dimensions of the profile.
[0330] Based on the target user's basic information, the electronic device determines the target user category and obtains the target profile dimension corresponding to the target user category.
[0331] Step 3: Create user profiles based on the profile dimensions.
[0332] Electronic devices process user data of target users in the target profile dimension to generate target user profiles of target users in the target profile dimension.
[0333] Step 4: Store the user profile in the profile blockchain and configure the user's identity for the user profile, so that the user has the right to conduct business activities based on the user profile based on the identity.
[0334] Electronic devices store the target user profile of the target user in a profile blockchain with the target user's user node as the head node, and record the correspondence between the target user identifier and the target user's user node. This allows the target user identifier to be associated with the profile blockchain that stores the target user's user profile, thus associating the target user profile with the target user's identity information. The target user's identity information can serve as the target user identifier, enabling the target user to enjoy the right to conduct commercial activities based on the target user profile.
[0335] Step 5: Determine the ownership of the user profile through the user's identity, and then use the user profile based on the ownership.
[0336] Upon receiving a user's request to use a target user profile, the system identifies the target user (i.e., the target user identifier) who owns the target user profile, and determines whether the user has the right to use the target user profile based on this identification. If the user has the right to use the target user profile, an alarm message is sent to the electronic device used by the target user. The system also sends the target user profile to the user's electronic device.
[0337] Based on the above processing, user profiles can be associated with user identity information, and ownership of the user profile can be bound to the user based on the user's identity information. Then, when using the user profile, the user can be informed of the usage behavior of the user profile through this association. The user profile can only be used after the user authorizes the usage behavior, which ensures that the user's rights and privacy are not violated and can improve the security of the user profile.
[0338] See Figure 14 , Figure 14 A flowchart of another user profile management method provided in this embodiment of the disclosure.
[0339] Step 1: Obtain user data.
[0340] Since various applications used by users store user data on the blockchain, electronic devices can obtain individual user data from mainstream public blockchains. Then, the electronic devices can store this user data in a pre-defined database using a wide data table. Furthermore, the electronic devices can retrieve the target user's user data from this pre-defined database.
[0341] Step 2: Determine the profile dimensions based on user data.
[0342] Electronic devices determine the target user category based on the target user's basic information and obtain the target profile dimensions corresponding to the target user category. The target profile dimensions are determined based on the user data of each user included in the target user category.
[0343] Step 3: Create user profiles based on profile dimensions, user data, and time attributes.
[0344] Electronic devices process user data of the target user in the target profile dimension to generate an initial user profile of the target user in the target profile dimension. Based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the time weight (i.e., time attribute) of the initial user profile is calculated. The calculated time weight and the initial user profile are determined as the final target user profile of the target user.
[0345] Step 4: Store the user profile in the profile blockchain and configure the user's identity for the user profile, so that the user has the right to engage in commercial activities based on the user profile based on the identity.
[0346] Electronic devices store the target user profile of the target user in a profile blockchain with the target user's user node as the head node, and record the correspondence between the target user identifier and the target user's user node. This allows the target user identifier to be associated with the profile blockchain that stores the target user's user profile, thus associating the target user profile with the target user's identity information. The target user's identity information can serve as the target user identifier, enabling the target user to enjoy the right to conduct commercial activities based on the target user profile.
[0347] Step 5: Use user profiles based on user identities.
[0348] Upon receiving a user's request to use a target user profile, the system identifies the target user who owns the profile and determines whether the user has the right to use it. If the user has the right to use the profile, an alarm message is sent to the target user's electronic device. The system also sends the target user profile to the user's electronic device.
[0349] Based on the above processing, the time weight of a user's profile in each profile dimension can be determined. This time weight describes the changing trend of the importance of a user's characteristics in that profile dimension over time, thus reflecting the personalized differences caused by time characteristics in the user profile generation process. Furthermore, by constructing a profile blockchain, the binding of user profiles with user identity information is achieved. When using user profiles, users are notified of the usage of the user profile through their identity information. The use of the user profile is only permitted after the user authorizes the use, ensuring that user rights and privacy are not violated and improving the security of user profiles.
[0350] See Figure 15 , Figure 15 A flowchart of another user profile management method provided in this embodiment of the disclosure.
[0351] Step 1: Obtain user data.
[0352] Since various applications used by users store user data on the blockchain, electronic devices can obtain individual user data from mainstream public blockchains. Then, the electronic devices can store this user data in a pre-defined database using a wide data table. Furthermore, the electronic devices can retrieve the target user's user data from this pre-defined database.
[0353] Step 2: Determine the dimensions of the profile.
[0354] Electronic devices determine the target user category based on the target user's basic information and obtain the target profile dimensions corresponding to the target user category. The target profile dimensions are determined based on the user data of each user included in the target user category.
[0355] Step 3: Create user profiles based on the profile dimensions.
[0356] Electronic devices process user data of target users in the target profile dimension to generate target user profiles of target users in the target profile dimension.
[0357] Step 4: Configure the digital identity of the user profile based on the DID, so that the user has the right to engage in commercial activities based on the user profile using this digital identity.
[0358] Electronic devices generate a target user's target DID and generate a target user identifier based on the target DID. The target user identifier is used as the target user's digital identity. Then, the target user's digital identity is associated with the target user profile, which enables the target user to enjoy the right to conduct business activities based on the target user profile.
[0359] Step 5: Use the DID to create user profiles.
[0360] Upon receiving a user's request to use a target user profile, the system identifies the target user's digital identity (i.e., target user identifier) who owns the target user profile. Based on the target user's digital identity, it determines whether the user has the right to use the target user profile; that is, it determines whether the user has the right to use the target user profile based on the target user information corresponding to the target user identifier. If the user has the right to use the target user profile, an alarm message is sent to the electronic device used by the target user. The system also sends the target user profile to the electronic device used by the user.
[0361] Based on the above processing, a user's DID can be generated, and a user identifier can be generated based on the DID. This user identifier can then be used to identify the owner of the user profile. When using a user profile, the user identifier identifies the identity information of the user who owns the profile. This identity information is then used to notify the user about the use of the profile. Use of the user profile is only permitted after the user authorizes the use, ensuring that user rights and privacy are not violated and improving the security of the user profile.
[0362] and Figure 1 For the corresponding method implementation examples, see [link to relevant documentation]. Figure 16 , Figure 16 This is a structural diagram of a user profile generation device provided in an embodiment of the present disclosure. The device includes:
[0363] The profile dimension determination module 1601 is used to determine the profile dimension corresponding to the target user based on the user information of the target user, and use it as the target profile dimension;
[0364] The initial user profile generation module 1602 is used to generate a user profile of the target user in the target profile dimension based on the user data of the target user in the target profile dimension, as an initial user profile;
[0365] The time weight calculation module 1603 is used to calculate the time weight of the initial user profile based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0366] The target user profile generation module 1604 is used to determine the calculated time weight and the initial user profile as the final user profile of the target user, which is used as the target user profile.
[0367] In some embodiments, the time weight calculation module 1603 is specifically used to determine whether a user profile of the target user in the target profile dimension has been generated before the initial profile is generated;
[0368] If no user profile of the target user in the target profile dimension has been generated before the initial profile is generated, the time weight of the initial user profile is calculated based on the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0369] If a user profile of the target user in the target profile dimension has been generated before the initial profile is generated, obtain the time weight of each user profile of the target user in the target profile dimension; determine the time weight at the inflection point in the trend of the time weight of each user profile according to the order of their generation time, and use it as the target time weight; calculate the time weight of the initial user profile based on the target time weight, the number of time weights of each user profile, the duration of the target time period corresponding to the user data of the target user, and the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period.
[0370] In some embodiments, the time weight calculation module 1603 is specifically used to calculate a reference time weight based on the duration of the target time period corresponding to the user data of the target user, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, and the time weight of the first user profile in each user profile according to the order of generation time of each user profile.
[0371] If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile increases from the target time weight according to the order of their generation time, the initial user profile's time weight is calculated based on the duration of the target time period corresponding to the target user's user data, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0372] If the reference time weight is not less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight to the first user profile in the target time period according to the order of the generation time of each user profile, the time weight of the initial user profile is calculated based on the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0373] If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile decreases from the target time weight according to the order of their generation time, the initial user profile's time weight is calculated based on the duration of the target time period corresponding to the target user's user data, the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the number of user profiles, and the number of time weights from the first user profile in each user profile to the target time weight according to the order of their generation time.
[0374] If the reference time weight is less than the third value, and the time weight of the first user profile in each user profile increases in the order of their generation time to the target time weight, the time weight of the initial user profile is calculated based on the duration between the time when the target user first engages in user behavior and the time when the target user last engages in user behavior within the target time period, the duration of the target time period corresponding to the user data of the target user, and the largest absolute difference among the differences between two adjacent time weights in each user profile.
[0375] In some embodiments, the apparatus further includes:
[0376] The extraction module is used to, after the target user profile generation module 1604 determines that the calculated time weight and the initial user profile are the final user profile of the target user as the target user profile, extract the user identifier carried in the usage request as the user identifier after receiving the usage request for the target user profile, and extract the usage summary carried in the usage request; wherein, the usage summary represents the usage scenario in which the user obtains the target user profile;
[0377] The right-to-use determination module is used to determine whether the user has the right to use the target user profile based on the user identifier, the usage summary and the user information of the target user.
[0378] The alarm message sending module is used to send an alarm message to the electronic device used by the target user if the user does not have the right to use the target user profile, so as to remind the target user of the user's request to use the target user profile this time;
[0379] The user profile sending module is used to send the target user profile to the electronic device used by the user if the user has the right to use the target user profile.
[0380] In some embodiments, the user information of the target user includes: the Internet Protocol (IP) address of the electronic device used by the target user;
[0381] The usage right determination module is specifically used to send an inquiry message based on the target user profile to the electronic device used by the target user according to the IP address of the electronic device used by the target user; wherein the inquiry message carries the user identifier and the usage summary;
[0382] Upon receiving a confirmation authorization message from the electronic device used by the target user, it is determined that the user has the right to use the target user profile;
[0383] Upon receiving a deauthorization message from the electronic device used by the target user, it is determined that the user does not have the right to use the target user profile.
[0384] In some embodiments, the user information of the target user includes: a list of authorized users and an authorization summary for the target user profile; wherein, the list of authorized users includes user identifiers of each user authorized by the target user to use the target user profile; and the authorization summary indicates the usage scenario in which the target user authorizes the use of the target user profile.
[0385] The right-to-use determination module is specifically used to determine whether the user identifier is included in the authorized list;
[0386] If the user identifier is not included in the authorized list, it is determined that the user does not have the right to use the target user profile;
[0387] If the authorized list contains the user identifier, calculate the difference between the usage summary and the authorization summary; if the difference is greater than a preset threshold, determine that the user does not have the right to use the target user profile; if the difference is not greater than the preset threshold, determine that the user has the right to use the target user profile.
[0388] In some embodiments, the right-of-use determination module is specifically used to extract continuous strings of a first preset length from the use digest to obtain the strings contained in the use digest;
[0389] For each extracted string, if the authorization digest contains a string that is identical to that string, the matching degree corresponding to that string is determined to be the first value;
[0390] If the authorization digest does not contain a string identical to the given string, extract consecutive strings of a second preset length from the given string to obtain each substring contained in the given string; for each substring contained in the given string, if the authorization digest does not contain a string identical to the given substring, determine the matching degree corresponding to the substring as a second value; if the authorization digest contains a string identical to the given substring, calculate the matching degree corresponding to the substring based on the number of characters contained in the substring, the number of characters contained in the given string, the number of characters contained in the authorization digest, and the number of times the string identical to the given substring appears in the authorization digest; calculate the sum of the matching degrees corresponding to each substring contained in the given string, and calculate the ratio of the sum to the number of each substring contained in the given string to obtain the matching degree corresponding to the given string;
[0391] Based on the matching degree of each string contained in the usage digest and the number of strings contained in the usage digest, the difference value between the usage digest and the authorization digest is calculated.
[0392] In some embodiments, the apparatus further includes:
[0393] The DID generation module is used to, after the target user profile generation module 1604 determines the calculated time weight and the initial user profile as the final user profile of the target user, and uses it as the target user profile, generate the DID of the target user according to the preset Distributed Identifier (DID) generation rules and the user information of the target user, and use it as the target DID.
[0394] The user identifier generation module is used to generate a user identifier for the target user based on the generation time of the specified user profile of the target user, the number of the target user, and the target DID, and use it as the target user identifier;
[0395] The recording module is used to record the target user identifier and the target user profile.
[0396] In some embodiments, the user identifier generation module is specifically used to perform hash processing on the generation time of the specified user profile of the target user to obtain the hash value of the generation time of the specified user profile, and to perform hash processing on the number of the target user to obtain the hash value of the number of the target user;
[0397] The hash value of the generation time of the specified user profile and the hash value of the target user's ID are concatenated to obtain a hash value string;
[0398] Based on the hash string and the target DID, a user identifier for the target user is generated and used as the target user identifier.
[0399] In some embodiments, the user identifier generation module is specifically configured to: if the number of characters contained in the hash string is not greater than the number of characters contained in the target DID, for each character in the hash string, determine the position of the character in the hash string according to the order of the characters in the hash string from high to low; determine the character in the target DID that is at the same position as the character according to the order of the characters in the target DID from high to low, and obtain the character corresponding to the character in the target DID; calculate the remainder between the character and the character corresponding to the character in the target DID to obtain the user identifier of the target user, which is used as the target user identifier;
[0400] If the number of characters in the hash string is greater than the number of characters in the target DID, the character that appears at the corresponding position in the target DID is determined according to the order of the characters in the hash string from most significant to least significant, and is designated as the first character. All other characters in the hash string besides the first character are designated as second characters. For each character in the target DID, the frequency of its occurrence is counted. For each first character, its position in the hash string is determined according to the order of the characters in the hash string from most significant to least significant. The character at the same position in the target DID as the first character is determined according to the order of the characters in the target DID from most significant to least significant, thus obtaining... The first character corresponds to the character in the target DID; the remainder between the first character and the character corresponding to the target DID is calculated as the first remainder; for each second character, the position of the second character in the hash value string is determined according to the order of the characters contained in the hash value string from low to high; the character in the corresponding sorting result that is at the same position as the second character is determined according to the order of the occurrence frequency of the characters contained in the target DID from high to low, thus obtaining the character corresponding to the second character in the target DID; the remainder between the second character and the character corresponding to the target DID is calculated as the second remainder; a user identifier of the target user containing the first remainder and the second remainder is generated as the target user identifier.
[0401] In some embodiments, the recording module is specifically used to determine whether the target user identifier is included in the correspondence between user identifiers and user nodes stored in the profile node; wherein, the profile node is the head node of a preset user blockchain; the user node is a non-head node of the user blockchain; and a user node is used to store the user information of the corresponding user.
[0402] If the correspondence contains the target user identifier, determine the user node corresponding to the target user identifier to obtain the user node of the target user; create a new linked list node after the last linked list node of the profile blockchain with the user node of the target user as the head node, and store the target user profile in the newly created linked list node;
[0403] If the correspondence does not contain the target user identifier, a new user node is created after the last user node in the user blockchain as the target user's user node, and the target user identifier and the target user's user node are recorded in the correspondence. A profile blockchain is created with the target user's user node as the head node. The newly created profile blockchain contains a newly created linked list node in addition to the head node. The target user profile is stored in the newly created linked list node.
[0404] In some embodiments, the recording module is specifically used to generate a two-dimensional array containing the target user profile and the generation time of the target user profile, and store the two-dimensional array in the newly created linked list node.
[0405] In some embodiments, the apparatus further includes:
[0406] The user node determination module is used to determine the user node corresponding to the target user identifier from the correspondence between the user identifier and the user node recorded in the profile node before the user profile sending module sends the target user profile to the electronic device used by the user.
[0407] The linked list node determination module is used to determine the linked list node corresponding to the target user profile in the correspondence between the user profile recorded in the user node of the target user and the linked list node.
[0408] The user profile acquisition module is used to obtain the target user profile from the determined linked list nodes.
[0409] Based on the user profile generation apparatus provided in this disclosure, the time weight of the initial user profile can represent the importance of user data in the target profile dimension within the target time period, that is, the importance of user characteristics of the target user in the target profile dimension. Thus, the time weight of each user profile of the target user generated at different times can represent the change in the importance of user characteristics of the target user in the target profile dimension over time. In other words, it can generate user profiles with time characteristics, which can improve the effectiveness of user profiles.
[0410] This disclosure also provides an electronic device, such as... Figure 17 As shown, it includes a processor 1701, a communication interface 1702, a memory 1703, and a communication bus 1704. The processor 1701, the communication interface 1702, and the memory 1703 communicate with each other through the communication bus 1704.
[0411] Memory 1703 is used to store computer programs;
[0412] When the processor 1701 executes the program stored in the memory 1703, it implements the user profile generation method steps described in any of the above embodiments.
[0413] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0414] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0415] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0416] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0417] In another embodiment provided in this disclosure, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described user profile generation methods.
[0418] In yet another embodiment provided in this disclosure, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the user profile generation methods described above.
[0419] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as 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 this disclosure 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. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0420] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0421] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0422] The above description is merely a preferred embodiment of this disclosure and is not intended to limit the scope of protection of this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure are included within the scope of protection of this disclosure.
Claims
1. A user profiling method, characterized by, The method comprises: determining, based on user information of a target user, a portrait dimension corresponding to the target user as a target portrait dimension; generating, based on user data of the target user in the target portrait dimension, a user portrait of the target user in the target portrait dimension as an initial user portrait; calculating a time weight of the initial user portrait based on a time length of a target time period corresponding to the user data of the target user and a time length between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior within the target time period; determining the calculated time weight and the initial user portrait as a final user portrait of the target user as a target user portrait.
2. The method of claim 1, wherein, The method comprises: determining, based on user information of a target user, a portrait dimension corresponding to the target user as a target portrait dimension; generating, based on user data of the target user in the target portrait dimension, a user portrait of the target user in the target portrait dimension as an initial user portrait; calculating a time weight of the initial user portrait based on a time length of a target time period corresponding to the user data of the target user and a time length between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior within the target time period; 3. The method of claim 2, wherein, determining the calculated time weight and the initial user portrait as a final user portrait of the target user as a target user portrait. The method comprises: determining, based on user information of a target user, a portrait dimension corresponding to the target user as a target portrait dimension; generating, based on user data of the target user in the target portrait dimension, a user portrait of the target user in the target portrait dimension as an initial user portrait; calculating a time weight of the initial user portrait based on a time length of a target time period corresponding to the user data of the target user and a time length between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior within the target time period; determining the calculated time weight and the initial user portrait as a final user portrait of the target user as a target user portrait. The method comprises: calculating a reference time weight based on the time length of the target time period corresponding to the user data of the target user, the time length between the time when the target user first performs the user behavior and the time when the target user last performs the user behavior within the target time period, and the time weight of the first user portrait in the user portraits in the order of the generation time of the user portraits. If the reference time weight is not less than a third value, and the time weight from a first user portrait in the user portraits to the target time weight is in an ascending trend in the order of generation time of the user portraits, the time weight of the initial user portrait is calculated based on a length of a target time period corresponding to the user data of the target user, a length of time between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior in the target time period, a number of the user portraits, and a number of time weights between the time weight of the first user portrait in the user portraits and the target time weight in the order of generation time of the user portraits. If the reference time weight is less than the third value, and the time weight from a first user portrait in the user portraits to the target time weight is in a descending trend in the order of generation time of the user portraits, the time weight of the initial user portrait is calculated based on a length of a target time period corresponding to the user data of the target user, a length of time between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior in the target time period, a number of the user portraits, and a number of time weights between the time weight of the first user portrait in the user portraits and the target time weight in the order of generation time of the user portraits. The calculation formula is as follows: wherein Q represents the time weight of the initial user portrait; Δt represents a length of time between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior in the target time period, T represents a length of a target time period corresponding to the user data of the target user; M represents a number of time weights between the time weight of a first user portrait in the user portraits and the target time weight in the order of generation time of the user portraits; K represents a number of the user portraits; and Δq represents the reference time weight. If the reference time weight is not less than the third value, and the time weight of the first user portrait in the user portraits to the target time weight is in a descending trend in the order of generation time of the user portraits, the time weight of the initial user portrait is calculated based on a time length between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior in the target time period, a time length of a target time period corresponding to the user data of the target user, and a difference value with the largest absolute value among difference values of adjacent two time weights in the time weights of the user portraits. The calculation formula is as follows: Wherein, Q represents the time weight of the initial user portrait; Δt represents the time length between the time when the target user first performs a user behavior and the time when the target user last performs a user behavior in the target time period, T represents the time length of the target time period corresponding to the user data of the target user; Δq represents the reference time weight; A represents the difference value with the largest absolute value among difference values of adjacent two time weights in the time weights of the user portraits.
4. The method of claim 1, wherein, After determining that the calculated time weight and the initial user portrait are the final user portrait of the target user as the target user portrait, the method further comprises: After receiving a use request for the target user portrait, extracting a user identifier carried in the use request as a user identifier, and extracting a use summary carried in the use request; wherein the use summary indicates a use scenario of the user obtaining the target user portrait; Based on the user identifier, the use summary and the user information of the target user, it is judged whether the user has the use right of the target user portrait; If the user does not have the use right of the target user portrait, an alarm message is sent to the electronic device used by the target user to remind the target user that this time the user requests to use the target user portrait; If the user has the use right of the target user portrait, the target user portrait is sent to the electronic device used by the user.
5. The method of claim 4, wherein, The user information of the target user includes: the Internet Protocol (IP) address of the electronic device used by the target user; The judgment of whether the user has the use right of the target user portrait based on the user identifier, the use summary and the user information of the target user comprises: sending an inquiry message for the target user portrait to the electronic device used by the target user according to an IP address of the electronic device used by the target user, wherein the inquiry message carries the user identifier and the use summary; determining that the user has the use right of the target user portrait when receiving a confirmation authorization message sent by the electronic device used by the target user; determining that the user does not have the use right of the target user portrait when receiving a cancellation authorization message sent by the electronic device used by the target user.
6. The method of claim 4, wherein, The user information of the target user includes an authorization list and an authorization summary of the target user for the target user portrait, wherein the authorization list contains user identifiers of each user authorized by the target user to use the target user portrait, and the authorization summary represents a use scenario authorized by the target user to use the target user portrait. The judgment of whether the user has the use right of the target user portrait based on the user identifier, the use summary and the user information of the target user includes: judging whether the authorization list contains the user identifier; if the authorization list does not contain the user identifier, determining that the user does not have the use right of the target user portrait; if the authorization list contains the user identifier, calculating a difference value between the use summary and the authorization summary; if the difference value is greater than a preset threshold, determining that the user does not have the use right of the target user portrait; if the difference value is not greater than the preset threshold, determining that the user has the use right of the target user portrait.
7. The method of claim 6, wherein, The calculation of the difference value between the use summary and the authorization summary includes: extracting continuous strings of a first preset length from the use summary to obtain each string contained in the use summary; for each extracted string, if the authorization summary contains the same string as the string, determining that the matching degree corresponding to the string is a first numerical value; if the authorization summary does not contain the same string as the string, extracting continuous strings of a second preset length from the string to obtain each substring contained in the string; for each substring contained in the string, if the authorization summary does not contain the same string as the substring, determining that the matching degree corresponding to the substring is a second numerical value; if the authorization summary contains the same string as the substring, calculating the matching degree corresponding to the substring based on the number of characters contained in the substring, the number of characters contained in the string, the number of characters contained in the authorization summary, and the number of times the same string as the substring appears in the authorization summary; calculating the sum of the matching degrees corresponding to each substring contained in the string, and calculating the ratio of the sum to the number of substrings contained in the string to obtain the matching degree corresponding to the string. Based on the matching degree corresponding to each string contained in the use summary and the number of strings contained in the use summary, a difference value between the use summary and the authorized summary is calculated.
8. The method of claim 4, wherein, After determining that the calculated time weight and the initial user portrait are the final user portrait of the target user as the target user portrait, the method further comprises: According to the preset decentralized identifier (DID) generation rule and the user information of the target user, a DID of the target user is generated as the target DID; Based on the generation time of the specified user portrait of the target user, the number of the target user and the target DID, a user identification of the target user is generated as the target user identification; The target user identification and the target user portrait are recorded correspondingly.
9. The method of claim 8, wherein, The generation of the target user identification based on the generation time of the specified user portrait of the target user, the number of the target user and the target DID comprises: The generation time of the specified user portrait of the target user is hashed to obtain a hash value of the generation time of the specified user portrait, and the number of the target user is hashed to obtain a hash value of the number of the target user; The hash value of the generation time of the specified user portrait and the hash value of the number of the target user are spliced to obtain a hash value string; Based on the hash value string and the target DID, the user identification of the target user is generated as the target user identification.
10. The method of claim 9, wherein, The generation of the target user identification based on the hash value string and the target DID comprises: If the number of characters contained in the hash value string is not greater than the number of characters contained in the target DID, for each character in the hash value string, the position of the character in the hash value string is determined according to the arrangement order of the characters contained in the hash value string from high bit to low bit, and the character at the same position in the target DID is determined according to the arrangement order of the characters contained in the target DID from high bit to low bit, to obtain the corresponding character of the character in the target DID; the remainder of the character and the corresponding character in the target DID is calculated to obtain the user identification of the target user as the target user identification. If the number of characters contained in the hash value string is greater than the number of characters contained in the target DID, determine, as a first character, a character existing at a corresponding position in the target DID in an arrangement order of characters contained in the hash value string from high bits to low bits, and determine, as a second character, other characters in the hash value string except the first character; for each character in the target DID, count the number of occurrences of the character; for each first character, determine a position of the first character in the hash value string in the arrangement order of characters contained in the hash value string from high bits to low bits; determine, as a corresponding character of the first character in the target DID, a character at a same position in the target DID in an arrangement order of characters contained in the target DID from high bits to low bits; calculate a remainder of the first character and the corresponding character in the target DID as a first remainder; for each second character, determine a position of the second character in the hash value string in an arrangement order of characters contained in the hash value string from low bits to high bits; determine, as a corresponding character of the second character in the target DID, a character at a same position in a corresponding sorting result in an arrangement order of the number of occurrences of characters contained in the target DID from high to low; calculate a remainder of the second character and the corresponding character in the target DID as a second remainder; and generate a user identifier of the target user containing the first remainder and the second remainder as a target user identifier.
11. The method of claim 8, wherein, The corresponding record of the target user identifier and the target user portrait includes: determining whether the target user identifier is contained in a corresponding relationship between a user identifier stored in a portrait node and a user node; wherein the portrait node is a preset head node of a user blockchain; the user node is a non-head node of the user blockchain; and one user node is used to store user information of a corresponding user; if the target user identifier is contained in the corresponding relationship, determining a user node corresponding to the target user identifier to obtain the user node of the target user; creating a new linked list node after a last linked list node of a portrait blockchain with the user node of the target user as a head node, and storing the target user portrait in the newly created linked list node; if the target user identifier is not contained in the corresponding relationship, creating a new user node after a last user node of the user blockchain as the user node of the target user, and corresponding recording the target user identifier and the user node of the target user in the corresponding relationship; creating a new portrait blockchain with the user node of the target user as a head node; wherein the newly created portrait blockchain contains a newly created linked list node except the head node; and storing the target user portrait in the newly created linked list node.
12. The method of claim 11, wherein, The storing of the target user portrait in the newly created linked list node includes: generate a two-dimensional array containing the target user portrait and a generation time of the target user portrait, and store the two-dimensional array to the newly created linked list node.
13. The method of claim 11, wherein, Before sending the target user portrait to the electronic device used by the user, the method further comprises: In the correspondence between the user identifier recorded in the portrait node and the user node, determine the user node corresponding to the target user identifier to obtain the user node of the target user; In the correspondence between the user portrait recorded in the user node of the target user and the linked list node, determine the linked list node corresponding to the target user portrait; Obtain the target user portrait from the determined linked list node.
14. A user profiling apparatus, characterized by The device comprises: A portrait dimension determination module configured to determine a portrait dimension corresponding to the target user based on user information of the target user as a target portrait dimension; An initial user portrait generation module configured to generate a user portrait of the target user in the target portrait dimension based on user data of the target user in the target portrait dimension as an initial user portrait; A time weight calculation module configured to calculate a time weight of the initial user portrait based on a time length of a target time period corresponding to the user data of the target user and a time length between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior within the target time period; A target user portrait generation module configured to determine the calculated time weight and the initial user portrait as a final user portrait of the target user as a target user portrait.
15. The apparatus of claim 14, wherein, The time weight calculation module is specifically configured to determine whether a user portrait of the target user in the target portrait dimension has been generated before the initial portrait is generated; If a user portrait of the target user in the target portrait dimension has not been generated before the initial portrait is generated, calculate a time weight of the initial user portrait based on a time length of a target time period corresponding to the user data of the target user and a time length between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior within the target time period; If a user portrait of the target user in the target portrait dimension has been generated before the initial portrait is generated, obtain time weights of each user portrait of the target user in the target portrait dimension that has been generated; Determine a time weight at an inflection point position in a change trend of the time weights of the user portraits as a target time weight in the order of generation times of the user portraits; Calculate a time weight of the initial user portrait based on the target time weight, a number of the time weights of the user portraits, a time length of a target time period corresponding to the user data of the target user, and a time length between a time when the target user first performs a user behavior and a time when the target user last performs a user behavior within the target time period.
16. The apparatus of claim 15, wherein, The time weight calculation module is specifically configured to calculate a reference time weight based on a time length of a target time period corresponding to user data of the target user, a time length between a time when the target user first performs a user behavior and a time when the target user last performs the user behavior in the target time period, and a time weight of a first user portrait in the user portraits in a chronological order of generation times of the user portraits. If the reference time weight is not less than a third value, and the time weight of the first user portrait in the user portraits in the chronological order of the generation times of the user portraits to the target time weight is in an ascending trend, the time weight of the initial user portrait is calculated based on the time length of the target time period corresponding to the user data of the target user, the time length between the time when the target user first performs the user behavior and the time when the target user last performs the user behavior in the target time period, a number of the user portraits, and a number of time weights between the time weight of the first user portrait in the user portraits and the target time weight in the chronological order of the generation times of the user portraits. Or, If the reference time weight is less than the third value, and the time weight of the first user portrait in the user portraits in the chronological order of the generation times of the user portraits to the target time weight is in a descending trend, the time weight of the initial user portrait is calculated based on the time length of the target time period corresponding to the user data of the target user, the time length between the time when the target user first performs the user behavior and the time when the target user last performs the user behavior in the target time period, a number of the user portraits, and a number of time weights between the time weight of the first user portrait in the user portraits and the target time weight in the chronological order of the generation times of the user portraits. The calculation formula is as follows: wherein Q represents the time weight of the initial user portrait, Δt represents the time length between the time when the target user first performs the user behavior and the time when the target user last performs the user behavior in the target time period, T represents the time length of the target time period corresponding to the user data of the target user, M represents the number of time weights between the time weight of the first user portrait in the user portraits and the target time weight in the chronological order of the generation times of the user portraits, K represents the number of the user portraits, and Δq represents the reference time weight. If the reference time weight is not less than the third value, and the time weight of the first user portrait in the user portraits to the target time weight is in a descending trend according to the chronological order of the generation time of the user portraits, the time weight of the initial user portrait is calculated based on the time length between the time when the target user first performs a user behavior and the time when the target user last performs a user behavior in the target time period, the time length of the target time period corresponding to the user data of the target user, and the difference value with the largest absolute value among the difference values between adjacent two time weights of the user portraits. The calculation formula is as follows: Wherein, Q represents the time weight of the initial user portrait; Δt represents the time length between the time when the target user first performs a user behavior and the time when the target user last performs a user behavior in the target time period, T represents the time length of the target time period corresponding to the user data of the target user; Δq represents the reference time weight; A represents the difference value with the largest absolute value among the difference values between adjacent two time weights of the user portraits.
17. The apparatus of claim 14, wherein, The device further comprises: The extraction module is configured to, after the target user portrait generation module determines that the calculated time weight and the initial user portrait are the final user portrait of the target user as the target user portrait, extract the user identifier of the user carried in the use request as the user identifier and extract the use summary carried in the use request after receiving the use request for the target user portrait; wherein, the use summary represents the use scenario of the target user portrait obtained by the user; The use right judgment module is configured to judge whether the user has the use right of the target user portrait based on the user identifier, the use summary and the user information of the target user; The alarm message sending module is configured to send an alarm message to the electronic device used by the target user to remind the target user of the request use behavior of the user for the target user portrait if the user does not have the use right of the target user portrait; The user portrait sending module is configured to send the target user portrait to the electronic device used by the user if the user has the use right of the target user portrait.
18. The apparatus of claim 17, wherein, The user information of the target user includes the Internet Protocol (IP) address of the electronic device used by the target user. The use right judgment module is specifically configured to send an inquiry message for the target user portrait to the electronic device used by the target user according to an IP address of the electronic device used by the target user; wherein the inquiry message carries the user identifier and the use summary; Upon receiving a confirmation authorization message sent by the electronic device used by the target user, it is determined that the user has the use right of the target user portrait; Upon receiving a cancellation authorization message sent by the electronic device used by the target user, it is determined that the user does not have the use right of the target user portrait.
19. The apparatus of claim 17, wherein, The user information of the target user includes an authorization list and an authorization summary of the target user for the target user portrait; wherein the authorization list contains user identifiers of each user authorized by the target user to use the target user portrait; and the authorization summary represents a use scenario in which the target user is authorized to use the target user portrait; The use right judgment module is specifically configured to judge whether the authorization list contains the user identifier; If the authorization list does not contain the user identifier, it is determined that the user does not have the use right of the target user portrait; If the authorization list contains the user identifier, a difference value between the use summary and the authorization summary is calculated; if the difference value is greater than a preset threshold, it is determined that the user does not have the use right of the target user portrait; if the difference value is not greater than the preset threshold, it is determined that the user has the use right of the target user portrait.
20. The apparatus of claim 19, wherein, The use right judgment module is specifically configured to extract a continuous string of a first preset length from the use summary to obtain each string contained in the use summary; For each extracted string, if the authorization summary contains a string identical to the string, the matching degree corresponding to the string is determined to be a first numerical value; If the authorization summary does not contain a string identical to the string, a continuous string of a second preset length is extracted from the string to obtain each substring contained in the string; for each substring contained in the string, if the authorization summary does not contain a string identical to the substring, the matching degree corresponding to the substring is determined to be a second numerical value; if the authorization summary contains a string identical to the substring, the matching degree corresponding to the substring is calculated based on the number of characters contained in the substring, the number of characters contained in the string, the number of characters contained in the authorization summary, and the number of times the string identical to the substring appears in the authorization summary; The sum of the matching degrees corresponding to each substring contained in the string is calculated, and the ratio of the sum to the number of substrings contained in the string is calculated to obtain the matching degree corresponding to the string; The difference value between the use summary and the authorization summary is calculated based on the matching degrees corresponding to each string contained in the use summary and the number of strings contained in the use summary.
21. The apparatus of claim 17, wherein, The device further comprises: The DID generation module is configured to generate a decentralized identifier (DID) of the target user according to a preset DID generation rule and user information of the target user after the target user portrait generation module determines that the time weight calculated and the initial user portrait are the final user portrait of the target user as the target user portrait. The user identifier generation module is configured to generate a user identifier of the target user based on a generation time of the specified user portrait of the target user, a number of the target user, and the target DID as the target user identifier. The recording module is configured to correspondingly record the target user identifier and the target user portrait.
22. The apparatus of claim 21, wherein, The user identifier generation module is specifically configured to hash the generation time of the specified user portrait of the target user to obtain a hash value of the generation time of the specified user portrait, and hash the number of the target user to obtain a hash value of the number of the target user. The hash value of the generation time of the specified user portrait and the hash value of the number of the target user are spliced to obtain a hash value string. The target user identifier is generated based on the hash value string and the target DID as the target user identifier.
23. The apparatus of claim 22, wherein, If the number of characters contained in the hash value string is not greater than the number of characters contained in the target DID, for each character in the hash value string, the position of the character in the hash value string is determined according to the arrangement order of the characters contained in the hash value string from high bits to low bits; the character at the same position in the target DID is determined according to the arrangement order of the characters contained in the target DID from high bits to low bits, to obtain the corresponding character of the character in the target DID. The remainder of the character and the corresponding character in the target DID is calculated to obtain the user identifier of the target user as the target user identifier. If the number of characters contained in the hash value string is greater than the number of characters contained in the target DID, the characters at the corresponding positions in the target DID are determined as first characters according to the arrangement order of the characters contained in the hash value string from high bits to low bits, and the other characters in the hash value string except the first characters are determined as second characters; for each character in the target DID, the number of occurrences of the character is counted. For each first character, the position of the first character in the hash value string is determined according to the arrangement order of the characters contained in the hash value string from high bits to low bits; the character at the same position in the target DID is determined according to the arrangement order of the characters contained in the target DID from high bits to low bits, to obtain the corresponding character of the first character in the target DID. The remainder of the first character and the corresponding character in the target DID is calculated as a first remainder. For each second character, determine the position of the second character in the hash value string according to the arrangement order of the characters contained in the hash value string from low to high, and determine the character in the corresponding sorting result at the same position as the second character according to the arrangement order of the occurrence times of the characters contained in the target DID from high to low, to obtain the corresponding character of the second character in the target DID; Calculate the remainder of the second character and the corresponding character in the target DID to obtain a second remainder; and generate the user identifier of the target user containing the first remainder and the second remainder as the target user identifier.
24. The apparatus of claim 21, wherein, The recording module is specifically configured to determine whether the target user identifier is contained in the corresponding relationship between the user identifier stored in the portrait node and the user node; the portrait node is a preset head node of a user blockchain; the user node is a non-head node of the user blockchain; one user node is used to store the user information of the corresponding user; If the target user identifier is contained in the corresponding relationship, the user node corresponding to the target user identifier is determined to obtain the user node of the target user; a new linked list node is created after the last linked list node of the portrait blockchain with the user node of the target user as the head node, and the target user portrait is stored in the new linked list node; If the target user identifier is not contained in the corresponding relationship, a new user node is created after the last user node of the user blockchain as the user node of the target user, and the target user identifier and the user node of the target user are recorded in the corresponding relationship; a portrait blockchain is newly created with the user node of the target user as the head node; the newly created portrait blockchain contains a new linked list node except the head node; and the target user portrait is stored in the new linked list node.
25. The apparatus of claim 24, wherein, The recording module is specifically configured to generate a two-dimensional array containing the target user portrait and the generation time of the target user portrait, and store the two-dimensional array in the new linked list node.
26. The apparatus of claim 24, wherein, The device further comprises: A user node determination module is configured to determine the user node corresponding to the target user identifier in the corresponding relationship between the user identifier recorded in the portrait node and the user node before the user portrait sending module sends the target user portrait to the electronic device used by the user. A linked list node determination module is configured to determine the linked list node corresponding to the target user portrait in the corresponding relationship between the user portrait recorded in the user node of the target user and the linked list node. A user portrait acquisition module is configured to acquire the target user portrait from the determined linked list node.
27. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store a computer program; The processor is used to execute the program stored in the memory to implement the method steps of any one of claims 1-13. The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store a computer program; The processor is used to execute the program stored in the memory to implement the method steps of any one of claims 1-13.
28. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps in any one of claims 1-13.
Citation Information
Patent Citations
User portrait generation method and device, electronic equipment and computer readable medium
CN110135976A
User portrait generation method and device, electronic equipment and storage medium
CN113934928A