Question and answer method, device, equipment, storage medium and computer program product
By extracting file content that users have permission to access from a large language model, the problem of confidential information leakage caused by the lack of user permission isolation in the large language model is solved, achieving higher security and accuracy.
Patent Information
- Application Number
- CN202411606886.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2044-11-11
AI Technical Summary
Large language models lack effective user permission isolation when answering user questions, leading to the leakage of confidential information.
By responding to user questions, inputting the questions into a large language model, extracting the target file content that the user has permission to access from the file content, generating and displaying the answer, and ensuring that only information that the user has permission to access is delivered.
This effectively prevents the leakage of confidential information and improves the security of the model-based question answering system.
Smart Images

Figure CN119598482B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information security, and particularly relates to a question and answer method and device, equipment, a storage medium and a computer program product. BACKGROUND
[0002] At present, when a large language model answers a question of a user, no effective user permission isolation is performed, the user can obtain confidential information of an enterprise through the question, and thus confidential information is leaked. SUMMARY
[0003] The main purpose of the present application is to provide a question and answer method, device, equipment, a storage medium and a computer program product, which aims to solve the technical problem that the existing question and answer method does not perform effective user permission isolation when a large language model answers a question of a user, the user can obtain confidential information of an enterprise through the question, and thus confidential information is leaked.
[0004] To achieve the above purpose, the present application provides a question and answer method, which comprises the following steps:
[0005] In response to a question raised by a user, inputting the question into a large language model, and obtaining file content cited by the large language model when answering the question;
[0006] Extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model;
[0007] Obtaining an answer generated by the large language model according to the question and the target file content, and displaying the answer.
[0008] Optionally, the step of extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model comprises the following steps:
[0009] Obtaining a source file corresponding to the file content, and obtaining file access permission of the user;
[0010] Obtaining target source files that the user has permission to access from the source file according to the file access permission;
[0011] Obtaining target file content corresponding to the target source files, and returning the target file content to the large language model.
[0012] Optionally, the step of obtaining file access permission of the user comprises the following steps:
[0013] Monitoring historical question and answer information and a current access environment of the user;
[0014] acquire initial access permission pre-assigned to the user;
[0015] adjust the initial access permission of the user according to the historical question and answer information and the current access environment, and obtain the file access permission of the user.
[0016] Optionally, the adjusting the initial access permission of the user according to the historical question and answer information and the current access environment, and obtaining the file access permission of the user, comprises:
[0017] performing semantic analysis, sentiment analysis and behavior pattern recognition on the historical question and answer information, and obtaining a multi-dimensional analysis result of the historical question and answer information;
[0018] acquiring geographical location positioning, device type and state recognition of the user from the current access environment;
[0019] analyzing the security of the user according to the geographical location positioning, the device type and the state recognition, and obtaining a security score of the user;
[0020] adjusting the initial access permission of the user according to the multi-dimensional analysis result of the historical question and answer information and the security score of the user, and obtaining the file access permission of the user.
[0021] Optionally, the inputting the question into a large language model and acquiring file content referenced by the large language model in answering the question in response to the question raised by the user, comprises:
[0022] inputting the question into a large language model in response to the question raised by the user;
[0023] vectorizing the question through the large language model, and obtaining a question vector;
[0024] matching the question vector with file content in a preset vector library, and acquiring file content referenced by the large language model in answering the question according to a matching result.
[0025] Optionally, before the inputting the question into a large language model and acquiring file content referenced by the large language model in answering the question in response to the question raised by the user, further comprising:
[0026] receiving a file added by a management user, and performing retrieval and reinforcement training on a large language model according to the file;
[0027] slicing the file, and obtaining file content;
[0028] storing the file content into the preset vector library, and creating a question and answer application according to the large language model and the preset vector library.
[0029] Correspondingly, the problem raised by the user is input into the large language model, and the file content cited by the large language model in answering the problem is obtained.
[0030] The problem raised by the user through the question and answer application is input into the large language model, and the file content cited by the large language model in answering the problem is obtained.
[0031] Optionally, the file is sliced to obtain file content, comprising:
[0032] The file type and file source of the file are obtained, and the encryption level of the file is analyzed according to the file type and the file source;
[0033] The model characteristics of the large language model and the user demand of the user are obtained, and the answer generation mode of the large language model is analyzed according to the model characteristics and the user demand;
[0034] The file is sliced according to the encryption level and the answer generation mode to obtain file content, wherein the file content includes multiple knowledge segments.
[0035] Optionally, the file content is stored in the preset vector library, comprising:
[0036] The file content is encrypted, and the encrypted file content is stored in the preset vector library;
[0037] The problem vector is matched with the file content in the preset vector library, comprising:
[0038] The file content in the preset vector library is decrypted, and the problem vector is matched with the decrypted file content.
[0039] Optionally, the answer generated by the large language model according to the problem and the target file content is obtained, and the answer is displayed, comprising:
[0040] The answer generated by the large language model according to the problem and the target file content is obtained;
[0041] The target source file corresponding to the target file content is obtained, and the answer and the target source file are displayed.
[0042] Optionally, after the target source file corresponding to the target file content is obtained, and the answer and the target source file are displayed, further comprising:
[0043] receive a permission application request fed back by the user according to the answer and the target source file;
[0044] send the answer, the target source file and the permission application request to a management user;
[0045] receive permission allocation information fed back by the management user according to the answer, the target source file and the permission application request;
[0046] re-extract custom file content from the file content according to the permission allocation information, and return the answer and the custom file content to the large language model;
[0047] obtain a custom answer regenerated by the large language model according to the question, the answer and the custom file content, and display the custom answer.
[0048] Optionally, after the target file content corresponding to the target source file is obtained and the answer and the target source file are displayed, the method further includes:
[0049] receive a file selection instruction fed back by the user according to the answer and the target source file;
[0050] return the question, the answer and the file selection instruction to the large language model;
[0051] obtain an answer regenerated by the large language model according to the question, the answer and the file selection instruction, and display the regenerated answer.
[0052] In addition, to achieve the above-mentioned purpose, the present application further provides a question and answer device, which comprises:
[0053] a question input module, configured to input a question raised by a user into a large language model and obtain file content cited by the large language model in answering the question;
[0054] a permission verification module, configured to extract target file content accessible by the user from the file content and return the target file content to the large language model;
[0055] an answer generation module, configured to obtain an answer generated by the large language model according to the question and the target file content, and display the answer.
[0056] Optionally, the permission verification module is further configured to obtain a source file corresponding to the file content, and obtain a file access permission of the user; obtain a target source file that the user has a permission to access from the source file according to the file access permission; obtain a target file content corresponding to the target source file, and return the target file content to the large language model.
[0057] Optionally, the permission verification module is further configured to monitor historical question and answer information and a current access environment of the user, obtain an initial access permission pre-assigned to the user, and adjust the initial access permission of the user according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
[0058] Optionally, the permission verification module is further configured to perform semantic analysis, sentiment analysis and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information, obtain a geographical location positioning, a device type and a state recognition of the user from the current access environment, analyze the security of the user according to the geographical location positioning, the device type and the state recognition to obtain a security score of the user, and adjust the initial access permission of the user according to the multi-dimensional analysis result of the historical question and answer information and the security score of the user to obtain the file access permission of the user.
[0059] Optionally, the question input module is further configured to input a question input by a user into a large language model, vectorize the question by the large language model to obtain a question vector, match the question vector with file content in a preset vector library, and obtain file content referenced by the large language model to answer the question according to a matching result.
[0060] Optionally, the question and answer device further comprises:
[0061] An application creation module is configured to receive a file added by a management user, and perform retrieval and reinforcement training on a large language model according to the file; slice the file to obtain file content; store the file content into the preset vector library, and create a question and answer application according to the large language model and the preset vector library.
[0062] Correspondingly, the question input module is further configured to input a question input by a user through the question and answer application into a large language model, and obtain file content referenced by the large language model to answer the question.
[0063] In addition, to achieve the above object, the present application further provides a question and answer device, which comprises a memory, a processor, and a question and answer program stored in the memory and executable on the processor, and the question and answer program is configured to implement the question and answer method as described above.
[0064] In addition, to achieve the above object, the present application further provides a storage medium, which stores a question and answer program, and the question and answer program is executed by a processor to implement the question and answer method as described above.
[0065] In addition, to achieve the above object, the present application further provides a computer program product, which comprises a question and answer program, and the question and answer program is executed by a processor to implement the question and answer method as described above.
[0066] The one or more technical solutions provided by the present application have at least the following technical effects:
[0067] In the present application, in response to a question raised by a user, the question is input into a large language model, and the file content referenced by the large language model to answer the question is obtained, the target file content accessible by the user is extracted from the file content, and the target file content is returned to the large language model, the answer generated by the large language model according to the question and the target file content is obtained, and the answer is displayed; since the present application only passes the file content accessible by the user to the large language model for answering when the user raises a question, the leakage of confidential information is avoided, and the security of the model question and answer is improved. BRIEF DESCRIPTION OF DRAWINGS
[0068] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and serve to explain the principles of the present application together with the specification.
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows, and obviously, other drawings can also be obtained by those skilled in the art without any creative labor.
[0070] Figure 1 Flowchart of a first embodiment of the question and answer method of the present application;
[0071] Figure 2 Flowchart of a second embodiment of the question and answer method of the present application;
[0072] Figure 3 Flowchart of a third embodiment of the question and answer method of the present application;
[0073] Figure 4A scene flow chart of an embodiment of the question and answer method of the present application;
[0074] Figure 5 An interface schematic diagram of an embodiment of the question and answer method of the present application;
[0075] Figure 6 A module structure schematic diagram of the question and answer device of an embodiment of the present application;
[0076] Figure 7 A device structure schematic diagram of the hardware running environment involved in the question and answer method in an embodiment of the present application.
[0077] The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0078] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and do not limit the present application.
[0079] In order to better understand the technical solutions of the present application, the following will be described in detail in conjunction with the drawings in the specification and specific embodiments.
[0080] At present, in the process of using a large language model, in order to ensure that the content corresponding to the large language model is reliable, the provided file content is usually sliced to form a data set through RAG (Retrieval-augmented Generation, retrieval-augmented generation). When the user raises a question, the corresponding data segment is obtained based on the vector retrieval or keyword retrieval mode, and then transmitted to the large language model, and the large language model generates the corresponding question answer.
[0081] However, the related technology does not do effective user permission isolation when obtaining the corresponding data segment, so that the user can obtain the enterprise's confidential information through the question, causing the enterprise's confidential information to be leaked, causing great loss to the enterprise.
[0082] Therefore, in order to overcome the above defects, the present application provides a solution, which comprises: in response to a question raised by a user, inputting the question into a large language model, and obtaining file content cited by the large language model to answer the question, extracting target file content accessible by the user from the file content, and returning the target file content to the large language model, obtaining an answer generated by the large language model according to the question and the target file content, and displaying the answer; since the present application only transmits the file content accessible by the user to the large language model for answering when the user raises a question, the leakage of confidential information is avoided, thereby improving the security of the model question and answer.
[0083] It should be noted that the execution subject of the embodiment can be a question and answer device with data processing, network communication and program running functions, for example, a cloud disk or a file management system, or other electronic devices capable of achieving the same or similar functions, and the embodiment does not limit this.
[0084] Based on this, the embodiment of the present application provides a question and answer method, referring to Figure 1 , Figure 1 The flowchart of the first embodiment of the question and answer method of the present application is shown in the figure.
[0085] In the first embodiment, the question and answer method comprises:
[0086] Step S10: in response to the question raised by the user, input the question into the large language model, and obtain the file content cited by the large language model in answering the question.
[0087] It should be understood that the user can raise questions through a preset application, which can be pre-set. In specific implementation, the preset application can be a document assistant corresponding to the file management system. Of course, in order to meet the individual needs of the user, the user can also raise questions through the management of the user's pre-constructed question and answer application (such as RAG application) in the embodiment, and the embodiment does not limit this.
[0088] It should be noted that the large language model can be a natural language processing model based on artificial intelligence technology, which can understand, analyze and generate human language text, and is used to answer various questions, provide information, generate text, etc. The question raised by the user can be a specific question or request issued by the user to the file management system, which needs to be answered or informed. The cited file content can be the content in the specific file, document or material referred to or cited by the large language model in answering the user's question, which can be stored in the file management system of the enterprise.
[0089] It can be understood that after inputting the question into the large language model, the large language model will answer the question and input the file content cited in answering the question, wherein the file content can be multiple knowledge segments, and the embodiment does not limit this.
[0090] Step S20: extract the target file content accessible by the user from the file content, and return the target file content to the large language model.
[0091] It should be understood that the target file content that the user has access to can refer to the part of the file content that the user is authorized to access and view according to the permission management mechanism of the enterprise. In a specific implementation, the file management system filters the part of the content that the user has access to from the referenced file content according to the permission management mechanism of the enterprise and the file access permission pre-assigned to the user, to ensure that the user can only see the information they are authorized to view, and to protect the information security of the enterprise.
[0092] Step S30: obtaining an answer generated by the large language model according to the question and the target file content, and displaying the answer.
[0093] It should be noted that the generated answer can refer to a specific response or solution to the user's question generated by the large language model based on the user's question and the filtered target file content through natural language processing technology.
[0094] It should be understood that the large language model can generate a specific answer based on the user's question and the filtered target file content. The file management system receives and displays this answer to the user, and the user can see the information related to their question and that they have access to.
[0095] The present embodiment only delivers the file content that the user has access to to the large language model for answering when the user asks a question, thereby avoiding the leakage of confidential information and improving the security of the model question and answer.
[0096] Reference Figure 2 , Figure 2 FIG. 2 is a flowchart of a second embodiment of the question and answer method of the present application. Based on the first embodiment shown in FIG. 1, the second embodiment of the question and answer method of the present application is proposed. Figure 1
[0097] In the second embodiment, the step S10 comprises:
[0098] Step S101: inputting the question asked by the user into the large language model.
[0099] It should be understood that in order to improve the accuracy of the file content, in the present embodiment, the question is first vectorized to obtain a question vector, and then the question vector is matched with the file content in the preset vector library, and the file content referenced by the large language model to answer the question is obtained according to the matching result.
[0100] Step S102: vectorizing the question through the large language model to obtain a question vector.
[0101] It can be understood that in the embodiment, the large language model converts the question raised by the user into a mathematical representation, i.e., a vector. The vector is a data structure containing multiple numerical values, used to represent the position of the text in a specific space. Through vectorization, the large language model can convert the text into a format that can be processed by the computer, while retaining its semantic information.
[0102] Step S103: matching the question vector with the file content in the preset vector library, and obtaining the file content referenced by the large language model to answer the question according to the matching result.
[0103] It should be understood that the preset vector library can be a database containing a large amount of file content (such as multiple knowledge fragments, etc.), and the file content in the preset vector library has been converted into a vector form. By calculating the similarity (such as cosine similarity) between the question vector and the file content vector in the preset vector library, the file content vector most similar to the question vector can be found, and after finding the file content vector most matched with the question vector, the corresponding file content can be retrieved from the preset vector library. These file contents will serve as the basis for the large language model to answer the user's question. The large language model can directly reference these file contents, or generate a more specific answer based on these contents, which is not limited in the embodiment.
[0104] The embodiment first vectorizes the question to obtain the question vector, then matches the question vector with the file content in the preset vector library, and obtains the file content referenced by the large language model to answer the question according to the matching result, thereby improving the accuracy of the file content and further improving the user's question and answer experience.
[0105] In the second embodiment, the step S20 comprises:
[0106] Step S201: obtaining the source file corresponding to the file content, and obtaining the file access authority of the user.
[0107] It should be understood that in order to avoid leakage of confidential information at the file level, in the embodiment, the source file corresponding to the file content and the file access authority of the user are first obtained, then the target source file that the user has the access right to access is obtained from the source file according to the file access authority, the target file content corresponding to the target source file is obtained, and the target file content is returned to the large language model.
[0108] It can be understood that in the embodiment, it is necessary to determine the source of the file content, that is, to find the original file that generates or contains the file content. In specific implementation, it can be to parse metadata, reference information or link in the file content, or query a database to find a source file associated with the file content. It is also necessary to query a user account or an access control list to determine the user's current file access permission. Among them, the file access permission can include access permission to different file types, file locations or file attributes, and the embodiment does not limit this.
[0109] Further, in order to meet the actual needs of the user, in the embodiment, the access permission of the user can also be adjusted, and the obtaining the file access permission of the user comprises: monitoring historical question and answer information and a current access environment of the user; obtaining initial access permission pre-assigned to the user; adjusting the initial access permission of the user according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
[0110] It should be noted that the historical question and answer information can refer to data generated by the user when interacting with the large language model in the past, including questions raised by the user, answers given by the large language model, feedback of the user, etc. The historical question and answer information can reflect the user's knowledge level, interest preference and possible access demand, etc. The current access environment can refer to the network environment, device information, geographic location and other external conditions in which the user is currently located. The current access environment can affect the user's access permission, for example, some sensitive information can only be accessed in the company's internal network environment. The initial access permission can refer to the file access permission pre-assigned to the user according to the user's role, position or organizational strategy. The initial access permission defines which files the user can view, edit or delete. The file access permission can refer to the access permission dynamically adjusted by the user according to the historical question and answer information, the current access environment and possibly other factors when actually accessing the file.
[0111] It should be understood that the historical question and answer information and the current access environment of the user are continuously monitored, and relevant data is collected. According to the static information such as the role and position of the user, a set of initial access permissions is pre-assigned to the user. According to the collected historical question and answer information and current access environment, the initial access permission of the user is dynamically adjusted. This adjustment can be based on various factors such as user behavior patterns, access requirements, security policies, etc. The adjusted file access permission will be applied to the user's actual file access request, ensuring that the user can only access the content authorized by him.
[0112] Further, in order to improve the accuracy of the access permission adjustment, the adjusting the initial access permission of the user according to the historical question and answer information and the current access environment to obtain the file access permission of the user comprises: performing semantic analysis, sentiment analysis and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information; obtaining the geographical location positioning, device type and state recognition of the user from the current access environment; analyzing the security of the user according to the geographical location positioning, the device type and the state recognition to obtain a security score of the user; and adjusting the initial access permission of the user according to the multi-dimensional analysis result of the historical question and answer information and the security score of the user to obtain the file access permission of the user.
[0113] It can be understood that the semantic analysis can refer to a process of understanding and interpreting the content of the text, aiming to extract semantic information such as topics, concepts and relationships in the text. The sentiment analysis can refer to a process of judging the sentiment tendency of the content of the text, which is used to identify whether the sentiment expressed by the text is positive, negative or neutral. The behavior pattern recognition can refer to a process of identifying the behavior characteristics, habits or rules of the user by analyzing the behavior data of the user. The geographical location positioning can refer to a technology for determining the current geographical location of the user, which can be realized by GPS, network positioning and the like. The device type can refer to the type of device used by the user to access the system, such as mobile phone, computer, tablet and the like. The state recognition can refer to the recognition of the current state of the user's device, such as whether it is connected to the company network, whether the security software is turned on and the like. The security score can refer to a security score of the user accessing the system, which is obtained by comprehensively evaluating the geographical location, device type, state and other factors of the user.
[0114] For ease of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, assume that an employee of a certain enterprise wants to understand the company's reimbursement process and plans to access relevant files stored in the enterprise's file management system. The specific steps are as follows: 1. Multidimensional analysis: semantic analysis: the system analyzes the questions the employee has asked in the past and finds that he has mentioned keywords such as "reimbursement" and "invoice" multiple times, indicating that he is interested in the reimbursement process. Sentiment analysis: the system finds that the employee usually shows a positive and patient attitude when asking questions, and does not show obvious negative emotions. Behavior pattern recognition: the system analyzes the employee's access records and finds that he usually accesses the system during working hours and the access frequency is relatively stable. 2. Environment information collection: geographic location positioning: the system locates the employee's current location in the company building through GPS. Device type: the employee uses a notebook computer provided by the company. State recognition: the system detects that the employee's notebook computer has connected to the company's internal network and installed the latest security software. 3. Security assessment: the system assesses the security score of the employee according to the information of his geographic location (inside the company), device type (company-provided notebook computer) and state recognition (connected to the company's internal network and installed security software), and the security score of the employee is high. 4. Permission adjustment: the system adjusts the initial access permission of the employee according to his historical question and answer information (interested in the reimbursement process) and the security score (high), allowing him to access more detailed reimbursement process guidelines and more relevant financial files.
[0115] Step S202: obtaining target source files that the user has access to from the source files according to the file access permission.
[0116] It can be understood that the file access permission can refer to the permission level of the user authorized to access specific files or file sets in the file management system. The file access permission determines which files the user can view, edit, download or delete, so in this embodiment, the target source files that the user has access to can be obtained from the source files according to the file access permission.
[0117] Step S203: obtaining target file content corresponding to the target source files, and returning the target file content to the large language model.
[0118] For ease of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, assume that the large language model vectorizes the question raised by the user and performs uniform retrieval in the vector library to retrieve 10 blocks (multiple knowledge fragments, i.e., file contents) with high matching degree, and the 10 blocks come from 4 files (i.e., source files). The large language model recalls 4 files, and the current user has access rights to only 3 of them (i.e., target source files). Corresponding to the 3 files, there are 8 blocks (i.e., target file contents corresponding to the target source files). The corresponding 8 blocks of contents and the user's question are transmitted to the large language model, and the large language model generates an answer within the corresponding permission range based on the transmitted contents for the user.
[0119] The present embodiment first acquires the source files corresponding to the file contents and the file access rights of the user, then acquires the target source files that the user has access rights to from the source files according to the file access rights, acquires the target file contents corresponding to the target source files, and returns the target file contents to the large language model, thereby being able to avoid leakage of confidential information at the file level and improving the security of the model question and answer.
[0120] In the second embodiment, the step S30 comprises:
[0121] Step S301: Acquire the answer generated by the large language model based on the question and the target file contents.
[0122] It should be understood that, in order to reduce the illusion of the large language model and realize the traceability and content credibility of the answer, in the present embodiment, the target source file corresponding to the target file contents is displayed at the same time as the answer.
[0123] It can be understood that after returning the target file contents to the large language model, the large language model generates a specific answer to the user's question based on the user's question and the filtered target file contents.
[0124] Step S302: Acquire the target source file corresponding to the target file contents, and display the answer and the target source file.
[0125] It should be understood that the original file or document containing the target file contents, i.e., the target source file, is identified and acquired. The generated answer and the target source file are displayed together to the user so that the user can understand the specific source and basis of the answer.
[0126] In the present embodiment, the target source file corresponding to the target file contents is displayed at the same time as the answer, thereby being able to reduce the illusion of the large language model and realize the traceability and content credibility of the answer.
[0127] Further, in order to obtain an answer containing more information, in this embodiment, after obtaining the answer, the user can also apply for permission to regenerate the answer to the management user, and the step S302 further includes: receiving the permission application request fed back by the user according to the answer and the target source file; sending the answer, the target source file and the permission application request to the management user; receiving the permission allocation information fed back by the management user according to the answer, the target source file and the permission application request; re-extracting the custom file content from the file content according to the permission allocation information, and returning the answer and the custom file content to the large language model; obtaining the custom answer regenerated by the large language model according to the question, the answer and the custom file content, and displaying the custom answer.
[0128] It should be noted that the permission application request can refer to the request of the user to the system to adjust or increase the access permission according to the answer and the target source file. The management user can refer to a user with permission allocation authority, which can be a system administrator or a person with corresponding responsibilities. The permission allocation information can refer to the specific information about the adjustment of the user's permission fed back by the management user according to the user's permission application request. The custom file content can refer to the content of the user newly obtained access permission re-extracted from the file content by the file management system according to the permission allocation information. The custom answer can refer to the more detailed or containing more information answer regenerated by the large language model according to the user's question, the original answer and the custom file content.
[0129] It should be understood that the user applies for permission to the file management system according to the answer and the target source file. The file management system sends the answer, the target source file and the permission application request to the management user. The management user decides whether to adjust the user's permission according to these information, and feeds back the permission allocation information. The file management system re-extracts the content of the user newly obtained access permission, i.e. the custom file content, from the file content according to the permission allocation information. The file management system returns the answer and the custom file content to the large language model. The large language model regenerates a custom answer containing more information according to the user's question, the original answer and the custom file content. The file management system displays the custom answer to the user so that the user can understand more detailed information.
[0130] Further, in order to obtain a more refined answer, in this embodiment, after obtaining the answer, the user can also select part of the file from the target source file to regenerate the answer. After step S302, the method further comprises: receiving a file selection instruction fed back by the user according to the answer and the target source file; returning the question, the answer and the file selection instruction to the large language model; obtaining an answer regenerated by the large language model according to the question, the answer and the file selection instruction, and displaying the regenerated answer.
[0131] It should be noted that the file selection instruction can be an instruction issued by the user to the system to select a specific file or file content according to the answer and the target source file, for further refining or supplementing the answer. The regenerated answer can be an answer regenerated by the large language model according to the user's question, the original answer and the file selection instruction, which is more detailed or contains more information.
[0132] It can be understood that the user issues a file selection instruction to the file management system according to the answer and the target source file, selects a specific file or file content to further refine or supplement the answer. The file management system returns the user's question, the answer generated by the large language model and the file selection instruction issued by the user to the large language model. The large language model regenerates an answer that is more detailed or contains more information according to the user's question, the original answer and the file selection instruction. The file management system displays the regenerated answer to the user.
[0133] Reference Figure 3 , Figure 3 The third embodiment of the question and answer method of the present application is shown in the flowchart. Based on the second embodiment shown in the above Figure 2 The third embodiment of the question and answer method of the present application is proposed.
[0134] In the third embodiment, before step S101, the method further comprises:
[0135] Step S01: receiving a file added by a management user, and performing retrieval enhancement training on the large language model according to the file.
[0136] It should be understood that in order to improve the retrieval and answering ability of the large language model in a specific field or topic, in this embodiment, the management user can also add files to the large language model for retrieval enhancement training, and store the added files in the form of file content.
[0137] It can be understood that the management user can refer to a user with the permission to add, manage files in the file management system, for example, a system administrator or an individual with specific permissions, and the embodiment does not limit this. In a specific implementation, receiving the file added by the management user can be that the file management system provides an interface or an interface allowing the management user to add files in the background in batches. In the embodiment, the large language model is trained using the content of the added file to improve the retrieval and answering ability of the model in a specific field or topic. In a specific implementation, the added file can be converted into training data, and the large language model can be trained through the training data.
[0138] Step S02: slicing the file to obtain file content.
[0139] It should be understood that, in order to more effectively process and store file content, in the embodiment, the file is divided into smaller segments or slices, and in a specific implementation, different files are sliced according to different slicing strategies to obtain multiple knowledge segments, wherein the slicing strategy can be pre-set.
[0140] Further, in order to meet the actual slicing requirements, the step S02 comprises: obtaining the file type and the file source of the file, and analyzing the encryption level of the file according to the file type and the file source; obtaining the model characteristics of the large language model and the user demand of the user, and analyzing the answer generation mode of the large language model according to the model characteristics and the user demand; slicing the file according to the encryption level and the answer generation mode to obtain file content, wherein the file content comprises multiple knowledge segments.
[0141] It should be noted that the file type can refer to the format or category of the file, such as a text file, an image file, an audio file, a video file, etc., each type has its specific storage and representation method. The file source can refer to the source or generation method of the file, such as internal generation, external reception, network download, etc., files from different sources may have different security and credibility. The encryption level can refer to the degree or level of file encryption, which is used to protect the confidentiality and integrity of the file. The higher the encryption level, the higher the security of the file. The model characteristics can refer to the characteristics exhibited by the large language model when processing natural language tasks, such as language understanding ability, generation ability, context perception ability, etc. The user demand can refer to the goal or demand that the user expects to achieve when using the large language model, such as obtaining specific information, generating text, conducting a conversation, etc. The answer generation mode can refer to the strategy or method adopted by the large language model when answering user questions, such as template-based generation, retrieval-based generation, generation-based generation, etc. The knowledge segment can refer to an information unit with specific meaning or value extracted from the file, which can be a concept, a fact, an opinion, etc.
[0142] It should be understood that the file management system first identifies the type (such as PDF, DOCX, TXT, etc.) and source (such as internal system, external mailbox, network link, etc.) of the uploaded file. According to the type and source of the file, the file management system assesses the encryption needs of the file. For example, sensitive data (such as financial statements, customer information) may require a higher encryption level, while public information (such as press releases, product manuals) may not require encryption. The file management system analyzes the characteristics of the currently used large language model (such as which type of text is good at processing, the speed and quality of generating answers, etc.) and the specific needs of the user (such as the need for quick access to answers, the need for detailed explanations, etc.). Based on the characteristics of the model and the user's needs, the file management system determines the best answer generation method that the large language model should use when answering user questions. For example, for questions that require quick answers, a retrieval-based generation method can be used; for questions that require detailed explanations, a generation-based generation method can be used. After determining the encryption level of the file and the answer generation method of the large language model, the file management system performs slicing processing on the file. The size and number of slices depend on the encryption level of the file (the higher the encryption level, the finer the slices) and the answer generation method (the more knowledge fragments that need to be extracted, the more slices there may be). The sliced file content is extracted and stored as multiple knowledge fragments, which can be used for subsequent question answering, retrieval, etc.
[0143] For ease of understanding, the following is an example, but does not limit the present application. As an example, assume there is a corporate file management system that contains various types and sources of files, such as internally generated financial statements, externally received customer information, and network downloaded competitor analysis reports. A user uploads a PDF format financial statement that comes from the internal finance department. Since the financial statement contains sensitive data, the corporate file management system sets its encryption level to the highest level. The large language model used by the corporate file management system is good at processing text data, and the user needs to quickly access the key data in the report. Based on the characteristics of the model and the user's needs, the corporate file management system decides to use a retrieval-based generation method to answer the user's questions. Due to the high encryption level, the corporate file management system performs fine slicing on the financial statement to ensure that each slice contains independent and complete knowledge fragments (such as income, expenses, profit, etc.). The sliced financial statement is extracted as multiple knowledge fragments and stored in the corporate file management system. When the user asks "What is the income for this quarter?", the corporate file management system can quickly retrieve the relevant knowledge fragments and return them to the user.
[0144] Step S03: store the file content in the preset vector library, and create a question and answer application according to the large language model and the preset vector library.
[0145] For ease of understanding, the following is illustrated by way of example, but does not limit the present application. As an example, assume that there is a corporate document management system that contains a large number of technical documents, policy files, and user manuals, etc. A system administrator uploads a new technical document to the corporate document management system. The corporate document management system uses the content of the new document to train a large language model so that it can better understand and answer technical-related questions. The corporate document management system divides the document into multiple paragraphs or chapters, each of which is a slice. The corporate document management system converts the content of these slices into vector representations and stores them in a preset vector library. The corporate document management system builds a question and answer application through which users can ask questions related to technical documents. For example, a user may ask about the use of a specific function or the details of a policy.
[0146] Further, to improve the security of the document content, the storing of the file content into the preset vector library includes encrypting the file content and storing the encrypted file content into the preset vector library; and the matching of the question vector with the file content in the preset vector library includes decrypting the file content in the preset vector library and matching the question vector with the decrypted file content.
[0147] It can be understood that before storing the file content into the preset vector library, the file content is first encrypted using a preset encryption algorithm to ensure that even if the preset vector library is accessed without authorization, the file content therein will not be easily understood or misused. The encrypted file content is converted into a vector form and stored in the preset vector library, which contains a plurality of encrypted file content vectors. When it is necessary to match the question vector with the file content in the preset vector library, the encrypted file content vectors in the preset vector library need to be decrypted first. This is because in the matching process, the original form of the file content needs to be accessed in order to compare with the question vector. Specifically, the similarity or distance between the decrypted file content vector and the question vector can be calculated to determine which file content in the preset vector library is most relevant to the user's question. The preset encryption algorithm can be preset, and the present embodiment does not limit this.
[0148] Correspondingly, the step S101 includes:
[0149] Step S101': in response to a question raised by a user through the question and answer application, inputting the question into the large language model and obtaining file content referenced by the large language model in answering the question.
[0150] The user of the embodiment can also add files to the large language model for retrieval and enhancement training, and store the added files in the form of file content, thereby improving the retrieval and answering ability of the large language model in a specific field or topic, and improving the user experience.
[0151] For the sake of understanding, reference Figure 4 and Figure 5 are made, but do not limit the present application. Figure 4 The scene flowchart of an embodiment of the question and answer method of the present application, Figure 5 The interface schematic diagram of an embodiment of the question and answer method of the present application, in order to solve the content leakage problem of the current large language model in the user question and answer process, the present application adopts a file permission allocation technology based on a cloud disk or a file management system, when the user asks a question, only the file content (multiple knowledge segments) that the current user has permission to access is retrieved, and the corresponding segment content is returned to the large language model, so that the large language model generates an answer and gives the final reference file. The specific control steps are as follows:
[0152] Step 1: The administrator assigns different file access permissions to different types of users.
[0153] Step 2: The administrator adds files in batches in the background and trains RAG, slices the files according to different slicing strategies, and creates an RAG-based application.
[0154] Step 3: The user asks a question on the RAG application created by the administrator (such as Figure 5 “what is the reimbursement process of Hangzhou Branch?”), the large language model vectorizes the question raised by the user, and uniformly retrieves in the vector library to find 10 blocks with high matching degree (such as Figure 4 block1, block2, block3, block4, block5, block6, block7, block8, block9 and block10 in Figure 4 ), and the 10 blocks come from 4 files (such as file1, file2, file3 and file4 in ).
[0155] Step 4: The 4 files recalled by the large language model, the current user has access permission to only 3 (such as file1, file2 and file3 in Figure 4 ), and the corresponding 3 files are associated with 8 blocks (such as block1, block2, block3, block4, block5, block6, block7 and block8 in Figure 4 ).
[0156] Step 5: transmit the corresponding 8 block contents and the user's question to the large language model, and the large language model generates an answer within the corresponding permission range based on the transmitted content (such as the answer of the document assistant in Figure 5 ) and displays which files the corresponding user's answer comes from (such as the files 1, 2 and 3 displayed in the "understand detailed information" part in Figure 5 ).
[0157] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the question and answer method of the present application. More forms of simple changes based on this technical concept are within the protection scope of the present application.
[0158] The present application also provides a question and answer device, please refer to Figure 6 , the question and answer device comprises:
[0159] a question input module 10, configured to input a question raised by a user into a large language model and acquire file content referenced by the large language model in answering the question;
[0160] a permission verification module 20, configured to extract target file content accessible by the user from the file content and return the target file content to the large language model;
[0161] an answer generation module 30, configured to acquire an answer generated by the large language model based on the question and the target file content and display the answer.
[0162] The question and answer device provided by the present application adopts the question and answer method in the above embodiments and can solve the technical problem that the large language model in the existing question and answer method does not perform effective user permission isolation when answering the user's question, the user can obtain confidential information of an enterprise by asking questions, and thus the confidential information is leaked. Compared with the prior art, the question and answer device provided by the present application has the same beneficial effects as the question and answer method provided by the above embodiments, and other technical features in the question and answer device are the same as the features disclosed in the above embodiments, which will not be repeated here.
[0163] The present application provides a question and answer device, which comprises at least one processor and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the question and answer method in the above embodiment I.
[0164] Reference will be made to Figure 7The diagram illustrates a structural schematic suitable for implementing the question-and-answer device in the embodiments of this application. The question-and-answer device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The question-and-answer device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0165] like Figure 7 As shown, the question-and-answer device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the question-and-answer device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touch screens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the question-and-answer device to communicate wirelessly or wiredly with other devices to exchange data. Although question-and-answer devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0166] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program codes for executing the method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiments disclosed in the present application are executed.
[0167] The question and answer device provided by the present application adopts the question and answer method in the above-mentioned embodiments, and can solve the technical problem that the existing question and answer method does not effectively isolate the user's authority when the large language model answers the user's question, and the user can obtain the confidential information of the enterprise through the question, thereby causing the confidential information to be leaked. Compared with the prior art, the question and answer device provided by the present application has the same beneficial effects as the question and answer method provided by the above-mentioned embodiments, and other technical features in the question and answer device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.
[0168] It should be understood that parts of the present application can be realized by hardware, software, firmware or a combination thereof. In the description of the above-mentioned embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0169] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0170] The present application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e. computer program) for executing the question and answer method in the above-mentioned embodiments.
[0171] The computer readable storage medium provided in the present application may, for example, be a U disk, but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more conductive wires, a portable computer diskette, a hard disk, a RAM (Random Access Memory), a ROM (Read Only Memory), an EPROM (Erasable Programmable Read Only Memory) or a flash memory, an optical fiber, a CD-ROM (CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted in any suitable medium, including but not limited to an electrical wire, an optical cable, an RF (Radio Frequency), and the like, or any suitable combination of the above.
[0172] The above computer readable storage medium can be contained in the question and answer device, or can exist separately without being assembled into the question and answer device.
[0173] The above computer readable storage medium carries one or more programs, which, when executed by the question and answer device, cause the question and answer device to perform the above question and answer method.
[0174] Computer program code for carrying out operations of the present application can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0175] The flow and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flow and block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or combinations of hardware and software.
[0176] The modules involved in the embodiments of the present application can be implemented in software or in hardware. In some cases, the name of the module does not constitute a limitation on the unit itself.
[0177] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer program) for executing the above-mentioned question and answer method, and can solve the technical problem that the existing large language model in the question and answer mode does not effectively isolate user permissions when answering user questions, and users can obtain confidential information of enterprises through questioning, thereby causing confidential information leakage. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the question and answer method provided by the above-mentioned embodiments, and will not be described here.
[0178] The present application also provides a computer program product comprising a computer program, which, when executed by a processor, implements the above-mentioned question and answer method.
[0179] The computer program product provided by the present application can solve the technical problem that the existing large language model in the question and answer mode does not effectively isolate user permissions when answering user questions, and users can obtain confidential information of enterprises through questioning, thereby causing confidential information leakage. Compared with the prior art, the computer program product provided by the present application has the same beneficial effects as the question and answer method provided by the above-mentioned embodiments, and will not be described here.
[0180] The above only describes some embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structural transformation, direct / indirect application in other related technical fields based on the technical concept of the present application, and the contents of the present application specification and drawings are included in the patent protection scope of the present application.
[0181] The present application discloses A1, a question and answer method, comprising:
[0182] In response to a question raised by a user, inputting the question into a large language model and obtaining file content cited by the large language model in answering the question;
[0183] Extracting target file content accessible by the user from the file content and returning the target file content to the large language model;
[0184] Obtaining an answer generated by the large language model based on the question and the target file content, and displaying the answer.
[0185] A2, the question and answer method of A1, the target file content accessible by the user is extracted from the file content, and the target file content is returned to the large language model, comprising:
[0186] Obtaining the source file corresponding to the file content, and obtaining the file access permission of the user;
[0187] Obtaining the target source file accessible by the user according to the file access permission from the source file;
[0188] Obtaining the target file content corresponding to the target source file, and returning the target file content to the large language model.
[0189] A3, the question and answer method of A2, the file access permission of the user comprises:
[0190] Monitoring the historical question and answer information and the current access environment of the user;
[0191] Obtaining the initial access permission pre-assigned to the user;
[0192] Adjusting the initial access permission of the user according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
[0193] A4, the question and answer method of A3, the initial access permission of the user is adjusted according to the historical question and answer information and the current access environment to obtain the file access permission of the user, comprising:
[0194] performing semantic analysis, sentiment analysis and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information;
[0195] obtaining geographical location positioning, device type and state recognition of the user from the current access environment;
[0196] analyzing the security of the user according to the geographical location positioning, the device type and the state recognition to obtain a security score of the user;
[0197] adjusting the initial access permission of the user according to the multi-dimensional analysis result of the historical question and answer information and the security score of the user to obtain the file access permission of the user.
[0198] A5. The question and answer method of any one of A1 to A4, wherein the step of inputting the question into a large language model and obtaining file content referenced by the large language model to answer the question in response to the question raised by the user comprises:
[0199] inputting the question into a large language model in response to the question raised by the user;
[0200] vectorizing the question through the large language model to obtain a question vector;
[0201] matching the question vector with file content in a preset vector library, and obtaining file content referenced by the large language model to answer the question according to a matching result.
[0202] A6. The question and answer method of A5, wherein the step of inputting the question into a large language model and obtaining file content referenced by the large language model to answer the question in response to the question raised by the user further comprises:
[0203] receiving a file added by a management user, and performing retrieval and reinforcement training on a large language model according to the file;
[0204] slicing the file to obtain file content;
[0205] storing the file content into the preset vector library, and creating a question and answer application according to the large language model and the preset vector library;
[0206] Correspondingly, the step of inputting the question into a large language model and obtaining file content referenced by the large language model to answer the question in response to the question raised by the user comprises:
[0207] inputting the question into a large language model in response to the question raised by the user through the question and answer application, and obtaining file content referenced by the large language model to answer the question.
[0208] A7. The question and answer method of A6, wherein the slicing the file to obtain file content comprises:
[0209] obtaining a file type and a file source of the file, and analyzing an encryption level of the file according to the file type and the file source;
[0210] obtaining a model feature of the large language model and a user demand of the user, and analyzing an answer generation manner of the large language model according to the model feature and the user demand;
[0211] slicing the file according to the encryption level and the answer generation manner to obtain file content, wherein the file content comprises a plurality of knowledge segments.
[0212] A8. The question and answer method of A6, wherein the storing the file content into the preset vector library comprises:
[0213] encrypting the file content, and storing the encrypted file content into the preset vector library;
[0214] The matching the question vector with the file content in the preset vector library comprises:
[0215] decrypting the file content in the preset vector library, and matching the question vector with the decrypted file content.
[0216] A9. The question and answer method of any one of A1 to A4, wherein the obtaining an answer generated by the large language model according to the question and the target file content, and displaying the answer comprises:
[0217] obtaining an answer generated by the large language model according to the question and the target file content;
[0218] obtaining a target source file corresponding to the target file content, and displaying the answer and the target source file.
[0219] A10. The question and answer method of A9, further comprising, after the obtaining the target source file corresponding to the target file content, and displaying the answer and the target source file:
[0220] receiving a permission application request fed back by the user according to the answer and the target source file;
[0221] sending the answer, the target source file, and the permission application request to a management user;
[0222] receiving permission allocation information fed back by the management user according to the answer, the target source file, and the permission application request;
[0223] re-extracting custom file content from the file content according to the permission assignment information, and returning the answer and the custom file content to the large language model;
[0224] obtaining a custom answer regenerated by the large language model according to the question, the answer and the custom file content, and displaying the custom answer.
[0225] A11. The question and answer method of A9, after obtaining the target source file corresponding to the target file content and displaying the answer and the target source file, further comprising:
[0226] receiving a file selection instruction fed back by the user according to the answer and the target source file;
[0227] returning the question, the answer and the file selection instruction to the large language model;
[0228] obtaining an answer regenerated by the large language model according to the question, the answer and the file selection instruction, and displaying the regenerated answer.
[0229] The application also discloses B12, a question and answer device, which comprises:
[0230] a question input module configured to input a question raised by a user into a large language model and obtain file content referenced by the large language model to answer the question in response to the question;
[0231] a permission verification module configured to extract target file content accessible by the user from the file content and return the target file content to the large language model;
[0232] an answer generation module configured to obtain an answer generated by the large language model according to the question and the target file content and display the answer.
[0233] B13. The question and answer device of B12, wherein the permission verification module is further configured to obtain a source file corresponding to the file content, obtain file access permission of the user, obtain a target source file accessible by the user from the source file according to the file access permission, obtain target file content corresponding to the target source file, and return the target file content to the large language model.
[0234] B14. The question and answer device of B13, wherein the permission verification module is further configured to monitor historical question and answer information and a current access environment of the user, obtain an initial access permission pre-assigned to the user, and adjust the initial access permission of the user according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
[0235] B15. The question and answer device of B14, wherein the permission verification module is further configured to perform semantic analysis, sentiment analysis, and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information, obtain a geographic location, a device type, and a state recognition of the user from the current access environment, analyze the security of the user according to the geographic location, the device type, and the state recognition to obtain a security score of the user, and adjust the initial access permission of the user according to the multi-dimensional analysis result of the historical question and answer information and the security score of the user to obtain the file access permission of the user.
[0236] B16. The question and answer device of any one of B12 to B15, wherein the question input module is further configured to input a question raised by a user into a large language model in response to the question, vectorize the question by the large language model to obtain a question vector, and match the question vector with file content in a preset vector library and obtain file content referenced by the large language model to answer the question according to a matching result.
[0237] B17. The question and answer device of B16, further comprising:
[0238] an application creation module configured to receive a file added by a management user, perform retrieval and enhanced training on a large language model according to the file, slice the file to obtain file content, store the file content into the preset vector library, and create a question and answer application according to the large language model and the preset vector library.
[0239] Correspondingly, the question input module is further configured to input a question raised by a user through the question and answer application into a large language model and obtain file content referenced by the large language model to answer the question.
[0240] The application further discloses C18, a question and answer device, comprising a memory, a processor, and a question and answer program stored in the memory and executable on the processor, wherein the question and answer program is implemented when executed by the processor to realize the question and answer method as described above.
[0241] The application also discloses D19, a storage medium, wherein a question and answer program is stored on the storage medium, and the question and answer program is executed by a processor to realize the question and answer method.
[0242] The application also discloses E20, a computer program product, wherein the computer program product comprises a question and answer program, and the question and answer program is executed by a processor to realize the question and answer method.
Claims
1. A question and answer method, characterized by, The question and answer method comprises: In response to a question raised by a user, inputting the question into a large language model and obtaining file content referenced by the large language model in answering the question; Extracting target file content accessible by the user from the file content and returning the target file content to the large language model, wherein the file access permission of the user is determined according to a security score of the user and a multi-dimensional analysis result of historical question and answer information, the security score is determined according to geographical location positioning, device type and state recognition of the user, and the multi-dimensional analysis result is obtained through semantic analysis, sentiment analysis and behavior pattern recognition; Obtaining an answer generated by the large language model according to the question and the target file content, and displaying the answer; Before the above-mentioned step, the method further comprises: Obtaining the file type and the file source of the file, and analyzing the encryption level of the file according to the file type and the file source; Obtaining the model characteristics of the large language model and the user demand of the user, and analyzing the answer generation mode of the large language model according to the model characteristics and the user demand, wherein the model characteristics are the characteristics exhibited by the large language model when processing natural language tasks, and the model characteristics include language understanding ability, generation ability and context awareness ability; According to the encryption level and the answer generation mode, the file is sliced to obtain file content, wherein the higher the encryption level, the finer the slicing, the more knowledge fragments the answer generation mode needs to extract, the more the slicing, and the file content comprises a plurality of knowledge fragments.
2. The question-answering method of claim 1, wherein, The step of extracting the target file content accessible by the user from the file content and returning the target file content to the large language model comprises: Obtaining the source file corresponding to the file content, and obtaining the file access permission of the user; According to the file access permission, obtaining the target source file accessible by the user from the source file; Obtaining the target file content corresponding to the target source file, and returning the target file content to the large language model.
3. The question answering method of claim 2, wherein, The step of obtaining the file access permission of the user comprises: Monitoring the historical question and answer information and the current access environment of the user; Obtaining the initial access permission pre-assigned to the user; Adjusting the initial access permission of the user according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
4. The question answering method of claim 3, wherein, The step of adjusting the initial access permission of the user according to the historical question and answer information and the current access environment to obtain the file access permission of the user comprises: Performing semantic analysis, sentiment analysis and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information; Obtaining the geographical location positioning, device type and state recognition of the user from the current access environment; Based on the geographic location, the device type, and the status identification, the user's security is analyzed to obtain the user's security score; Based on the multidimensional analysis results of the historical question and answer information and the user's security score, the user's initial access permissions are adjusted to obtain the user's file access permissions.
5. The question-answering method according to any one of claims 1 to 4, characterized in that, The process of responding to a user's question by inputting the question into a large language model and obtaining the file content referenced by the large language model in response to the question includes: In response to a user's question, the question is input into the large language model; The problem is vectorized using the large language model to obtain a problem vector; The question vector is matched with the file content in the preset vector library, and the file content referenced by the large language model in answering the question is obtained based on the matching result.
6. The question answering method of claim 5, wherein, Before responding to a user's question, inputting the question into the large language model, and obtaining the file content referenced by the large language model in response to the question, the method further includes: Receive files added by the management user, and perform retrieval enhancement training on the large language model based on the files; The file is sliced to obtain its content; The file content is stored in the preset vector library, and a question-and-answer application is created based on the large language model and the preset vector library; Accordingly, in response to a user's question, inputting the question into a large language model and obtaining the file content referenced by the large language model in answering the question includes: In response to a question posed by a user through the question-and-answer application, the question is input into the large language model, and the content of the file referenced by the large language model in answering the question is obtained.
7. A question and answer apparatus characterized by comprising: The question-and-answer device includes: The question input module is used to respond to a question raised by a user, input the question into the large language model, and obtain the file content referenced by the large language model in response to the question; The permission verification module is used to extract the target file content that the user has permission to access from the file content, and return the target file content to the large language model. The user's file access permissions are determined based on the user's security score and the multidimensional analysis results of historical question and answer information. The security score is determined based on the user's geographical location, device type, and status recognition. The multidimensional analysis results are obtained through semantic analysis, sentiment analysis, and behavioral pattern recognition. The answer generation module is used to obtain the answer generated by the large language model based on the question and the content of the target file, and to display the answer; The step of responding to a user's question by inputting the question into a large language model and obtaining the file content referenced by the large language model in response to the question further includes: The file type and file source of the file are obtained, and the encryption level of the file is analyzed according to the file type and the file source; the model characteristics of the large language model and the user demand of the user are obtained, and the answer generation mode of the large language model is analyzed according to the model characteristics and the user demand, wherein the model characteristics are characteristics exhibited by the large language model when processing natural language tasks, and the model characteristics include language understanding ability, generation ability, and context perception ability; the file is sliced according to the encryption level and the answer generation mode to obtain file content, wherein the higher the encryption level, the finer the slicing, the more knowledge fragments the answer generation mode needs to extract, and the more the slicing, and the file content includes a plurality of knowledge fragments.
8. A question answering apparatus, characterized by comprising: The question and answer device comprises a memory, a processor, and a question and answer program stored on the memory and executable on the processor, and the question and answer program, when executed by the processor, implements the question and answer method of any one of claims 1 to 6.
9. A storage medium, characterized by The storage medium has a question and answer program stored thereon, and the question and answer program, when executed by the processor, implements the question and answer method of any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer program product comprises a question and answer program, and the question and answer program, when executed by the processor, implements the question and answer method of any one of claims 1 to 6.
Citation Information
Patent Citations
Question and answer model construction method, knowledge base creation method, question and answer search method and electronic equipment
CN116842151A
Protection method and system for preventing file tampering based on adaptive security mechanism
CN118551416A