Method and device for interacting with large language model combining role isolation and input reduction

By employing role isolation and input simplification, the problems of context redundancy and token overflow in multi-turn dialogues of large language models are solved, achieving efficient management of context data and improving the stability and accuracy of the model.

CN122635539APending Publication Date: 2026-08-25SHENZHEN WUWEI YUANJIE DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610745146.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing large language models suffer from context redundancy, role mismatch, and context token overflow issues in multi-turn dialogues, affecting the stability and accuracy of the interaction.

Method used

By employing role isolation and input simplification methods, business roles are determined through intent recognition, relevant historical contexts are dynamically filtered, combined, and compressed to generate simplified context inputs for processing in a large language model.

Benefits of technology

This achieves isolation of contexts for different roles, reduces interference from redundant information, avoids service anomalies caused by context overflow, and improves the accuracy and stability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122635539A_ABST
    Figure CN122635539A_ABST
Patent Text Reader

Abstract

The application provides a large language model interaction method and device combining role isolation and input reduction, the method comprising receiving the current input of a user and identifying the corresponding business role; according to the business role, searching for the corresponding target storage partition from a plurality of role-independent data storage partitions; dynamically filtering the historical context related to the current input from the target storage partition; combining the current input and the historical context to generate a combined context; performing length judgment on the combined context, if the context length exceeds a preset threshold, performing compression and / or truncation processing on the combined context to generate a reduced context; inputting the reduced context into a large language model for processing and feeding back the response of the model. The application stores the role data in a partition and reduces the context input in advance, avoids the output inaccuracy caused by role mutual stringing and service abnormalities caused by data overflow, and improves the accuracy and stability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of AI interaction technology, and in particular to a large language model interaction method and device that combines role isolation and input simplification. Background Technology

[0002] With the widespread application of AI-powered large language models in scenarios such as smart offices, multi-turn continuous interaction has become the norm. However, during the use of these large language models, it has been found that existing interaction solutions have numerous shortcomings, severely impacting the stability of the interaction and the accuracy of the output. Specific pain points are as follows: 1. Severe Contextual Redundancy: During long-term continuous dialogues, contextual dialogue content accumulates continuously, generating a large amount of invalid, repetitive, and delayed redundant information. This redundant information interferes with the logical judgment of large models, leading to a decrease in the accuracy of model output. Furthermore, the mixing of dialogue content from multiple scenarios and of different types makes it highly susceptible to cross-referencing and interference between dialogue information from different roles, causing serious data accuracy problems.

[0003] 2. Context overflow leads to service exceptions: Large language models all have a limit on the length of context tokens. As the number of dialogue rounds increases, the length of the context also increases, which can easily trigger the upper limit of the model tokens, eventually leading to abnormal problems such as dialogue interruption, service crash, and output truncation, making it impossible to support long-term continuous interaction.

[0004] 3. Role data mismatch leads to inaccurate data: Traditional large-scale model interaction solutions use a unified context storage method and do not manage data partitioning based on user dialogue roles. Even when creating a new session, role mismatch still exists. Historical dialogue data from different business roles and different scenarios are stored and retrieved in a mixed manner. Invalid information across roles continuously interferes with the logic of the current dialogue, resulting in increasingly lower accuracy of answers.

[0005] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0006] This invention provides a large language model interaction method and device that combines role isolation and input simplification. The main purpose of this invention is to solve the technical problems mentioned in the background art of the prior art.

[0007] The first aspect of this invention provides a large language model interaction method that combines role isolation and input simplification, comprising: Receive the user's current input and identify the business role corresponding to the current input based on the intent; Based on the business role, the target storage partition corresponding to the business role is found from multiple independent data storage partitions for each role; Dynamically filter historical contexts related to the current input from the target storage partition; The current input is combined with the historical context to generate a combined context; The number of lexical units in the combined context is determined. If the number of lexical units exceeds a preset threshold, the combined context is compressed and / or truncated to generate a simplified context. The simplified context is input into the large language model for processing, and the response of the simplified context is obtained from the large language model.

[0008] In an optional embodiment of the first aspect of the present invention, the data storage partition is established based on a cache database, and physical isolation between the context data of different business roles is achieved by configuring different storage prefixes for each business role.

[0009] In an optional embodiment of the first aspect of the present invention, dynamically filtering historical context related to the current input from the target storage partition includes: Extract the currently input keywords, and prioritize the historical context in the target storage partition by combining keyword matching degree, content relevance and time order; Based on the sorting results of the priority ranking, a predetermined number of historical contexts or those exceeding a predetermined relevance threshold are selected.

[0010] In an optional embodiment of the first aspect of the present invention, the step of combining the current input with the historical context to generate a combined context includes: The current input and the historical context are preprocessed, and the preprocessing includes filtering out duplicate descriptions, invalid statements and low-relevance content in the current input and the historical context.

[0011] In an optional embodiment of the first aspect of the invention, performing compression and / or truncation processing on the combined context includes: Delete several context data items that are ranked lower in relevance to the current input from the combined context; And / or truncate some of the time-ordered context data from the combined context in chronological order.

[0012] In an optional embodiment of the first aspect of the present invention, the step of inputting the simplified context into a large language model for processing and obtaining the response of the simplified context from the large language model includes: The simplified context and the response are stored in the target storage partition corresponding to the business role for subsequent interaction.

[0013] In an optional embodiment of the first aspect of the present invention, each processing method for performing identification of business roles, combining the current input with the historical context, and compressing and / or truncating the combined context adopts a stateless mode. The stateless mode does not save its own historical running state, but only processes based on the current input and the result found from the data storage partition.

[0014] A second aspect of the present invention provides a large language model interaction system that combines role isolation and input simplification, the large language model interaction system comprising: The role recognition module is used to receive the user's current input and identify the business role corresponding to the current input based on the intent. The data partition matching module is used to find the target storage partition corresponding to the business role from multiple independent data storage partitions of each role, based on the business role. The historical context filtering module is used to dynamically filter out historical contexts related to the current input from the target storage partition; The input data combination module is used to combine the current input with the historical context to generate a combined context; The input data simplification module is used to determine the number of lexical units in the combined context. If the number of lexical units exceeds a preset threshold, the combined context is compressed and / or truncated to generate a simplified context. The large language model interaction module is used to input the simplified context into the large language model for processing and to obtain the response of the simplified context fed back by the large language model.

[0015] A third aspect of the present invention provides a large language model interaction device that combines role isolation and input simplification, the large language model interaction device comprising: a memory and at least one processor, the memory storing instructions, and the memory and the at least one processor being interconnected via a circuit; The at least one processor invokes the instructions in the memory to cause the large language model interaction device combining role isolation and input simplification to perform the large language model interaction method combining role isolation and input simplification as described in any one of the first aspects of the invention.

[0016] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the large language model interaction method combining role isolation and input simplification as described in any one of the first aspects of the present invention.

[0017] Beneficial Effects: This invention provides a method and device for large language model interaction that combines role isolation and input simplification. The method includes receiving the user's current input and identifying the corresponding business role; based on the business role, finding the corresponding target storage partition from multiple independent data storage partitions for each role; dynamically filtering historical context related to the current input from the target storage partition; combining the current input and historical context to generate a combined context; judging the length of the combined context, and if the context length exceeds a preset threshold, performing compression and / or truncation on the combined context to generate a simplified context; inputting the simplified context into a large language model for processing and receiving a response from the model. This invention, through role-based data partitioning and context simplification before input, avoids inaccurate output caused by role cross-referencing and service anomalies caused by data overflow, thus improving the accuracy and stability of the model. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of an embodiment of the large language model interaction method that combines role isolation and input simplification according to the present invention; Figure 2 This is a schematic diagram of an embodiment of the interaction logic of a large language model that combines role isolation and input simplification according to the present invention; Figure 3 This is a schematic diagram of an embodiment of a large language model interaction system that combines role isolation and input simplification according to the present invention; Figure 4 This is a schematic diagram of an embodiment of the large language model interaction device that combines role isolation and input simplification according to the present invention. Detailed Implementation

[0019] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0020] The first aspect of this invention provides a method for interaction in large language models that combines role isolation and input simplification. This method aims to address issues such as context redundancy, role mismatch, and context token overflow that existing large language models easily encounter in multi-role, multi-turn dialogues. This method can be executed on a single computer system. (See [link to relevant documentation]). Figure 1 The large language model interaction method that combines role isolation and input simplification includes: S100. Receive the user's current input and identify the business role corresponding to the current input through intent recognition. Specifically, in this invention, the system receives the current text (i.e., current input) entered by the user through the interactive interface, parses the user input in real time, and determines the intent contained therein and the corresponding business role (such as customer service or finance). Taking "Please help me check my financial expense report from last quarter" as an example, after receiving the user input, the system's intent recognition function (adopting a stateless mode, not relying on any historical session state, and only performing real-time analysis on the current input) will use Natural Language Understanding (NLU) technology to identify the user's core intent as "check financial expense report," and determine, based on a preset role knowledge base, that the business role corresponding to this intent should be "financial assistant."

[0021] S200. Based on the business role, locate the target storage partition corresponding to the business role from multiple independent data storage partitions for each role. In this step of the present invention, the system locates the corresponding independent data storage partition for each role based on the "financial assistant" role identified in step S100. In the present invention, the data storage system can be implemented based on a caching database such as Redis, and the data partitions of different roles are isolated by a specific prefix. Taking the financial assistant role as an example, the data partition prefix for the financial assistant role can be role:[finance_assistant] (that is, the data storage partition is established based on a caching database, and physical isolation between the context data of different business roles is achieved by configuring different storage prefixes for each business role).

[0022] S300. Dynamically filter historical contexts related to the current input from the target storage partition. In this invention, this step may include: extracting keywords from the current input, and prioritizing the historical contexts in the target storage partition by combining keyword matching degree, content relevance, and time order; based on the priority ranking result, filtering out a predetermined number of historical contexts or those with a predetermined relevance threshold.

[0023] Specifically, in this step of the present invention, the system's keyword extraction function processes the input text. For example, the bidirectional maximum matching method can be used to extract keywords. Taking "help me check the financial expense report for the previous quarter" as an example, the extracted core keywords can be "check", "last quarter", "finance" and "expense report". After that, the system's context compression function performs preliminary compression on the input text, removing colloquial and redundant words (such as "help me" and "check"), retaining the core instructions (such as "check the financial expense report for the previous quarter"), and generating the compressed current context.

[0024] Furthermore, the system will use the extracted keywords ("query", "last quarter", "finance", and "expense report") as search criteria to perform searches within the data partition of the financial assistant role (role: [finance_assistant]). The system's dynamic context filtering function will prioritize the retrieved historical contexts based on keyword matching, semantic similarity between historical contexts and the current input text, and the timestamps of the context records. Taking the scenario mentioned above as an example, in this process, recent historical conversations related to "expense reports" will have higher priority than conversations from a long time ago about "annual budget". The system will filter out the top N historical contexts with the highest priority or those with a relevance higher than a certain threshold.

[0025] More specifically, when prioritizing, this invention calculates a comprehensive priority score for each historical context in the target role's storage partition, and sorts and filters based on this score. This score is a weighted combination of three sub-scores: keyword matching score, semantic relevance score, and time decay score.

[0026] Step 1: Current Input Analysis and Keyword Extraction. When the system receives the user's current input, it first performs the following operations: Keyword Extraction: The keyword extraction function is called to extract a set of weighted keywords from the current input: Keywords_current={(k1, w1), (k2, w2), ..., (kn, wn)}, where k is the keyword and w is its importance weight.

[0027] Step 2: Traverse the historical context and calculate scores for each dimension. The system will traverse every historical context record within the target role's partition. Each record contains at least three pieces of information: historical questions, historical answers, and a timestamp. For each historical context record, the system will calculate the following three scores in parallel or sequentially: (1) Keyword Matching Score: This score measures the direct overlap between the current input and the historical context at the "vocabulary" level. The calculation method can be: iterate through each keyword in the current input and check if the keyword appears in the text recorded in the historical context (including historical questions and answers). The scoring formula is: Score _keyword_i =(Σw _match ) / (Σw _total ), where Σw _match Σw is the sum of the weights of all keywords appearing in the historical context records. _total The total weight of all keywords in the current input is the sum of the weights. This score is a value normalized to the interval [0, 1], which intuitively represents the coverage of key information in the current input in the historical records.

[0028] (2) Semantic relevance score: This score aims to compensate for the shortcomings of keyword matching and judge relevance from the "semantic" or "conceptual" level. It can handle the situation of synonyms, near-synonyms, or different expressions but the same intent. The implementation technology can be vector embedding technology. The system will preload a sentence embedding model (such as Sentence-BERT). The specific calculation method is as follows: input the current input into the embedding model to obtain the current input vector representation. When the historical context is stored, the system has pre-calculated and stored the historical vector representation. If not, it is calculated in real time. Optionally, the historical vector representation is the vector representation of the overall semantics of the historical question and answer. Calculate the cosine similarity between the current input vector representation and the historical vector representation. This score is usually in the range of [0, 1] (for positively related text). The higher the score, the closer the two are semantically.

[0029] (3) Time Decay Score: This score introduces a "time" dimension. The basic principle is that more recent conversations are usually more relevant. An exponential decay function can be used, and the calculation method is as follows: Obtain the current timestamp and the timestamp of the historical context, calculate the time difference Δt between the current timestamp and the historical timestamp (the unit can be hours, days, etc.), and the scoring formula is: Score _time_i =e^(-λ×Δt), where e is the base of the natural logarithm, λ is a configurable decay rate parameter. The larger λ is, the faster the relevance decreases over time, and the system prefers recent conversations. The smaller λ is, the weaker the influence of time factors. The time decay score is also a value in the interval (0, 1]. When Δt=0, the score is 1. As the time difference increases, the score approaches 0.

[0030] Finally, the three independent scores are summed using a weighted average to calculate the final overall priority score. The weights of the three scores are adjustable based on the application scenario to allow for more flexible control of the ranking strategy. For example, in technical Q&A scenarios that require precise matching of terminology, the keyword weight can be increased; in general dialogue scenarios that require understanding the user's ambiguous intent, the semantic-related weight can be increased; and in short tasks with extremely high requirements for contextual coherence, the time-related weight can be increased.

[0031] Step 3: The system will sort all historical context records in descending order based on the calculated comprehensive priority score. Finally, it will select the historical content that will ultimately participate in the context combination according to a preset strategy. For example, the Top-K strategy directly selects the top K records after sorting (e.g., the top 3-5 records); the threshold strategy selects all records with a comprehensive priority score higher than a preset threshold (e.g., all records with a score > 0.7). The sorting method described above in this invention achieves intelligent, multi-dimensional, and configurable priority sorting of historical context, ensuring that the final selected historical content is highly relevant to the current conversation in terms of vocabulary, semantics, and timeliness, laying a solid foundation for generating high-quality and accurate responses.

[0032] S400. Combine the current input with the historical context to generate a combined context. In this step of the present invention, the system's context combination function combines the content of the current input with the filtered associated historical context, and performs stateless compression processing on the combined context through the system's context compression function. The compression mechanism can also utilize natural language processing technology, with the aim of filtering out meaningless interjections, repetitive polite descriptions (such as repeated "hello" and "please ask"), invalid statements, and redundant information with extremely low relevance in the current input and historical context, retaining only the core factual information strongly related to the current business logic (i.e., before combining the current input with the historical context to generate a combined context, the system includes: preprocessing the current input and the historical context, the preprocessing including filtering out repetitive descriptions, invalid statements, and low-relevance content in the current input and the historical context).

[0033] S500: The combined context is evaluated for the number of lexical units. If the number of lexical units exceeds a preset threshold, compression and / or truncation are performed on the combined context to generate a simplified context. In this invention, the compression and / or truncation process in this step includes: deleting several context data items from the combined context that are ranked lower in relevance to the current input; and / or truncating several context data items from the combined context that are ranked earlier in time.

[0034] Specifically, in step S500 of this invention, after obtaining the combined context, the system immediately calculates the number of tokens in the combined context and compares it with a preset token threshold (i.e., a preset threshold, for example, 80% of the API limit of a large language model (i.e., 3000 tokens) can be used as the preset threshold). In this invention, if the number of tokens does not exceed the preset threshold, the combined context is directly converted into the context of the final input. If the number of tokens exceeds the preset threshold, the system will start a truncation and recompression mechanism. For example, it will prioritize deleting context data with low relevance to the current input that is ranked lower in the historical context. If the number of tokens still exceeds the limit, it can further truncate from the earlier context data according to the time order until the number of tokens is lower than the preset threshold. The technical solution of this invention can ensure that the context submitted to the large model is within a safe length range under any circumstances through the above process.

[0035] It should be noted that in this invention, the processing methods used to identify business roles, combine the current input with the historical context, and compress and / or truncate the combined context all adopt a stateless mode. This stateless mode does not save its own historical running state, but only processes based on the current input and the results retrieved from the data storage partition. In this invention, each execution of the above processing methods relies solely on the current input data and data retrieved in real time from the database, without saving the internal state of the previous run. This design greatly improves the stability and predictability of the system, avoiding erroneous judgments caused by historical state contamination.

[0036] S600: The simplified context is input into the large language model for processing, and the response of the simplified context fed back by the large language model is obtained. In this step of the present invention, the system will send the simplified context, which has been isolated, filtered, compressed and verified to be of acceptable length through the above steps S100-S400, to the large language model (LLM) of the corresponding role for inference calculation, generate an accurate response result and output it to the user.

[0037] In an optional embodiment of the first aspect of the present invention, after each round of dialogue, the system will append the current user's input content (i.e., simplified context) and the response content of the large language model (i.e., response) to the independent data storage partition corresponding to the role in the cache database according to the user's business role, so as to realize the real-time update of the historical context and prepare data for the next round of multi-round interaction (i.e., after the simplified context is input into the large language model for processing and the response of the simplified context is obtained from the large language model, the simplified context and the response are stored in the target storage partition corresponding to the business role for use in subsequent interactions).

[0038] In summary, the complete interaction logic of this invention, which combines role isolation and input simplification in a large language model interaction scheme, can be described as follows: Figure 2 As shown, the solution of this invention mainly has the following functional points: (1) Intent recognition: It adopts a stateless processing mode, does not store any historical dialogue data, and is only responsible for parsing the text input by the user in real time, recognizing the user's dialogue intent, and determining the business role (such as customer service, finance, technology, etc.) corresponding to the current dialogue, so as to provide role-based differentiation for subsequent data isolation and retrieval.

[0039] (2) Keyword extraction: Connect to the content input by the user, and use word segmentation algorithm (such as BidirectionalMaximum Matching Method) to split out keywords and matching degree, so as to provide support for dynamic retrieval, filtering out relevant historical context and filtering out other invalid information.

[0040] (3) Partitioned storage: Partitioned storage is based on the cache database. Independent data storage areas are established at the role level. Each dialogue role is configured with a corresponding storage prefix (such as role:[role A], role:[role B]) and data partition to achieve isolation between context data of different roles. At the same time, it supports reading, writing, updating and retrieving context data.

[0041] (4) Dynamic context filtering: Based on the current input content, business role, keyword matching degree and historical time, the historical context is prioritized and selected to participate in the context combination with historical content that is highly relevant to the current business, thereby reducing interference from invalid information and reducing the length of the context.

[0042] (5) Context compression: The stateless processing mode is also adopted to compress the original context of each round of dialogue, filter out repeated descriptions, invalid statements and low-relevance content in the context, and retain only the information content related to the current business.

[0043] (6) Context combination: Based on the current dialogue role and the extracted keywords, dynamically retrieve and filter the associated historical context from the corresponding role database partition, integrate it with the current input context, call the stateless processing mode, generate a concise and effective context, determine whether the context length exceeds the preset tokens threshold, if it does, prioritize deleting low-related historical content, truncate early historical content in chronological order, and re-perform compression.

[0044] (7) Large Model Call: Receive the combined simplified context data, call the large language model for inference calculation, finally generate the corresponding response result, and complete the result output.

[0045] Furthermore, by combining role isolation and input simplification in a large language model interaction scheme, this invention can bring at least the following technical effects: 1. By using role-based partitioning storage, contextual data isolation between different business roles is achieved, reducing role information confusion and data misalignment issues during multi-scenario interactions.

[0046] 2. By using context compression, duplicate content, invalid statements, and low-relevant information are filtered out, reducing the length of the model input context and minimizing the impact of redundant information on the model's inference results.

[0047] 3. By using dynamic filtering and priority sorting mechanisms, the correlation between historical context and current business scenario is improved, and irrelevant historical content is reduced from participating in model reasoning.

[0048] 4. Through the context length control mechanism, when the context exceeds the preset token threshold, automatic filtering, truncation or recompression is performed to reduce service anomalies caused by context length exceeding the limit.

[0049] 5. By using a cache database, historical context can be partitioned for storage, fast retrieval, and real-time updates, improving the efficiency of context management in multi-turn interaction scenarios.

[0050] 6. By using a stateless context processing approach, the impact of historical state data on current business judgments and context processing results is reduced, thereby improving system processing stability.

[0051] See Figure 3 The second aspect of the present invention provides a large language model interaction system that combines role isolation and input simplification, the large language model interaction system comprising: Role recognition module 10 is used to receive the user's current input and identify the business role corresponding to the current input based on the intent; The data partition matching module 20 is used to find the target storage partition corresponding to the business role from multiple independent data storage partitions of each role based on the business role. The historical context filtering module 30 is used to dynamically filter out historical contexts related to the current input from the target storage partition; The input data combination module 40 is used to combine the current input with the historical context to generate a combined context; The input data simplification module 50 is used to determine the number of lexical units in the combined context. If the number of lexical units exceeds a preset threshold, the combined context is compressed and / or truncated to generate a simplified context. The large language model interaction module 60 is used to input the simplified context into the large language model for processing and to obtain the response of the simplified context fed back by the large language model.

[0052] In an optional embodiment of the second aspect of the present invention, the data storage partition is established based on a cache database, and physical isolation between the context data of different business roles is achieved by configuring different storage prefixes for each business role.

[0053] In an optional embodiment of the second aspect of the present invention, the historical context filtering module includes: The sorting processing unit is used to extract the currently input keywords and sort the historical context in the target storage partition by combining keyword matching degree, content relevance and time order. The filtering processing unit is used to filter out a predetermined number of historical contexts or those exceeding a predetermined relevance threshold based on the sorting results of the priority sorting.

[0054] In an optional embodiment of the second aspect of the present invention, the large language model interactive system further includes an input data preprocessing module, which is used to preprocess the current input and the historical context, the preprocessing including filtering out duplicate descriptions, invalid statements and low-relevance content in the current input and the historical context.

[0055] In an optional embodiment of the second aspect of the present invention, the input data simplification module includes: The deletion processing unit is used to delete several context data that are ranked lower in terms of relevance to the current input from the combined context; The truncation processing unit is used to truncate several context data items that are ranked earlier in time from the combined context in chronological order.

[0056] In an optional embodiment of the second aspect of the present invention, the large language model interactive system further includes: The input response storage module is used to store the simplified context and the response in the target storage partition corresponding to the business role for subsequent interaction.

[0057] In an optional embodiment of the second aspect of the present invention, each processing method for performing identification of business roles, combining the current input with the historical context, and compressing and / or truncating the combined context adopts a stateless mode. The stateless mode does not save its own historical running state, but only processes based on the current input and the result found from the data storage partition.

[0058] Figure 4 This is a schematic diagram of the structure of a large language model interaction device combining role isolation and simplified input, provided by an embodiment of the present invention. This large language model interaction device can vary significantly due to different configurations or performance. It may include one or more processors 70 (central processing units, CPUs) (e.g., one or more processors) and memory 80, and one or more storage media 90 (e.g., one or more mass storage devices) for storing applications or data. The memory and storage media can be temporary or persistent storage. The program stored in the storage media may include one or more modules (not shown in the diagram), each module including a series of instruction operations within the large language model interaction device combining role isolation and simplified input. Furthermore, the processor may be configured to communicate with the storage media to execute the series of instruction operations in the storage media on the large language model interaction device combining role isolation and simplified input.

[0059] The large language model interactive device of this invention, which combines role isolation and simplified input, may also include one or more power supplies 100, one or more wired or wireless network interfaces 110, one or more input / output interfaces 120, and / or one or more operating systems, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 4 The illustrated structure of a large language model interactive device that combines role isolation and input simplification does not constitute a limitation on large language model interactive devices that combine role isolation and input simplification. It may include more or fewer components than illustrated, and / or combine certain components, and / or have different component arrangements.

[0060] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the large language model interaction method combining role isolation and input simplification.

[0061] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system or system / unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0062] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence and / or the part that contributes to the prior art, and / or all or part 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, and / or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. 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, and / or optical disks.

[0063] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, and / or equivalent substitutions can be made to some of the technical features therein; and these modifications and / or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A large language model interaction method that combines role isolation and input simplification, characterized in that, include: Receive the user's current input and identify the business role corresponding to the current input based on the intent; Based on the business role, the target storage partition corresponding to the business role is found from multiple independent data storage partitions for each role; Dynamically filter historical contexts related to the current input from the target storage partition; The current input is combined with the historical context to generate a combined context; The number of lexical units in the combined context is determined. If the number of lexical units exceeds a preset threshold, the combined context is compressed and / or truncated to generate a simplified context. The simplified context is input into the large language model for processing, and the response of the simplified context is obtained from the large language model.

2. The large language model interaction method combining role isolation and input simplification as described in claim 1, characterized in that, The data storage partition is established based on a cache database, and physical isolation between the context data of different business roles is achieved by configuring different storage prefixes for each business role.

3. The large language model interaction method combining role isolation and input simplification as described in claim 1, characterized in that, The step of dynamically filtering historical context related to the current input from the target storage partition includes: Extract the currently input keywords, and prioritize the historical context in the target storage partition by combining keyword matching degree, content relevance and time order; Based on the sorting results of the priority ranking, a predetermined number of historical contexts or those exceeding a predetermined relevance threshold are selected.

4. The large language model interaction method combining role isolation and input simplification as described in claim 1, characterized in that, Before combining the current input with the historical context to generate the combined context, the following steps are included: The current input and the historical context are preprocessed, and the preprocessing includes filtering out duplicate descriptions, invalid statements and low-relevance content in the current input and the historical context.

5. The large language model interaction method combining role isolation and input simplification as described in claim 1, characterized in that, The compression and / or truncation process performed on the combined context includes: Delete several context data items that are ranked lower in relevance to the current input from the combined context; And / or truncate some of the time-ordered context data from the combined context in chronological order.

6. The large language model interaction method combining role isolation and input simplification as described in claim 1, characterized in that, The step of inputting the simplified context into a large language model for processing and obtaining the response of the simplified context from the large language model includes: The simplified context and the response are stored in the target storage partition corresponding to the business role for subsequent interaction.

7. The large language model interaction method combining role isolation and input simplification as described in claim 1, characterized in that, All processing methods used to perform tasks such as identifying business roles, combining the current input with the historical context, and compressing and / or truncating the combined context adopt a stateless mode. The stateless mode does not save its own historical running state and only processes based on the current input and the results found from the data storage partition.

8. A large language model interaction system that combines role isolation and input simplification, characterized in that, The large language model interaction system includes: The role recognition module is used to receive the user's current input and identify the business role corresponding to the current input based on the intent. The data partition matching module is used to find the target storage partition corresponding to the business role from multiple independent data storage partitions of each role, based on the business role. The historical context filtering module is used to dynamically filter out historical contexts related to the current input from the target storage partition; The input data combination module is used to combine the current input with the historical context to generate a combined context; The input data simplification module is used to determine the number of lexical units in the combined context. If the number of lexical units exceeds a preset threshold, the combined context is compressed and / or truncated to generate a simplified context. The large language model interaction module is used to input the simplified context into the large language model for processing and to obtain the response of the simplified context fed back by the large language model.

9. A large language model interactive device that combines role isolation and input simplification, characterized in that, The large language model interaction device that combines role isolation and input simplification includes: a memory and at least one processor, wherein the memory stores instructions and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the large language model interaction device combining role isolation and input simplification to perform the large language model interaction method combining role isolation and input simplification as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the large language model interaction method that combines role isolation and input simplification as described in any one of claims 1-7.