User portrait determination method and device, storage medium and electronic device
By constructing a pre-defined knowledge base and utilizing a large language model for multi-round prompt optimization, the problem of fragmented user behavior data across different platforms was solved, improving the accuracy and richness of user profiles.
Patent Information
- Application Number
- CN202511585801.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-10
AI Technical Summary
The fragmentation of user behavior data across different platforms results in low accuracy of existing user profiling technologies, making it difficult to capture and deeply integrate features.
By constructing a pre-defined knowledge base, integrating and preprocessing multi-source data, and using a large language model for multi-round prompt optimization, user profiles are generated.
It improves the accuracy of user profile construction, enables a deep understanding and dynamic portrayal of user behavior, overcomes the data silo phenomenon, and enhances the accuracy and richness of user profiles.
Smart Images

Figure CN121502018A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method and apparatus for determining a user profile, a storage medium, and an electronic device. Background Technology
[0002] In related technologies, user profiles can be built using user behavior data across different platforms, but the following problems often exist: 1) User behavior data is fragmented across different platforms, making it impossible to build a unified and complete user view; 2) The construction of user profiles mainly relies on users' structured behavior logs or static tags, lacking deep integration of multimodal information such as text and interaction paths, resulting in one-sided profiles and semantic gaps; 3) Traditional profiling methods are based on static rules or shallow models, making it difficult to capture temporal features such as user interest migration and behavioral pattern evolution.
[0003] In other words, the relevant technologies suffer from fragmented user behavior data across different platforms, making it difficult to capture and deeply integrate features, resulting in low accuracy of existing user profiling technologies.
[0004] There is still no effective solution to the problem that user behavior data is fragmented across different platforms, making it difficult to capture and deeply integrate features, resulting in low accuracy of existing user profiling technologies. Summary of the Invention
[0005] This application provides a method and apparatus for determining user profiles, a storage medium, and an electronic device to at least solve the problem in the prior art where user behavior data is fragmented across different platforms, making it difficult to capture and deeply integrate features, resulting in low accuracy of existing user profiling technologies.
[0006] According to one embodiment of this application, a method for determining a user profile is provided, comprising: performing a retrieval operation in a preset knowledge base based on a received query instruction to obtain a knowledge base retrieval result, wherein the preset knowledge base is constructed using multi-source data, the multi-source data including behavioral data of the target user of the user profile queried by the query instruction on multiple platforms; constructing prompt words using the knowledge base retrieval result and the query instruction; inputting the prompt words into a large language model to perform multi-round prompt optimization on the output result of the large language model using the prompt words; and determining the obtained optimization result as the user profile queried by the query instruction.
[0007] In an exemplary embodiment, before performing a retrieval operation in a preset knowledge base based on a received query instruction and obtaining the knowledge base retrieval results, the process includes: acquiring the multi-source data, wherein the multi-source data includes: internet behavior data, telecommunications network behavior data, and user-uploaded data; preprocessing the multi-source data; and storing the preprocessed multi-source data in the preset knowledge base.
[0008] In one exemplary embodiment, preprocessing the multi-source data includes: performing a cleaning operation on the multi-source data, wherein the cleaning operation includes: missing value imputation, deduplication, and format standardization; performing batch processing and streaming processing on the cleaned multi-source data to obtain processed data; and performing data consistency verification on the processed data to complete the preprocessing of the multi-source data.
[0009] In one exemplary embodiment, a retrieval operation is performed in a preset knowledge base based on a received query instruction to obtain knowledge base retrieval results. This includes: parsing the query instruction to obtain the username of the target user; performing a retrieval in the preset knowledge base using the username; and determining the retrieved data associated with the username as the knowledge base retrieval results.
[0010] In an exemplary embodiment, the prompt words are input into a large language model to perform multi-round prompt optimization on the output of the large language model using the prompt words. This includes: an acquisition step: acquiring the m-th round output result of the large language model, where m = 1, 2, 3…; a determination step: determining the size relationship between m and a preset iteration number; an update step: when the size relationship indicates that m is less than or equal to the preset iteration number, updating the prompt words using the m-th round output result, and inputting the updated prompt words into the large language model to output the n-th round output result using the updated prompt words; updating the m-th round output result using the n-th round output result, where n = m + 1; and repeatedly executing the acquisition step, the determination step, and the update step until the determination step determines that the size relationship indicates m is greater than the preset iteration number, and determining the target output result as the optimized result of multi-round prompt optimization on the output of the large language model.
[0011] In an exemplary embodiment, updating the prompt word based on the output result of the m-th round includes: retrieving data associated with the output result of the m-th round from the preset knowledge base to obtain a target retrieval result; updating the output result of the m-th round to a first position in the prompt word template corresponding to the prompt word, and updating the target retrieval result to a second position in the prompt word template to obtain an updated prompt word.
[0012] In an exemplary embodiment, after determining the obtained optimization result as the user profile queried by the query instruction, the method further includes: feeding back the user profile to the target object that sent the query instruction; wherein, when the query instruction includes a tendency prediction indication, the user profile also includes a prediction score of the target category tendency, wherein the tendency prediction indication includes the target category tendency.
[0013] According to another embodiment of this application, a user profile determination device is also provided, comprising: a retrieval module, configured to perform a retrieval operation in a preset knowledge base based on a received query instruction, and obtain a knowledge base retrieval result, wherein the preset knowledge base is constructed using multi-source data, the multi-source data including behavioral data of the target user of the user profile queried by the query instruction on multiple platforms; a construction module, configured to construct prompt words based on the knowledge base retrieval result and the query instruction; an optimization module, configured to input the prompt words into a large language model to perform multi-round prompt optimization on the output result of the large language model using the prompt words; and a determination module, configured to determine the obtained optimization result as the user profile queried by the query instruction.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method at runtime.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described method through the computer program.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0017] In this embodiment, a pre-built knowledge base is constructed using multi-source data, including behavioral data of the target user across multiple platforms. The received query command is then retrieved from this knowledge base to obtain retrieval results. Hint words are constructed using the retrieval results and the query command; these hint words are then input into a large language model to perform multi-round optimization of the model's output; the optimized result is then determined as the user profile indicated by the query command. Thus, this embodiment solves the problem in related technologies where fragmented user behavioral data across different platforms makes feature capture and deep fusion difficult, resulting in low accuracy in existing user profiling technologies. It improves the accuracy of user profile construction. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a hardware structure block diagram of a computer terminal for a user profile determination method according to an embodiment of this application. Figure 2 This is a flowchart of a method for determining a user profile according to an embodiment of this application; Figure 3 This is another flowchart (a) of the method for determining a user profile according to an embodiment of this application; Figure 4 This is another flowchart (II) of the method for determining a user profile according to an embodiment of this application; Figure 5 This is a schematic diagram illustrating the construction of prompt words in the user profile determination method according to an embodiment of this application; Figure 6 This is a schematic diagram illustrating the tendency prediction method for determining user profiles according to an embodiment of this application; Figure 7 This is a schematic diagram of the parameter configuration of the user profile determination method according to an embodiment of this application; Figure 8 This is another flowchart (III) of the method for determining a user profile according to an embodiment of this application; Figure 9 This is a schematic diagram of a query page illustrating a method for determining a user profile according to an embodiment of this application; Figure 10 This is a structural block diagram of a user profile determination device according to an embodiment of this application. Detailed Implementation
[0019] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus; "a plurality" means two or more.
[0021] The methods and embodiments provided in this application can be executed on a computer terminal, similar computing device, cloud platform, independent physical server, software platform, or network element device, wherein the aforementioned software platform runs through one or more servers. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal for a user profile determination method according to an embodiment of this application. For example... Figure 1 As shown, a computer terminal may include one or more ( Figure 1 (Only one is shown in the image) A processor 102 and a memory 104 for storing data. In one exemplary embodiment, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. The processor 102 may include, but is not limited to, a processing device such as a microprocessor (MCU) or a programmable logic device (FPGA). Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 Equivalent functions or ratios shown Figure 1 The functions shown have more different configurations.
[0022] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0023] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0024] This embodiment provides a method for determining a user profile, which is applied to the aforementioned computer terminal. Figure 2 This is a flowchart of a method for determining a user profile according to an embodiment of this application. The process includes the following steps: Step S202: Perform a retrieval operation in the preset knowledge base according to the received query instruction to obtain the knowledge base retrieval result. The preset knowledge base is constructed by multi-source data, which includes the behavior data of the target user of the query user profile indicated by the query instruction on multiple platforms. Optionally, the query command could be something like: What is the user profile of user "XXX"? This could be combined with predictions based on factors such as fraudulent tendencies and troll tendencies. In this case, "XXX" could be the target user's real name or nickname.
[0025] Step S204: Construct prompt words based on the knowledge base retrieval results and the query instructions; Step S206: Input the prompt words into the large language model to perform multi-round prompt optimization on the output of the large language model through the prompt words; Step S208: The obtained optimization result is determined as the user profile queried by the query instruction.
[0026] Through steps S202 to S208 above, in this embodiment, a preset knowledge base is pre-constructed using multi-source data including the target user's behavioral data across multiple platforms. The received query instruction is then retrieved from the preset knowledge base to obtain the knowledge base retrieval results. Hint words are constructed using the knowledge base retrieval results and the query instruction; these hint words are then input into a large language model to perform multi-round optimization of the model's output; the optimized result is then determined as the user profile indicated by the query instruction. Thus, this embodiment solves the problem in related technologies where fragmented user behavioral data across different platforms makes feature capture and deep fusion difficult, resulting in low accuracy in existing user profiling technologies. It improves the accuracy of user profile construction.
[0027] In an exemplary embodiment, before performing a retrieval operation in a preset knowledge base based on a received query instruction and obtaining the knowledge base retrieval results, the process includes: acquiring the multi-source data, wherein the multi-source data includes: internet behavior data, telecommunications network behavior data, and user-uploaded data; preprocessing the multi-source data; and storing the preprocessed multi-source data in the preset knowledge base.
[0028] In this embodiment, multi-source data can be extracted from multiple platforms such as the Internet domain and telecommunications network domain. It also supports users accessing multi-source data through both offline and real-time channels. Specifically: .
[0029] in, Indicates multi-source data, Represents internet behavior data, This represents telecommunications network behavior data. This refers to user-uploaded data, specifically structured or unstructured data uploaded by the user. Internet behavioral data includes things like comments and reposts, while telecommunications network behavioral data includes calls and SMS messages. User-uploaded structured or unstructured data can be understood as user attribute information, such as the user's age and location.
[0030] Furthermore, the multi-source data is preprocessed, including: cleaning the multi-source data, wherein the cleaning operation includes: missing value imputation, deduplication, and format standardization; batch processing and streaming processing of the cleaned multi-source data to obtain processed data; and data consistency verification of the processed data to complete the preprocessing of the multi-source data.
[0031] Specifically, in this embodiment, user-uploaded data from multi-source data is cleaned. Internet behavior data and telecommunications network behavior data from the multi-source data undergo batch processing and streaming processing. Whether to perform batch processing and streaming processing on the cleaned user-uploaded data is optional, as is whether to perform cleaning operations on the Internet behavior data and telecommunications network behavior data before batch processing and streaming processing.
[0032] Regarding user-uploaded data, this application embodiment supports data uploads in formats such as CSV, JSON, and Excel, and can automatically identify the data type. It also performs format standardization and anomaly handling on user-uploaded data. Specifically, the data cleaning operation for user-uploaded data includes: ; in, This represents user-uploaded data after the cleaning process. Impute indicates missing value imputation, Dedup indicates deduplication, and Normalize indicates format standardization.
[0033] For internet behavior data and telecommunications network behavior data, offline-read internet behavior data and telecommunications network behavior data are primarily processed using the Spark distributed computing engine, while real-time data acquired from Kafka is preprocessed using streaming frameworks such as Spark Streaming / Flink. This preprocessing includes data anonymization, data cleaning, data mining, and text summarization. Specifically: .
[0034] in, This indicates batch processing operations, including deduplication, data anonymization, and missing value imputation. This indicates streaming processing, including window aggregation, anomaly detection, etc. This refers to streaming data read in real time, which can be streaming internet data read in real time. This indicates preprocessed multi-source data (without consistency verification).
[0035] Consistency checks on preprocessed multi-source data are performed periodically. The specific check method is as follows: .
[0036] Where N is the number of data fields, and F represents the data after consistency verification.
[0037] For the preprocessed multi-source data, the preprocessed multi-source data is stored in the line-drawing knowledge base to construct a user profile knowledge base (equivalent to the preset knowledge base in the above embodiment), including:
[0038] Where K represents the user profile knowledge base (which can be a graph database or a vector database). It should be noted that... In fact, it includes In other words, It can be used as the union in building a user profile knowledge base, or it can be used in obtaining... The union of the times is taken.
[0039] Through the aforementioned preprocessing steps, the pre-defined knowledge base contains processed user data collected from multiple perspectives and platforms, providing strong support for subsequent user profile construction and personalized queries. When executing user queries, the system will retrieve relevant information based on this knowledge base and, combined with the capabilities of a large language model, generate more accurate and detailed user profiles. This multi-source data integration and preprocessing approach overcomes data silos, enabling a deep understanding and dynamic portrayal of user behavior.
[0040] In one exemplary embodiment, a retrieval operation is performed in a preset knowledge base based on a received query instruction to obtain knowledge base retrieval results. This includes: parsing the query instruction to obtain the username of the target user; performing a retrieval in the preset knowledge base using the username; and determining the retrieved data associated with the username as the knowledge base retrieval results.
[0041] In other words, the system parses the query command to extract the username of the target user whose profile is being queried. It then searches a pre-defined knowledge base using the username, identifying the data associated with that username as the knowledge base retrieval results. These results can include the target user's behavior records across different platforms, preference settings, interaction paths, text content analysis results, etc., covering various dimensions and types of information needed to construct a user profile. For example, to understand the shopping preferences and social activity of someone named "Zhang San," the system first parses the query command to identify the target user as "Zhang San." Then, it searches the pre-defined knowledge base for all data tagged "Zhang San," including "Zhang San's" shopping records on e-commerce websites, active time on social media, posting status, and comments.
[0042] To perform steps S204 and S206 above, this embodiment of the application requires the construction of a base model. Specifically: First, a general large model is selected. A Large Language Model (LLM) is adopted as the base model: .
[0043] Large Language Models (LLMs) are pre-trained neural network models with an extremely large number of parameters. These models, through unsupervised learning on massive amounts of text data, can grasp the complex structure and semantic relationships of language, and possess various language processing capabilities such as text generation, context understanding, translation, summarization, dialogue, and encoding conversion. LLMs can perform well on a wide range of natural language processing tasks, including but not limited to text generation, question answering, dialogue understanding and generation, sentiment analysis, text classification, and summarization, without requiring additional training for each task.
[0044] Furthermore, by integrating LangChain with the external knowledge base K, enhanced search engine generation (RAG) is achieved: .
[0045] Secondly, design the prompt word engineering. Design the prompt word chain to guide the model in generating profiles: Where Q represents the user's query command, and C represents the context. This is the result of a knowledge base search.
[0046] In an exemplary embodiment, the prompt words are input into a large language model to perform multi-round prompt optimization on the output of the large language model using the prompt words. This includes: an acquisition step: acquiring the m-th round output result of the large language model, where m = 1, 2, 3…; a determination step: determining the size relationship between m and a preset iteration number; an update step: when the size relationship indicates that m is less than or equal to the preset iteration number, updating the prompt words using the m-th round output result, and inputting the updated prompt words into the large language model to output the n-th round output result using the updated prompt words; updating the m-th round output result using the n-th round output result, where n = m + 1; and repeatedly executing the acquisition step, the determination step, and the update step until the determination step determines that the size relationship indicates m is greater than the preset iteration number, and determining the target output result as the optimized result of multi-round prompt optimization on the output of the large language model.
[0047] The target output result is the output result of the round containing the preset iteration number. For example, if the preset iteration number is 10, then the output result of the 10th round is the target output result.
[0048] It is understandable that the acquisition step, the determination step, and the update step constitute multi-round prompt optimization: .
[0049] in, Let m be the intermediate semantic representation generated in round t. In the case of t=1, These are prompt words constructed based on knowledge base retrieval results. When t is greater than 1, This is equivalent to the updated prompt. T represents the preset number of iterations.
[0050] Furthermore, updating the prompt word based on the output result of the m-th round includes: retrieving data associated with the output result of the m-th round from the preset knowledge base to obtain the target retrieval result; updating the output result of the m-th round to the first position in the prompt word template corresponding to the prompt word, and updating the target retrieval result to the second position in the prompt word template to obtain the updated prompt word.
[0051] In other words, during the update of the prompt words, a retrieval strategy based on a preset knowledge base is specifically employed: the output results of the m-th round are analyzed, and data related to the output results of the m-th round are retrieved from the preset knowledge base to obtain target retrieval results that can supplement or correct the model's output. The current output results and target retrieval results are then embedded into the prompt word template to generate updated prompt words. For example, the output results of the m-th round are updated in the context position of the prompt word template, and the target retrieval results are updated in the position of the knowledge base retrieval results in the prompt word template.
[0052] In an exemplary embodiment, after determining the obtained optimization result as the user profile queried by the query instruction, the method further includes: feeding back the user profile to the target object that sent the query instruction; wherein, when the query instruction includes a tendency prediction indication, the user profile also includes a prediction score of the target category tendency, wherein the tendency prediction indication includes the target category tendency.
[0053] In other words, if the query instruction input by the target object (i.e., the user) also includes a tendency prediction indication, the embodiments of this application can also perform customized prediction of user profile tendencies.
[0054] Specifically, eight types of tendency predictions can be made based on the profile knowledge base: .
[0055] Where H represents user profile behavior data, Assign a preference score to the user in category c. It should be noted that the target category preference in the preference prediction indicator will be included in the input large language model from the prompt word template.
[0056] Understandably, H represents the optimization result; for example, given a preset iteration count of 10, .like Figure 9As shown, the received query instruction is: "What is the user profile of user 'Yanyanmu'? And predict the user's tendencies based on their suspected fraud or online troll tendencies." Figure 9 The propensity index includes target category propensities such as fraud propensity and online troll propensity; and H can refer to... Figure 9 The data includes "Gender: Female, User Level: 0, ..., Mentioned Friends: None". Combined with... Figure 9 In special cases, if the information provided in the query instruction is insufficient, and / or the information in the preset knowledge base is insufficient, the user profile may not include the predicted score of the target category tendency, but rather the preset feedback result. The preset feedback result is, for example: "For the prediction of fraud tendency and water army tendency, since the information provided does not contain any information about whether the user behavior is abnormal or abnormal in length, the corresponding prediction cannot be made."
[0057] To better understand the process of determining the user profile described above, the following description will further illustrate the method of determining the user profile with reference to optional embodiments, but it is not intended to limit the technical solution of the embodiments of this application.
[0058] The user profiling technology in related technologies suffers from the following problems: 1) Severe data silos: behavioral data is fragmented across different platforms, making it impossible to build a unified and complete user view; 2) Single modeling dimension: It mainly relies on structured behavior logs or static tags, lacking deep integration of multimodal information such as text and interaction paths, resulting in one-sided profiles and semantic gaps; 3) Weak dynamic evolution modeling capability: Traditional methods are based on static rules or shallow models, making it difficult to capture temporal features such as user interest migration and behavioral pattern evolution; 4) Shallow application of large models: Although large language models (LLM) are introduced for semantic analysis, they are not effectively coordinated with structured information such as user behavior graphs and social relationship networks, resulting in a "semantic and behavioral disconnect" problem; 5) Poor real-time performance and scalability: Profile updates are lagging, lacking streaming computing and lightweight inference mechanisms, making it difficult to support high-time-sensitivity scenarios such as marketing and risk control. In other words, the user profiling technology in related technologies has significant shortcomings in multi-source heterogeneous data fusion, dynamic behavior modeling, semantic and structural coordination, and real-time intelligent decision-making, making it difficult to meet the needs of enterprises for refined operations and personalized services. There is an urgent need for a new technical architecture to break down modal and platform barriers and achieve a leap from "static tags" to "dynamic insights" and from "single-point analysis" to "omni-domain linkage." To address the aforementioned shortcomings, the optional embodiments of this application aim to provide a high-precision, high-timeliness, and deep-insight user profiling solution (equivalent to the user profiling determination method in the above embodiments), fully supporting key business scenarios such as precision marketing, product optimization, customer retention, and personalized services, and driving enterprises to transform and upgrade from "experience-driven" to "intelligence-driven."
[0059] The implementation process of the optional embodiments of this application is as follows: Figure 3 As shown, it includes: Step 1: Build a user profile knowledge base.
[0060] Step 1.1: Extract data from the Internet domain and the telecommunications network domain (equivalent to Internet behavior data and telecommunications network behavior data in the above embodiments), and extract, clean, transform, load and store the data from multiple data sources.
[0061] Step 1.2: Obtain data in real-time from Kafka or read data offline from databases such as Hive (equivalent to offline data of internet behavior data and telecommunications network behavior data in the above embodiments), and clean and preprocess the data. Regularly check the accuracy, completeness, and consistency of the data to ensure that the data quality meets the needs of analysis and modeling. Improve the accuracy and reliability of end-user profiles.
[0062] Step 1.3: Obtain user-uploaded dynamic data, clean and preprocess the data to eliminate errors and duplicates, standardize data format, handle missing and outlier values, ensure that data from different sources can be processed uniformly, improve data quality, and finally store it in the existing knowledge base for subsequent users to ask questions and make predictions based on the user profile in the knowledge base.
[0063] Regarding step 1.3, the specific implementation method for obtaining user-defined uploaded dynamic data is as follows: Figure 4 As shown, steps 1.31 to 1.33 are included: Step 1.31: Receive user input data through the main interface, determine whether the input data is uploaded data, if yes, proceed to step 32, otherwise proceed to step 33.
[0064] Step 1.32: Determine if the input data is from a user clicking to upload data, and redirect to the data upload page. Receive the file selected or dragged by the user onto the upload page. After confirming the user clicked to upload the file, check the file format and integrity. If the format is correct and the file is complete, directly store the data in the database or file system. If the format is incorrect or the file is incomplete, preprocess the file and store it in the database or file system (which includes the preset knowledge base in the above embodiments).
[0065] Step 1.33: If the input data is determined to be a query command rather than a user's click to upload data, then: retrieve the knowledge base search results using the query command. Combine the query command and the knowledge base search results to obtain prompt words, which are then input into the user profile model to instruct the model to perform user profile mining. Display the analysis results and output / export the results.
[0066] Step 2: Building multi-level user profiles.
[0067] The optional embodiments of this application support the selection of currently mainstream large-scale models. A general-purpose large-scale model foundation is a pre-trained model with broad applicability and powerful performance. This model learns various languages and knowledge during training, enabling adaptive learning and improvement in different scenarios. A general-purpose large-scale model foundation typically contains a large number of parameters and complex structures, capable of processing large amounts of data and extracting useful features and patterns from it.
[0068] The prompt word project of the optional embodiments of this application is as follows: Figure 5 As shown, a user behavior profiling system is built based on a large language model, combined with a retrieval enhancement module to access external knowledge bases. Figure 5 In this context, the prompt chain performs transformations or other processing on the generated responses until the desired result is achieved, thereby enhancing the ability of LLM to solve complex problems through multi-turn dialogues.
[0069] Step 3: Customized Prediction of Multi-Dimensional User Profile Tags. Based on specific business needs, and combining existing knowledge base or custom-uploaded data, predict the target user's tendencies in eight categories (internet trolls, insults, petitions, fraud, celebrity worship, shopping, government affairs, and cyberbullying). Specifically... Figure 6 As shown.
[0070] Optional, for Figure 3 The process shown in the figure, in an optional embodiment of this application, also includes a configuration management module. The configuration management module is responsible for performing system parameter configuration and algorithm management. The management process of the configuration management module is as follows: Figure 7 As shown, the configuration management module is divided into three sub-modules: system parameter configuration, algorithm model management, and algorithm inference management. The system parameter configuration sub-module is responsible for configuring and managing various system parameters, such as server configuration and computing platform parameter configuration. The algorithm model management sub-module is responsible for uploading, calling, version management, and category management of algorithm models. The algorithm inference management sub-module is responsible for managing the results of algorithm inference and computational analysis, such as metadata management, adding and deleting inference results, and calibrating and modifying inference results.
[0071] Optional, for Figure 3 The process shown in the figure, in optional embodiments of this application, also includes a query and display module. The query process corresponding to the query and display module is as follows: Figure 8 As shown, it includes: Step S801: Large model type and temperature selection configuration.
[0072] Step S802: Determine whether the target object of the input command has set the user profile preference option based on the received query command. If the user profile preference option is set, proceed to step 803; otherwise, proceed to step 804.
[0073] Step S803: After making a prediction based on specific tendencies, proceed to step S804.
[0074] Step S804: Output the user profile based on the user's nickname and corresponding configuration.
[0075] Step S805: Display the output user profile on the page.
[0076] The query and display module is responsible for responding to user query commands, selecting based on query filters and other parameters, and returning the corresponding user profile data to the front end for visualization. A schematic diagram of the multi-level user profile large model query page is shown below. Figure 9 As shown.
[0077] In summary, the optional embodiments of this application construct an intelligent user insight platform that is "data-scalable, model-guided, prediction-customizable, and system-configurable," solving the pain points of traditional profiling systems such as data fragmentation, static solidification, semantic gaps, and business disconnect. The aforementioned user profile determination method enables real-time data processing and a flexible data upload mechanism, allowing the system to quickly respond to user needs, thereby enhancing the real-time nature and flexibility of user profiles. Through multi-layered user profile construction and prompt word engineering, the accuracy and richness of user profiles are improved. Customized predictions of user profiles meet diverse business needs of enterprises, improving the system's applicability. Furthermore, the configuration management module ensures the system's efficient operation and long-term stability. The query and display module provides convenient data query and visualization functions, enhancing the user experience.
[0078] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0079] This application also provides a structural block diagram of a user profile determination device. Figure 10 This is a structural block diagram of a user profile determination device according to an embodiment of this application; as shown below. Figure 10 As shown, it includes: The retrieval module 1002 is used to perform a retrieval operation in a preset knowledge base based on the received query instruction, and obtain the knowledge base retrieval results. The preset knowledge base is constructed using multi-source data, which includes the behavioral data of the target user of the user profile requested by the query instruction on multiple platforms. Module 1004 is used to construct prompt words based on the retrieval results from the knowledge base and the query instructions; The optimization module 1006 is used to input the prompt words into the large language model so as to perform multi-round prompt optimization on the output result of the large language model through the prompt words; The determination module 1008 is used to determine the obtained optimization result as the user profile queried by the query instruction.
[0080] The aforementioned device pre-constructs a knowledge base using multi-source data, including behavioral data of the target user across multiple platforms. Upon receiving a query command, a retrieval operation is performed within the knowledge base to obtain retrieval results. Hint words are constructed using the retrieval results and the query command; these hint words are then input into a large language model to perform multi-round optimization of the model's output; the optimized result is then determined as the user profile indicated by the query command. Thus, this embodiment solves the problem in related technologies where fragmented user behavioral data across different platforms makes feature capture and deep fusion difficult, resulting in low accuracy in existing user profiling technologies. It improves the accuracy of user profile construction.
[0081] In one exemplary embodiment, the device further includes a storage module, configured to perform a retrieval operation in a preset knowledge base upon receiving a query instruction, and to obtain the multi-source data before obtaining the knowledge base retrieval results, wherein the multi-source data includes: internet behavior data, telecommunications network behavior data, and user-uploaded data; to preprocess the multi-source data, and to store the preprocessed multi-source data in the preset knowledge base.
[0082] In an exemplary embodiment, the storage module is further configured to perform a cleaning operation on the multi-source data, wherein the cleaning operation includes: missing value imputation, deduplication, and format standardization; performing batch processing and streaming processing on the cleaned multi-source data to obtain processed data; and performing data consistency verification on the processed data to complete the preprocessing of the multi-source data.
[0083] In an exemplary embodiment, the retrieval module 1002 is further configured to parse the query instruction to obtain the username of the target user. The retrieval is then performed in a preset knowledge base using the username, and the retrieved data associated with the username is determined as the knowledge base retrieval result.
[0084] In an exemplary embodiment, the optimization module 1006 is further configured to perform the following steps: acquiring the m-th round output result of the large language model, where m = 1, 2, 3, ...; determining the relationship between m and a preset iteration number; updating the prompt word by means of the m-th round output result when the relationship indicates that m is less than or equal to the preset iteration number, and inputting the updated prompt word into the large language model so that the large language model outputs the n-th round output result through the updated prompt word; updating the m-th round output result by means of the n-th round output result, where n = m + 1; and repeatedly executing the acquisition step, the determination step, and the update step until the determination step determines that the relationship indicates that m is greater than the preset iteration number, and determining the target output result as the optimized result of multi-round prompt optimization of the output result of the large language model.
[0085] In an exemplary embodiment, the optimization module 1006 is further configured to retrieve data associated with the output result of the m-th round from the preset knowledge base to obtain the target retrieval result; update the output result of the m-th round to the first position in the prompt word template corresponding to the prompt word, and update the target retrieval result to the second position in the prompt word template to obtain the updated prompt word.
[0086] In one exemplary embodiment, the apparatus further includes a feedback module, configured to, after determining the obtained optimization result as the user profile queried by the query instruction, feed back the user profile to the target object that sent the query instruction; wherein, when the query instruction includes a tendency prediction indication, the user profile also includes a prediction score of the target category tendency, wherein the tendency prediction indication includes the target category tendency.
[0087] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0088] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps: S1, perform a retrieval operation in a preset knowledge base based on the received query instruction to obtain the knowledge base retrieval results. The preset knowledge base is constructed using multi-source data, which includes the behavioral data of the target user of the user profile requested by the query instruction on multiple platforms. S2, construct prompt words based on the knowledge base retrieval results and the query instructions; S3, input the prompt words into the large language model, so as to perform multi-round prompt optimization on the output of the large language model through the prompt words; S4, the obtained optimization result is determined as the user profile queried by the query instruction.
[0089] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0090] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0091] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program: S1, perform a retrieval operation in a preset knowledge base based on the received query instruction to obtain the knowledge base retrieval results. The preset knowledge base is constructed using multi-source data, which includes the behavioral data of the target user of the user profile requested by the query instruction on multiple platforms. S2, construct prompt words based on the knowledge base retrieval results and the query instructions; S3, input the prompt words into the large language model, so as to perform multi-round prompt optimization on the output of the large language model through the prompt words; S4, the obtained optimization result is determined as the user profile queried by the query instruction.
[0092] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0093] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0094] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0095] Embodiments of this application also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0096] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0097] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0098] The collection, storage, use, processing, transmission, provision, and disclosure of user data and other information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0099] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining a user profile, characterized in that, include: The system executes a retrieval operation in a preset knowledge base based on the received query command to obtain the knowledge base retrieval results. The preset knowledge base is constructed using multi-source data, which includes the behavioral data of the target user of the user profile requested by the query command on multiple platforms. Prompt words are constructed based on the search results from the knowledge base and the query instructions; The prompt words are input into a large language model to perform multi-round prompting optimization on the output of the large language model using the prompt words; The optimized result is determined as the user profile that the query instruction indicates to query.
2. The method for determining a user profile according to claim 1, characterized in that, Before obtaining the knowledge base search results by executing a search operation in the preset knowledge base upon receiving the query command, the process includes: The multi-source data is acquired, including: internet behavior data, telecommunications network behavior data, and user-uploaded data. The multi-source data is preprocessed, and the preprocessed multi-source data is stored in the preset knowledge base.
3. The method for determining a user profile according to claim 2, characterized in that, Preprocessing the multi-source data includes: The multi-source data is cleaned, and the cleaning operation includes: missing value imputation, deduplication, and format standardization. Batch processing and streaming processing are performed on the cleaned multi-source data to obtain the processed data. The processed data is subjected to data consistency verification to complete the preprocessing of the multi-source data.
4. The method for determining a user profile according to claim 1, characterized in that, The system executes a search operation in a preset knowledge base based on the received query command, and obtains the knowledge base search results, including: Parse the query command to obtain the username of the target user; The user name is used to search the preset knowledge base, and the data retrieved that is associated with the user name is determined as the knowledge base search result.
5. The method for determining a user profile according to claim 1, characterized in that, The prompt words are input into a large language model to perform multi-round prompting optimization on the output of the large language model using the prompt words, including: Acquisition Steps: Obtain the output result of the m-th round of the large language model, where m = 1, 2, 3, ...; Determine the steps: Determine the relationship between m and the preset number of iterations; Update steps: When the size relationship indicator m is less than or equal to the preset number of iterations, update the prompt word with the output result of the mth round, and input the updated prompt word into the large language model so that the large language model outputs the output result of the nth round with the updated prompt word; update the output result of the mth round with the output result of the nth round, where n=m+1; The acquisition step, the determination step, and the update step are executed repeatedly until the determination step determines that the size relationship indicator m is greater than the preset number of iterations. The target output result is then determined as the optimized result of multi-round prompting optimization of the output result of the large language model.
6. The method for determining a user profile according to claim 5, characterized in that, The prompt word is updated based on the output result of the m-th round, including: Retrieve data associated with the output result of the m-th round from the preset knowledge base to obtain the target retrieval result; The output result of the m-th round is updated to the first position in the prompt word template corresponding to the prompt word, and the target retrieval result is updated to the second position in the prompt word template to obtain the updated prompt word.
7. The method for determining a user profile according to claim 1, characterized in that, After determining the optimized result as the user profile indicated by the query instruction, the method further includes: The user profile is fed back to the target object that sent the query command; Where the query instruction includes a tendency prediction indicator, the user profile also includes a target category tendency prediction score, wherein the tendency prediction indicator includes the target category tendency.
8. A device for determining a user profile, characterized in that, include: The retrieval module is used to perform a retrieval operation in a preset knowledge base based on the received query instruction, and obtain the knowledge base retrieval results. The preset knowledge base is constructed using multi-source data, which includes the behavioral data of the target user of the user profile requested by the query instruction on multiple platforms. The construction module is used to construct prompt words based on the retrieval results from the knowledge base and the query instructions; An optimization module is used to input the prompt words into a large language model, so as to perform multi-round prompt optimization on the output of the large language model through the prompt words; The determination module is used to determine the obtained optimization result as the user profile indicated by the query instruction.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.