Group chat data processing method and device, electronic equipment and storage medium

By listening to user chat data in group chat scenarios and utilizing pre-trained intelligent agents to participate in group chats, the problem of monotonous AI chat experience is solved, and interaction between multiple users and intelligent agents is realized, improving user experience and fun.

CN122124474APending Publication Date: 2026-06-02NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2024-12-02
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, AI chat scenarios are mainly one-to-one chats between a single user and an intelligent agent, resulting in a low user experience and a lack of interactivity and fun.

Method used

This paper provides a group chat data processing method. By listening to user chat data in a group chat scenario, a pre-trained agent participates in the group chat when preset trigger conditions are met, realizing the interaction between multiple users and the agent, including active and passive chat actions. The method also utilizes a large language model (LLM) to generate more personalized and user-friendly responses.

Benefits of technology

It enhances the user's AI chat experience, increases the interactivity and fun of group chat scenarios, deepens the interaction between users and the intelligent agent, provides emotional companionship, and improves user stickiness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122124474A_ABST
    Figure CN122124474A_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, electronic device, and storage medium for processing group chat data, relating to the field of intelligent agent technology, and alleviates the technical problem of low user experience in AI chat. The method includes: monitoring user chat data in a group chat scenario; the group chat scenario includes a pre-trained intelligent agent and at least two users, each intelligent agent corresponding to preset group chat triggering conditions; the user chat data includes the user's message content and message initiation time; in response to the user chat data satisfying the group chat triggering conditions, the intelligent agent performs chat actions in the group chat scenario based on the user chat data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of intelligent agent technology, and in particular to a group chat data processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] Many software programs have chat functionality with intelligent agents. For example, in a game, a user can ask questions to a non-user character (NPC) controlled by an intelligent agent, or a user can chat with an intelligent question-and-answer robot, and so on.

[0003] Currently, AI chat scenarios between users and intelligent agents are all one-to-one, meaning a real user chats with an intelligent agent. For example, a user asks a question to an intelligent question-answering robot, and the robot answers the question. However, this one-to-one AI chat method is too monotonous, resulting in a low user experience. Summary of the Invention

[0004] The purpose of this disclosure is to provide a method, apparatus, electronic device, and storage medium for processing group chat data, so as to alleviate the technical problem of low user experience in AI chat.

[0005] In a first aspect, embodiments of this disclosure provide a group chat data processing method, the method comprising:

[0006] Monitor user chat data in a group chat scenario; the group chat scenario includes a pre-trained agent and at least two users, the agent corresponds to a preset group chat trigger condition; the user chat data includes the user's message content and the message initiation time;

[0007] In response to the user chat data satisfying the group chat triggering condition, the intelligent agent performs chat actions in the group chat scenario based on the user chat data.

[0008] Secondly, a group chat data processing device is provided, including:

[0009] A monitoring module is used to monitor user chat data in a group chat scenario; the group chat scenario includes a pre-trained agent and at least two users, and the agent corresponds to a preset group chat trigger condition; the user chat data includes the user's message content and the message initiation time;

[0010] An execution module is used to respond to the user chat data satisfying the group chat triggering condition, and the intelligent agent performs chat actions in the group chat scenario based on the user chat data.

[0011] Thirdly, embodiments of this disclosure also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method described in the first aspect above.

[0012] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method described in the first aspect above.

[0013] The embodiments disclosed herein bring the following beneficial effects:

[0014] This disclosure provides a group chat data processing method, apparatus, electronic device, and storage medium. It monitors user chat data in a group chat scenario involving a pre-trained agent and at least two users. The user chat data includes the user's message content and the message initiation time. In response to the user chat data meeting preset group chat trigger conditions for the agent, the agent performs chat actions in the group chat scenario based on the user chat data. In this solution, the pre-trained agent can be applied to group chat scenarios. This agent can monitor the chat data of multiple users in the group chat scenario and trigger its own participation in the group chat when the user chat data meets certain conditions. This realizes an AI group chat scenario between one agent and multiple users, avoiding the monotony of one-on-one AI chat, thereby improving the user's AI chat experience and alleviating the technical problem of a low user experience in AI chat.

[0015] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 The illustration shows an application scenario provided by an embodiment of this disclosure;

[0018] Figure 2 A schematic diagram of the structure of a mobile phone provided in an embodiment of this disclosure is shown;

[0019] Figure 3A flowchart illustrating the group chat data processing method provided in this embodiment of the disclosure;

[0020] Figure 4 An example of a data flow diagram for a chat NPC scenario in the group chat data processing method provided in this application and this disclosure embodiment;

[0021] Figure 5 An example of a flowchart of the main modules of the chat NPC scenario in the group chat data processing method provided in this embodiment of the disclosure;

[0022] Figure 6 An example of a flowchart illustrating the memory mechanism in the group chat data processing method provided in this embodiment of the disclosure;

[0023] Figure 7 An example of a security policy processing flowchart in the group chat data processing method provided in this disclosure embodiment;

[0024] Figure 8 This is a schematic diagram of the structure of a group chat data processing device provided in an embodiment of the present disclosure;

[0025] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions 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, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0027] The terms “comprising” and “having”, and any variations thereof, used in the embodiments of this disclosure are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or devices.

[0028] Currently, the application scenarios of intelligent chat in games can include multiple areas. For example, in-game chat channels for users in the same city (referred to as "city channels") need to further enhance social activity and improve user retention. It is hoped that AI can play a significant positive role in generating social buzz, while personalized AI chat interactions allow users to develop a more comprehensive and three-dimensional understanding of the main characters, making their images more vivid and well-rounded. Another example is the anthropomorphic companionship of characters in games. Users need emotional support outside of gameplay, and the project team also needs to further convey the character design of virtual summoned beasts through personalized chat interactions. Intelligent NPCs transform virtual summoned beasts into social friends for users, allowing users to receive positive feedback through AI chat, thereby maintaining user emotional connection and increasing user stickiness.

[0029] These applications not only enhance the interactivity and fun of games but also provide users with a more immersive experience. AI technology transforms NPCs in games from monotonous programmed characters into virtual partners capable of deep interaction with users. With further technological advancements, AI will play an increasingly important role in games. AIGC has demonstrated significant application prospects in fields such as film production, virtual reality, and gaming.

[0030] However, most current AI chat scenarios are one-to-one, meaning a real user chats with a single AI agent. There is no specific adaptation for chat scenarios involving multiple users chatting with a single AI agent, resulting in a low user experience in AI chat.

[0031] Based on this, the present disclosure provides a group chat data processing method, apparatus, electronic device, and storage medium, which can alleviate the technical problem of low user experience in AI chat.

[0032] In one embodiment of this disclosure, the group chat data processing method can run on a local terminal device or a server. When the group chat data processing method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices.

[0033] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of group chat data processing are completed on the cloud gaming server. The client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the user operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.

[0034] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the user through a graphical user interface, that is, conventionally downloading, installing, and running the game program via an electronic device. The local terminal device can provide the graphical user interface to the user in various ways, such as rendering it on the terminal's display screen or providing it to the user through holographic projection. For example, the local terminal device can include a display screen for displaying the graphical user interface, which includes game screens, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.

[0035] In one possible implementation, this disclosure provides a group chat data processing method that provides a graphical user interface through a terminal device, wherein the terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.

[0036] For example, such as Figure 1 As shown, Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. The application scenario may include an electronic terminal (e.g., mobile phone 102) and a server 101. The electronic terminal can communicate with the server 101 via a wired or wireless network. The electronic terminal is used to run a virtual desktop, through which it can interact with the server 101 to edit content on the server 101.

[0037] This embodiment uses mobile phone 102 as an example to illustrate the electronic terminal. Mobile phone 102 includes components such as a radio frequency (RF) circuit 110, a memory 120, and a processor 130. Those skilled in the art will understand that... Figure 2 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements.

[0038] The RF circuit 110 can also communicate wirelessly with networks and other devices. The wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).

[0039] The memory 120 can be used to store software programs and modules. The processor 130 executes various functional applications and data processing of the mobile phone 102 by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone 102, etc. In addition, the memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0040] The processor 130 is the control center of the mobile phone 102. It connects various parts of the mobile phone through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it performs various functions of the mobile phone 102 and processes data, thereby monitoring the mobile phone as a whole.

[0041] The embodiments of this disclosure will be further described below with reference to the accompanying drawings.

[0042] Figure 3This is a flowchart illustrating a group chat data processing method provided in an embodiment of this disclosure. This method can be applied to intelligent agents. Figure 3 As shown, the method includes:

[0043] Step S310: Listen to user chat data in the group chat scenario.

[0044] In this group chat scenario, there are pre-trained agents and at least two users, and each agent has a preset group chat trigger condition. As an example, the solution provided in this disclosure can be applied to a group chat scenario of an intelligent NPC (agent), in which multiple users can chat with one intelligent NPC.

[0045] It should be noted that an intelligent agent refers to a proxy that can perceive the environment in a group chat scenario and take actions (execute chat actions) to achieve a specific goal. The intelligent agent in this embodiment can be software or a system, possessing autonomy, adaptability, and interactive capabilities. The intelligent agent perceives changes in the group chat environment (e.g., through data input), makes judgments and decisions based on its learned knowledge and algorithms, and then executes chat actions to influence the environment or achieve predetermined goals. The core of the intelligent agent lies in its ability to learn autonomously and continuously evolve to better complete tasks and adapt to complex environments.

[0046] As an optional implementation, the agent in this embodiment is a model trained using historical group chat data. The model trained using historical group chat data is determined by the trained target Large Language Model (LLM), such as... Figure 4 As shown, the model generated by training with historical group chat data is determined through the trained target LLM. LLM is an artificial intelligence model that uses machine learning techniques to understand and generate human language. For example, the group chat scenario of intelligent NPCs is an application scenario of LLM role-playing, thereby enabling users to enjoy a richer chat experience through casual conversation.

[0047] The user chat data includes the content of the user's messages and the time the message was initiated. As an example of the message content, an empty message means that no user has spoken in the chat room corresponding to the group chat scenario. This can also be considered a situation that meets the triggering conditions for the group chat. In this case, the intelligent agent can be activated, that is, the intelligent agent speaks first.

[0048] In step S320, in response to the user's chat data meeting the group chat triggering conditions, the intelligent agent performs chat actions in the group chat scenario based on the user's chat data.

[0049] In practical applications, the timing of an agent speaking in a group chat scenario can be varied, meaning that group chat triggering conditions can include various types of triggering conditions, such as active group chat triggering conditions and passive group chat triggering conditions.

[0050] As an example, a group chat triggering condition can include a passive group chat triggering condition, where the user's chat data contains a pending instruction for the agent. This step can specifically include the following steps: in response to the pending instruction for the agent being contained in the user's chat data, the agent performs a chat action in the group chat scenario according to the pending instruction.

[0051] During a chat between a user and an intelligent agent, the intelligent agent can respond to user commands. For example, when a user names a chatbot (intelligent agent), the chatbot passively responds, or when a user asks a question to the chatbot, the chatbot passively answers the question. This improves the accuracy of the intelligent agent's timing of speaking in group chat scenarios.

[0052] For example, if a user requests a response from an agent (e.g., designates an agent to respond), the agent will respond to the user. To avoid the agent responding too frequently and weakening communication between users, the agent may not respond every time, employing a response judgment method that combines rules and algorithms. For instance, the agent will not respond if any of the following conditions are not met: security compliance check passed, with a separate security compliance judgment module ensuring user input compliance; positive sentiment analysis, with a sentiment classification model ensuring positive sentiment in user input; other rules, such as activation conditions, cooldown time, and queries per second (QPS) limits.

[0053] As another example, group chat triggering conditions include proactive group chat triggering conditions; this step may specifically include the following steps: in response to user chat data meeting the proactive group chat triggering conditions, selecting a target proactive topic to be initiated from multiple preset proactive topics based on the user chat data; the agent performs dialogue actions in the group chat scenario based on the target proactive topic.

[0054] For example, beyond passive responses when an agent is called upon or asked a question, an agent can also proactively speak in a group chat under certain conditions, even if it hasn't been called upon or asked. This can be understood as the agent actively initiating topics or interjecting in group chats even without user mentions, if user chat data meets certain conditions. This prevents awkward silences and enhances the overall activity and experience of group chats involving multiple users and the agent.

[0055] In one alternative implementation, when the atmosphere in a group chat becomes quiet or the topic becomes monotonous, the agent can proactively initiate a new topic to revitalize the channel. The specific strategy involves configuring a proactive topic library (preset proactive topics) and triggering it based on rules. For example, a specific rule could be that the last message was more than ten minutes old and the last message was not from an agent.

[0056] The pre-set proactive topics can be obtained through online user data analysis and offline collection. For example, they can include popular topics such as brain teasers and cheesy pickup lines, interactive topics such as telling jokes and solving riddles, and game-related topics such as anecdotes. At the same time, online user data is collected regularly to conduct offline data analysis of the topics, adding positive feedback topics and popular topics, and removing negative feedback topics to ensure high user engagement for proactive topics.

[0057] As an optional implementation, the triggering conditions for proactive group chat can include various situations, thereby making the timing of the agent's proactive speech more flexible. For example, the triggering conditions for proactive group chat include any one or more of the following: user chat data meets a preset data format; sentiment analysis data of the user chat data conforms to a preset sentiment type; the number of topics in the user chat data is less than a preset number of topics; no user chat data is generated within a first preset time period in the group chat scenario; and the number of times user chat data is generated within a second preset time period in the group chat scenario is greater than a preset number. Examples of the preset data formats include text, images, animated emoticons, etc.

[0058] It's important to note that existing AI chat scenarios are all one-to-one, meaning a conversation between a real user and an AI, with the AI ​​trained using data from their individual chat logs. This solution, however, is designed for group chats where multiple real users interact with a single AI. This AI is trained using multi-user chat logs that include both one-to-one and multi-to-group chat data. In group chats, the AI ​​is triggered to participate when user chat data meets certain conditions.

[0059] The AI ​​agent generated by training on historical group chat data can be applied in group chat scenarios. In group chat scenarios, the AI ​​agent can monitor the chat data of multiple users and trigger itself to participate in the group chat when the user chat data meets certain conditions, realizing an AI group chat scenario between one AI and multiple users, avoiding the monotony of one-on-one AI chat, and thus improving the user's AI chat experience.

[0060] In this embodiment, the AI ​​achieves a significant effect on activating user participation in group chats by using an intelligent agent with appropriate speaking rhythm. Simultaneously, the example of user interaction and companionship with a virtual IP (intelligent agent) provides a model for AI-human interaction. From a gaming perspective, this genuinely provides emotional companionship to users, indirectly enhancing user engagement and their sense of identification with the IP.

[0061] The steps described above will be explained in detail below.

[0062] In some embodiments, a more comprehensive answer can be generated by retrieving pre-defined knowledge data. As an example, the above response to user chat data includes pending instructions for the agent. The agent performs chat actions in a group chat scenario based on these pending instructions, which may specifically include the following steps:

[0063] In response to a user's chat data containing a command to be responded to for the agent, the system retrieves target preset knowledge data related to the target user's chat data corresponding to the command to be responded to from preset knowledge data; the target preset knowledge data and the target user's chat data are input into a large language model (LLM) to obtain a first output result, and a first response result for the command to be responded to is obtained based on the first output result; the agent performs chat actions in a group chat scenario according to the first response result.

[0064] For example, to further enhance the realism of the agent, additional reference information can be provided, and a pre-defined knowledge profile can be added to the agent. For instance, a regional knowledge base can be attached to the agent, including local geography, local specialties and cuisine, and addresses of specialty shops. This specialized regional knowledge base supplements the Large Language Model (LLM) knowledge, and RAG technology is used to enhance the agent's knowledge breadth. For example, a knowledge base could be built for game-related knowledge or other common sense, such as... Figure 4 and Figure 5 As shown, the Retrieval Augmentation (RAG) mechanism enables large language models to utilize external information sources such as knowledge points. Specifically, the RAG mechanism can be used to retrieve relevant knowledge points from the knowledge base to enhance model performance.

[0065] In this embodiment of the disclosure, when the user interacts with the intelligent agent, the intelligent agent can generate responses with more regional and other characteristics based on relevant knowledge such as location, thereby enhancing the granularity of the intelligent agent. This helps the large language model generate more accurate, comprehensive, and context-appropriate answers, while also effectively reducing the possibility of generating misleading information.

[0066] In some embodiments, similar knowledge data can be determined through vector comparison, making the retrieval results in the preset knowledge data more accurate. As an example, retrieving target preset knowledge data related to the target user's chat data corresponding to the instruction to be responded to from the preset knowledge data may specifically include the following steps:

[0067] Based on the instruction to be responded to, target user chat data is filtered from the user chat data; the target user chat data corresponding to the instruction to be responded to is converted into vector form chat data; the vector form chat data is compared with the vector form preset knowledge data to obtain the comparison result; based on the comparison result, target preset knowledge data that matches the target user chat data is determined from the preset knowledge data.

[0068] In this embodiment of the disclosure, the knowledge data most similar to the user's chat data is retrieved from the preset knowledge data by means of vector comparison, which makes the retrieval results in the preset knowledge data more accurate, so that the agent's answer results are closer to the user's chat data.

[0069] In some embodiments, model processing can be performed using model prompts to improve the model's data processing efficiency. As an example, the above-mentioned input of target preset knowledge data and target user chat data into a Large Language Model (LLM) may specifically include the following steps: adding the target preset knowledge data and target user chat data to a model prompt template to obtain a first model prompt, and inputting the first prompt into the LLM.

[0070] For example, first, in the regional knowledge base (preset knowledge data), the most similar entries to the current user's input query (target user chat data) are retrieved. This involves converting the query into a vector using an embedding vector model, allowing for precise vector-based comparison between the query and other contextual information in the regional knowledge base. This similarity search identifies the top k most similar data entries (target preset knowledge data) in the regional knowledge base. Then, the query and the retrieved additional information (the top k entries) are integrated into a preset template to obtain the Prompt. Finally, this enhanced Prompt can be input into the LLM (Large Language Model) to enable the large language model to generate the required output more efficiently. It should be noted that the model prompt template described above can be understood as the concatenation format and order for generating the Prompt.

[0071] In some embodiments, historical data can be incorporated into group chat scenarios as a memory, summarizing and extracting important memories from historical chat records, which can enhance the generation effect of the large language model. As an example, the aforementioned group chat triggering conditions include preset historical data triggering conditions. In response to user chat data meeting the group chat triggering conditions, the agent performs chat actions in the group chat scenario based on the user chat data, which may specifically include the following steps:

[0072] In response to user chat data meeting preset historical data trigger conditions, target historical key data related to user chat data is determined from historical key data; wherein, historical key data is key data extracted from historical user chat data in group chat scenarios;

[0073] The target's historical key data and user chat data are added to the Template to obtain the second Prompt. The second Prompt is then input into the LLM to obtain the second output result. Based on the second output result, the second response result corresponding to the user chat data is obtained. The agent performs chat actions in the group chat scenario according to the second response result.

[0074] As an optional implementation method, such as Figure 4 , Figure 5 and Figure 6 As shown, when a situation similar to subjective memory and / or objective memory occurs in the current group chat scenario, the memory mechanism triggers the concatenation of the user input and this similar subjective memory and / or objective memory, and calls the large language model to reply based on the concatenated data.

[0075] For example, such as Figure 6 As shown, the core components of the memory mechanism include an information extractor and triggers. The information extractor is responsible for offline extraction of subjective and objective memories from historical records and storing them in a database as a list. The trigger determines when to use the memory, such as when the user is silent, when the user input is similar to the memory point, or when the triggering time is determined according to time rules, etc. At the appropriate triggering time, the user input and the memory point are concatenated, and the large model is invoked to generate the final model response.

[0076] In this embodiment, not all historical key data (such as all user personal information) is added to the second model prompt words. Instead, only the target historical key data related to the current user's chat data is added to the second model prompt words. This avoids the situation where the model cannot input all historical records due to the limited length of the model prompt words input by the large model, which would result in data loss in the model.

[0077] In some embodiments, the preset historical data triggering condition corresponds to a preset historical key data extraction standard, which includes any one or more of the following: data related to user objective information, data related to user subjective emotions, and data related to user subjective preferences. The method may further include the following steps: obtaining historical user chat data of the group chat scenario; extracting key data from the historical user chat data according to the historical key data extraction standard, and determining the extracted key data as the historical key data.

[0078] It's important to note that most of the historical data is unimportant. Therefore, it's necessary to extract the key information and store it as objective memory, such as the objective memory that the user resides in Shanghai. Furthermore, based on experience in real-world social scenarios, the AI ​​agent's persona should dynamically adjust with the interaction process, rather than remaining static. Therefore, it's necessary to summarize the dynamic information in the historical data, which is usually subjective, such as whether the user is currently unhappy or somewhat sad.

[0079] As an optional implementation method, the key data includes objective information and subjective information (dynamic information) from historical user chat data. Objective information can be objective data such as the user's name and address; subjective information can be the user's emotional information (e.g., the user is currently unhappy, the user is currently somewhat sad), the user's current preferences, and other subjective dynamic information.

[0080] By incorporating historical data into group chat scenarios as a form of memory, and summarizing and extracting important memories from historical chat records, the generation effect of large language models can be enhanced, thereby improving the user experience and the AI-like human-like feel of intelligent agents.

[0081] In some embodiments, the preset historical data triggering conditions described above may include multiple scenarios to make the use of historical data more flexible. As an example, the preset historical data triggering conditions may include any one or more of the following:

[0082] User chat data includes data related to historical key data, chat events corresponding to user chat data are similar to historical chat events corresponding to historical key data, and the current chat atmosphere corresponding to user chat data is similar to the historical chat atmosphere corresponding to historical key data.

[0083] In some embodiments, training samples may include chat data of virtual characters with a specified persona, compliant and secure dialogue data, etc., to enable the model to conform to the specified persona and perform secure and compliant dialogues, thereby improving the model's training performance. As an example, a model generated using historical group chat data is determined by the trained target LLM, whose training samples include historical group chat data and any one or more of the following:

[0084] Chat data based on virtual characters with preset personas, chat data conforming to preset security rules, chat data generated through interruption, chat data generated through gameplay, chat data containing comparison data, chat data containing command data, and chat data after the group chat AI is launched.

[0085] To prepare training data more efficiently and generate only the necessary data, the training data, for example, is roughly divided into the following parts according to experience and character design. Each part is in a certain proportion to form the final training data: NPC character question and answer data to strengthen the stability of the basic NPC character design; security enhancement data, which addresses responses to security attack issues, such as enhancing the basic security capabilities of the model for protecting minors; facial expression question and answer data, which adapts to the project team's facial expression encoding data, enabling the model to respond with facial expressions, making it more human-like; online cleaned data, which cleanses high-quality question and answer data from online data, enabling the model to strengthen positive responses; interruption data, which addresses interruption scenarios in group chats, allowing the model to join the conversation more naturally; text game data, which generates gameplay data for text games, such as riddles and brain teasers, to increase the fun of group chats; user question and answer data from the NPC interaction leaderboard, which prepares comparative data on the model's responses to users and ordinary users in the interaction leaderboard to highlight the privileges of the leaderboard leader; and command data, which addresses response data to user commands sent in group chats, enhancing the diversity of the model's command responses. To ensure that the large language model performs well in group chat scenarios such as security, word games, interruption, and proactive speaking, the above sample data can be allocated in an appropriate ratio to form the final training data.

[0086] As an alternative implementation, by adding compliant and secure dialogue data (chat data that conforms to preset security rules) to the training samples of the large language dialogue model, the trained large language model can be equipped with security detection capabilities, fundamentally enhancing the model's security and further reducing security risks.

[0087] As another alternative implementation, by adding the chat data of a specified character (the chat data of a virtual character with a preset persona) to the training samples of the large language dialogue model, the model's anthropomorphism and role-playing consistency can be enhanced, such as... Figure 4As shown, ensuring that the training data of the model is consistent with the expectations enhances the anthropomorphism of role-playing. That is, the general language model generates content that is consistent with the preset character setting during the role performance process, and makes words and deeds that conform to the character setting.

[0088] In this embodiment of the disclosure, the training samples may include various data such as chat data of a specified persona and compliant and secure dialogue data, which can enable the model to achieve various effects such as conforming to the specified persona and performing compliant and secure dialogue, thereby further improving the training effect of the large language model.

[0089] In some embodiments, training samples can be generated through thought chains, thereby improving the quality of the training samples. As an example, training samples for a target large language model are generated as follows: based on a target Prompt with thought chains, data processing is performed through a language model to obtain intermediate processing results; the intermediate processing results are added to the target Prompt, and based on the target Prompt with the added intermediate processing results, data processing is performed again through a language model to obtain the final processing result; training samples are obtained based on the final processing result.

[0090] It should be noted that Chain-of-Thought is a discrete cue learning method, which is contextual learning within a large model. That is, without training, examples are added before the current sample input, so that the model can complete the task by inputting these texts at once.

[0091] As an optional implementation, during the training sample data generation phase, model prompts with thought chains are used to encourage the large language model to explain its reasoning process. Intermediate results are then added to the model prompts, leading to more accurate target data in a chain-like manner. For example, other large language models can be run using model prompts with thought chains to obtain intermediate results from their responses. These intermediate results are then added to the model prompts, and the above steps are repeated to obtain the final response from the large language model. This final result is used as the initial training sample data, i.e., the aforementioned target data. With ordinary model prompts, the model answers incorrectly, but if given some problem-solving ideas, the model can answer correctly.

[0092] In this embodiment of the disclosure, model prompts with thought chains can be used to call a generative pre-trained deep learning model (GPT) to construct high-quality training sample data, thereby ensuring that the training data of the model is consistent with expectations.

[0093] In some embodiments, filtering training samples by a predefined target type using a binary classification model can further improve the quality of the training samples. As an example, the training samples obtained based on the final processing result include:

[0094] The trained binary classification model is used to determine whether the final processing result belongs to the preset target type of chat data; the classification of the binary classification model includes the preset target type and non-preset target type; the chat data belonging to the preset target type is determined as the training sample of the target LLM.

[0095] As an optional implementation method, in addition to using rules such as format normalization, removal of illegal characters such as English letters and symbols, and data deduplication for batch screening of training sample data, it is also possible to combine deep reinforcement learning (RLHF) technology based on user preferences. By combining feedback data of online users to the agent's responses, a trained binary classification model (such as a reward model) can be used to score the initial screening data for secondary screening. That is, the binary classification model is used to judge the quality of the responses of the target data. The target data with better responses (i.e., the user's expectations) is used as the final training sample data, and the responses expected by the user are retained as much as possible as the final training data.

[0096] In this embodiment of the disclosure, a binary classification model is used to screen training samples for preset target types, which ensures the validity and high quality of the data from the source and guarantees that the training data of the model is consistent with expectations.

[0097] In some embodiments, the trained LLM model can be tested in chat mode, and the final model to be used can be determined based on the test results to ensure the effectiveness of the model's chat application. As an example, the above methods for determining the final model using the trained target LLM include:

[0098] Obtain multiple trained target LLMs; for each target LLM, obtain the model parameters of the target LLM, and conduct chat tests based on the model parameters to obtain chat test data; test the chat test data according to preset test standards to obtain test results; determine the final model corresponding to the agent from multiple target LLMs based on the test results corresponding to multiple target LLMs.

[0099] For example, in order to determine the optimal LLM model, such as Figure 4As shown, in this embodiment, a model evaluation mechanism is added after obtaining the LLM base model, including automated evaluation and semi-automated evaluation. Automated evaluation can be understood as performing system testing based on the model parameters configured in the trained LLM model. Specifically, the system uses the trained LLM model to simulate dialogue, obtaining the dialogue response results of each LLM model in the simulated dialogue. The system can automatically test the dialogue response results according to evaluation metrics to obtain test results. These test results are used to select the best LLM model from the multiple trained LLM models tested.

[0100] For automated evaluation, for example, an automated model evaluation tool is developed based on the open-source OpenCompass framework. This tool supports remote calls in completion / chat modes, covers all common public evaluation datasets and supports custom datasets. It also includes evaluation task management, evaluation result visualization, model call testing, logging, and intermediate result recording functions. The main workflow of a single evaluation includes: evaluation configuration (call address, model parameters, dataset configuration, etc.); assembling the prompt and calling the model to obtain inference results; post-processing the inference results and obtaining evaluation results according to evaluation metrics; and summarizing and displaying the results, supporting comparison of results from multiple models.

[0101] For semi-automated evaluation, for example, it is jointly maintained by the planner and QA, with a custom question list for the model persona and other dimensions, batch test results, and manual review, which facilitates quick comparison of model performance.

[0102] As an optional implementation, during the internal model performance evaluation phase, automated evaluation is performed first, with only a small number of key samples undergoing semi-automated or manual evaluation. During the internal testing phase, most interactions are one-on-one, which is not suitable for multi-person group chat scenarios. Considering both project confidentiality and ease of implementation, a group chat simulation scenario was built based on a bot, allowing for direct multi-person testing of intelligent group chats within the chat group. Furthermore, to simulate online performance and facilitate quick and easy observation of the model's overall online performance, the entire process from the external server to the large model and then to the forwarding bot can be streamlined. The model can directly generate responses based on online messages and synchronize them to the chat group via the forwarding bot.

[0103] In practical applications, due to differences in datasets and the fact that test conditions are not always identical, it is difficult to make fair comparisons of the evaluation results of different models. Furthermore, the provided test datasets are generally publicly available English datasets, which are not aligned with the application scenarios.

[0104] In this embodiment, the completed model evaluation process facilitates the selection of the initial base model and the horizontal comparison of the fine-tuned model. It also manages the test records throughout the entire process, allowing for historical reference and expansion of test cases. Furthermore, the comprehensive model performance evaluation mechanism avoids the situation where the novel application scenario of chatbots leads to a lack of readily available evaluation datasets and processes in the industry, thus affecting the effectiveness of the model's chat application.

[0105] In some embodiments, security and compliance checks can be performed on user chat content, which can improve the data security of chat content in group chat scenarios. As an example, after monitoring user chat data in a group chat scenario as described above, the method may further include the following steps:

[0106] The system checks whether user chat data complies with preset security rules. If user chat data does not comply with preset security rules, chat actions are performed in group chat scenarios based on preset compliant response data. If user chat data complies with preset security rules, chat actions are performed in group chat scenarios based on user chat data.

[0107] For example, such as Figure 4 and Figure 7 As shown, after the user inputs data, the security classification model performs security checks on the input data. If the input does not conform to the rules (preset security rules), the model responds with preset content; only if it conforms does it proceed to the next step of response processing. Furthermore, by adding secure dialogue data to the training samples of the large language dialogue model, the trained large language model can be endowed with security detection capabilities, fundamentally enhancing the model's security and further reducing security risks.

[0108] As an optional implementation, a blocking strategy is adopted to protect system security and prevent users from attempting to input sensitive information. When sensitive information is detected, users are categorized into low-risk, high-risk, or permanently banned based on their risk level, and corresponding measures are taken, such as muting or restricting access permissions, to ensure the security of the system and other users. The specific strategies (number of occurrences, statistics duration, and ban duration) for low-risk, high-risk, and timed offline statistics can be customized according to the project team's needs. Furthermore, to address malicious attacks from a very small number of online users and to quickly respond to online emergencies, manual user blocking is supported.

[0109] By using a security detection module as a security defense line, user input is checked for safety and compliance, thus preventing serious online incidents caused by the inability to effectively prevent users from probing into sensitive information.

[0110] In some embodiments, security and compliance checks can be performed on the chat content to be sent by the intelligent agent, which can improve the data security of chat content in group chat scenarios. As an example, the intelligent agent described above performs chat actions in a group chat scenario based on user chat data, which may specifically include the following steps:

[0111] The process involves determining the third response result of the intelligent agent in response to user chat data; detecting whether the third response result conforms to preset security rules; if the third response result conforms to the preset security rules, the intelligent agent performs dialogue actions in the group chat scenario based on the third response result; if the third response result does not conform to the preset security rules, the intelligent agent performs dialogue actions in the group chat scenario based on preset compliant response data. It is understood that the third response result in this embodiment may include the first response result and the second response result, wherein the determination methods of the first response result and the second response result are as described above and will not be repeated here.

[0112] For example, security checks are performed on the agent's responses to user queries. For instance, security checks are performed not only on the user's responses to the agent, but also on the agent's responses to user queries; only if the checks pass are the agent executed with the response.

[0113] In this embodiment of the disclosure, the content to be responded to by the model also undergoes a security detection process. For example, such as... Figure 4 and Figure 5 As shown, the content to be responded to by the model is subject to security checks through a security detection mechanism. If the content to be responded to by the model complies with the rules (preset security rules), the content to be responded to by the model is sent.

[0114] By using a security detection mechanism as a security defense line, the model's responses are tested for security. This means that the responses of the intelligent agent are tested to ensure they are safe and compliant, thus avoiding serious online incidents caused by the fact that the current randomness of model responses makes it impossible to effectively prevent users from probing for sensitive information.

[0115] Figure 8 A schematic diagram of a group chat data processing device is provided. This device can be applied to intelligent agents. Figure 8 As shown, the group chat data processing device 800 includes:

[0116] The monitoring module 801 is used to monitor user chat data in a group chat scenario; the group chat scenario includes a pre-trained agent and at least two users, and the agent corresponds to a preset group chat trigger condition; the user chat data includes the user's message content and the message initiation time;

[0117] The execution module 802 is used to respond to the user chat data satisfying the group chat triggering condition, and the intelligent agent performs chat actions in the group chat scenario based on the user chat data.

[0118] Through the above methods, the pre-trained agent can be applied to group chat scenarios. In group chat scenarios, the agent can monitor the chat data of multiple users and trigger itself to participate in the group chat when the user chat data meets certain conditions, realizing an AI group chat scenario between one agent and multiple users. This avoids the monotony of one-on-one AI chat, thereby improving the user's AI chat experience and alleviating the technical problem of low user AI chat experience.

[0119] In one feasible implementation, the group chat triggering condition includes an active group chat triggering condition; the execution module is specifically used to: in response to the user chat data satisfying the active group chat triggering condition, select a target preset active topic to be initiated from multiple preset active topics according to the user chat data; the intelligent agent performs dialogue actions in the group chat scenario based on the target preset active topic.

[0120] In a feasible implementation, the active group chat triggering conditions include any one or more of the following: the user chat data meets a preset data format, the sentiment analysis data of the user chat data conforms to a preset sentiment type, the topic types of the user chat data are less than a preset number of types, no user chat data is generated within a first preset time period in the group chat scenario, and the number of times the user chat data is generated within a second preset time period in the group chat scenario is greater than a preset number.

[0121] In one feasible implementation, the group chat triggering condition includes a passive group chat triggering condition, wherein the passive group chat triggering condition is that the user chat data contains a pending response instruction for the intelligent agent; the execution module is further configured to: in response to the user chat data containing a pending response instruction for the intelligent agent, the intelligent agent performs a chat action in the group chat scenario according to the pending response instruction.

[0122] In a feasible implementation, the execution module is specifically configured to: in response to the user chat data containing a pending instruction for the agent, retrieve target preset knowledge data related to the target user chat data corresponding to the pending instruction from preset knowledge data; input the target preset knowledge data and the target user chat data into a Large Language Model (LLM) to obtain a first output result of the LLM, and obtain a first response result for the pending instruction based on the first output result; and have the agent perform chat actions in the group chat scenario according to the first response result.

[0123] In a feasible implementation, the execution module is further configured to: filter target user chat data in the user chat data based on the instruction to be responded to; convert the target user chat data into vector form chat data; compare the vector form chat data with vector form preset knowledge data to obtain a comparison result; and determine target preset knowledge data that matches the target user chat data from the preset knowledge data based on the comparison result.

[0124] In a feasible implementation, the execution module is specifically used to: add the target preset knowledge data and the target user chat data to the model prompt template to obtain the first model prompt word, and input the first model prompt word into the large language model.

[0125] In a feasible implementation, the group chat triggering condition includes a preset historical data triggering condition, and the execution module is further configured to: in response to the user chat data satisfying the preset historical data triggering condition, determine target historical key data related to the user chat data from historical key data; wherein, the historical key data is key data extracted from the historical user chat data of the group chat scenario; add the target historical key data and the user chat data to the model prompt template to obtain a second model prompt word, and input the second model prompt word into the large language model to obtain a second output result, and obtain a second response result corresponding to the user chat data based on the second output result;

[0126] The agent performs chat actions in the group chat scenario based on the second response result.

[0127] In a feasible implementation, the preset historical data triggering conditions include any one or more of the following: the user chat data contains data related to the historical key data, the chat event corresponding to the user chat data is similar to the historical chat event corresponding to the historical key data, and the current chat atmosphere corresponding to the user chat data is similar to the historical chat atmosphere corresponding to the historical key data.

[0128] In a feasible implementation, the preset historical data triggering condition corresponds to a preset historical key data extraction standard, which includes any one or more of the following: data related to user objective information, data related to user subjective emotions, and data related to user subjective preferences. The method further includes: acquiring historical user chat data of the group chat scenario; extracting key data from the historical user chat data according to the historical key data extraction standard, and determining the extracted key data as the historical key data.

[0129] In one feasible implementation, the agent is a model generated by training with historical group chat data, and the model generated by training with historical group chat data is determined by a target large language model after training.

[0130] In a feasible implementation, the training samples of the target large language model include the historical group chat data and any one or more of the following: chat data based on virtual characters with preset personas, chat data that conforms to preset security rules, chat data formed by interrupting, chat data formed by playing games, chat data containing comparison data, chat data containing instruction data, and chat data after data cleaning.

[0131] In a feasible implementation, the training samples of the target large language model are generated as follows: based on the target prompt words with thought chains, data processing is performed through the language model to obtain intermediate processing results; the intermediate processing results are added to the target prompt words, and based on the target prompt words with the added intermediate processing results, data processing is performed again through the language model to obtain the final processing results; the training samples are obtained based on the final processing results.

[0132] In a feasible implementation, the process of obtaining the training samples based on the final processing result includes: using a trained binary classification model to determine whether the final processing result belongs to a preset target type of chat data; wherein, the classification of the binary classification model includes the preset target type and non-preset target types; and determining the chat data belonging to the preset target type as the training samples of the target large language model.

[0133] In a feasible implementation, the method of determining the final model through the trained target large language model includes: acquiring multiple trained target large language models; acquiring model parameters for each target large language model, and conducting chat tests based on the model parameters to obtain chat test data; testing the chat test data according to a preset test standard to obtain test results; and determining the final model corresponding to the agent from the multiple target large language models based on the test results corresponding to the multiple target large language models.

[0134] In one feasible implementation, the device further includes: a detection module, configured to, after monitoring user chat data in the group chat scenario, detect whether the user chat data conforms to preset security rules; if the user chat data does not conform to the preset security rules, then perform a chat action in the group chat scenario based on preset compliant response data; if the user chat data conforms to the preset security rules, then perform a chat action in the group chat scenario based on the user chat data.

[0135] In a feasible implementation, the execution module is further configured to: determine the third response result of the intelligent agent in response to the user's chat data; detect whether the third response result conforms to the preset security rules; if the third response result conforms to the preset security rules, the intelligent agent performs a dialogue action in the group chat scenario based on the third response result; if the third response result does not conform to the preset security rules, the intelligent agent performs a dialogue action in the group chat scenario based on preset compliant response data.

[0136] The group chat data processing device provided in this embodiment has the same technical features as the group chat data processing method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.

[0137] Figure 9 The diagram illustrates the structure of an electronic device according to an embodiment of the present disclosure, including a memory 901, a processor 902, and a bus 903. The memory 901 stores machine-readable instructions executable by the processor 902. When the electronic device runs a group chat data processing method as described in the embodiment, the processor 902 communicates with the memory 901 via the bus 903. The processor 902 executes the machine-readable instructions. The preamble of the method item of the processor 902 performs the following steps:

[0138] The system monitors user chat data in a group chat scenario. The group chat scenario includes a pre-trained agent and at least two users. Each agent has a preset group chat trigger condition. The user chat data includes the user's message content and the time the message was initiated. In response to the user chat data meeting the group chat trigger condition, the agent performs a chat action in the group chat scenario based on the user chat data.

[0139] Through the above methods, the pre-trained agent can be applied to group chat scenarios. In group chat scenarios, the agent can monitor the chat data of multiple users and trigger itself to participate in the group chat when the user chat data meets certain conditions, realizing an AI group chat scenario between one agent and multiple users. This avoids the monotony of one-on-one AI chat, thereby improving the user's AI chat experience and alleviating the technical problem of low user AI chat experience.

[0140] In one feasible implementation, the group chat triggering condition includes an active group chat triggering condition; when the processor executes a response to the user chat data satisfying the group chat triggering condition, and the intelligent agent performs a chat action in the group chat scenario based on the user chat data, it is specifically used for:

[0141] In response to the user chat data satisfying the active group chat triggering condition, the agent selects a target preset active topic to be initiated from multiple preset active topics based on the user chat data; the agent performs dialogue actions in the group chat scenario based on the target preset active topic.

[0142] In a feasible implementation, the active group chat triggering conditions include any one or more of the following: the user chat data meets a preset data format, the sentiment analysis data of the user chat data conforms to a preset sentiment type, the topic types of the user chat data are less than a preset number of types, no user chat data is generated within a first preset time period in the group chat scenario, and the number of times the user chat data is generated within a second preset time period in the group chat scenario is greater than a preset number.

[0143] In one feasible implementation, the group chat triggering condition includes a passive group chat triggering condition, wherein the passive group chat triggering condition is that the user chat data contains a pending response instruction for the intelligent agent; when the processor executes a chat action in the group chat scenario in response to the user chat data satisfying the group chat triggering condition, the processor is specifically configured to: in response to the user chat data containing a pending response instruction for the intelligent agent, the intelligent agent executes a chat action in the group chat scenario in response to the pending response instruction.

[0144] In one feasible implementation, when the processor executes a response to a pending instruction for the agent contained in the user chat data, and the agent performs a chat action in the group chat scenario based on the pending instruction, the processor specifically performs the following: in response to a pending instruction for the agent contained in the user chat data, it retrieves target preset knowledge data related to the target user chat data corresponding to the pending instruction from preset knowledge data; it inputs the target preset knowledge data and the target user chat data into a large language model to obtain a first output result, and obtains a first response result for the pending instruction based on the first output result; the agent performs a chat action in the group chat scenario based on the first response result.

[0145] In one feasible implementation, when the processor retrieves target preset knowledge data related to the target user chat data corresponding to the instruction to be responded to from preset knowledge data, it specifically performs the following steps: filtering target user chat data in the user chat data based on the instruction to be responded to; converting the target user chat data into vector form chat data; comparing the vector form chat data with the vector form preset knowledge data to obtain a comparison result; and determining target preset knowledge data matching the target user chat data from the preset knowledge data based on the comparison result.

[0146] In a feasible implementation, when the processor performs the task of inputting the target preset knowledge data and the target user chat data into the large language model (LLM), it specifically performs the following steps: adding the target preset knowledge data and the target user chat data to the model prompt template to obtain a first model prompt word, and inputting the first model prompt word into the large language model.

[0147] In a feasible implementation, the group chat triggering condition includes a preset historical data triggering condition. When the processor executes a response to the user chat data satisfying the group chat triggering condition, and the agent performs a chat action in the group chat scenario based on the user chat data, the processor specifically performs the following: In response to the user chat data satisfying the preset historical data triggering condition, it determines target historical key data related to the user chat data from historical key data; wherein, the historical key data is key data extracted from historical user chat data in the group chat scenario; it adds the target historical key data and the user chat data to a model prompt template to obtain a second model prompt word, and inputs the second model prompt word into a large language model to obtain a second output result, and obtains a second response result corresponding to the user chat data based on the second output result; the agent performs a chat action in the group chat scenario based on the second response result.

[0148] In a feasible implementation, the preset historical data triggering conditions include any one or more of the following: the user chat data contains data related to the historical key data, the chat event corresponding to the user chat data is similar to the historical chat event corresponding to the historical key data, and the current chat atmosphere corresponding to the user chat data is similar to the historical chat atmosphere corresponding to the historical key data.

[0149] In a feasible implementation, the preset historical data triggering condition corresponds to a preset historical key data extraction standard, which includes any one or more of the following: data related to user objective information, data related to user subjective emotions, and data related to user subjective preferences; the processor is further configured to: acquire historical user chat data of the group chat scenario; extract key data from the historical user chat data according to the historical key data extraction standard, and determine the extracted key data as the historical key data.

[0150] In one feasible implementation, the agent is a model generated by training with historical group chat data, and the model generated by training with historical group chat data is determined by a target large language model after training.

[0151] In a feasible implementation, the training samples of the target large language model include the historical group chat data and any one or more of the following: chat data based on virtual characters with preset personas, chat data that conforms to preset security rules, chat data formed by interrupting, chat data formed by playing games, chat data containing comparison data, chat data containing instruction data, and chat data after data cleaning.

[0152] In a feasible implementation, the training samples of the target large language model are generated as follows: based on the target prompt words with thought chains, data processing is performed through the language model to obtain intermediate processing results; the intermediate processing results are added to the target prompt words, and based on the target prompt words with the added intermediate processing results, data processing is performed again through the language model to obtain the final processing results; the training samples are obtained based on the final processing results.

[0153] In a feasible implementation, when the processor executes the process of obtaining the training samples based on the final processing result, it is specifically used to: use a trained binary classification model to determine whether the final processing result belongs to chat data of a preset target type; wherein, the classification of the binary classification model includes the preset target type and non-preset target types; and determine the chat data belonging to the preset target type as the training samples of the target large language model.

[0154] In a feasible implementation, the method of determining the final model through the trained target large language model includes: acquiring multiple trained target large language models; acquiring model parameters for each target large language model, and conducting chat tests based on the model parameters to obtain chat test data; testing the chat test data according to a preset test standard to obtain test results; and determining the final model corresponding to the agent from the multiple target large language models based on the test results corresponding to the multiple target large language models.

[0155] In one feasible implementation, after monitoring user chat data in the group chat scenario, the processor is further configured to: detect whether the user chat data conforms to preset security rules; if the user chat data does not conform to the preset security rules, then perform a chat action in the group chat scenario based on preset compliant response data; if the user chat data conforms to the preset security rules, then perform a chat action in the group chat scenario based on the user chat data.

[0156] In a feasible implementation, when the processor executes a chat action in the group chat scenario based on the user chat data, it is specifically configured to: determine the third response result of the intelligent agent corresponding to the user chat data; detect whether the third response result conforms to a preset security rule; if the third response result conforms to the preset security rule, the intelligent agent executes a dialogue action in the group chat scenario based on the third response result; if the third response result does not conform to the preset security rule, the intelligent agent executes a dialogue action in the group chat scenario based on preset compliant response data.

[0157] In practical applications, the memory 901 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 904 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0158] Bus 903 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0159] The memory 901 is used to store programs. After receiving an execution instruction, the processor 902 executes the program. The method executed by the apparatus defined by the process disclosed in any of the foregoing embodiments of this disclosure can be applied to the processor 902 or implemented by the processor 902.

[0160] The processor 902 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 902 or by instructions in software form. The processor 902 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 901, and processor 902 reads the information from memory 901 and, in conjunction with its hardware, completes the steps of the above method.

[0161] This disclosure also provides a computer-readable storage medium storing a computer program that is executed by a processor, wherein the processor performs the following steps:

[0162] The system monitors user chat data in a group chat scenario. The group chat scenario includes a pre-trained agent and at least two users. Each agent has a preset group chat trigger condition. The user chat data includes the user's message content and the time the message was initiated. In response to the user chat data meeting the group chat trigger condition, the agent performs a chat action in the group chat scenario based on the user chat data.

[0163] Through the above methods, the pre-trained agent can be applied to group chat scenarios. In group chat scenarios, the agent can monitor the chat data of multiple users and trigger itself to participate in the group chat when the user chat data meets certain conditions, realizing an AI group chat scenario between one agent and multiple users. This avoids the monotony of one-on-one AI chat, thereby improving the user's AI chat experience and alleviating the technical problem of low user AI chat experience.

[0164] In one feasible implementation, the group chat triggering condition includes an active group chat triggering condition; when the processor executes a response to the user chat data satisfying the group chat triggering condition, and the intelligent agent performs a chat action in the group chat scenario based on the user chat data, it is specifically used for:

[0165] In response to the user chat data satisfying the active group chat triggering condition, the agent selects a target preset active topic to be initiated from multiple preset active topics based on the user chat data; the agent performs dialogue actions in the group chat scenario based on the target preset active topic.

[0166] In a feasible implementation, the active group chat triggering conditions include any one or more of the following: the user chat data meets a preset data format, the sentiment analysis data of the user chat data conforms to a preset sentiment type, the topic types of the user chat data are less than a preset number of types, no user chat data is generated within a first preset time period in the group chat scenario, and the number of times the user chat data is generated within a second preset time period in the group chat scenario is greater than a preset number.

[0167] In one feasible implementation, the group chat triggering condition includes a passive group chat triggering condition, wherein the passive group chat triggering condition is that the user chat data contains a pending response instruction for the intelligent agent; when the processor executes a chat action in the group chat scenario in response to the user chat data satisfying the group chat triggering condition, the processor is specifically configured to: in response to the user chat data containing a pending response instruction for the intelligent agent, the intelligent agent executes a chat action in the group chat scenario in response to the pending response instruction.

[0168] In one feasible implementation, when the processor executes a response to a pending instruction for the agent contained in the user chat data, and the agent performs a chat action in the group chat scenario based on the pending instruction, the processor specifically performs the following: in response to a pending instruction for the agent contained in the user chat data, it retrieves target preset knowledge data related to the target user chat data corresponding to the pending instruction from preset knowledge data; it inputs the target preset knowledge data and the target user chat data into a large language model to obtain a first output result, and obtains a first response result for the pending instruction based on the first output result; the agent performs a chat action in the group chat scenario based on the first response result.

[0169] In one feasible implementation, when the processor retrieves target preset knowledge data related to the target user chat data corresponding to the instruction to be responded to from preset knowledge data, it specifically performs the following steps: filtering target user chat data in the user chat data based on the instruction to be responded to; converting the target user chat data into vector form chat data; comparing the vector form chat data with the vector form preset knowledge data to obtain a comparison result; and determining target preset knowledge data matching the target user chat data from the preset knowledge data based on the comparison result.

[0170] In a feasible implementation, when the processor performs the task of inputting the target preset knowledge data and the target user chat data into the large language model (LLM), it specifically performs the following steps: adding the target preset knowledge data and the target user chat data to the model prompt template to obtain a first model prompt word, and inputting the first model prompt word into the large language model.

[0171] In a feasible implementation, the group chat triggering condition includes a preset historical data triggering condition. When the processor executes a response to the user chat data satisfying the group chat triggering condition, and the agent performs a chat action in the group chat scenario based on the user chat data, the processor specifically performs the following: In response to the user chat data satisfying the preset historical data triggering condition, it determines target historical key data related to the user chat data from historical key data; wherein, the historical key data is key data extracted from historical user chat data in the group chat scenario; it adds the target historical key data and the user chat data to a model prompt template to obtain a second model prompt word, and inputs the second model prompt word into a large language model to obtain a second output result, and obtains a second response result corresponding to the user chat data based on the second output result; the agent performs a chat action in the group chat scenario based on the second response result.

[0172] In a feasible implementation, the preset historical data triggering conditions include any one or more of the following: the user chat data contains data related to the historical key data, the chat event corresponding to the user chat data is similar to the historical chat event corresponding to the historical key data, and the current chat atmosphere corresponding to the user chat data is similar to the historical chat atmosphere corresponding to the historical key data.

[0173] In a feasible implementation, the preset historical data triggering condition corresponds to a preset historical key data extraction standard, which includes any one or more of the following: data related to user objective information, data related to user subjective emotions, and data related to user subjective preferences; the processor is further configured to: acquire historical user chat data of the group chat scenario; extract key data from the historical user chat data according to the historical key data extraction standard, and determine the extracted key data as the historical key data.

[0174] In one feasible implementation, the agent is a model generated by training with historical group chat data, and the model generated by training with historical group chat data is determined by a target large language model after training.

[0175] In a feasible implementation, the training samples of the target large language model include the historical group chat data and any one or more of the following: chat data based on virtual characters with preset personas, chat data that conforms to preset security rules, chat data formed by interrupting, chat data formed by playing games, chat data containing comparison data, chat data containing instruction data, and chat data after data cleaning.

[0176] In a feasible implementation, the training samples of the target large language model are generated as follows: based on the target prompt words with thought chains, data processing is performed through the language model to obtain intermediate processing results; the intermediate processing results are added to the target prompt words, and based on the target prompt words with the added intermediate processing results, data processing is performed again through the language model to obtain the final processing results; the training samples are obtained based on the final processing results.

[0177] In a feasible implementation, when the processor executes the process of obtaining the training samples based on the final processing result, it is specifically used to: use a trained binary classification model to determine whether the final processing result belongs to chat data of a preset target type; wherein, the classification of the binary classification model includes the preset target type and non-preset target types; and determine the chat data belonging to the preset target type as the training samples of the target large language model.

[0178] In a feasible implementation, the method of determining the final model through the trained target large language model includes: acquiring multiple trained target large language models; acquiring model parameters for each target large language model, and conducting chat tests based on the model parameters to obtain chat test data; testing the chat test data according to a preset test standard to obtain test results; and determining the final model corresponding to the agent from the multiple target large language models based on the test results corresponding to the multiple target large language models.

[0179] In one feasible implementation, after monitoring user chat data in the group chat scenario, the processor is further configured to: detect whether the user chat data conforms to preset security rules; if the user chat data does not conform to the preset security rules, then perform a chat action in the group chat scenario based on preset compliant response data; if the user chat data conforms to the preset security rules, then perform a chat action in the group chat scenario based on the user chat data.

[0180] In a feasible implementation, when the processor executes a chat action in the group chat scenario based on the user chat data, it is specifically configured to: determine the third response result of the intelligent agent corresponding to the user chat data; detect whether the third response result conforms to a preset security rule; if the third response result conforms to the preset security rule, the intelligent agent executes a dialogue action in the group chat scenario based on the third response result; if the third response result does not conform to the preset security rule, the intelligent agent executes a dialogue action in the group chat scenario based on preset compliant response data.

[0181] In this embodiment of the disclosure, the computer program, when run by the processor, can also execute other machine-readable instructions to perform other methods as described in the embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.

[0182] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0183] For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0184] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0185] In addition, the functional units in the embodiments provided in this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0186] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the group chat data processing method described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0187] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0188] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this disclosure. All should be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for processing group chat data, characterized in that, The method includes: Monitor user chat data in a group chat scenario; the group chat scenario includes a pre-trained agent and at least two users, the agent corresponds to a preset group chat trigger condition; the user chat data includes the user's message content and the message initiation time; In response to the user chat data satisfying the group chat triggering condition, the intelligent agent performs chat actions in the group chat scenario based on the user chat data.

2. The method according to claim 1, characterized in that, The group chat triggering conditions include the active group chat triggering conditions; In response to the user chat data satisfying the group chat triggering condition, the intelligent agent performs chat actions in the group chat scenario based on the user chat data, including: In response to the user chat data satisfying the active group chat triggering condition, a target preset active topic to be initiated is selected from multiple preset active topics based on the user chat data; The intelligent agent performs dialogue actions in the group chat scenario based on the target preset topic.

3. The method according to claim 2, characterized in that, The conditions for triggering an active group chat include any one or more of the following: The user chat data meets the preset data format, the sentiment analysis data of the user chat data conforms to the preset sentiment type, the topic types of the user chat data are less than the preset number of types, no user chat data is generated within the first preset time period in the group chat scenario, and the number of times the user chat data is generated within the second preset time period in the group chat scenario is greater than the preset number.

4. The method according to claim 1, characterized in that, The group chat triggering conditions include passive group chat triggering conditions, wherein the passive group chat triggering conditions are that the user chat data contains an instruction to be responded to for the intelligent agent. In response to the user chat data satisfying the group chat triggering condition, the intelligent agent performs chat actions in the group chat scenario based on the user chat data, including: In response to the user chat data containing a pending response instruction for the agent, the agent performs a chat action in the group chat scenario according to the pending response instruction.

5. The method according to claim 4, characterized in that, The response is that the user chat data contains a pending response instruction for the agent, and the agent performs chat actions in the group chat scenario according to the pending response instruction, including: In response to the user chat data containing a pending instruction for the agent, target preset knowledge data related to the target user chat data corresponding to the pending instruction is retrieved from preset knowledge data; The target preset knowledge data and the target user chat data are input into the large language model to obtain the first output result, and the first response result of the instruction to be responded to is obtained based on the first output result; The agent performs chat actions in the group chat scenario based on the first response result.

6. The method according to claim 5, characterized in that, The step of retrieving target preset knowledge data related to the target user chat data corresponding to the instruction to be responded to from preset knowledge data includes: Based on the pending response instruction, filter the target user's chat data from the user chat data; Convert the target user's chat data into vector form chat data; The similarity of the vector-form chat data with the preset knowledge data in vector form is compared to obtain the comparison results; Based on the comparison results, target preset knowledge data that matches the target user's chat data is determined from the preset knowledge data.

7. The method according to claim 5, characterized in that, The step of inputting the target preset knowledge data and the target user chat data into the large language model includes: The target preset knowledge data and the target user chat data are added to the model prompt template to obtain the first model prompt word, and the first model prompt word is input into the large language model.

8. The method according to claim 1, characterized in that, The group chat triggering conditions include preset historical data triggering conditions. In response to the user chat data satisfying the group chat triggering conditions, the intelligent agent performs chat actions in the group chat scenario based on the user chat data, including: In response to the user chat data satisfying the preset historical data triggering condition, target historical key data related to the user chat data is determined from historical key data; wherein, the historical key data is key data extracted from the historical user chat data of the group chat scenario; The target historical key data and the user chat data are added to the model prompt template to obtain the second model prompt word. The second model prompt word is then input into the large language model to obtain the second output result. Based on the second output result, the second response result corresponding to the user chat data is obtained. The agent performs chat actions in the group chat scenario based on the second response result.

9. The method according to claim 8, characterized in that, The preset historical data triggering conditions include any one or more of the following: The user chat data includes data related to the historical key data, the chat events corresponding to the user chat data are similar to the historical chat events corresponding to the historical key data, and the current chat atmosphere corresponding to the user chat data is similar to the historical chat atmosphere corresponding to the historical key data.

10. The method according to claim 8, characterized in that, The preset historical data triggering conditions correspond to preset historical key data extraction criteria, which include any one or more of the following: data related to user objective information, data related to user subjective emotions, and data related to user subjective preferences; the method further includes: Obtain historical user chat data for the group chat scenario; Based on the historical key data extraction criteria, key data is extracted from the historical user chat data, and the extracted key data is identified as the historical key data.

11. The method according to claim 1, characterized in that, The intelligent agent is a model generated by training with historical group chat data, and the model generated by training with historical group chat data is determined by the target large language model after training.

12. The method according to claim 11, characterized in that, The training samples for the target large language model include the historical group chat data and any one or more of the following: Chat data based on virtual characters with preset personas, chat data conforming to preset security rules, chat data generated through interruption, chat data generated through gameplay, chat data containing comparison data, chat data containing command data, and chat data after data cleaning and processing.

13. The method according to claim 11, characterized in that, The training samples for the target large language model are generated in the following manner: Based on target prompts with thought chains, data is processed using a language model to obtain intermediate processing results; The intermediate processing results are added to the target prompt words, and the data is processed again through the language model based on the target prompt words with the added intermediate processing results to obtain the final processing result; The training samples are obtained based on the final processing results.

14. The method according to claim 13, characterized in that, The process of obtaining the training samples based on the final processing result includes: The trained binary classification model is used to determine whether the final processing result belongs to the chat data of the preset target type; wherein, the classification of the binary classification model includes the preset target type and non-preset target type; Chat data belonging to the preset target type are identified as training samples for the target large language model.

15. The method according to claim 11, characterized in that, Methods for determining the final model using a trained target large language model include: Obtain multiple trained target large language models; For each target large language model, obtain the model parameters of the target large language model, and conduct chat tests based on the model parameters to obtain chat test data; The chat test data is tested according to preset test standards to obtain test results; The final model corresponding to the agent is determined from the multiple target large language models based on the test results corresponding to the multiple target large language models.

16. The method according to claim 1, characterized in that, After monitoring user chat data in the group chat scenario, the method further includes: Detect whether the user chat data complies with preset security rules; If the user chat data does not conform to the preset security rules, then chat actions are performed in the group chat scenario based on the preset compliant response data; If the user chat data conforms to the preset security rules, then chat actions are performed in the group chat scenario based on the user chat data.

17. The method according to claim 1, characterized in that, The intelligent agent performs chat actions in the group chat scenario based on the user chat data, including: Determine the third response result of the intelligent agent in response to the user's chat data; Check whether the third response result conforms to preset security rules; If the third response result conforms to the preset security rules, the agent performs a dialogue action in the group chat scenario based on the third response result. If the third response does not conform to the preset security rules, the agent will perform a dialogue action in the group chat scenario based on the preset compliant response data.

18. A group chat data processing device, characterized in that, include: The listening module is used to monitor user chat data in group chat scenarios. The group chat scenario includes a pre-trained agent and at least two users, and the agent corresponds to a preset group chat trigger condition. The user chat data includes the user's message content and the time the message was initiated. An execution module is used to respond to the user chat data satisfying the group chat triggering condition, and the intelligent agent performs chat actions in the group chat scenario based on the user chat data.

19. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 17.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 17.