A method for generating secure replies for an enterprise communication platform

By generating session requests, verifying identities, and determining the scope of executable pre-retrievals in the enterprise communication platform, a security context package is constructed, which solves the problem that intelligent assistants cannot distinguish user permissions and realizes the generation of secure responses.

CN123164087APending Publication Date: 2026-11-24GUANGZHOU QIMING ZHIYUAN INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611360273.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-03
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

The intelligent assistants in existing enterprise communication platforms cannot effectively distinguish the resource access permissions of different users, leading to unauthorized access and leakage of internal enterprise information.

Method used

The process involves extracting user messages to generate session requests, performing security verification, generating a request identity root, determining the executable pre-retrieval scope from the enterprise communication platform's database, determining the security context packet based on this scope, and inputting it into the intelligent assistant model to generate a response.

Benefits of technology

Effectively prevents unauthorized access and information leakage, ensuring that the intelligent assistant model operates only within the scope of permissions when processing user messages, thus eliminating information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164087A_ABST
    Figure CN123164087A_ABST
Patent Text Reader

Abstract

This application discloses a secure response generation method for an enterprise communication platform. In response to a user's dialogue request instruction initiated within the platform, the method extracts user messages and generates a session request corresponding to the dialogue request instruction based on the user messages. The session request undergoes security verification, and if verification is successful, a request identity root is generated based on the session request. Resource directory metadata is extracted from the enterprise communication platform's database, and an executable pre-retrieval scope corresponding to the request identity root is determined based on the resource directory metadata. A security context packet is determined based on the executable pre-retrieval scope. The security context packet and user messages are input into the intelligent assistant model of the enterprise communication platform for the intelligent assistant model to generate a response result. This application restricts the retrieval and query scope of the intelligent assistant model to certain limits, fundamentally preventing unauthorized access and information leakage in the generated response result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of secure response generation technology for enterprise communication platforms, and specifically to a method for generating secure responses for enterprise communication platforms. Background Technology

[0002] As enterprises deepen their digital transformation, enterprise instant messaging platforms have become the core entry point for internal collaboration. Nowadays, large language models are being used more and more widely in enterprise office scenarios. Many enterprises are integrating intelligent assistants into their instant messaging systems, enabling them to answer questions, summarize information, search knowledge bases, create tasks, call tools, or operate external systems in group chats or private chats.

[0003] Different users have different access to information, and the intelligent assistants in existing enterprise communication platforms cannot effectively distinguish the resource access permissions of different users, thus failing to effectively prevent unauthorized access and leakage of internal enterprise information. Summary of the Invention

[0004] In view of this, this application provides a secure response generation method for enterprise communication platforms to solve the problem that intelligent assistants in existing enterprise communication platforms cannot effectively distinguish resource access permissions for different users, and thus cannot effectively prevent unauthorized reading and leakage of internal enterprise information.

[0005] To achieve the above objectives, the following solution is proposed:

[0006] Firstly, a method for generating secure responses for an enterprise communication platform includes:

[0007] In response to a user’s dialogue request instruction initiated in the enterprise communication platform, the system extracts the user’s message and generates a session request corresponding to the dialogue request instruction based on the user’s message.

[0008] The session request is subjected to security verification, and it is determined whether the verification is successful. If the verification is successful, a request identity root is generated based on the session request.

[0009] Extract resource catalog metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval range corresponding to the request identity root based on the resource catalog metadata;

[0010] The security context packet is determined based on the executable pre-retrieval range;

[0011] The security context packet and the user message are input into the intelligent assistant model of the enterprise communication platform so that the intelligent assistant model can generate a response result.

[0012] Preferably, generating a session request corresponding to the dialogue request instruction based on the user message includes:

[0013] The user message determines the environment metadata, dialogue source type metadata, user identifier, and referenced resource identifier;

[0014] The environmental metadata is normalized into workspace ID and channel ID;

[0015] The session ID, message ID, session type, and group / internal identifier are generated from the metadata of the dialogue source type.

[0016] Construct a request ID based on the user identifier, channel ID, message ID, and a pre-generated random number;

[0017] A session request is constructed based on the request ID, message ID, user identifier, work area ID, channel ID, session ID, session type, and group / internal identifier.

[0018] Preferably, generating the request identity root based on the session request includes:

[0019] Determine the user's role information and the user's membership relationship information in the enterprise communication platform;

[0020] Extract key request fields from the session request;

[0021] Extract each message explicit item, each group bound item, and each resource reference item from the database, and form a candidate item set;

[0022] For each candidate item in the candidate item set, determine whether the session request matches that candidate item;

[0023] The project set is composed of the matched candidate projects;

[0024] The request identity root is composed of the project set, role information, member relationship information, and request key fields.

[0025] Preferably, determining the executable pre-retrieval range corresponding to the request identity root based on the resource directory metadata includes:

[0026] The requested identity root is normalized and its hash value is calculated to obtain the identity root identifier;

[0027] For each resource scope in the resource directory metadata, the permission determination function corresponding to the identity root identifier is called to determine whether each resource scope is permitted.

[0028] The scope of resources that are allowed by permissions is composed of a set of permissions to be determined;

[0029] The permission determination set is compiled to obtain the executable pre-search range.

[0030] Preferably, determining the security context packet based on the executable pre-retrieval scope includes:

[0031] Determine the allowed source types within the executable pre-retrieval scope, and determine the queryable data sources based on the source types;

[0032] Extract the query predicates from the executable pre-retrieval range, and generate a query plan from the query predicates;

[0033] The query plan is used to perform a query on the queryable data source to obtain returned records;

[0034] The returned record is divided into various context units;

[0035] For each of the context units, a unit identifier for the context unit is generated based on the source type, and the context unit is marked using the identity root identifier and the unit identifier to obtain a candidate context unit;

[0036] Each trusted unit is selected from each of the candidate context units;

[0037] A security context packet is constructed from each of the aforementioned trusted units.

[0038] Preferably, the step of filtering each trusted unit from each of the candidate context units includes:

[0039] For each candidate context unit, extract each first keyword, each entity name, content time period, version information, and structured status from the candidate context unit.

[0040] The user messages are matched with each of the first keywords, and a keyword matching score is calculated.

[0041] The user messages are compared with the names of each entity to calculate the entity hit score;

[0042] Obtain the request time of the session request, determine whether the request time is within the content time limit, and if so, use the preset first threshold as the time validity score.

[0043] Calculate the version score based on the version information;

[0044] The conclusive score of the candidate context unit is calculated based on the structured state;

[0045] Each of the keyword matching score, entity hit score, time validity score, version score, and conclusion score is assigned a weight, and a weighted sum is calculated to obtain a comprehensive score.

[0046] The comprehensive score is used for screening, and the selected candidate context units are used as trusted units.

[0047] Preferably, the construction of the security context packet by each of the trusted units includes:

[0048] For each of the trusted units, a trusted context block for that trusted unit is constructed;

[0049] Each trusted context block is grouped to obtain a partition;

[0050] Each partition is serialized in a preset fixed order to obtain a security context packet.

[0051] Secondly, a secure response generation device for an enterprise communication platform includes:

[0052] The session request generation module is used to respond to a user's conversation request instruction initiated in the enterprise communication platform, extract user messages, and generate a session request corresponding to the conversation request instruction based on the user messages.

[0053] The request identity root generation module is used to perform security verification on the session request and determine whether the verification is successful. If the verification is successful, a request identity root is generated based on the session request.

[0054] The retrieval scope determination module is used to extract resource directory metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval scope corresponding to the request identity root based on the resource directory metadata;

[0055] A security context packet determination module is used to determine a security context packet based on the executable pre-retrieval range;

[0056] The response result generation module is used to input the security context packet and the user message into the intelligent assistant model of the enterprise communication platform, so that the intelligent assistant model can generate a response result.

[0057] Thirdly, a secure response generation device for an enterprise communication platform includes a memory and a processor;

[0058] The memory is used to store programs;

[0059] The processor is configured to execute the program to implement the steps of the secure response generation method for an enterprise communication platform as described in any of the first aspects.

[0060] Fourthly, a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the secure response generation method for an enterprise communication platform as described in any of the first aspects.

[0061] As can be seen from the above technical solution, this application responds to a user's dialogue request instruction initiated in an enterprise communication platform by extracting user messages and generating a session request corresponding to the dialogue request instruction based on the user messages; performing security verification on the session request and determining whether the verification passes; if the verification passes, generating a request identity root based on the session request; extracting resource directory metadata from the enterprise communication platform's database and determining the executable pre-retrieval scope corresponding to the request identity root based on the resource directory metadata; determining a security context packet based on the executable pre-retrieval scope; and inputting the security context packet and the user messages into the intelligent assistant model of the enterprise communication platform for the intelligent assistant model to generate a response result. This application first extracts and structures user messages into a session request based on the user-initiated dialogue request, and then verifies them. This is the first step in ensuring data security. After successful verification, a request identity root representing the compliant identity of this request is generated. Subsequently, resource directory metadata is extracted from the enterprise communication platform's database. This metadata describes the logical structure of the enterprise's information resources, thereby determining the executable pre-retrieval scope matching the request identity root. This scope represents the information that the current user is authorized to see. This scope is then further encapsulated into a security context packet as a kind of entity description, and then input into the intelligent assistant model along with the user message. Thus, when the intelligent assistant model processes user messages, the sources of information that it can retrieve and apply are restricted from the beginning to the scope defined by this security context packet. The generated response result fundamentally eliminates unauthorized access and information leakage. Attached Figure Description

[0062] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0063] Figure 1 An optional flowchart of a secure response generation method for an enterprise communication platform provided in an embodiment of this application;

[0064] Figure 2 A schematic diagram of a secure response generation device for an enterprise communication platform provided in this application embodiment;

[0065] Figure 3 This is a schematic diagram of the structure of a secure response generation device for an enterprise communication platform provided in an embodiment of this application. Detailed Implementation

[0066] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0067] This invention can be used in a wide variety of general-purpose or special-purpose computing environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.

[0068] This invention can be used in different conversational environments such as enterprise group chat, private chat, customer groups, system tasks, and console Q&A; the intelligent assistant model refers to an intelligent robot that is connected to the enterprise instant messaging system, which can receive user messages in group chat, private chat or system tasks, and generate answers or perform actions based on context and tool capabilities.

[0069] This invention provides a secure response generation method for an enterprise communication platform. This method can be applied to various computer terminals or smart terminals, and its execution entity can be the processor or server of the computer terminal or smart terminal. The method flowchart is shown below. Figure 1 As shown, it specifically includes:

[0070] S1: In response to a user's dialogue request instruction initiated in the enterprise communication platform, extract the user message and generate a session request corresponding to the dialogue request instruction based on the user message.

[0071] This application first transforms the user-initiated natural language dialogue request instruction into a structured session request, thereby extracting elements from the original message that can be used for subsequent security processing, such as message type, identity type, session type, referenced attachments or documents, and the context, etc. This embodiment does not impose any limitations on this.

[0072] Finally, there is the user message, which contains various basic information such as user identifier, message length, and message content. This lays the data foundation for subsequent response generation.

[0073] S2: Perform security verification on the session request and determine whether the verification is successful. If the verification is successful, generate a request identity root based on the session request.

[0074] After a session request is generated, it is not processed directly. Instead, a security verification is performed first. The verification can be multifaceted, but the purpose is the same: to confirm whether the request itself is qualified to be processed. After the verification is passed, a request identity root is generated to ensure that subsequent requests rely on this request identity root, and that it is clear and unique.

[0075] The requested identity root can be a structured collection.

[0076] S3: Extract resource directory metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval range corresponding to the request identity root based on the resource directory metadata.

[0077] This step first extracts resource directory metadata from the enterprise communication platform's database. Resource directory metadata is not the specific resource content; it describes what information exists in the enterprise, how it is organized, and which category of directory it belongs to. By matching the request identity root with the resource directory metadata, an executable preliminary search range can be determined. This range is the information boundary that the current request is theoretically allowed to reach. It is determined before it actually enters the intelligent assistant model for processing, so it is a preliminary process.

[0078] S4: Determine the security context packet based on the executable pre-retrieval range.

[0079] This step defines the executable pre-retrieval scope as a security context packet. For example, by encapsulating the executable pre-retrieval scope into a security context packet, a structure that the intelligent assistant model input end can recognize is formed. In essence, the security context packet is a physical representation of boundary conditions. In the subsequent process, it is used as an input parameter to force entry into the intelligent assistant model, fundamentally limiting the boundaries and ensuring the security of enterprise resource data.

[0080] S5: Input the security context packet and the user message into the intelligent assistant model of the enterprise communication platform so that the intelligent assistant model can generate a response result.

[0081] This step involves inputting the security context packet and the user message into the intelligent assistant model. The key lies in the user message itself and a clear, pre-calculated boundary constraint. The intelligent assistant model is constrained by this constraint when understanding the user message, organizing the answer, and calling resource information. As a result, the final response will not leak any information outside the security scope, nor will it be easily accessed or read by the user.

[0082] As can be seen from the above technical solution, this application first extracts user messages from user-initiated dialogue requests and structures them into session requests, then performs verification. This is the first step in ensuring data security. After successful verification, a request identity root representing the compliant identity of this request is generated. Subsequently, resource directory metadata is extracted from the enterprise communication platform's database. This metadata describes the logical structure of enterprise information resources, thus determining the executable pre-retrieval scope matching the request identity root. This scope represents the information that the current user is authorized to see. This scope is then further encapsulated into a security context package as an entity description, and then input into the intelligent assistant model along with the user message. Therefore, when the intelligent assistant model processes user messages, the sources of information that it can retrieve and apply are limited from the beginning to the scope defined by this security context package, fundamentally preventing unauthorized reading and information leakage.

[0083] Specifically, this application can be applied to various enterprise communication platforms, and its intelligent assistant model includes various types, such as enterprise group chat robots, enterprise knowledge assistants, multi-agent collaboration platforms, project collaboration robots, enterprise internal question and answer systems, automated office assistants, R&D project assistants, and customer group collaboration assistants, etc. This application does not limit these.

[0084] This application is applicable to various scenarios, such as intelligent assistant models needing to answer questions in group chats on enterprise communication platforms, but different groups, different people, and different projects have different information visibility ranges; group chats contain a mix of messages from multiple people and on multiple topics, requiring intelligent assistant models to select context from historical messages, project information, and knowledge bases; users request bots to execute tools in group chats, such as reading files, creating tasks, modifying documents, calling interfaces, or operating external systems; intelligent assistant models may generate high-risk tool calls, requiring approval, parameter verification, and authorized consumption before execution; after a tool call is rejected or awaiting approval, the intelligent assistant model needs to know this status for subsequent reasoning to avoid repeatedly initiating the same high-risk call; and enterprises want to control context reading, tool calls, approval, authorized consumption, and audit logs under the same security boundary.

[0085] The method provided in this embodiment of the invention includes a process for generating a session request corresponding to the dialogue request instruction based on the user message, which is described in detail below:

[0086] The user message determines the environment metadata, dialogue source type metadata, user identifier, and referenced resource identifier;

[0087] The environmental metadata is normalized into workspace ID and channel ID;

[0088] The session ID, message ID, session type, and group / internal identifier are generated from the metadata of the dialogue source type.

[0089] Construct a request ID based on the user identifier, channel ID, message ID, and a pre-generated random number;

[0090] A session request is constructed based on the request ID, message ID, user identifier, work area ID, channel ID, session ID, session type, and group / internal identifier.

[0091] Specifically, by looking at the user message itself, we can extract several key pieces of information. In layman's terms, these include the environment in which the message was generated, the conversation scenario it came from, who sent it, and the resources mentioned in the message. These four types of information form the basic framework of a session request.

[0092] Among them, environment metadata refers to channel, tenant, or workspace metadata. Standardizing it as workspace ID and channel ID is to provide a unified representation of the message's source environment. Different entry points and clients may bring different formats of environment information, but this application standardizes it into two fields: the workspace ID indicates which enterprise space it belongs to, and the channel ID indicates which entry point it came from. Conversation source type metadata refers to session, group, message, and session type metadata. It is used to determine the identity characteristics of this conversation. The session ID identifies which continuous conversation it belongs to, the message ID identifies which message in that conversation, and the session type distinguishes whether it is a one-on-one chat or a group chat. The "Chat" and "Inside / Outside the Group" indicators further clarify whether the group chat containing this message includes external users, users whose identities have not been verified, etc. The request ID is constructed by binding the user identifier, channel ID, message ID, and a pre-generated random number together. The purpose of this is to ensure that each request ID uniquely corresponds to a specific message in a specific channel and a specific processing process. The addition of a random number ensures that even if the same message is triggered repeatedly, each generated request ID will be different, preventing subsequent confusion. The user identifier is the user's identity or platform-side identity declaration. The referenced resource identifier is the identifier of the component, document, or other resource explicitly referenced by the user message.

[0093] Finally, these standardized and uniquely identified pieces of information are pieced together to form a session request. This session request is no longer the original user message, but a structured object carrying environmental information, dialogue identity information, user identity information, and a unique request identifier. Subsequent security verification and request identity root generation are determined based on it, which can ensure the consistency and contextual coherence of the entire process.

[0094] Optionally, other types of information can be obtained depending on the specific scenario, such as limiting the projects, resources, operation types, and validity periods that the session request is allowed to access.

[0095] The process of generating a request identity root based on the session request in this application will be described in detail below.

[0096] Determine the user's role information and the user's membership relationship information in the enterprise communication platform;

[0097] Extract key request fields from the session request;

[0098] Extract each message explicit item, each group bound item, and each resource reference item from the database, and form a candidate item set;

[0099] For each candidate item in the candidate item set, determine whether the session request matches that candidate item;

[0100] The project set is composed of the matched candidate projects;

[0101] The request identity root is composed of the project set, role information, member relationship information, and request key fields.

[0102] Specifically, the above process involves constructing a root object that represents the identity of the current request. First, the user's role information and membership information are determined. Role information refers to the user's identity within the enterprise communication platform, such as whether they are a regular member, an administrator, or a business manager. Membership information refers to which organizations, groups, and projects the user belongs to and is associated with. These two types of information represent the user's position within the enterprise. Then, key request fields are extracted from the session request. These fields are the most representative of the intent and target of the request and may include resources mentioned in the message, the source of the conversation, and the request type. They are responsible for describing what the request itself is doing and what content it involves.

[0103] Then, three types of items are identified from the database: explicit message items, group-bound items, and resource reference items. Explicit message items are those items explicitly mentioned in the message; group-bound items are those bound to the group to which the current session belongs; and resource reference items are those associated with the resources referenced in the message. These three types of items together form a set of candidate items. However, the candidate items need to be filtered, that is, the session request is checked one by one to see if they match. For example, items mentioned in the user message, group-bound items, and resource-pointing items are all considered. Only those items that are actually related to the current session request will be kept.

[0104] The project collection, role information, member relationship information, and request key fields are put together to form the request identity root. Specifically, the project collection can be placed under the user's project association dimension, the role information and member relationship information are used to describe the user's position in the enterprise and group, and the request key fields are attached to the identity root as context attributes of the session request.

[0105] The following embodiments provide a detailed explanation of the steps in this application for determining the executable pre-retrieval scope corresponding to the request identity root based on the resource catalog metadata.

[0106] The requested identity root is normalized and its hash value is calculated to obtain the identity root identifier;

[0107] For each resource scope in the resource directory metadata, the permission determination function corresponding to the identity root identifier is called to determine whether each resource scope is permitted.

[0108] The scope of resources that are allowed by permissions is composed of a set of permissions to be determined;

[0109] The permission determination set is compiled to obtain the executable pre-search range.

[0110] Specifically, the request identity root is first normalized and its hash value is calculated in order to obtain a stable identity root identifier. The request identity root itself may carry various formats and different field orders during the construction process. Using it directly will introduce uncertainty. Therefore, after normalization, hashing is performed to obtain a unique identifier, which will be more accurate when used to match the resource scope later.

[0111] Then, iterate through each resource scope in the resource directory metadata, calling the permission determination function corresponding to this identity root identifier for each one. The matching method is to call the permission determination function corresponding to this identity root identifier one by one to determine whether this resource scope is allowed under the condition of requesting the identity root. Allowed ones are kept, and disallowed ones are excluded. The resource scopes filtered out in this way form the permission determination set. During the compilation process, the resource scopes in the permission determination set can be normalized, the expression format can be unified, redundant information caused by duplication or inclusion relationships can be removed, and then the structure can be organized into an executable structure according to a predefined format.

[0112] The permission determination function is a set of rules implemented for the current identity root identifier to determine whether a certain resource scope can be accessed. When called, the currently traversed resource scope and the requesting identity root are passed to this function as input. The function will match the user attributes, organization, role, and the permission requirements defined in the resource directory corresponding to the requesting identity root to determine whether the identity represented by the requesting identity root meets the conditions required for the resource scope to be accessed. If it meets the conditions, the function returns "allow"; otherwise, it returns "deny".

[0113] Optionally, the step of determining the security context packet based on the executable pre-retrieval scope in this application may include:

[0114] Determine the allowed source types within the executable pre-retrieval scope, and determine the queryable data sources based on the source types;

[0115] Extract the query predicates from the executable pre-retrieval range, and generate a query plan from the query predicates;

[0116] The query plan is used to perform a query on the queryable data source to obtain returned records;

[0117] The returned record is divided into various context units;

[0118] For each of the context units, a unit identifier for the context unit is generated based on the source type, and the context unit is marked using the identity root identifier and the unit identifier to obtain a candidate context unit;

[0119] Each trusted unit is selected from each of the candidate context units;

[0120] A security context packet is constructed from each of the aforementioned trusted units.

[0121] Specifically, the executable pre-retrieval scope defines the boundaries, but the boundaries themselves are abstract; they only indicate which scopes are allowed to be invoked. Therefore, this application determines the source types, which refer to the allowed libraries, tables, documents, etc., within the retrieval scope. Based on the source types, the actual data sources that can be queried in this request can be determined. Then, query predicates are extracted from the executable pre-retrieval scope. The query predicates are the part of the scope that actually has filtering capabilities; they indicate the data in the data source that meets the conditions. Therefore, generating a query plan using query predicates clarifies how to query and what to query within the executable pre-retrieval scope, thereby obtaining the returned records. These returned records are the actual content filtered from the data sources with permitted permissions according to the permitted conditions.

[0122] The returned records are then segmented into context units for greater granularity. For each context unit, a unit identifier is generated based on its source type. This unit identifier is then combined with the previously calculated identity root identifier to mark the unit. This allows each context unit to be traced back to its permitted source type and binds it to the request identity root for consistency. For example, historical group chat messages can be segmented according to the same group, the same message reply chain, the same mentioned entity, or messages from adjacent time windows; project documents can be segmented according to titles, paragraphs, or version boundaries; and historical reply results and approval results can also be segmented according to their respective record boundaries.

[0123] The next step is to perform a trusted screening of the candidate context units. The screening criteria may include the reliability of the source, the consistency of the content, the relevance to the current request, etc. This embodiment does not impose any restrictions on this. Finally, these trusted units are used to form a security context package.

[0124] The process of filtering trusted units from the candidate context units described above includes:

[0125] For each candidate context unit, extract each first keyword, each entity name, content time period, version information, and structured status from the candidate context unit.

[0126] The user messages are matched with each of the first keywords, and a keyword matching score is calculated.

[0127] The user messages are compared with the names of each entity to calculate the entity hit score;

[0128] Obtain the request time of the session request, determine whether the request time is within the content time limit, and if so, use the preset first threshold as the time validity score.

[0129] Calculate the version score based on the version information;

[0130] The conclusive score of the candidate context unit is calculated based on the structured state;

[0131] Each of the keyword matching score, entity hit score, time validity score, version score, and conclusion score is assigned a weight, and a weighted sum is calculated to obtain a comprehensive score.

[0132] The comprehensive score is used for screening, and the selected candidate context units are used as trusted units.

[0133] Specifically, the first keyword indicates the key content of the candidate context unit; the entity name indicates the specific person, project, department, or business object involved in the candidate context unit; the content time limit refers to the timeliness of the candidate context unit; the version information indicates whether the content candidate context unit is the latest and has been updated; and the structured status indicates whether the candidate context unit has been organized and the fields are clear, or whether it is scattered and unstructured.

[0134] The next step is to match the user message with information from various dimensions of the candidate context units. This includes matching the user message with the primary keyword, such as breaking down the user message into words and determining how many of the primary keyword's terms match, resulting in a hit rate, or overlap. A higher overlap rate leads to a higher keyword matching score. Next, the user message is compared with entity names to see if it mentions a specific person, project, department, or business object, and whether the corresponding entity appears in the candidate context unit. If a project name is mentioned and the candidate context unit also contains that project, it indicates a high likelihood of direct relevance, and the entity hit score increases accordingly. The time validity score is determined by whether the user message falls within the time limit of the candidate context unit. If it does, the content is valid in terms of time, and a preset threshold is used as the score. If it does not, the content may be outdated and unsuitable as a basis for generating a response. The version score is based on the freshness of the content. The newer the version information and the closer it is to the current valid version, the higher the score. Older versions may contain outdated information. The conclusive score is calculated based on the structure. Highly structured content indicates that it is conclusive and well-organized information. Unstructured and fragmented content, even if relevant, may introduce noise and therefore receive a lower score.

[0135] After each score is calculated, weights are allocated to calculate the overall score. The weights can be allocated equally, or according to the platform's preset rules, or dynamically according to different conversation scenarios. This embodiment does not impose any restrictions on this. Finally, the overall score is used for filtering, for example, candidate context units with a score greater than a preset threshold are selected as trusted units.

[0136] The process of constructing a security context packet by each of the trusted units in the above process includes:

[0137] For each of the trusted units, a trusted context block for that trusted unit is constructed;

[0138] Each trusted context block is grouped to obtain a partition;

[0139] Each partition is serialized in a preset fixed order to obtain a security context packet.

[0140] Specifically, since trusted units are relatively scattered content fragments, and also carry tags and rating information, directly piling them together would appear messy. Therefore, a trusted context block is first constructed for each trusted unit, so that the content in it exists in the form of an independent block, which facilitates subsequent organization and reading by the intelligent assistant model. Then, all trusted context blocks are grouped to avoid all context blocks being laid out flat. This allows the intelligent assistant model to distinguish between primary and secondary elements during processing. Through grouping, related content is grouped into the same partition, which makes the logical relationship between the entire context structure clearer.

[0141] Finally, the partitions are strung together in a preset fixed order and serialized into a security context packet. This maintains the structural integrity and helps the intelligent assistant model effectively understand and utilize this information.

[0142] In one embodiment, the user message is "What was the last confirmed interface field change made by customer C in project A?" This is first converted into a session request. The request includes an external group tag and a claimed project A. However, the claim only indicates that A is mentioned in the message and does not imply a relationship between the user and A. Then, a request identity root is constructed. When verifying user roles and membership relationships, the request identity root finds that the user is not an internal member of project A. Therefore, project A is not included in the project set of the request identity root. The request identity root only retains the external customer identity, and the project association is empty. Next, the executable pre-retrieval scope is determined based on the request identity root. Since there are no allowed projects in the request identity root, the resource scope corresponding to the internal risk database is determined. If the permission check fails, the only allowed source is customer-visible data. Therefore, a query plan with customer group and public tag restrictions is generated for the customer database. No query plan is generated for the internal risk database. Thus, the security context package construction only executes the customer data query. The internal risk database, internal project documents, and internal vector index do not receive retrieval requests. The internal text mentioned in the candidate resource references is not read. The content entering the model is only customer-visible data, or the model directly returns an access denied response. The final audit log saves the request identity root, permission decision, executed customer data query plan, and the reason why the internal source is not enabled, but does not record any unread internal text.

[0143] Furthermore, the security context packet and the user message are input into the intelligent assistant model of the enterprise communication platform so that after the intelligent assistant model generates a response, it can make tool calls to process it.

[0144] Specifically, the first step is to verify the following: determine the scope of tools corresponding to this session request; ensure that the operation type of each tool is consistent with the definition in the tool registry; ensure that there are no fields in the session request that are not declared in the tool structure; and determine whether the required fields are complete and whether the field types, enumeration values, numerical ranges, length limits, and data volume limits meet the requirements.

[0145] Then, the tool path, tool identifier, current network address, and other relevant fields of the tool are normalized into standard parameters, and the differences before and after normalization are recorded for subsequent traceability and auditing. The unique corresponding project identifier is parsed from the normalized parameters, and it is confirmed that the project belongs to the authorized project set in the current request identity root. Each project is sorted according to the parameter name, and the character encoding, numeric representation, null value representation, and set order are unified to generate normalized parameters. The tool structure version output by the intelligent assistant model is written into the audit record to form an immutable call object, which contains the request identifier, identity root identifier, tool call identifier, tool name, operation type, normalized parameters, normalized target resource, project identifier, mode version, and model output hash.

[0146] If any of the normalization parameters, target resources, projects, tools, or operation types need to be modified subsequently, a new immutable call object must be regenerated and re-validated. The original object cannot be directly modified. If the structure or boundary validation fails, the tool will not be executed. For cases involving only format errors, corrections can be made within the same session request. However, for violations involving resources, projects, or hidden fields, the intelligent assistant model cannot be allowed to automatically retry, and a security failure status will be generated directly.

[0147] Optionally, before invoking the tool, a security check is performed on the call. The inputs for the check include the request identity root, an immutable call that has been structurally verified, a snapshot of the tool registry, a snapshot of the risk policy, and a snapshot of the current session state. The risk policy snapshot contains hard rules, continuous risk parameters, thresholds, approval levels, and restriction templates, and includes a unique version number. Then, a unique fingerprint is generated for this call. This fingerprint generation only selects the normalized key fields from the call, including the identity root identifier, tool name, operation type, parameter normalization result, target resource normalization result, project identifier, and mode version, etc. All fields are deterministically encoded according to a fixed order and unified rules, and then a hash value is calculated to obtain the call fingerprint. The request number and identity information such as user and session are already included in the identity root identifier and are not repeatedly involved in the fingerprint calculation. The tool call number is only used for event association and is not involved in logical deduplication. All subsequent steps use the same call fingerprint.

[0148] Among these, pre-defined hard rules can be executed first. If a rejection rule is hit, the call is directly rejected; if a mandatory approval rule is hit, it cannot be bypassed. Hard rules cover situations such as disabled tools or operations, outdated tool versions, calls not belonging to the currently visible set, inconsistent identity roots, projects not belonging to the identity root's project set, out-of-bounds target resources, out-of-bounds symbolic links, unresolved or unbounded wildcard aliases, external groups sending restricted data outside the organization, destructive operations not worthy of approval, replays or the same call already blocked without retry, parameters containing undeclared fields or high-risk fragments, or exceeding the absolute data volume limit. For calls not directly handled by hard rules, risk scores can be calculated for filtering. Tool risks come from fixed risk types in the tool registry: read-only queries, internal rollbackable writes, external writes, code execution, or destructive operations each correspond to different risk values. Parameter risks are determined based on... The highest severity level of the parameter rule hit is calculated, taking into account the number of hit rules. Resource risk is the maximum value among all resource risk indicators. Ordinary project resources, formal or protected resource roots, and bounded wildcards correspond to different values. Unresolved aliases and unbounded wildcards trigger both hard rejection and the highest risk. Exposure risk is jointly determined by the data sensitivity level and the target party, while also referring to the ratio of the requested data volume to the policy limit. Historical risk is calculated based on recent similar blocking records of the same identity, tool, operation type, target resource, and project, and decays over time. If the same call within the current request has been blocked by non-retry or determined to be a replay, the historical risk is directly taken as the highest and blocked by hard rule output. The calculation process, input fields, hit rules, values, rule versions, and evidence summaries for each risk feature are all retained. The evidence summary only saves the minimum fragment required to complete the audit.

[0149] The detection output includes the original fingerprint, the actual execution fingerprint, the processing decision, the execution call reference, the original risk score, the execution risk score, the risk discovery, the restriction set, and the policy version. The actual execution fingerprint is the only call fingerprint that is allowed to be executed subsequently.

[0150] When approval is required, an approval request is created and written to the blocking status. The approval uses the actual execution fingerprint as the unique matching identifier. First, the proposed authorization boundary is generated and its version is calculated. After approval, it is used as the official scope version. The deduplication identifier is jointly generated by the execution fingerprint, risk policy version, and scope version. The approval request contains a variety of parameters, such as approval identifier, request identifier scope version, approver policy, status, version, creation time, expiration time, etc. During the pending approval stage, only approval records with the status of pending approval, execution fingerprint, risk policy version, and proposed authorization scope version that are completely consistent and have not expired are allowed to be reused. If any call parameter, target resource, project, identity root, mode version, or policy version changes, the pre-check must be re-executed and a new approval must be created, unless there is an existing still valid approval template scope that can cover the new call.

[0151] When making an approval decision, the verification process checks whether the approval record is still pending, whether the approval chain meets the policy, whether it has expired, whether the policy is valid, and whether the version has not changed. After approval, the decision information is recorded and the status and version are atomically updated. Approval only generates a consumable authorization and does not directly trigger execution. After approval, an approval scope is generated, including the scope identifier, approval identifier, identity root identifier, scope version, policy version, etc. The parameter template only describes the fields, types, enumerations, numerical ranges, and data volume limits that the approver explicitly allows to change. High-risk calls default to one-time precise authorization, and the actual call fingerprint is the precise fingerprint. The template scope can only be used when the approver explicitly approves a set of repeatable operations. The template only allows changes to specified fields; unlisted fields must remain consistent. For critical fields such as the identity root identifier, unbounded wildcards are not allowed. The actual call after template instantiation still needs to be re-normalized and validated.

[0152] When the status is pending approval, approval rejected, policy rejected, or verification failed, a blocking status is written. The blocking status is bound to the identity root and execution fingerprint, including the processing decision, reason, risk discovery, whether approval is pending, retry policy, alternative actions, and version information. The retry policy specifies whether a new call can be generated after narrowing the scope or supplementing conditions. Alternative actions may include changing to read-only, reducing data volume, limiting resource roots, or requesting manual confirmation. During the execution phase, the actual call is recalculated using the same normalization and fingerprint functions, and a general access control check is performed. Access control conditions may include identity root matching, valid pattern, valid policy, risk object matching, fingerprint matching, resources within the allowed range, the project within the authorized set, and no valid blocking status, etc. If any condition is not met, execution is rejected, and bypassing by modifying parameters or replacing resources through automatic retries is not allowed. When direct release is performed, a short-term one-time execution ticket is created. Before execution, the ticket status changes from issued to executing. The same random number can only be changed once. For restricted releases, the actual call is consistent with the restricted call.

[0153] In addition to general access control, approval access control must also be met when approving and releasing data. This includes approval being approved, the approver being valid, the scope being valid, fingerprint or template matching, the project being within the scope, the sensitivity level being within the scope, etc. Template authorization only allows changes to the fields listed in the parameter template and the actual values ​​being within the approval boundaries. After a successful match, the authorization count is atomically consumed once before the tool is executed, and an approval execution ticket is generated. In the event of concurrent competition, only one can succeed. If a system error occurs before the tool starts, the consumption can be undone. Once the tool starts, the count is not recovered.

[0154] The tool executor only accepts direct or approval tickets. Before execution, it re-verifies that the ticket is not expired, the identity root and fingerprint are consistent, and changes the ticket status to "in execution." It avoids repeated calls to external tools. The tool result is standardized into status, summary, result reference, error code, and time information. The summary retains only a brief overview suitable for session reading; bulky content is saved as controlled assets and returned with a reference. When the result is fed back, the execution result is associated with the request identifier, identity root identifier, tool call identifier, execution fingerprint, and ticket identifier and written to the audit log. Asset metadata is also recorded, including asset identifier, source tool, creation time, result reference, etc. Subsequent requests to read this asset require regenerating the current identity root and performing pre-authorization filtering. Successful execution at this time does not guarantee continued authorization.

[0155] In one embodiment, the user message is "Write the project summary to the formal knowledge base." When the tool is invoked, for the summary file of project A, the call is first structurally validated and normalized to generate an immutable call, and a unique fingerprint is calculated. This fingerprint is determined by the identity root identifier, tool name, operation type, parameters, target resource, project identifier, and mode version. Then, risk detection is performed. The call is an internally rollbackable write, and the tool risk is medium; it hits a medium-level parameter rule, and the parameter risk is medium; the formal knowledge base is a protected resource, and the resource risk is high; the data is internal and written within the same project, and the exposure risk is low; there are no recent similar blocking records, and the historical risk is zero. After the risk score is calculated and falls within the approval range, it is simultaneously written to the formal knowledge base, triggering the mandatory approval rule. Therefore, the decision is to require approval, and the execution fingerprint remains unchanged. Next, an approval request is created. After the project leader approves, an approval scope is generated, which fixes parameters such as the request identity root, tool, consumption count, and validity period. However, approval only generates authorization and does not directly execute. If the target resource is changed from project A to project B, this change is considered a new call, and the fingerprint is re-normalized and recalculated to obtain a new fingerprint. Because the actual object is inconsistent with the original execution call reference, the new fingerprint is inconsistent with the original execution fingerprint, and project B is not within the approval scope. Both the general access control and the approval access control fail simultaneously, and execution is rejected. When the call is restored to the original approved content, the original fingerprint is obtained again. The scope record shows that the remaining count is one and the version is valid. By comparing and exchanging the atomic consumption authorization, an approval execution ticket bound to this fingerprint and a one-time random number is generated. After the executor verifies the ticket, it is only written to the formal knowledge base of project A. Concurrent requests cannot obtain tickets due to version or remaining count incompatibility. Repeated submissions of the same ticket return idempotent results because the random number has already been used, and therefore are not rewritten.

[0156] In one embodiment, assuming an attempt is made to call a deletion tool to remove a protected file, the current user is not the resource owner, and organizational policy stipulates that such deletions cannot be approved before the deletion tool can be used to remove protected files, the deletion call is first normalized and its fingerprint is calculated. Then, a hard rule check is performed. If the call is found to contain two rejection rules: "destructive operations on protected resources cannot be approved" and "the target resource does not belong to the current owner's boundary," a rejection decision is directly output. No approval is created, and no continuous risk score is calculated. The status is then written to a blocking state, which is bound to the identity root and the call fingerprint. The reason for rejection, whether approval is pending, the retry strategy, and alternative actions are recorded. The retry strategy specifies that the call can only be re-evaluated in a new form. Alternative actions include reading file metadata or requesting the resource owner to handle it themselves. During the execution phase, because the risk decision is a rejection and a valid blocking object exists, no direct ticket or approval ticket can be generated, and the deletion tool is never called. Subsequent model inputs will contain a minimal summary of the blocking state. When the model generates a deletion call with the same identity root and the same fingerprint again, it will be identified as a non-retryable blocking within the current request, and the approval or execution request will not be generated again. If the user changes to reading-only query file metadata, the parameter change will form a new call and a new fingerprint, and the complete detection will be re-executed instead of reusing the original rejection result.

[0157] and Figure 1 Corresponding to the method described above, embodiments of the present invention also provide a secure response generation device for enterprise communication platforms, used for... Figure 1 In a specific implementation of the method, the secure response generation device for an enterprise communication platform provided in this embodiment of the invention can be used in computer terminals or various mobile devices, combined with... Figure 2 This section introduces the secure response generation device for enterprise communication platforms, such as... Figure 2 As shown, the device may include:

[0158] The conversation request generation module 10 is used to respond to a conversation request instruction initiated by a user in the enterprise communication platform, extract user messages, and generate a conversation request corresponding to the conversation request instruction based on the user messages.

[0159] The request identity root generation module 20 is used to perform security verification on the session request and determine whether the verification is successful. If the verification is successful, a request identity root is generated based on the session request.

[0160] The retrieval scope determination module 30 is used to extract resource directory metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval scope corresponding to the request identity root based on the resource directory metadata;

[0161] Security context packet determination module 40 is used to determine the security context packet based on the executable pre-retrieval range;

[0162] The response result generation module 50 is used to input the security context packet and the user message into the intelligent assistant model of the enterprise communication platform so that the intelligent assistant model can generate a response result.

[0163] As can be seen from the above technical solution, this application first extracts user messages from user-initiated dialogue requests and structures them into session requests, then performs verification. This is the first step in ensuring data security. After successful verification, a request identity root representing the compliant identity of this request is generated. Subsequently, resource directory metadata is extracted from the enterprise communication platform's database. This metadata describes the logical structure of enterprise information resources, thus determining the executable pre-retrieval scope matching the request identity root. This scope represents the information that the current user is authorized to see. This scope is then further encapsulated into a security context package as an entity description, and then input into the intelligent assistant model along with the user message. Therefore, when the intelligent assistant model processes user messages, the sources of information that it can retrieve and apply are limited from the beginning to the scope defined by this security context package, fundamentally preventing unauthorized reading and information leakage.

[0164] Furthermore, embodiments of this application provide a secure response generation device for an enterprise communication platform. Optionally, Figure 3 The diagram shows the hardware structure of the secure response generation device for the enterprise communication platform. Figure 3 The hardware structure of the secure response generation device of the enterprise communication platform may include: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.

[0165] In this embodiment, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.

[0166] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0167] Memory 03 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.

[0168] The memory stores a program that the processor can call. The program is used to execute the following secure response generation method for the enterprise communication platform, including:

[0169] In response to a user’s dialogue request instruction initiated in the enterprise communication platform, the system extracts the user’s message and generates a session request corresponding to the dialogue request instruction based on the user’s message.

[0170] The session request is subjected to security verification, and it is determined whether the verification is successful. If the verification is successful, a request identity root is generated based on the session request.

[0171] Extract resource catalog metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval range corresponding to the request identity root based on the resource catalog metadata;

[0172] The security context packet is determined based on the executable pre-retrieval range;

[0173] The security context packet and the user message are input into the intelligent assistant model of the enterprise communication platform so that the intelligent assistant model can generate a response result.

[0174] Optionally, the refined and extended functions of the program can be found in the description of the secure response generation method for the enterprise communication platform in the method embodiments.

[0175] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor. When the program runs, it controls the device where the storage medium is located to execute the following secure response generation method for an enterprise communication platform, including:

[0176] In response to a user’s dialogue request instruction initiated in the enterprise communication platform, the system extracts the user’s message and generates a session request corresponding to the dialogue request instruction based on the user’s message.

[0177] The session request is subjected to security verification, and it is determined whether the verification is successful. If the verification is successful, a request identity root is generated based on the session request.

[0178] Extract resource catalog metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval range corresponding to the request identity root based on the resource catalog metadata;

[0179] The security context packet is determined based on the executable pre-retrieval range;

[0180] The security context packet and the user message are input into the intelligent assistant model of the enterprise communication platform so that the intelligent assistant model can generate a response result.

[0181] Specifically, the storage medium can be a computer-readable storage medium, which can be an electronic storage device such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM.

[0182] Optionally, the refined and extended functions of the program can be found in the description of the secure response generation method for the enterprise communication platform in the method embodiments.

[0183] Furthermore, the functional modules in the various embodiments of this disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module 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 this disclosure, in essence, or the part that contributes to the prior art, or a 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, a live streaming device, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this disclosure.

[0184] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0185] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0186] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating secure responses for an enterprise communication platform, characterized in that, include: In response to a user’s dialogue request instruction initiated in the enterprise communication platform, the system extracts the user’s message and generates a session request corresponding to the dialogue request instruction based on the user’s message. The session request is subjected to security verification, and it is determined whether the verification is successful. If the verification is successful, a request identity root is generated based on the session request. Extract resource catalog metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval range corresponding to the request identity root based on the resource catalog metadata; The security context packet is determined based on the executable pre-retrieval range; The security context packet and the user message are input into the intelligent assistant model of the enterprise communication platform so that the intelligent assistant model can generate a response result.

2. The method according to claim 1, characterized in that, The step of generating a session request corresponding to the dialogue request instruction based on the user message includes: The user message determines the environment metadata, dialogue source type metadata, user identifier, and referenced resource identifier; The environmental metadata is normalized into workspace ID and channel ID; The session ID, message ID, session type, and group / internal identifier are generated from the metadata of the dialogue source type. Construct a request ID based on the user identifier, channel ID, message ID, and a pre-generated random number; A session request is constructed based on the request ID, message ID, user identifier, work area ID, channel ID, session ID, session type, and group / internal identifier.

3. The method according to claim 1, characterized in that, The step of generating a request identity root based on the session request includes: Determine the user's role information and the user's membership relationship information in the enterprise communication platform; Extract key request fields from the session request; Extract each message explicit item, each group bound item, and each resource reference item from the database, and form a candidate item set; For each candidate item in the candidate item set, determine whether the session request matches that candidate item; The project set is composed of the matched candidate projects; The request identity root is composed of the project set, role information, member relationship information, and request key fields.

4. The method according to claim 1, characterized in that, The step of determining the executable pre-retrieval range corresponding to the request identity root based on the resource directory metadata includes: The requested identity root is normalized and its hash value is calculated to obtain the identity root identifier; For each resource scope in the resource directory metadata, the permission determination function corresponding to the identity root identifier is called to determine whether each resource scope is permitted. The scope of resources that are allowed by permissions is composed of a set of permissions to be determined; The permission determination set is compiled to obtain the executable pre-search range.

5. The method according to any one of claims 1 to 4, characterized in that, The determination of the security context packet based on the executable pre-retrieval scope includes: Determine the allowed source types within the executable pre-retrieval scope, and determine the queryable data sources based on the source types; Extract the query predicates from the executable pre-retrieval range, and generate a query plan from the query predicates; The query plan is used to perform a query on the queryable data source to obtain returned records; The returned record is divided into various context units; For each of the context units, a unit identifier for the context unit is generated based on the source type, and the context unit is marked using the identity root identifier and the unit identifier to obtain a candidate context unit; Each trusted unit is selected from each of the candidate context units; A security context packet is constructed from each of the aforementioned trusted units.

6. The method according to claim 5, characterized in that, The step of filtering each trusted unit from each of the candidate context units includes: For each candidate context unit, extract each first keyword, each entity name, content time period, version information, and structured status from the candidate context unit. The user messages are matched with each of the first keywords, and a keyword matching score is calculated. The user messages are compared with the names of each entity to calculate the entity hit score; Obtain the request time of the session request, determine whether the request time is within the content time limit, and if so, use the preset first threshold as the time validity score. Calculate the version score based on the version information; The conclusive score of the candidate context unit is calculated based on the structured state; Each of the keyword matching score, entity hit score, time validity score, version score, and conclusion score is assigned a weight, and a weighted sum is calculated to obtain a comprehensive score. The comprehensive score is used for screening, and the selected candidate context units are used as trusted units.

7. The method according to claim 5, characterized in that, The construction of the security context package by each of the trusted units includes: For each of the trusted units, a trusted context block for that trusted unit is constructed; Each trusted context block is grouped to obtain a partition; Each partition is serialized in a preset fixed order to obtain a security context packet.

8. A secure response generation device for an enterprise communication platform, characterized in that, include: The session request generation module is used to respond to a user's conversation request instruction initiated in the enterprise communication platform, extract user messages, and generate a session request corresponding to the conversation request instruction based on the user messages. The request identity root generation module is used to perform security verification on the session request and determine whether the verification is successful. If the verification is successful, a request identity root is generated based on the session request. The retrieval scope determination module is used to extract resource directory metadata from the database of the enterprise communication platform, and determine the executable pre-retrieval scope corresponding to the request identity root based on the resource directory metadata; A security context packet determination module is used to determine a security context packet based on the executable pre-retrieval range; The response result generation module is used to input the security context packet and the user message into the intelligent assistant model of the enterprise communication platform, so that the intelligent assistant model can generate a response result.

9. A secure response generation device for an enterprise communication platform, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the secure response generation method for an enterprise communication platform as described in any one of claims 1-7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the secure response generation method for an enterprise communication platform as described in any one of claims 1-7.