Question and answer information transmission method and equipment

By updating the session identifier in the computing device, the problem of large language models obtaining user privacy is solved, and the secure transmission and privacy protection of user data are achieved.

CN120658416APending Publication Date: 2025-09-16CHENGDU HUAWEI TECH CO LTD

Patent Information

Application Number
CN202410295175.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

When a large language model is used on the user side, it may obtain all the user's data, leading to user privacy leakage. Existing technologies such as localized deployment and private services cannot effectively prevent privacy leakage.

Method used

The user's session ID is continuously updated through computing devices, making it impossible for the network model to find the user's historical conversation information through the session ID. Methods such as periodic updates, text length thresholds, session ID exchanges, and newly created IDs are used to ensure user data security.

Benefits of technology

It reduces the probability of network models obtaining user privacy and improves user privacy security and data protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120658416A_ABST
    Figure CN120658416A_ABST
Patent Text Reader

Abstract

The invention discloses a question and answer information transmission method and equipment, relates to the technical field of IT, and can reduce the information amount of user information acquired by a large language model so as to reduce the probability of user privacy disclosure. A specific solution includes: a computing device receives question information from a first user; afterwards, the computing device determines a first session identifier corresponding to the first user according to the first information, and sends question information and the first session identifier to the network model, the first information being used for indicating a relationship between the plurality of users and the plurality of session identifiers. And the computing device updates the first information, and the session identifier corresponding to the user in the updated first information is changed. Then, the computing device receives the target question information from the first user again, and determines a second session identifier corresponding to the first user according to the updated first information; then, the computing device sends a first message to the network model, the first message comprising: the target question information and the second session identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of IT technology, and in particular to a method and device for transmitting question and answer information. Background Art

[0002] With the development of artificial intelligence (AI), the language understanding capabilities of large language models (LLMs) have rapidly improved. More and more users and businesses (referred to as client-side) are inclined to engage in dialogue with large language models. For example, users can ask questions to large language models, which then respond. Alternatively, businesses can send data to large language models, which then process the data.

[0003] However, when a large language model is used on the user side, the large language model can obtain all the data sent by the user side. In this way, the large language model may obtain user privacy based on user data, resulting in the leakage of user privacy. Summary of the Invention

[0004] The present application provides a method and device for transmitting question-and-answer information, which can reduce the amount of user information obtained by a large language model, thereby reducing the probability of user privacy leakage.

[0005] In a first aspect, the present application provides a method for transmitting question and answer information. In this method, a computing device can receive question information from a first user. Afterwards, the computing device can determine a first session identifier corresponding to the first user based on the first information, and send the question information and the first session identifier to a network model, where the first information is used to indicate the relationship between multiple users and multiple session identifiers. In addition, the computing device can update the first information, and the session identifier corresponding to the user in the updated first information changes. Then, the computing device can receive the target question information from the first user again, and determine the second session identifier corresponding to the first user based on the updated first information. Then, the computing device can send a first message to the network model, where the first message is used to indicate a reply to the target question information, and the first message includes: the target question information and the second session identifier.

[0006] Based on the above technical solution, the computing device uses the first session identifier when sending a question to the network model for the first time. After updating the first information, the computing device can determine the second session identifier corresponding to the first user based on the updated first information, and then send the target question information and the second session identifier to the network model. Because the session identifier corresponding to the user in the updated first information can change, the network model cannot use the session identifier to find the user's entire historical conversation information. This prevents the network model from obtaining user privacy based on large amounts of user data, thereby reducing the possibility of user privacy leaks.

[0007] In combination with the first aspect, in a possible design, the method may further include: the computing device periodically updating the first information.

[0008] It is understood that by periodically updating the first information, the session identifier used by the user can be guaranteed to change over time. That is, questions asked during different time periods correspond to different session identifiers. This prevents the network model from obtaining all of the user's data based on a single session identifier, thereby reducing the probability of the network model obtaining user privacy.

[0009] In conjunction with the first aspect, in another possible design, the method may further include: the computing device obtaining a first text length, where the first text length is the sum of the lengths of a question message sent by the first user to the network model using a first session identifier and a target question message, and the first session identifier is the session identifier used by the first user the last time they sent a question message to the network model. If the first text length is greater than or equal to a first preset length threshold, the computing device updates the first information.

[0010] It is understood that by obtaining the sum of the text length of all question messages sent to the network model using a single session identifier and the text length of the message to be sent, and updating the first information, the computing device can avoid sending excessively long text messages to the network model using a single session identifier. This prevents the network model from obtaining all of the user's data based on a single session identifier, thereby reducing the probability of the network model obtaining user privacy.

[0011] In conjunction with the first aspect, in another possible design, the multiple users include a first user and a second user; wherein, before updating the first information, the session identifier corresponding to the first user is the first session identifier, and the session identifier corresponding to the second user is the second session identifier. The method may further include: the computing device determining the second user from the multiple users. Thereafter, the computing device updates the session identifier corresponding to the first user from the first session identifier to the second session identifier, and updates the session identifier corresponding to the second user from the second session identifier to a third session identifier.

[0012] It is understandable that by exchanging session identifiers between users, it is possible to ensure that users in a session use different session identifiers to send data. This can prevent the network model from obtaining all of the user's data based on a single session identifier, thereby reducing the probability of the network model obtaining user privacy.

[0013] In combination with the first aspect, in another possible design, the method may also include: the computing device may receive question information from the second user, and determine the third session identifier corresponding to the second user based on the updated first information, and send the question information and the third session identifier to the network model.

[0014] In conjunction with the first aspect, in another possible design, the method may further include: the computing device obtaining a usage duration of a current session identifier corresponding to each of the multiple users. Thereafter, the computing device determines a second user based on the multiple usage durations, where the second session identifier corresponding to the second user is a session identifier having a usage duration greater than a preset usage duration threshold.

[0015] It is understood that the computing device compares the usage time of each user's corresponding current session identifier and preferentially selects the second session identifier with a longer usage time to exchange with the first user's session identifier. This can avoid the long-term use of session identifiers and reduce the amount of question information obtained by the network model from the same user.

[0016] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may obtain a second text length for each user, where the second text length is the length of a question message sent by the user to the network model using the current session identifier. The computing device may then determine a second user based on the multiple second text lengths, where the second session identifier corresponding to the second user is a session identifier whose second text length is greater than a second preset length threshold.

[0017] It is understood that the computing device compares the length of the question information sent by each user to the network model using the current session identifier, and preferentially selects the second session identifier with the longer text to exchange with the first user's session identifier. This avoids sending too many question information using the session identifier, and reduces the number of question information obtained by the network model from the same user.

[0018] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may obtain a second session identifier, where the second session identifier is a newly created session identifier, and the computing device may update the session identifier corresponding to the first user from the first session identifier to the second session identifier.

[0019] In other words, the computing device can request the network model to create a new session instead of using the existing session identifiers of each user. In this way, users can send questions to the network model using different session identifiers, reducing the amount of historical question information obtained by the network model.

[0020] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may obtain a target key set corresponding to the second session identifier, the target key set including: a first public key, a first private key corresponding to the first public key, a second public key, and a second private key corresponding to the second public key, the first public key being used to encrypt data sent to the network model, and the second public key being used to encrypt data sent by the network model. The computing device may then send the first private key and the second public key to the network model.

[0021] It can be understood that obtaining the key through the computing device and sending the key to the network model can ensure that the information transmission between the network model and the computing device is in an encrypted state, thereby improving the user's data security.

[0022] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may encrypt the target question information to obtain encrypted target question information, wherein the target question information in the first message is encrypted data.

[0023] It is understandable that the computing device encrypts the target question information and sends the encrypted target question information to the network model, thereby preventing information content from being leaked and improving the security of user information.

[0024] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may determine the security level of the first user based on second information, where the second information is used to indicate a relationship between users and security levels. The computing device may determine target encryption information corresponding to the first user based on the security level of the first user. The computing device may encrypt the target question information based on the target encryption algorithm to obtain encrypted target question information.

[0025] It is understandable that the computing device determines the user's security level and selects a suitable encryption algorithm to encrypt the question information according to the security level. In this way, the user's question information can be encrypted based on the user's actual needs, thereby improving the user's experience.

[0026] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may receive a second message from the network model, the second message including encrypted first reply information, the first reply information being data replying to the target question information; and the computing device may decrypt the encrypted first reply information to obtain the decrypted first reply information.

[0027] It is understandable that, since the first reply information is in an encrypted state, the computing device can decrypt the encrypted first reply information, and thus send the decrypted first reply information to the user side.

[0028] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may obtain the real identifier of the first user. Thereafter, the computing device may determine the virtual identifier of the first user based on the real identifier of the first user. Then, the computing device may send the first message to the network model based on the virtual identifier of the first user.

[0029] It is understandable that the computing device uses the virtual identifier of the first user to send the first message to the network model, which can prevent the network model from tracing back to the real identifier of the first user, thereby improving the privacy of user information.

[0030] In combination with the first aspect, in another possible design, the method may further include: if the target question information does not contain sensitive data, the computing device sends a first message to the network model.

[0031] It is understandable that by checking the target question information, leakage of sensitive data can be avoided, thereby improving the security of user data.

[0032] In combination with the first aspect, in another possible design, the method may further include: if sensitive data exists in the target question information, the computing device may send a prompt message to the first user, where the prompt message is used to indicate that sensitive data exists in the target question information.

[0033] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may input target question information into a trained text detection model to generate first detection information, where the first detection information indicates whether sensitive data exists in the question information. Thereafter, the computing device may detect the target question information using preset detection conditions to generate second detection information, where the second detection information indicates whether sensitive data exists in the question information. The computing device may then generate text detection information based on the first detection information and the second detection information.

[0034] It is understandable that by detecting the target question information through the trained text detection model and preset detection conditions, it is possible to accurately determine whether sensitive data exists, thereby improving the accuracy of the generated text detection information.

[0035] In conjunction with the first aspect, in another possible design, the method may further include: the computing device may receive second reply information from the knowledge base to the target question information. The computing device may then encrypt the second reply information to obtain encrypted second reply information. The first message also includes the encrypted second reply information.

[0036] It is understood that if the large model has a knowledge base, the computing device can receive the second reply information from the knowledge base. The computing device then needs to encrypt not only the target question information but also the second reply information. The computing device can then send the target question information and the second reply information together to the network model. This ensures that the network model can accurately obtain the reply information by combining the target question information and the second reply information. Furthermore, because the computing device encrypts the data, the security of user information is improved.

[0037] In a second aspect, the present application provides a computing device comprising a processor and a memory. The processor is configured to execute instructions stored in the memory, so that the computing device executes the method described in the first aspect and any possible design thereof.

[0038] In a third aspect, the present application provides an electronic device comprising: a memory and one or more processors, wherein the memory is coupled to the processor; the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the one or more processors, the electronic device executes the method described in the first aspect and any possible design method thereof.

[0039] In a fourth aspect, the present application provides a chip system, which is applied to a computing device. The chip system includes one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via wiring. The interface circuits are configured to receive signals from a memory of the computing device and send the signals to the processors, the signals including computer instructions stored in the memory. When the processors execute the computer instructions, the computing device performs the method described in the first aspect and any possible design thereof.

[0040] In a fifth aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on a computing device, the computing device executes the method described in the first aspect and any possible design thereof.

[0041] In a sixth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible design thereof.

[0042] It can be understood that the beneficial effects that can be achieved by the electronic device described in the second aspect and any possible design thereof, the computing device described in the third aspect and any possible design thereof, the chip system described in the fourth aspect, the computer-readable storage medium described in the fifth aspect, and the computer program product described in the sixth aspect can be referred to as the beneficial effects in the first aspect and any possible design thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of a scenario in which a user sends a question message provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of the structure of an information question and answer system provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of the structure of another information question-and-answer system provided in an embodiment of the present application;

[0046] Figure 4 A flow chart of a method for transmitting question and answer information provided in an embodiment of the present application;

[0047] Figure 5 This is a schematic diagram of an example of a user sending a question message provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of another example of a user sending a question message provided in an embodiment of the present application;

[0049] Figure 7 A flow chart of another method for transmitting question and answer information provided in an embodiment of the present application;

[0050] Figure 8 A flow chart of another method for transmitting question and answer information provided in an embodiment of the present application;

[0051] Figure 9 A schematic diagram of an example of sensitive information detection provided in an embodiment of the present application;

[0052] Figure 10 This is a schematic diagram of an example of a configuration interface provided in an embodiment of the present application;

[0053] Figure 11 A flow chart of another method for transmitting question and answer information provided in an embodiment of the present application;

[0054] Figure 12 A flow chart of another method for transmitting question and answer information provided in an embodiment of the present application;

[0055] Figure 13 A schematic diagram of the composition of a device for transmitting question and answer information provided in an embodiment of the present application;

[0056] Figure 14 A schematic diagram of the structural composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0058] In this application, the character " / " generally indicates that the preceding and following objects are in an "or" relationship. For example, A / B can be understood as A or B.

[0059] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of such features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0060] Furthermore, the terms "including," "having," and any variations thereof, as used in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or modules is not limited to the listed steps or modules, but may optionally include other steps or modules not listed, or may optionally include other steps or modules inherent to the process, method, product, or apparatus.

[0061] Additionally, in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present concepts in a concrete manner.

[0062] In order to facilitate understanding of the technical solution of the present application, before giving a detailed introduction to the method for transmitting question and answer information in the embodiment of the present application, the professional terms mentioned in the embodiment of the present application are first introduced.

[0063] 1. Prompt: Prompt is a short text template used to provide input to the large language model. The large language model can use prompts to clarify the task objectives and obtain contextual information, thereby producing more accurate and relevant responses.

[0064] 2. Session: The lifecycle of a session typically begins when a user asks their first question or request and ends when they indicate they're done interacting. During this process, the large language model can continuously track conversation history based on the session to generate coherent and relevant responses.

[0065] 3. Asymmetric encryption: Asymmetric encryption uses a pair of keys for encryption and decryption. The public key is used to encrypt information and is publicly available to all users. The private key is used to decrypt ciphertext. Only the user holding the private key can decrypt information encrypted with the public key.

[0066] 4. Privacy Differentiation: When summarizing query results in a database, appropriate noise or randomness is added to the results, making it difficult for the statistical party to accurately infer the information of the data sample. At the same time, the added noise does not significantly affect the overall statistical distribution.

[0067] After introducing the professional terms mentioned in the embodiments of this application, the conventional technologies are introduced below.

[0068] Currently, when a user uses a large language model, the large language model creates a session for the user and transmits the session identifier to the user. Later, when the user sends a question to the large language model, the user can also send the session identifier to the large language model. Because the session identifier does not change during the session (i.e., the question-and-answer period), the large language model can obtain all of the user's data based on the session identifier. This may result in the large language model obtaining the user's privacy based on all of the user's data, leading to privacy leaks.

[0069] For example, Figure 1 As shown in the figure, users A, B, and C can all initiate sessions with the large language model. The large language model assigns session identifiers to user A as session1, to user B as session2, and to user C as session3. Information A1, A2, and A3 are questions sent by user A to the large language model via session1, information B1, B2, and B3 are questions sent by user B to the large language model via session2, and information C1, C2, and C3 are questions sent by user C to the large language model via session3.

[0070] Currently, users can use a variety of methods to prevent large language models from obtaining user privacy. For example, some companies prohibit the use of large language models. For another example, users can deploy large language models locally, that is, train and deploy large language models on their own devices. For another example, users can purchase private large language model services. However, local deployment of large language models requires a large amount of computing resources and requires subsequent maintenance by technical personnel. It not only has high requirements for equipment, but also requires a lot of manpower. In addition, local deployment of large language models can only use open source models, and it is impossible to avoid the acquisition of user privacy when the large language model obtains a large amount of user data. When using private large language model services, the large language model provider is still required to maintain the large language model, and it is impossible to avoid the acquisition of user privacy when the large language model obtains a large amount of user data.

[0071] To this end, an embodiment of the present application provides a method for transmitting question-and-answer information. In this method, a device for transmitting question-and-answer information (hereinafter referred to as the transmission device) can continuously update the user's corresponding session identifier after receiving the user's question information. The transmission device can then send the user's question information to the network model based on the new session identifier. Because the user's session identifier is constantly changing, the network model cannot find the user's historical conversation information through the session identifier. In this way, it can prevent the network model from obtaining user privacy based on a large amount of user data, thereby improving the user's privacy security.

[0072] It should be noted that the embodiments of the present application do not limit the network model. For example, the network model can be a large language model, such as a large language model obtained by training a recurrent neural network (RNN), a large language model obtained by training a long short-term memory network (LSTM), etc. For another example, the network model can also be a chatbot model. For another example, the network model can also be an image recognition model, a speech processing model, a generation model, etc. In the following embodiments, the network model is taken as an example to introduce the embodiments of the present application.

[0073] The execution subject of the question-and-answer information transmission method provided in the present application can be a transmission device for question-and-answer information, and the transmission device can be a computing device. At the same time, the transmission device can also be a central processing unit (CPU) of the computing device, or a transmission module in the computing device for transmitting question-and-answer information. In the embodiments of the present application, the transmission method for question-and-answer information provided in the embodiments of the present application is described by taking the transmission device executing the transmission method for question-and-answer information as an example.

[0074] Optionally, the computing device may be a computing device cluster. The computing device cluster may be connected by a set of loosely integrated computer software or hardware to collaborate closely to complete computing tasks. A single computer in a computing device cluster is usually referred to as a node, and the nodes may be connected by means of a local area network, high-speed interconnection, remote direct memory access (RDMA), distributed shared memory, and the like. The computing device cluster may include one or more clusters of a high-availability cluster, a load-balancing cluster, a high-performance computing cluster, and a high-availability cluster. The computing device cluster may include: hardware resources (such as servers, memory, central processing unit (CPU), etc.) and service resources (such as software, integrated development environment, etc.).

[0075] Optionally, the transmission device may also be an electronic device.

[0076] For example, the electronic device in the embodiments of the present application may be a tablet computer, a mobile phone, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an in-vehicle device, or the like. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.

[0077] The implementation environment of the embodiments of the present application is introduced below.

[0078] like Figure 2 As shown, an information question and answer system provided in an embodiment of the present application includes: an electronic device 201 and a computing device 202.

[0079] In an embodiment of the present application, a client of a large language model (hereinafter referred to as the model client) and a security toolbox (i.e., the aforementioned transmission device) are deployed in the electronic device 201. The user can send questions to the large language model through the model client, and the security toolbox is used to process the user's question information to improve the user's privacy. The security toolbox can also transmit information sent by the model client to the large language model, and can also transmit the large language model's reply information to the client.

[0080] In one possible design, the security toolbox may include a sensitive information identification module, a differential privacy module, and a data encryption module. The sensitive information identification module identifies questions and determines whether they contain sensitive information. The differential privacy module performs privacy differential analysis on user questions, thereby increasing information entropy. The data encryption module encrypts the questions and transmits them to the large language model. Furthermore, the data encryption module decrypts responses from the large language model and transmits them to the client.

[0081] A large language model is deployed in the computing device 202. The computing device 302 can provide computing resources for the large language model, and the large language model can use the computing resources of the computing device 202 to process data and obtain response information.

[0082] For example, a model client can send a question to the secure toolbox. The secure toolbox can then process the question and send the processed question to the large language model. The large language model can then generate a response to the question and transmit it to the client via the secure toolbox.

[0083] The above is to deploy the model client and the security toolbox on the same device. In some embodiments, the model client and the security toolbox are deployed on different devices.

[0084] like Figure 3 As shown, another information question and answer system provided by an embodiment of the present application includes: electronic device 301, computing device 302 and computing device 303. Among them, the electronic device 301 is deployed with a model client, and the computing device 302 is deployed with a security toolbox.

[0085] After introducing the application scenarios and implementation environment of the embodiments of the present application, the following describes in detail the method for transmitting question and answer information provided by the embodiments of the present application, taking the transmission device as a security toolbox as an example.

[0086] The embodiment of the present application provides a method for transmitting question and answer information, such as Figure 4 As shown, the method for transmitting the question and answer information may include:

[0087] S401: A first user sends a question to a security toolbox.

[0088] In a possible implementation, the first user sends question information to the security toolbox through the model client.

[0089] It should be noted that the user sending information to the security toolbox mentioned in the embodiments of the present application refers to the user sending information to the security toolbox through the model client.

[0090] Optionally, before the first user sends the question information to the security toolbox, the first user may log in to the model client.

[0091] Exemplarily, the first user may enter a corresponding first account and first password to log in to the model client.

[0092] In some embodiments, the first user may also send an identification of the first user to the security toolbox.

[0093] It should be noted that the embodiment of the present application does not limit the identifier of the first user. For example, the identifier of the first user can be the account number of the first user. Alternatively, the identifier of the first user can be the Internet Protocol (IP) address of the first user.

[0094] Accordingly, the security toolbox receives question information from the first user.

[0095] S402: The security toolbox determines a first session identifier corresponding to the first user based on the first information.

[0096] In some embodiments, after the security toolbox receives the target question information from the first user, the security toolbox may determine whether a session identifier corresponding to the first user exists based on the first information, where the first information indicates the relationship between multiple users and multiple session identifiers. If the session identifier corresponding to the first user does not exist, the security toolbox sends a first session creation request to the large language model, requesting the establishment of a session with the first user. The large language model may receive the first session creation request from the security toolbox, create a session identifier corresponding to the first user, and send the session identifier corresponding to the first user to the security toolbox. If the session identifier corresponding to the first user exists, the security toolbox may execute S403.

[0097] It should be understood that in the embodiment of the present application, the large language model creates a session identifier corresponding to the user, that is, the large language model creates a session with the user, and the user can transmit information to the large language model through the session identifier.

[0098] For example, as shown in Table 1, it shows the relationship between users and session identifiers.

[0099] Table 1

[0100] User ID Session ID User A session1 User B session2 User c session3

[0101] That is, user a is using session 1, user b is using session 2, and user c is using session 3.

[0102] It should be noted that, in the embodiment of the present application, the first information can be continuously updated to adjust the relationship between the user and the session identifier. For the specific process of updating the first information, reference can be made to the following embodiment, which will not be described in detail here.

[0103] S403: The security toolbox sends question information and the first session identifier to the large language model.

[0104] Accordingly, the large language model can provide the security tool with a response to the query. For a detailed description of the process by which the security toolbox sends a query and receives a response to it, please refer to the description of the process by which the security toolbox sends a target query and receives a response to it in the following embodiments, and will not be repeated here.

[0105] S404: The security toolbox updates the first information.

[0106] The session identifier corresponding to the user in the updated first information is changed.

[0107] For example, in combination with Table 1, Table 2 shows the updated relationship between the user and the session identifier.

[0108] Table 2

[0109] User ID Session ID User A session3 User B session1 User c session2

[0110] That is, compared to Table 1, in Table 2, the session used by user a is updated to session 3, the session used by user b is updated to session 1, and the session used by user c is updated to session 2.

[0111] S405: The first user sends target question information to the security toolbox.

[0112] S406: The security toolbox receives target question information from the first user.

[0113] S407: The security toolbox determines a second session identifier corresponding to the first user according to the updated first information.

[0114] In a possible implementation, the security toolbox may search for the second session identifier corresponding to the first user from the updated first information according to the identifier of the first user.

[0115] S408: The security toolbox sends a first message to the large language model.

[0116] The first message is used to instruct a reply to the target question information, and the first message includes: the target question information and the second session identifier.

[0117] In some embodiments, the security toolbox may store the correspondence between the first user's target question information and the second session identifier.

[0118] That is, the security toolbox may store the session identifier used when sending the user's question information.

[0119] For example, as shown in Table 3, it shows the correspondence between the user's question information and the used session identifier.

[0120] Table 3

[0121]

[0122] That is, when user A sends information A1 and information A2, he uses session ID 1, and when sending information A3, he uses session ID 2. When user B sends information B1 and information B2, he uses session ID 2, and when sending information B3, he uses session ID 1.

[0123] S409: The large language model receives the first message from the security toolbox.

[0124] In some embodiments, after the large language model receives the first message from the security toolbox, the large language model may store the target question information according to the second session identifier.

[0125] For example, Figure 5 As shown, information A1 and information A2 are information sent by user A to the large language model through session 1 in combination with table 1. After the first information is updated, information A3 and information A4 are information sent by user A to the large language model through session 3 in combination with table 2.

[0126] Optionally, the large language model can query historical question information corresponding to the second session identifier based on the second session identifier. Thereafter, the large language model can generate first reply information based on the target question information and the historical question information corresponding to the second session identifier.

[0127] For example, combined Figure 5 It can be seen that if the second session identifier is session3, the large language model can obtain information A3 and information A4 based on session3, but cannot obtain information A1 and information A2.

[0128] Based on the above technical solution, after receiving the target question information from the first user, the security toolbox can determine the second session identifier corresponding to the first user based on the updated first information, and then send the target question information and the second session identifier to the large language model. Because the session identifier corresponding to the user in the updated first information can change, the large language model cannot use the session identifier to find the user's entire historical conversation information. This prevents the large language model from obtaining user privacy based on large amounts of user data, thereby improving user privacy security.

[0129] After describing how the security tool forwards user questions to the large language model, we'll now detail how the security toolbox updates the first information. Triggering the security toolbox to update the first information can be divided into two methods: trigger method 1 and trigger method 2. In trigger method 1, the security toolbox can update the first information based on time. In trigger method 2, the security toolbox can update the first information based on text length.

[0130] The following introduces the first triggering method, that is, the process of the security toolbox updating the first information according to time.

[0131] In the embodiment of the present application, the security toolbox may periodically update the first information.

[0132] In a possible implementation, the security toolbox may update the first information at intervals of a first preset time period.

[0133] In a possible design, the first preset duration may be the duration of use of the session identifier currently used by the user, or the first preset duration may be the duration automatically accumulated by the security toolbox.

[0134] For example, if the first preset duration is 10 minutes, when user a uses session ID 1 for 10 minutes, the security toolbox may update the session ID corresponding to user a. Alternatively, the security toolbox may automatically count the time and update the first information every 10 minutes.

[0135] It should be noted that the first preset duration is not limited in this embodiment of the present application. For example, the first preset duration can be 10 minutes, 60 minutes, 100 minutes, etc. Furthermore, the first preset duration can be set by the user or pre-configured by the developer. Furthermore, when the security toolbox updates the first information, it can update the session identifiers corresponding to all users in the first information, or it can update the session identifiers corresponding to some users in the first information. This embodiment of the present application does not limit this.

[0136] It is understood that by periodically updating the first information, the session identifier used by the user can be guaranteed to change over time. That is, questions asked during different time periods correspond to different session identifiers. This prevents the large language model from obtaining all of the user's data based on a single session identifier, thereby reducing the probability of the large language model obtaining user privacy.

[0137] After introducing the first triggering mode (ie, the process of the security toolbox updating the first information according to time), the second triggering mode, ie, the process of the security toolbox updating the first information according to the length of the text, will be introduced below.

[0138] In an embodiment of the present application, after the security toolbox receives the target question information from the first user (i.e., S302), the security toolbox may obtain a first text length, where the first text length is the sum of the length of the question information sent by the first user to the large language model using the first session identifier and the length of the target question information. The first session identifier is the session identifier used by the first user the last time they sent a question information to the large language model. Thereafter, if the first text length is greater than or equal to a first preset length threshold, the security toolbox updates the first information. If the first text length is less than the first preset length threshold, the security toolbox does not update the first information.

[0139] It should be understood that the question information sent by the first user to the large language model using the first session identifier mentioned in the embodiments of the present application refers to all question information sent by the first user to the large language model using the first session identifier. Furthermore, the session identifier used by the first user to send a question information to the large language model the last time the first user sent the question information refers to the session identifier used to send the question information before the first user sent the target question information.

[0140] For example, referring to Table 3, if the target question message is message A3, the last question message sent by user a is message A2, and the first session identifier is session identifier 1, then the question message sent by user a using session identifier 1 includes: message A1 and message A2, and the first text length is the sum of the text lengths of messages A1, A2, and A3.

[0141] It should be noted that the embodiment of the present application does not limit the first preset length threshold. For example, the first preset length threshold can be 50, 100, 200, etc.

[0142] It is understood that by obtaining the sum of the text lengths of all questions sent to the large language model using a single session identifier and the text length of the message to be sent, and updating the first information, the security toolbox can avoid situations where text messages sent to the large language model using a single session identifier are too long. This prevents the large language model from obtaining all of the user's data based on a single session identifier, thereby reducing the probability of the large language model gaining access to user privacy.

[0143] After describing how the security toolbox triggers the update of the first information, we now describe how the security toolbox implements this update. This can be done in two ways: Method A and Method B. Method A involves the security toolbox updating the first information by exchanging session identifiers corresponding to each user. Method B involves the security toolbox assigning a newly created session identifier to each user.

[0144] The following describes method A, that is, the security toolbox updates the first information by exchanging session identifiers corresponding to each user.

[0145] In an embodiment of the present application, the security toolbox may provide services for multiple users, and the security toolbox may exchange session identifiers corresponding to the multiple users.

[0146] In some embodiments, the multiple users may include a first user and a second user; wherein, before updating the first information, the session identifier corresponding to the first user is the first session identifier, and the session identifier corresponding to the second user is the second session identifier. The security toolbox may determine the second user from the multiple users. Thereafter, the security toolbox may update the session identifier corresponding to the first user from the first session identifier to the second session identifier, and update the session identifier corresponding to the second user from the second session identifier to a third session identifier. The third session identifier is any session identifier among the multiple users' session identifiers except the first session identifier. The third session identifier may be the same as the second session identifier, or the third session identifier may be different from the second session identifier.

[0147] It should be understood that if the third session identifier is the same as the second session identifier, it indicates that the session identifiers corresponding to the first and second users have been swapped. If the third session identifier is different from the second session identifier, it indicates that the second user has used the session identifiers corresponding to other users other than the first and second users. For example, combining Table 1 and Table 2, in the updated Table 2, user a uses user c's session identifier, user b uses user a's session identifier, and user c uses user b's session identifier.

[0148] It should be noted that the present embodiment does not limit the order in which session identifiers corresponding to multiple users are exchanged. The security toolbox may exchange session identifiers in a predetermined order (e.g., from largest to smallest identifier, from earliest to latest identifier generation time), or the security toolbox may exchange session identifiers corresponding to each user in a random order.

[0149] For example, Figure 6 As shown, user A can first send information A4 to the large language model through session1, then send information A3 to the large language model through session4, then send information A2 to the large language model through session3, and then send information A1 to the large language model through session2. In other words, the session identifier corresponding to user A changes from session1 to session4, then from session4 to session3, and then from session3 to session2. Similarly, users B, C, and D can refer to the explanation of the information sent by user A. In this way, the information corresponding to session1 includes: user A's information A4, user B's information B3, user C's information C2, and user D's information D1. Similarly, the introduction of session2, session3, and session4 can refer to session1 and will not be repeated here.

[0150] It is understandable that by exchanging session identifiers between users, it is possible to ensure that users in a single session use different session identifiers to send data. This prevents a large language model from obtaining all of a user's data based on a single session identifier, thereby reducing the probability of the large language model gaining access to user privacy.

[0151] In other embodiments, the security toolbox may determine the second user based on the usage duration of the current session identifier corresponding to the user. The security toolbox may obtain the usage duration of the current session identifier corresponding to each of multiple users. The security toolbox may then determine the second user based on the multiple usage durations, where the second user's second session identifier is a session identifier whose usage duration exceeds a preset usage duration threshold.

[0152] It should be understood that the current session identifier corresponding to the user is the session identifier corresponding to the user in the first information currently used in the security toolbox. For example, in conjunction with Table 1, the current session identifier corresponding to user a is session identifier 1, and in conjunction with Table 2, the current session identifier corresponding to user a is session identifier 3.

[0153] It should be noted that the present embodiment does not limit the preset usage time threshold. For example, the preset usage time threshold can be 20 minutes, 50 minutes, 100 minutes, etc.

[0154] Optionally, the second session identifier may be a session identifier with the longest usage time among the current session identifiers corresponding to multiple users, excluding the second session identifier.

[0155] As you can understand, the Security Toolbox compares the usage duration of each user's current session identifier and preferentially selects the second session identifier with the longest usage duration to exchange with the first user's session identifier. This prevents session identifiers from being used for extended periods of time and reduces the number of questions the large language model collects from the same user.

[0156] In other embodiments, the security toolbox may identify the second user based on the length of text sent by the user using the current session identifier. The security toolbox may obtain the second text length of each user, where the second text length is the length of the question message sent by the user to the large language model using the current session identifier. The security toolbox may then identify the second user based on multiple second text lengths, with the second user corresponding to the session identifier being the session identifier whose second text length exceeds a second preset length threshold.

[0157] It should be noted that the second preset length threshold is not limited in the embodiment of the present application. For example, the second preset length threshold may be 50, 100, 200, etc.

[0158] As you can understand, the security toolbox compares the length of each user's question sent to the large language model using their current session identifier, and prioritizes the second session identifier with the longer text to exchange with the first user's session identifier. This avoids sending too many questions using the same session identifier, reducing the number of questions the large language model receives from the same user.

[0159] In other embodiments, the security toolbox may determine the second user based on the length of text sent by the user using the current session identifier and the duration of the user using the current session identifier. The second session identifier corresponding to the second user is a session identifier in which the length of the second text is greater than a second preset length threshold and the duration of the session identifier is greater than a preset usage duration threshold.

[0160] In some embodiments, before updating the first information, the security toolbox may receive a question from the second user. The security toolbox may then determine a second session identifier corresponding to the second user based on the first information and send the question and the second session identifier to the network device. After the security toolbox updates the first information, the security toolbox may receive a question from the second user. The security toolbox may then determine a third session identifier corresponding to the second user based on the updated first information and send the question and the third session identifier to the large language model.

[0161] In this way, not only the first user's session identifier is changed, but also the second user's session identifier. This allows multiple users' session identifiers to be changed, thus preventing the large language model from obtaining all user data based on a single session identifier, thereby reducing the probability of the large language model obtaining user privacy.

[0162] After introducing method A (ie, the security toolbox updates the first information by exchanging session identifiers corresponding to each user), method B, ie, the process in which the security toolbox assigns a newly created session identifier to the user, is introduced below.

[0163] In this embodiment of the present application, after the security toolbox determines to update the first information, the security toolbox may obtain a second session identifier, which is the newly created session identifier. Thereafter, the security toolbox may update the session identifier corresponding to the first user from the first session identifier to the second session identifier. Prior to updating the first information, the session identifier corresponding to the first user was the first session identifier.

[0164] In one possible implementation, the full toolbox may send a second session creation request to the large language model, requesting the creation of a session with the first user. The large language model may receive the second session creation request from the secure toolbox, create a session identifier corresponding to the first user, and send the session identifier corresponding to the first user to the secure toolbox. The session identifier created by the second session creation request is different from the session identifier created by the first session creation request.

[0165] For example, combined Figure 5 It can be seen that the information corresponding to session 1 is information A1 and information A2, and the information corresponding to session 3 is information A3 and information A4.

[0166] In other words, the security toolbox can request the large language model to create a new session instead of using the existing session identifiers of each user. This allows users to send questions to the large language model using different session identifiers, reducing the amount of historical question information the large language model obtains.

[0167] The above is an introduction to the process of updating the first information in the security toolbox. The following is an introduction to the process of information transmission between the security toolbox and the large language model.

[0168] In some embodiments, when data is transmitted between the security toolbox and the large language model, encryption of the data is not required. That is, the data sent by the security toolbox and the data sent by the large language model in S401-S409 are both encrypted.

[0169] In other embodiments, when data is transmitted between the security toolbox and the large language model, the data may be encrypted.

[0170] The embodiment of the present application provides a method for transmitting question and answer information, such as Figure 7 As shown, before S408, the method for transmitting the question and answer information may include:

[0171] S701: The security toolbox obtains a target key set corresponding to a second session identifier.

[0172] In this embodiment of the present application, the target key set includes: a first public key, a first private key corresponding to the first public key, a second public key, and a second private key corresponding to the second public key. The first public key is used to encrypt data sent to the large language model, and the second public key is used to encrypt data sent from the large language model. The first private key is used to decrypt data encrypted with the first public key, and the second private key is used to decrypt data encrypted with the second public key.

[0173] S702: The security toolbox sends the first private key and the second public key to the large language model.

[0174] S703: The large language model receives the first private key and the second public key from the security toolbox.

[0175] It should be noted that the embodiments of the present application do not limit the timing of executing S701-S703. For example, the security toolbox may assign a key to the user upon receiving a question from the user for the first time, and use the first assigned key for each subsequent question (i.e., executing S701-S703 only once for the first user). For another example, the security toolbox may assign a key to the user each time it receives a question from the user (i.e., executing S701-S703 multiple times for the first user).

[0176] It is understandable that obtaining the key through the security toolbox and sending the key to the large language model can ensure that the information transmission between the large language model and the security toolbox is in an encrypted state, thereby improving the user's data security.

[0177] After the security toolbox distributes the key, the following describes the process of data encryption transmission.

[0178] S704: The security toolbox encrypts the target question information to obtain encrypted target question information.

[0179] In the embodiment of the present application, the target question information in the first message is encrypted data. That is, in the embodiment of the present application, the target question information in the first message sent by the security toolbox in S408 is encrypted data.

[0180] In one possible implementation, the security toolbox may encrypt the target question information using the first public key. Accordingly, after the large language model receives the encrypted target question information, the large language model may decrypt the encrypted target question information using the first private key to obtain the target question information.

[0181] It is understandable that the security toolbox encrypts the target question information and sends the encrypted target question information to the large language model. In this way, information content leakage can be avoided, thereby improving the security of user information.

[0182] In some embodiments, before the security toolbox encrypts the target question information, the security toolbox may determine the first user's security level based on second information, where the second information indicates the relationship between the user and the security level. The security toolbox may determine target encryption information corresponding to the first user based on the first user's security level and third information, where the third information indicates the relationship between the security level and the encryption algorithm. The security toolbox may then encrypt the target question information based on the target encryption algorithm to obtain encrypted target question information.

[0183] It should be noted that the relationship between users and security levels may include, but is not limited to, any of the following: the relationship between user identification (such as IP address) and security level, the relationship between user location and security level, and the relationship between user department and security level. Different security levels correspond to different encryption algorithms. For example, a high security level corresponds to a complex encryption algorithm with high security. A low security level corresponds to a simple encryption algorithm with fast encryption and decryption speeds.

[0184] It should be noted that the second information may be pre-configured by a developer, or the second information may be configured by a user.

[0185] It is understandable that the security toolbox determines the user's security level and selects an appropriate encryption algorithm to encrypt the question information based on the security level. In this way, the user's question information can be encrypted based on the user's actual needs, thereby improving the user's experience.

[0186] The above is an introduction to the data encryption process on the security toolbox side. The following describes the information encryption process of the large language model.

[0187] After S409, the method further includes:

[0188] S705: The large language model generates first response information based on the target question information.

[0189] S706: The large language model encrypts the first reply information to obtain encrypted first reply information.

[0190] In a possible implementation, the large language model may encrypt the first reply information according to the second public key and the target encryption algorithm.

[0191] S707: The large language model sends a second message to the security toolbox.

[0192] The second message includes: encrypted first reply information, where the first reply information is data for replying to the target question information.

[0193] S708: The security toolbox receives the second message from the large language model, and decrypts the encrypted first reply information to obtain the decrypted first reply information.

[0194] In one possible implementation, the security toolbox stores fourth information indicating a relationship between a session identifier and a user private key. The security toolbox can determine the second private key corresponding to the second session identifier based on the fourth information and the second session identifier. The security toolbox can then use the second private key to decrypt the encrypted first reply message to obtain the decrypted first reply message.

[0195] It is understandable that, since the first reply information is in an encrypted state, the security toolbox can decrypt the encrypted first reply information and thus send the decrypted first reply information to the user side.

[0196] S709: The security toolbox sends the decrypted first reply information to the first user.

[0197] The above describes the encryption process for content transmitted between the security toolbox and the large language model. The following describes the process of hiding the user's identity during information transmission between the security toolbox and the large language model.

[0198] In some embodiments, before the security toolbox sends the first message to the large language model, the security toolbox may obtain the first user's real identifier. Thereafter, the security toolbox may determine the first user's virtual identifier based on fifth information and the first user's real identifier, where the fifth information indicates the correspondence between the user's real identifier and the virtual identifier. The security toolbox may send the first message to the large language model based on the first user's virtual identifier.

[0199] It should be noted that the embodiment of the present application does not limit the user's identity (real identity, virtual identity). For example, the user's identity can be an IP address, user account, etc.

[0200] It is understandable that the security toolbox uses the first user's virtual identifier to send the first message to the large language model, which can prevent the large language model from tracing back to the first user's real identifier, thereby improving the privacy of user information.

[0201] For example, Figure 8 As shown, the differential privacy module can specify the encryption algorithm to the data encryption module and initialize the key. Afterwards, the data encryption module can generate an encryption prompt and instruct the large language model to use the specified encryption algorithm and key for encryption. The large language model can then feedback to the data encryption module that the encryption of the data has been learned. The differential privacy module can then send the question information and encryption configuration (encryption algorithm and key) to the data encryption module, which will encrypt the question information based on the encryption configuration and send the encrypted question information to the large language model via the session identifier virtual identifier (such as the springboard IP). The large language model can then send the encrypted reply information to the data encryption module, which will decrypt it and send the decrypted reply information to the differential privacy module for forwarding to the user.

[0202] The above is an introduction to the data transmission process between the secure toolbox and the large language model. The following describes the data transmission process between the secure toolbox and the first user.

[0203] In some embodiments, after receiving the target question information, the security toolbox may detect the target question information and generate text detection information, which indicates whether sensitive data is present in the target question information. If the target question information does not contain sensitive data, the security toolbox sends a first message to the large language model.

[0204] It is understandable that by checking the target question information, leakage of sensitive data can be avoided, thereby improving the security of user data.

[0205] In some embodiments, if sensitive data exists in the target question information, the security toolbox may send a prompt message to the first user, where the prompt message is used to indicate that sensitive data exists in the target question information.

[0206] Exemplarily, the prompt message may be: There is sensitive data in the current text, please delete it.

[0207] Optionally, if the target question information contains sensitive data, the security toolbox may delete the sensitive data in the target question information to generate a modified target question information, and then send the modified target question information to the first user.

[0208] For example, if the target query is: Is there a competing product in the market for the company's upcoming product A? Product A is sensitive data. The modified target query would be: Is there a competing product in the market for the company's upcoming product A?

[0209] It is understandable that by modifying the target question information, the user's operations can be reduced, thereby improving the user experience.

[0210] The following describes the process of detecting sensitive data using the Security Toolbox.

[0211] In one possible implementation, the security toolbox may input target question information into a trained text detection model to generate first detection information, which indicates whether sensitive data exists in the question information. The security toolbox may then use pre-set detection conditions to detect the target question information and generate second detection information, which indicates whether sensitive data exists in the question information. The security toolbox may then generate text detection information based on the first and second detection information.

[0212] It should be noted that the embodiments of the present application do not pre-test the text detection model. For example, the text detection model can be an autoencoder model. For another example, the text detection model can be an autoregressive model. Furthermore, the embodiments of the present application do not limit the preset detection conditions. For example, the preset detection condition is: whether it is the same as the preset sensitive data. For another example, the preset detection condition is: satisfying a preset regular expression.

[0213] In one possible design, if the first detection information and the second detection information are the same, the security toolbox uses the first detection information as text detection information. If the first detection information and the second detection information are different, the security toolbox uses the second detection information as text detection information.

[0214] For example, if the first detection information is used to indicate that text a and text b are sensitive data, and the second detection information is used to indicate that text a, text b, and text c are sensitive data, then the text detection information indicates that text a, text b, and text c are sensitive data.

[0215] Optionally, if the first detection information is different from the second detection information, the security toolbox uses the union of the first detection information and the second detection information as the text detection information.

[0216] It is understandable that by detecting the target question information through the trained text detection model and preset detection conditions, it is possible to accurately determine whether sensitive data exists, thereby improving the accuracy of the generated text detection information.

[0217] The following describes the process of detecting sensitive data with specific examples. Figure 9 As shown, administrators can first configure sensitive data detection. They can set sensitive words and sensitive databases. The sensitive information identification module can then generate regular expressions for sensitive data based on the sensitive words. Furthermore, the sensitive information module can train a pre-set text detection model based on the general database and the sensitive database to generate a trained text detection model. Users can then set the scoring threshold for the text detection model.

[0218] The user can then enter a question. The sensitive data regular expression is used to determine whether the question contains sensitive data. The trained text detection model is then used to encode the question and compare the encoding with the sensitive database using a K-nearest distance to generate a score. The sensitive identification module then generates text detection information based on the results of the sensitive data regular expression and the results of the trained text detection model.

[0219] It should be noted that Figure 9 The configuration shown can be configured by a user who logs into the model client or by an administrator with management authority, and this embodiment of the present application does not limit this.

[0220] For example, Figure 10 As shown, the security toolbox can display a first configuration interface 1001, which includes: security level (such as Level 1, Level 2), text detection threshold (such as 0.7, 0.68), encryption algorithm (such as Algorithm 1, Algorithm 2). In response to the operation of the "Level 1" mark, the security toolbox can display a second configuration interface 1002, which includes: sensitive word path, sensitive database path, sensitive data regularization, transfer learning, etc.

[0221] In other words, the security level is not only related to the encryption algorithm, but also to the text detection threshold, sensitive word path, sensitive database path, sensitive data regularization, transfer learning, etc. In this way, different security levels can correspond to different detection configurations.

[0222] The following describes the embodiments of the present application with reference to specific examples. Figure 11 As shown, the user can initiate a conversation. The sensitive information identification module in the security toolbox can identify sensitive information in the question information. If sensitive information exists, the user is alerted. If sensitive information does not exist, the sensitive information identification module transmits the question information to the differential privacy module. Afterwards, the differential privacy module in the security toolbox can determine the session identifier, encryption algorithm, key, etc. according to the mapping relationship table (such as the first information, the second information, the third information, and the fourth information). Then, the differential privacy module can send information such as the encryption algorithm key to the large language model, instructing the large language model to decrypt the question information and encrypt the reply information. In addition, the differential privacy module can send the question information to the data encryption module, which encrypts the question information and sends the encrypted question information to the large language model. The large language model can send the encrypted reply information to the differential privacy module. Afterwards, the differential privacy module can decrypt the reply information and send the decrypted reply information to the user.

[0223] The above is an introduction to privacy protection during the question-and-answer process using a large language model. The following is an introduction to privacy protection during the question-and-answer process using a knowledge base and a large language model.

[0224] The embodiment of the present application provides a method for transmitting question and answer information, such as Figure 12 As shown, the method for transmitting the question and answer information may include:

[0225] S1201: A first user sends target question information to a knowledge base.

[0226] Among them, this knowledge base is a knowledge base of a large language model plug-in.

[0227] Exemplarily, the knowledge base may be a vector database.

[0228] Correspondingly, the knowledge base may receive target question information from the first user.

[0229] S1202: The knowledge base generates second reply information based on the target question information.

[0230] In a possible implementation, the knowledge base may recall knowledge based on the target question information and generate second reply information.

[0231] S1203: The knowledge base sends a second reply message to the security toolbox.

[0232] Accordingly, the security toolbox receives second reply information from the knowledge base.

[0233] S1204: The security toolbox combines the second reply information with the target question information.

[0234] For example, the second reply information received by the security toolbox is a prompt. Afterwards, the security toolbox may combine the second reply information with the target question information to generate a prompt.

[0235] In an embodiment of the present application, after the security toolbox combines the second reply information with the target question information, it can encrypt the second reply information and the target question information to obtain encrypted second reply information and target question information.

[0236] That is to say, in the embodiment of the present application, S704 not only encrypts the target question information, but also encrypts the second reply information.

[0237] It should be noted that the specific encryption process can refer to the introduction of encryption of target question information in the above embodiment, which will not be described in detail here.

[0238] In some embodiments, after the security toolbox combines and encrypts the second reply information with the target question information, the security toolbox may send a first message to the large language model (i.e., S408). The first message may include: the encrypted target question information and the encrypted second reply information.

[0239] Accordingly, the large language model can receive the first message from the security toolbox. The large language model can then decrypt the data to obtain the target question information and the second response information. The large language model can then generate the first response information based on the target question information and the second response information. The large language model can then encrypt the first response information to generate the encrypted first response information.

[0240] It is understood that if the large model has a knowledge base, the security toolbox can receive the second response information from the knowledge base. The security toolbox then needs to encrypt not only the target question information but also the second response information. The security toolbox can then send the target question information and the second response information together to the large language model. This ensures that the large language model can accurately generate the response information by combining the target question information and the second response information. Furthermore, because the security toolbox encrypts the data, it can improve the security of user information.

[0241] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the security toolbox. It is understandable that, in order to realize the above functions, the security toolbox includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the steps of a method for transmitting question and answer information in each example described in the embodiment disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in hardware or in a way that the security toolbox software drives the hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0242] In the embodiment of the present application, the transmission device of question and answer information can be divided into functional modules or functional units according to the above method example. For example, each functional module or functional unit can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules or functional units. Among them, the division of modules or units in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0243] Please refer to Figure 13 , which shows a schematic diagram of a transmission device for question and answer information provided by an embodiment of the present application. The transmission device for question and answer information can be a functional module in the above-mentioned computing device for implementing the method of the embodiment of the present application. Figure 13 As shown, the transmission device of the question and answer information may include: a receiving module 1301, a processing module 1302, and a sending module 1303. The receiving module 1301 is used to receive question information from a first user. The processing module 1302 is used to determine the first session identifier corresponding to the first user based on the first information. The sending module 1303 is used to send the question information and the first session identifier to the network model, where the first information is used to indicate the relationship between multiple users and multiple session identifiers. The processing module 1302 is also used to update the first information, where the session identifier corresponding to the user in the updated first information is changed. The receiving module 1301 is also used to receive target question information from the first user. The processing module 1302 is also used to determine the second session identifier corresponding to the first user based on the updated first information. The sending module 1303 is also used to send a first message to the network model, where the first message is used to indicate a reply to the target question information, and the first message includes: the target question information and the second session identifier.

[0244] In a possible design, the processing module 1302 is further configured to periodically update the first information.

[0245] In another possible design, processing module 1302 is further configured to obtain a first text length, where the first text length is the sum of the lengths of the question information sent by the first user to the network model using the first session identifier and the target question information. The first session identifier is the session identifier used by the first user the last time they sent a question information to the network model. If the first text length is greater than or equal to a first preset length threshold, the first information is updated.

[0246] In another possible design, the multiple users include a first user and a second user; before the first information is updated, the session identifier corresponding to the second user is the second session identifier. Processing module 1302 is further configured to determine the second user from the multiple users. Processing module 1302 is further configured to update the session identifier corresponding to the first user from the first session identifier to the second session identifier; and update the session identifier corresponding to the second user from the second session identifier to a third session identifier.

[0247] In another possible design, receiving module 1301 is further configured to receive a question from the second user. Processing module 1302 is further configured to determine the third session identifier corresponding to the second user based on the updated first information. Sending module 1303 is further configured to send the question and the third session identifier to the network model.

[0248] In another possible design, processing module 1302 is further configured to obtain a usage duration of a current session identifier corresponding to each of a plurality of users, and determine a second user based on the plurality of usage durations, where the second session identifier corresponding to the second user is a session identifier having a usage duration greater than a preset usage duration threshold.

[0249] In another possible design, processing module 1302 is further configured to obtain a second text length for each user, where the second text length is the length of the question information sent by the user to the network model using the current session identifier. Processing module 1302 is further configured to determine a second user based on the multiple second text lengths, where the second session identifier corresponding to the second user is a session identifier whose second text length exceeds a second preset length threshold.

[0250] In another possible design, processing module 1302 is further configured to obtain a second session identifier, where the second session identifier is a newly created session identifier; wherein, before updating the first information, the session identifier corresponding to the first user is the first session identifier. Processing module 1302 is further configured to update the session identifier corresponding to the first user from the first session identifier to the second session identifier.

[0251] In another possible design, processing module 1302 is further configured to obtain a target key set corresponding to the second session identifier, the target key set including: a first public key, a first private key corresponding to the first public key, a second public key, and a second private key corresponding to the second public key. The first public key is used to encrypt data sent to the network model, and the second public key is used to encrypt data sent by the network model. Sending module 1303 is further configured to send the first private key and the second public key to the network model.

[0252] In another possible design, the processing module 1302 is further configured to encrypt the target question information to obtain encrypted target question information, wherein the target question information in the first message is encrypted data.

[0253] In another possible design, processing module 1302 is further configured to determine the first user's security level based on the second information, where the second information indicates the relationship between the user and the security level. Processing module 1302 is further configured to determine target encryption information corresponding to the first user based on the first user's security level and third information, where the third information indicates the relationship between the security level and the encryption algorithm. Processing module 1302 is further configured to encrypt the target question information based on the target encryption algorithm to obtain encrypted target question information.

[0254] In another possible design, receiving module 1301 is further configured to receive a second message from the network model, the second message including encrypted first reply information, the first reply information being data in response to the target question information. Processing module 1302 is further configured to decrypt the encrypted first reply information to obtain decrypted first reply information.

[0255] In another possible design, receiving module 1301 is further configured to obtain the first user's real identifier. Processing module 1302 is further configured to determine the first user's virtual identifier based on the first user's real identifier, and the fifth information is configured to indicate the correspondence between the user's real identifier and the virtual identifier. Sending module 1303 is further configured to send a first message to the network model based on the first user's virtual identifier.

[0256] In another possible design, the sending module 1303 is further configured to send a first message to the network model if the target question information does not contain sensitive data.

[0257] In another possible design, the sending module 1303 is further configured to send a prompt message to the first user if sensitive data exists in the target question information, where the prompt message is used to indicate that sensitive data exists in the target question information.

[0258] In another possible design, processing module 1302 is further configured to input the target question information into a trained text detection model to generate first detection information, where the first detection information indicates whether sensitive data exists in the question information. Processing module 1302 is further configured to detect the target question information using preset detection conditions to generate second detection information, where the second detection information indicates whether sensitive data exists in the question information. Processing module 1302 is further configured to generate text detection information based on the first detection information and the second detection information.

[0259] In another possible design, receiving module 1301 is further configured to receive second reply information from the knowledge base for the target question information. Processing module 1302 is further configured to encrypt the second reply information to obtain encrypted second reply information, wherein the first message also includes the encrypted second reply information.

[0260] Some other embodiments of the present application provide a computing device including a processor and a memory. The processor is configured to execute instructions stored in the memory so that the computing device performs the functions or steps performed by the security toolbox in the above method embodiments.

[0261] Other embodiments of the present application provide an electronic device. The electronic device may include a memory and one or more processors. The memory and processor are coupled. The electronic device may also include a camera. Alternatively, the electronic device may be connected to an external camera. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device may perform the various functions or steps performed by the security toolbox in the above-described method embodiments.

[0262] The present application also provides a chip system. Figure 14 As shown, the chip system includes at least one processor 1401 and at least one interface circuit 1402. The processor 1401 and the interface circuit 1402 can be interconnected via lines. For example, the interface circuit 1402 can be used to receive signals from other devices (such as the memory of a computing device). For another example, the interface circuit 1402 can be used to send signals to other devices (such as the processor 1401). Exemplarily, the interface circuit 1402 can read instructions stored in the memory and send the instructions to the processor 1401. When the instructions are executed by the processor 1401, the computing device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0263] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned computing device, the computing device executes the various functions or steps performed by the security toolbox in the above-mentioned method embodiment.

[0264] An embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the various functions or steps executed by the security toolbox in the above method embodiment.

[0265] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0266] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0267] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0268] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0269] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0270] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for transmitting question and answer information, characterized in that: The method comprises: Receiving a question from a first user; Determine, based on the first information, a first session identifier corresponding to the first user, and send the question information and the first session identifier to the network model, where the first information is used to indicate a relationship between multiple users and multiple session identifiers; Updating the first information, where the session identifier corresponding to the user in the updated first information is changed; receiving target question information from the first user; Determining a second session identifier corresponding to the first user according to the updated first information; A first message is sent to the network model, where the first message is used to instruct a reply to the target question information, and the first message includes: the target question information and the second session identifier.

2. The method according to claim 1, characterized in that After receiving the target question information from the first user, the method further includes: Obtaining a first text length, where the first text length is the sum of the length of the question information sent by the first user to the network model using the first session identifier and the length of the target question information, where the first session identifier is the session identifier used by the first user the last time he sent a question information to the network model; If the length of the first text is greater than or equal to the first preset length threshold, the first information is updated.

3. The method according to claim 1 or 2, characterized in that The multiple users include the first user and the second user; wherein, before updating the first information, the session identifier corresponding to the second user is the second session identifier; and updating the first information includes: determining the second user from the plurality of users; Updating the session identifier corresponding to the first user from the first session identifier to the second session identifier; The session identifier corresponding to the second user is updated from the second session identifier to a third session identifier.

4. The method according to claim 3, characterized in that After updating the first information, the method further includes: receiving a question from the second user; The third session identifier corresponding to the second user is determined according to the updated first information, and the question information and the third session identifier are sent to the network model.

5. The method according to claim 3, characterized in that The determining the second user from the multiple users includes: Obtaining a usage duration of a current session identifier corresponding to each of the multiple users; The second user is determined according to the plurality of usage durations, and the second session identifier corresponding to the second user is a session identifier whose usage duration is greater than a preset usage duration threshold.

6. The method according to claim 3 or 5, characterized in that The determining the second user from the multiple users includes: Acquire a second text length of each user, where the second text length is the length of the question information sent by the user to the network model using the current session identifier; The second user is determined according to the multiple second text lengths, and the second session identifier corresponding to the second user is a session identifier in which the second text length is greater than a second preset length threshold.

7. The method according to claim 1 or 2, characterized in that Before updating the first information, the method further includes: Obtaining the second session identifier, where the second session identifier is a newly created session identifier; The updating of the first information includes: The session identifier corresponding to the first user is updated from the first session identifier to the second session identifier.

8. The method according to any one of claims 1 to 7, characterized in that Before sending the first message to the network model, the method further includes: Encrypting the target question information to obtain the encrypted target question information; The target question information in the first message is encrypted data.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: receiving a second message from the network model, the second message including: encrypted first reply information, the first reply information being data replying to the target question information; The encrypted first reply information is decrypted to obtain the decrypted first reply information.

10. The method according to any one of claims 1 to 9, characterized in that Before sending the first message to the network model, the method further includes: Obtaining the real identifier of the first user; Determining a virtual identifier of the first user based on the real identifier of the first user; The sending a first message to the network model includes: The first message is sent to the network model according to the virtual identifier of the first user.

11. The method according to any one of claims 1 to 10, characterized in that The sending a first message to the network model includes: If the target question information does not contain sensitive data, the first message is sent to the network model.

12. A device for transmitting question and answer information, characterized in that: The device comprises: A receiving module, configured to receive question information from a first user; a processing module, configured to determine a first session identifier corresponding to the first user based on the first information; a sending module, configured to send the question information and the first session identifier to the network model, wherein the first information is used to indicate a relationship between multiple users and multiple session identifiers; The processing module is further configured to update the first information, wherein the session identifier corresponding to the user in the updated first information is changed; The receiving module is further configured to receive target question information from the first user; The processing module is further configured to determine a second session identifier corresponding to the first user based on the updated first information; The sending module is further configured to send a first message to the network model, where the first message is used to instruct a reply to the target question information, and the first message includes: the target question information and the second session identifier.

13. A computing device, characterized in that including processor and memory; The processor is configured to execute instructions stored in the memory, so that the computing device performs the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed by a computing device, the computing device performs the method according to any one of claims 1 to 11.

15. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method and device for recovering session, and computer storage medium

    CN109246172A

  • Session holding method and related equipment

    CN109413123A

  • Intelligent service system and method, electronic equipment and storage medium

    CN117319494A

  • Privacy protection method and device during dialogue access, electronic equipment and storage medium

    CN117407912A

Cited By

  • Secure Large Language Model Data Gateway

    US20250378268A1