Data processing method and apparatus, and computer device and storage medium
By deploying a gateway system in a trusted execution environment, processing and managing dialogue request and response data between the user and the LLM service, the problem of terminal data leakage and low security is solved, and the data is secure interaction and accurate feedback is achieved. .
Patent Information
- Application Number
- PCT/CN2024/099810
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-20
- Filing Date
- 2024-06-18
- Publication Date
- 2024-12-26
AI Technical Summary
In the prior art, there is a problem of terminal data leakage in the dialogue process by calling the network interface of the large language model (LLM) service, resulting in low security and difficulty in managing the dialogue process of each terminal, which cannot guarantee the security of data.
Deploy the gateway system in the trusted execution environment of the server, receive the dialogue request from the user and perform the transformation process, generate the processed dialogue request, send it to the third-party server deployed with the language network model, and generate the target response data based on the initial response data adjustment to generate the target response data based on the initial response data , ensure data security.
Through the processing of the gateway system, the risk of leakage of pending data is alleviated, the security of terminal data is guaranteed, and the accuracy of target response data is improved.
Smart Images

Figure CN2024099810_26122024_PF_FP_ABST
Abstract
Description
Data processing method, device, computer equipment and storage medium
[0001] This application claims priority to Chinese patent application No. 202310736489.8, filed on June 20, 2023, with the invention name “Data processing method, device, computer equipment and storage medium”. The contents of the above-mentioned Chinese patent application disclosure are hereby cited in their entirety as part of this application. Technical Field
[0002] The present disclosure relates to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment, and storage medium. Background Art
[0003] With the development of technology, artificial intelligence (AI) large language models (LLMs) have been widely used in various industries, such as language translation and gaming. By calling the LLM service's network interface, users can communicate with the LLM to obtain the desired results. However, this method poses the risk of data leakage, making the communication process with the LLM less secure.
[0004] Summary of the Invention
[0005] The embodiments of the present disclosure at least provide a data processing method, apparatus, computer equipment, and storage medium.
[0006] An embodiment of the present disclosure provides a data processing method, which is applied to a gateway system deployed in a trusted execution environment of a server. The method includes:
[0007] Receive the conversation request sent by the user end;
[0008] Performing transformation processing on the data to be processed contained in the dialogue request to generate a processed dialogue request, wherein the data to be processed is data with security requirements;
[0009] sending the processed dialogue request to a third-party server deployed with a language network model, and receiving initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request;
[0010] Based on the data to be processed in the dialogue request, the initial response data is adjusted to generate target response data, and the target response data is sent to the user terminal.
[0011] In an optional embodiment, the dialogue request includes a data tag indicating data to be processed; and the transforming the data to be processed included in the dialogue request to generate a processed dialogue request includes:
[0012] determining the data type and transformation level of the to-be-processed data indicated by the data tag;
[0013] Determining a target processing algorithm corresponding to the data to be processed based on the data type and the transformation level;
[0014] The target processing algorithm is used to transform the data to be processed indicated by the data tag to generate a post-processing dialogue request.
[0015] In an optional implementation manner, determining the data type and transformation level of the to-be-processed data indicated by the data tag includes:
[0016] The data type and transformation level of the to-be-processed data indicated by the data tag are determined based on the information table included in the dialogue request.
[0017] In an optional implementation manner, determining the data type and transformation level of the to-be-processed data indicated by the data tag includes:
[0018] Based on the tag type of the data tag included in the dialog request, the data type and transformation level of the to-be-processed data indicated by the data tag are determined.
[0019] In an optional embodiment, the transforming the data to be processed indicated by the data tag using the target processing algorithm to generate a post-processing dialogue request includes:
[0020] Using the target processing algorithm, transforming the data to be processed to generate processed data corresponding to the data to be processed;
[0021] A processed dialogue request is generated based on other data in the dialogue request except the data to be processed, the processed data, and preset instruction data for instructing data mark retention.
[0022] In an optional embodiment, the initial response data packet contains the data tag, and adjusting the initial response data based on the to-be-processed data in the dialogue request to generate the target response data includes:
[0023] determining, based on the data tag included in the initial response data, the processed data included in the initial response data;
[0024] The processed data in the initial response data is replaced with the corresponding data to be processed to generate target response data.
[0025] In an optional embodiment, after receiving the conversation request sent by the user terminal, the method further includes: performing authority verification on the user terminal based on the user terminal identifier carried in the conversation request to obtain an authority verification result;
[0026] The transforming the data to be processed included in the dialogue request to generate a processed dialogue request includes: when the authority verification result indicates that the user terminal has the use authority, transforming the data to be processed included in the dialogue request to generate a processed dialogue request.
[0027] In an optional implementation, before receiving the dialogue request sent by the user terminal, the method further includes:
[0028] Receive the data to be verified sent by the user end;
[0029] Generate target verification data based on the data to be verified and the trust root module included in the trusted execution environment;
[0030] The target verification data is sent to the user terminal to verify the target verification data and generate a verification result indicating whether the gateway system is running in a trusted execution environment.
[0031] In an optional implementation, the data to be verified is generated based on initialization data generated by the user terminal and first public key information included in the gateway system; the method further includes: receiving second public key information sent by the user terminal;
[0032] The generating target verification data based on the data to be verified and the trust root module included in the trusted execution environment includes:
[0033] Parsing the data to be verified using the first private key information contained in the gateway system to obtain the initialization data;
[0034] generating report data based on the initialization data and the second public key information;
[0035] The report data is processed using a trust root module included in the trusted execution environment to generate target verification data.
[0036] In an optional implementation, the conversation request is encrypted using a determined first session key, where the first session key is generated based on the first public key information and second private key information contained in the user terminal. After receiving the conversation request sent by the user terminal, the method further includes:
[0037] Generate a second session key based on the first private key information and the second public key information;
[0038] The second session key is used to parse the conversation request to obtain a parsed conversation request, wherein the parsed conversation request includes the data to be processed.
[0039] An embodiment of the present disclosure further provides a data processing device, which is applied to a gateway system, wherein the gateway system is deployed in a trusted execution environment of a server, and the device includes:
[0040] A receiving module configured to receive a conversation request sent by a user terminal;
[0041] a processing module configured to transform the data to be processed contained in the dialogue request to generate a processed dialogue request, wherein the data to be processed is data with security requirements;
[0042] a sending module configured to send the processed dialogue request to a third-party server deployed with a language network model, and receive initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request;
[0043] The generating module is configured to adjust the initial response data based on the data to be processed in the dialogue request, generate target response data, and send the target response data to the user terminal.
[0044] An embodiment of the present disclosure also provides a computer device, comprising: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the above-mentioned data processing method or steps in any possible implementation of the above-mentioned data processing method are performed.
[0045] An embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program executes the above-mentioned data processing method or steps in any possible implementation of the data processing method.
[0046] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, exemplary embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.
[0048] FIG1 shows a flow chart of a data processing method provided by an embodiment of the present disclosure;
[0049] FIG2 shows a flow chart of another data processing method provided by an embodiment of the present disclosure;
[0050] FIG3 shows a schematic structural diagram of a gateway system provided by an embodiment of the present disclosure;
[0051] FIG4 shows a schematic structural diagram of a data processing device provided by an embodiment of the present disclosure;
[0052] FIG5 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.
[0054] Research has found that the process of communicating with the LLM by calling the LLM service's network interface can lead to data leakage, making the communication process with the LLM less secure. Furthermore, each terminal independently calls the network interface to communicate with the LLM, making it difficult to manage the communication process for each terminal and, consequently, unable to guarantee the security of the terminal data during the communication process.
[0055] Based on the above research, this disclosure provides a data processing method, applied to a gateway system, that manages the interaction between a user terminal and a third-party server hosting a language network model, ensuring the security of the terminal data (data provided by the user terminal) during the interaction. Furthermore, the gateway system is deployed within the server's trusted execution environment, preventing other devices, such as the third-party server, from accessing the user terminal's data, thus ensuring the security of the terminal data.
[0056] In an exemplary implementation of this method, after receiving a conversation request from a user, the to-be-processed data contained in the conversation request can be transformed to generate a processed conversation request. Since the to-be-processed data is subject to security requirements, transforming it can mitigate the risk of data leakage and ensure its security, thus ensuring that the generated processed conversation request meets security requirements. The processed conversation request can then be sent to a third-party server deployed with a language network model, and initial response data returned by the third-party server is received. Based on the to-be-processed data in the conversation request, the initial response data is adjusted to generate target response data, ensuring that the target response data meets user requirements and improves the accuracy of the target response data.
[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0058] The term "and / or" herein simply describes an associative relationship, indicating that three possible relationships exist. For example, "A and / or B" can represent the existence of A alone, the simultaneous existence of A and B, and the existence of B alone. Furthermore, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "including at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.
[0059] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0060] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0061] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0062] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0063] To facilitate understanding of this embodiment, a data processing method disclosed in an embodiment of the present disclosure is first described in detail. The data processing method provided in an embodiment of the present disclosure may be executed by a gateway system deployed within a trusted execution environment of a server. The server may be communicatively connected to one or more client terminals. Specifically, the client terminals and the server on which the gateway system is deployed are located within the same target domain, while a third-party server on which the language network model is deployed is located outside the target domain. In some possible implementations, the data processing method may be implemented by a processor invoking computer-readable instructions stored in a memory.
[0064] 1 , which is a flow chart of a data processing method according to an embodiment of the present disclosure, includes steps S101 to S104 , wherein:
[0065] S101, receiving a conversation request sent by a user terminal;
[0066] S102, transforming the data to be processed contained in the dialogue request to generate a processed dialogue request, wherein the data to be processed is data with security requirements;
[0067] S103: sending the processed dialogue request to a third-party server that deploys a language network model, and receiving initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request;
[0068] S104: Based on the data to be processed in the dialogue request, adjust the initial response data to generate target response data, and send the target response data to the user terminal.
[0069] S101 to S104 will be schematically described below.
[0070] For S101:
[0071] During implementation, the user can enter a conversation content on the terminal interface. The conversation content contains multiple data. A conversation request is generated based on the conversation content and sent to the server's gateway system. For example, the conversation request may include "xxxxxdata1, xxxdata2xxxxx, xxdata3xxxxx", where data1, data2, and data3 are data to be processed with security requirements, and "xx..." can represent other data that does not meet security requirements.
[0072] The conversation content may include a data tag indicating the data to be processed, so that the generated conversation request includes the data tag. The data tag can be set as needed. For example, the conversation content may include "xxxxx{{data1}}, xxx{{data2}}xxxxx, xx{{data3}}xxxxx", and the data tag may be "{{}}".
[0073] The session request may also include the data type and / or transformation level corresponding to the data to be processed. When the session request includes the data type but not the transformation level, a mapping relationship between the data type and the processing algorithm may be set so that the target processing algorithm for the data to be processed can be subsequently determined based on the data type. When the session request does not include the data type but includes the transformation level, a mapping relationship between the transformation level and the processing algorithm may be set so that the target processing algorithm for the data to be processed can be subsequently determined based on the transformation level. When the session request includes both the data type and the transformation level, a mapping relationship between the data type, the transformation level, and the processing algorithm may be set so that the target processing algorithm for the data to be processed can be subsequently determined based on the data type and the transformation level.
[0074] In an optional implementation, the dialog request may further include an information table storing the data type and transformation level of the data to be processed, as indicated by each data identifier. For example, the dialog request may include "xxxxx{{data1}}, xxx{{data2}}xxxxx, xx{{data3}}xxxxx," with the data identifier being "{{}}." Exemplarily, the information table included in the dialog request may be as follows:
[0075] According to the above table, the data type of the data to be processed data1 can be the numeric type num, the transformation level is 1, the data type of the data to be processed data2 can be the character type char, the transformation level can be 2, the data type of the data to be processed data3 can be the character type char, the transformation level can be 3, and so on.
[0076] In another optional implementation, the data tags used to indicate the data to be processed in the dialog request may have multiple tag types, and different tag types correspond to different data types and transformation levels. For example, the data tags may include "{}", "{{}}", "{{{}}}", "[]", "[[]]", and "[[[]]]". The data type corresponding to the data tag "{}" may be num, and the transformation level may be 1; the data type corresponding to the data tag "{{}}" may be num, and the transformation level may be 2, and so on. Similarly, the data type corresponding to the data tag "[]" may be char, and the transformation level may be 1; the data type corresponding to the data tag "[[]]" may be char, and the transformation level may be 2, and so on.
[0077] The user terminal may include the second public key information Pub A and the second private key information pri A , and the gateway system may include a first public key information and a first private key information. Exemplarily, the first public key information and the first private key information may be key information based on an elliptic curve, that is, the first public key information Pub B With the first private key information pri B Has the following relationship: Pub B =[pri B ]×P, where P is the elliptic curve generator.
[0078] During implementation, after receiving the conversation content, the user end can use a key agreement protocol to generate symmetric keys, namely the first session key and the second session key. The user end uses the first session key to sign the conversation request, and the gateway system uses the second session key to parse the conversation request. The first session key is generated based on the first public key and the second private key, and the second session key is generated based on the second public key and the first private key. Setting session keys ensures security during communication.
[0079] In an optional implementation, the conversation request is encrypted using a determined first session key, and the first session key is generated based on the first public key information and the second private key information; after receiving the conversation request sent by the user end, the method further includes: generating a second session key based on the first private key information and the second public key information; and using the second session key to parse the conversation request to obtain a parsed conversation request.
[0080] Exemplarily, the first session key is obtained according to the following formula (1): Pub AB =[pri A ]×Pub B =(X AB ,Y AB) (1)
[0081] The second session key is obtained according to the following formula (2): AB =[pri B ]×Pub A =(X AB ,Y AB ) (2)
[0082] When implementing, you can also select X AB , or Y AB As the first session key and the second session key. The first session key and the second session key can be set with an expiration date, for example, the expiration date can be a preset time period or the number of conversations.
[0083] After receiving the conversation request sent by the user end, a second session key can be generated first, and the conversation request can be parsed using the second session key to obtain a parsed conversation request. The parsed conversation request contains various data, such as data to be processed, so that the data to be processed contained in the parsed conversation request can be subsequently transformed and processed.
[0084] In an exemplary implementation, the gateway system may also authorize each client within the target domain during system initialization, so that subsequent session requests from authorized clients can be processed, enhancing the security of the method. Authorization verification methods may include, but are not limited to, tokens, public keys, and certificates. For example, after authorizing each client, a whitelist may be maintained in the gateway system, storing the client identifiers of each client.
[0085] In an optional implementation, after receiving the dialogue request sent by the user terminal, the method further includes: performing authority verification on the user terminal based on the user terminal identifier carried in the dialogue request to obtain an authority verification result.
[0086] The conversation request may carry a user terminal identifier. The gateway system performs permission verification on the user terminal based on the user terminal identifier. For example, it may determine whether the user terminal identifier exists in the whitelist. If so, the permission verification result may indicate that the user terminal has permission to use the service. Otherwise, if it does not exist, the permission verification result may indicate that the user terminal does not have permission to use the service.
[0087] If the authorization verification result indicates that the user terminal has the authorization to use the data, the data to be processed included in the dialogue request is transformed to generate a processed dialogue request. If the authorization verification result indicates that the user terminal does not have the authorization to use the data, no subsequent processing is performed and the dialogue process ends.
[0088] For S102:
[0089] During implementation, the data to be processed contained in the conversation request can be determined and transformed to generate processed data. Subsequently, a processed conversation request can be generated based on the processed data. The data to be processed can be data with security requirements and can be configured as needed, such as phone data, email data, and so on.
[0090] For example, if the conversation request includes data tags, the data to be processed can be determined based on the data tags. For example, a trained neural network model can be used to detect each piece of data included in the conversation request to determine the data to be processed. For example, the data to be processed in the conversation request can be determined based on a regular expression representing the data format of the data to be processed.
[0091] After determining the data to be processed, a preset processing algorithm can be used to transform at least one data to be processed included in the conversation request to generate a processed conversation request. The preset processing algorithm can be set as needed, such as a hash algorithm, an encryption algorithm, etc.
[0092] When the dialogue request includes the data type of the data to be processed, the target processing algorithm corresponding to the data to be processed can be determined based on the data type; when the dialogue request includes the transformation level of the data to be processed, the target processing algorithm corresponding to the data to be processed can be determined based on the transformation level; when the dialogue request includes the data type and transformation level of the data to be processed, the target processing algorithm corresponding to the data to be processed can be determined based on the data type and the transformation level, so that the target processing algorithm can be used to transform the data to be processed.
[0093] In an alternative embodiment, the dialog request may include the data type of the data to be processed and the request level of the dialog request, and the request level is determined as the transformation level of each data to be processed in the dialog request, that is, the transformation level of each data to be processed in the dialog request is the same.
[0094] In an optional implementation, the dialogue request includes a data tag for indicating data to be processed; and the transforming the data to be processed included in the dialogue request to generate a processed dialogue request may include, for example:
[0095] Step A1: Determine the data type and transformation level of the data to be processed indicated by the data tag based on the information table contained in the dialogue request; or, determine the data type and transformation level of the data to be processed indicated by the data tag based on the tag type of the data tag contained in the dialogue request.
[0096] Step A2: determining a target processing algorithm corresponding to the data to be processed based on the data type and the transformation level;
[0097] Step A3: using the target processing algorithm, transform the data to be processed indicated by the data tag to generate a post-processing dialogue request.
[0098] In step A1, in one embodiment, if the conversation request includes an information table, the data type and transformation level of the data to be processed indicated by the data tag can be determined from the information table. The information table includes the data type and transformation level corresponding to each data tag of the data to be processed. In another embodiment, data tags of multiple tag types can be provided, with different tag types corresponding to different data types and transformation levels. Therefore, the data type and transformation level of the data to be processed indicated by the data tag can be determined based on the tag type of the data tag included in the conversation request.
[0099] In step A2, a mapping relationship between the transformation level of the data type and the processing algorithm can be established. This allows the target processing algorithm to be matched to the dialog request based on the data type and transformation level of the data to be processed. For example, processing algorithms corresponding to different transformation levels can be determined for each data type. The higher the transformation level, the greater the degree of data transformation by the corresponding processing algorithm. In other words, the processed data loses its original semantics to a greater extent, making restoration more difficult.
[0100] For example, for the data type of the numeric type num, three transformation levels can be set. When the transformation level is one, the corresponding processing algorithm can be a scaling algorithm or a translation algorithm, that is, the scaling algorithm can perform scaling operations on the numeric value, and the translation algorithm can perform left or right shift operations on the numeric value, etc.; when the transformation level is two, the corresponding processing algorithm can be an encryption algorithm; when the transformation level is three, the corresponding processing algorithm can be a rounding algorithm or a truncation algorithm, the rounding algorithm can perform rounding operations on the numeric value, and the truncation algorithm can perform truncation operations on the numeric value, etc.
[0101] For example, for the data type of character type char, three transformation levels can be set. When the transformation level is level one, the corresponding processing algorithm can be an obfuscation algorithm; when the transformation level is level two, the corresponding processing algorithm can be an encryption algorithm, and the encryption algorithm can be selected as needed, such as a symmetric encryption algorithm; when the transformation level is level three, the corresponding processing algorithm can be a hash algorithm, etc.
[0102] The target processing algorithm that matches the data to be processed is determined based on the data type and transformation level of the data to be processed, as well as the mapping relationship between the transformation level of the determined data type and the processing algorithm. For example, if the data type to be processed is char and the transformation level is level 2, the target processing algorithm can be an encryption algorithm. By setting processing algorithms corresponding to different transformation levels for different data types, the transformation processing is more flexible, ensuring data security while increasing the diversity of transformation processing to meet user needs.
[0103] In step A3, the data to be processed, as indicated by the data tag, can be determined. For example, if the dialog request contains the data "xxxxxnum{{data1}}," where "{{}}" is the data tag, data1 is the data to be processed. The target processing algorithm corresponding to the data to be processed is then used to transform the data to generate a processed dialog request.
[0104] For example, during implementation, to prevent data leakage during a conversation, each data item included in the conversation request can be inspected to identify other data to be processed beyond the data indicated by the data identifier. This identification can be performed, for example, using regular expressions, neural network models, and the like. For example, for phone number data, a regular expression representing the structure of the phone number can be generated, and data in the conversation request that satisfies this regular expression can be identified as data to be processed that meets security requirements. In other words, the data to be processed included in the conversation request can include both the data to be processed indicated by the data identifier and the identified data to be processed. The identified data to be processed can be transformed using a pre-set processing algorithm.
[0105] The target processing algorithm is used to transform the data to be processed indicated by the data tag to obtain processed data, and then a processed dialogue request is generated based on the processed data and other unprocessed data in the dialogue request.
[0106] For example, during implementation, the use of the target processing algorithm to transform the data to be processed indicated by the data tag to generate a post-processing dialogue request may include: using the target processing algorithm to transform the data to be processed to generate processed data corresponding to the data to be processed; and generating a post-processing dialogue request based on other data in the dialogue request except the data to be processed, the processed data, and preset instruction data for indicating that the data tag is retained.
[0107] To ensure that data tags are not lost in subsequently received initial response data, instruction data indicating that data tags should be retained can be preset. After transforming the data to be processed using the target processing algorithm to generate processed data corresponding to the data to be processed, the data to be processed and the corresponding processed data can be associated and cached in a cache module. Furthermore, a post-processing dialog request can be generated based on the data other than the data to be processed in the dialog request, the processed data, and the preset instruction data indicating that data tags should be retained.
[0108] For S103 and S104:
[0109] After generating a processed conversation request, the processed conversation request is sent to a third-party server that deploys a language network model. In response to the processed conversation request, the third-party server invokes the language network model to generate initial response data, and returns the initial response data to the gateway system. The language network model is a large model obtained through training.
[0110] For example, during implementation, to ensure that data tags are not lost in the initial guidance data returned by the language network model, the trained language network model can be fine-tuned using training samples to obtain a fine-tuned language network model. The training samples include sample conversation data and sample response data associated with the sample conversation data, both of which include data tags.
[0111] For example, if the processed dialog request indicates instruction data with a data tag retained, the initial response data returned by the fine-tuned language network model can include this data tag. Furthermore, based on the unprocessed data in the dialog request, the content indicated by the data tag in the initial response data can be adjusted, for example, by adjusting the content indicated by the data tag to the unprocessed data, thereby obtaining the target response data, which can then be returned to the user terminal.
[0112] For another example, if the initial response data does not include a data tag, the initial response data can be tested to determine the processed data included in the initial response data, and then the processed data can be replaced with the unprocessed data in the dialogue request to generate the target response data.
[0113] In an optional embodiment, the initial response data packet contains the data tag, and the initial response data is adjusted based on the data to be processed in the dialogue request to generate target response data, including: determining the processed data contained in the initial response data based on the data tag contained in the initial response data; replacing the processed data in the initial response data with the corresponding data to be processed to generate target response data.
[0114] The processed data can be determined based on the data tags contained in the initial response data, or the processed data contained in the initial response data can be determined based on the stored data to be processed and the associated processed data. The processed data in the initial response data is then replaced with the corresponding data to be processed to generate the target response data.
[0115] If the initial response data does not include the processed data, the initial response data may be directly sent to the user end as the target response data.
[0116] According to an embodiment of the present disclosure, by restoring the processed data in the initial response data to the data to be processed, the target response data is obtained, thereby ensuring the accuracy of the feedback data (ie, the target response data) of the dialogue request received by the user end.
[0117] After the gateway system is deployed in the trusted execution environment of the server, the user end can verify the gateway system to determine whether the gateway system is running in the trusted execution environment (TEE).
[0118] To this end, in an optional implementation manner, before receiving the dialogue request sent by the user terminal, the method further includes:
[0119] Step B1, receiving the data to be verified sent by the user terminal;
[0120] Step B2: generating target verification data based on the data to be verified and the trust root module included in the trusted execution environment;
[0121] Step B3: sending the target verification data to the user terminal, and the user terminal is used to verify the target verification data and generate a verification result indicating whether the gateway system is running in a trusted execution environment.
[0122] The data to be verified can be generated by the user end according to agreed rules and agreed algorithms. For example, the user end can generate initialization data (e.g., a randomly generated string of specific bytes), and then use an encryption algorithm, such as an elliptic curve encryption algorithm and the first public key information, to encrypt the initialization data to generate the data to be verified. In other words, the data to be verified is generated based on the initialization data generated by the user end and the first public key information contained in the gateway system.
[0123] Furthermore, the trusted root module included in the trusted execution environment can process the data to be verified, generate target verification data, and send the target verification data to the user end so that the user end can verify the target verification data and generate a verification result indicating whether the gateway system is running in the trusted execution environment.
[0124] In an optional implementation, the user terminal may also send the second public key information to the gateway system; for example, in step B2, generating target verification data based on the data to be verified and the trust root module contained in the trusted execution environment may include: using the first private key information contained in the gateway system to parse the data to be verified to obtain the initialization data; generating report data based on the initialization data and the second public key information; and using the trust root module contained in the trusted execution environment to process the report data to generate target verification data.
[0125] When the data to be verified is encrypted using the first public key information, the first private key information can be used to parse the data to be verified to obtain initialization data. In the embodiments of the present disclosure, by encrypting the initialization data before transmission, the security of the data can be guaranteed and tampering can be avoided. Then, the initialization data and the second public key information can be processed to generate report data, for example, by performing hash processing on the initialization data and the second public key information to generate report data. Then, the trust root module included in the trusted execution environment can be used to process the report data to generate target verification data.
[0126] FIG2 is a flowchart of another data processing method provided by an embodiment of the present disclosure. The data processing method will be exemplarily described below in conjunction with FIG2. The method may include:
[0127] S201: Accepting a conversation request sent by a user terminal.
[0128] S202: Determine whether the user terminal has the permission to use.
[0129] For example, based on the user terminal identifier carried in the dialog request, the user terminal can be authenticated to obtain an authentication result. If the authentication result indicates that the user terminal does not have the authorization to use the data, the process ends. If the authentication result indicates that the user terminal has the authorization to use the data, step S203 is executed.
[0130] S203, parsing to obtain the data to be processed, the data type and the transformation level.
[0131] The dialog request includes a data tag. Parsing the dialog request can obtain the data to be processed indicated by the data tag. Then, based on the information table included in the dialog request, the data type and transformation level of the data to be processed indicated by the data tag can be obtained. Alternatively, the data type and transformation level of the data to be processed indicated by the data tag can be determined based on the tag type of the data tag.
[0132] S204: Use the built-in preset algorithm to check and fill in the gaps in the dialogue request.
[0133] For example, a preset algorithm, such as a regular expression or neural network model, is used to identify data in the dialog request other than the data to be processed indicated by the data tag, thereby determining the other data to be processed. The data to be processed indicated by the data tag and the identified other data to be processed constitute the data to be processed included in the dialog request.
[0134] S205: transform the data to be processed in the dialogue request to obtain a processed dialogue request.
[0135] For example, a target processing algorithm can be determined based on the data type and transformation level, and the target processing algorithm can be used to transform the data to be processed indicated by the data tag to generate processed data; and / or, a preset processing algorithm can be used to transform the identified data to be processed to generate processed data; and then, a processed dialogue request can be generated based on the processed data and unprocessed data in the dialogue request.
[0136] S206: Send the processed dialogue request to a third-party server where the language network model is deployed.
[0137] S207: Receive initial response data returned by the third-party server.
[0138] S208: Based on the data to be processed in the dialogue request, adjust the initial response data to generate target response data, and send the target response data to the user terminal.
[0139] It should be noted that, regarding the omitted contents of steps S201-S208 in the method embodiment described based on FIG2 , reference can be made to the relevant descriptions in the method embodiment described based on FIG1 , and no further details are given here.
[0140] The gateway system described above will be exemplarily described below with reference to FIG3 . As shown in FIG3 , the gateway system is deployed within a trusted execution environment (TEE) on a server and may include a session management module 301, a data processing module 302, and a data recovery module 303. The session management module 302 is connected to the data processing module 302 and the data recovery module 303, respectively. The session management module 301 may include a rights management module 311 and a cache module 312.
[0141] The rights management module 311 is configured to receive a session request from a user and invoke the data processing module 302 to transform the data to be processed contained in the session request to generate processed data corresponding to the data to be processed. The module then associates the data to be processed with the corresponding processed data and caches them in the cache module 312. The cache module 312 can cache the data associated with the current session request and delete the data associated with the current session request after the current session request ends.
[0142] The authority management module 311 is also used to generate a post-processing dialogue request based on other data and processed data in the dialogue request except the data to be processed; or, it can also generate a post-processing dialogue request based on other data in the dialogue request except the data to be processed, processed data and preset instruction data for indicating that the data mark is retained.
[0143] The rights management module 311 is further configured to send the processed dialogue request to a third-party server deployed with a language network model, and receive initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request.
[0144] The authority management module 311 is also used to call the data recovery module 303, adjust the initial response data according to the unprocessed data and the corresponding processed data cached by the cache module 312, generate target response data, and send the target response data to the user end.
[0145] The dialogue management module 301 may also include a log module 313, which stores record information of dialogue requests, such as the user-side information initiating the dialogue request, the IP of the request source, the request time, etc. The log module will not record the user-side dialogue request and the initial response data and target response data.
[0146] During implementation, the gateway system may further include a security verification module 304 , which is connected to the session management module 301 .
[0147] The session management module 301 is further configured to receive data to be verified sent by the user terminal, and send the data to be verified to the security verification module 304 .
[0148] The security verification module 304 is configured to generate target verification data based on the data to be verified and the trust root module included in the trusted execution environment; and send the target verification data to the session management module 301 .
[0149] The session management module 301 is used to send the target verification data to the user terminal, and the user terminal is used to verify the target verification data and generate a verification result indicating whether the gateway system is running in a trusted execution environment.
[0150] It should be noted here that, regarding the functions of each module and the interactions between modules in the embodiment of the gateway system described in Figure 3, reference can be made to the relevant description of the execution subject in the method embodiment based on Figures 1 and 2 above, and no further details will be given here.
[0151] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0152] Based on the same inventive concept, the embodiments of the present disclosure also provide a data processing device corresponding to the data processing method. Since the principle of solving the problem by the device in the embodiments of the present disclosure is similar to the above-mentioned data processing method in the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0153] 4 is a schematic diagram of the structure of a data processing device provided in an embodiment of the present disclosure. The device may include: a receiving module 401, a processing module 402, a sending module 403, and a generating module 404; wherein:
[0154] Receiving module 401, used to receive a conversation request sent by a user terminal;
[0155] A processing module 402 is configured to transform the data to be processed contained in the dialogue request to generate a processed dialogue request, wherein the data to be processed is data with security requirements;
[0156] a sending module 403 configured to send the processed dialogue request to a third-party server deployed with a language network model, and receive initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request;
[0157] The generating module 404 is configured to adjust the initial response data based on the data to be processed in the dialogue request, generate target response data, and send the target response data to the user terminal.
[0158] In an optional embodiment, the dialog request includes a data tag indicating data to be processed; accordingly, the processing module 402, when transforming the data to be processed included in the dialog request to generate a processed dialog request, is configured to:
[0159] determining the data type and transformation level of the data to be processed indicated by the data tag based on the information table included in the dialogue request; or determining the data type and transformation level of the data to be processed indicated by the data tag based on the tag type of the data tag included in the dialogue request;
[0160] Determining a target processing algorithm corresponding to the data to be processed based on the data type and the transformation level;
[0161] The target processing algorithm is used to transform the data to be processed indicated by the data tag to generate a post-processing dialogue request.
[0162] In an optional embodiment, the processing module 402, when transforming the to-be-processed data indicated by the data tag using the target processing algorithm to generate a processed dialogue request, is configured to:
[0163] Using the target processing algorithm, transforming the data to be processed to generate processed data corresponding to the data to be processed;
[0164] A processed dialogue request is generated based on other data in the dialogue request except the data to be processed, the processed data, and preset instruction data for instructing data mark retention.
[0165] In an optional embodiment, the initial response data packet contains the data tag; accordingly, the generation module 404, when adjusting the initial response data based on the data to be processed in the dialogue request to generate the target response data, is used to: determine the processed data contained in the initial response data based on the data tag contained in the initial response data; replace the processed data in the initial response data with the corresponding data to be processed to generate the target response data.
[0166] In an optional embodiment, the apparatus further includes: a first verification module 405, after receiving the conversation request sent by the user terminal, configured to perform permission verification on the user terminal based on the user terminal identifier carried in the conversation request to obtain a permission verification result;
[0167] Correspondingly, the processing module 402, when transforming the data to be processed contained in the dialogue request to generate a processed dialogue request, is used to: when the permission verification result indicates that the user terminal has the permission to use, transform the data to be processed contained in the dialogue request to generate a processed dialogue request.
[0168] In an optional implementation, the apparatus further includes: a second verification module 406, before receiving the dialogue request sent by the user terminal, configured to:
[0169] Receive the data to be verified sent by the user end;
[0170] Generate target verification data based on the data to be verified and the trust root module included in the trusted execution environment;
[0171] The target verification data is sent to the user terminal, and the user terminal is used to verify the target verification data and generate a verification result indicating whether the gateway system is running in a trusted execution environment.
[0172] In an optional implementation, the data to be verified is generated based on the initialization data generated by the user terminal and the first public key information included in the gateway system; accordingly, the receiving module 401 is further used to: receive the second public key information sent by the user terminal;
[0173] Accordingly, when generating target verification data based on the data to be verified and the trusted root module included in the trusted execution environment, the second verification module 406 is configured to:
[0174] Parsing the data to be verified using the first private key information contained in the gateway system to obtain the initialization data;
[0175] generating report data based on the initialization data and the second public key information;
[0176] The report data is processed using a trust root module included in the trusted execution environment to generate target verification data.
[0177] In an optional implementation, the conversation request is encrypted using a determined first session key, where the first session key is generated based on the first public key information and the second private key information. Accordingly, the apparatus further includes a parsing module 407, which, after receiving the conversation request sent by the user terminal, is configured to:
[0178] Generate a second session key based on the first private key information and the second public key information;
[0179] The conversation request is parsed using the second session key to obtain a parsed conversation request.
[0180] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0181] Based on the same technical concept, an embodiment of the present disclosure also provides a computer device. Referring to Figure 5, a structural diagram of a computer device 500 provided in an embodiment of the present disclosure includes a processor 501, a memory 502, and a bus 503. Among them, the memory 502 is used to store execution instructions, including a memory 5021 and an external memory 5022; the memory 5021 here is also called an internal memory, which is used to temporarily store the calculation data in the processor 501, as well as the data exchanged with the external memory 5022 such as a hard disk. The processor 501 exchanges data with the external memory 5022 through the memory 5021. When the computer device 500 is running, the processor 501 communicates with the memory 502 through the bus 503, so that the processor 501 executes the steps of the data processing method described in the above method embodiment.
[0182] In one possible implementation, the processor 501 executes the following instructions:
[0183] Receive the conversation request sent by the user end;
[0184] Performing transformation processing on the data to be processed contained in the dialogue request to generate a processed dialogue request, wherein the data to be processed is data with security requirements;
[0185] sending the processed dialogue request to a third-party server deployed with a language network model, and receiving initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request;
[0186] Based on the data to be processed in the dialogue request, the initial response data is adjusted to generate target response data, and the target response data is sent to the user terminal.
[0187] For the relevant instructions executed by the processor 501 in the computer device, reference may be made to the relevant description in the above method embodiment, which will not be described in detail here.
[0188] Embodiments of the present disclosure further provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, executes the steps of the data processing method described in the above method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0189] An embodiment of the present disclosure further provides a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the data processing method described in the above method embodiment. For details, please refer to the above method embodiment and will not be repeated here.
[0190] For example, the computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, 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 communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0193] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0194] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. 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.
[0195] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims
1. A data processing method, applied to a gateway system, wherein the gateway system is deployed in a trusted execution environment of a server, the method comprising: Receive a conversation request sent by the user end; Transforming the data to be processed contained in the dialogue request to generate a processed dialogue request, wherein the data to be processed is data with security requirements; Sending the processed dialogue request to a third-party server deployed with a language network model, and receiving initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request; Based on the data to be processed in the dialog request, the initial response data is adjusted to generate target response data, and the target response data is sent to the user terminal.
2. The method according to claim 1, wherein: The dialog request includes a data tag for indicating the data to be processed; the transforming process is performed on the data to be processed included in the dialog request to generate a processed dialog request, including: Determine the data type and transformation level of the to-be-processed data indicated by the data tag; Determining a target processing algorithm corresponding to the data to be processed based on the data type and the transformation level; The target processing algorithm is used to transform the data to be processed indicated by the data tag to generate a post-processing dialogue request.
3. The method according to claim 2, wherein: The determining the data type and transformation level of the to-be-processed data indicated by the data tag comprises: Based on the information table included in the dialog request, the data type and transformation level of the to-be-processed data indicated by the data tag are determined.
4. The method according to claim 2, wherein: The determining the data type and transformation level of the to-be-processed data indicated by the data tag comprises: Based on the tag type of the data tag included in the dialog request, the data type and transformation level of the to-be-processed data indicated by the data tag are determined.
5. The method according to any one of claims 2 to 4, wherein: The step of transforming the data to be processed indicated by the data tag using the target processing algorithm to generate a post-processing dialogue request includes: Using the target processing algorithm, transform the data to be processed to generate processed data corresponding to the data to be processed; A processed dialog request is generated based on other data in the dialog request except the to-be-processed data, the processed data, and preset instruction data for indicating that the data mark is retained.
6. The method according to claim 5, wherein: The initial response data packet contains the data tag, and the initial response data is adjusted based on the to-be-processed data in the dialogue request to generate the target response data, including: Determining processed data included in the initial response data based on the data tag included in the initial response data; The processed data in the initial response data is replaced with the corresponding data to be processed to generate target response data.
7. The method according to any one of claims 1 to 6, further comprising, after receiving the dialog request sent by the user terminal: Based on the user terminal identifier carried in the dialogue request, performing authority verification on the user terminal to obtain an authority verification result; The transforming the data to be processed contained in the dialogue request to generate a processed dialogue request includes: When the authority verification result indicates that the user terminal has the use authority, the data to be processed included in the dialogue request is transformed to generate a processed dialogue request.
8. The method according to any one of claims 1 to 6, before receiving the dialog request sent by the user terminal, further comprising: Receive the data to be verified sent by the user end; Generate target verification data based on the data to be verified and the trust root module included in the trusted execution environment; The target verification data is sent to the user terminal to verify the target verification data and generate a verification result indicating whether the gateway system is running in a trusted execution environment.
9. The method according to claim 8, wherein: The data to be verified is generated based on the initialization data generated by the user terminal and the first public key information contained in the gateway system; the method further includes: receiving the second public key information sent by the user terminal; The generating target verification data based on the data to be verified and the trust root module included in the trusted execution environment includes: Using the first private key information contained in the gateway system, the data to be verified is parsed to obtain the initialization data; Generate report data based on the initialization data and the second public key information; The report data is processed using a trust root module included in the trusted execution environment to generate target verification data.
10. The method according to claim 9, wherein: The conversation request is encrypted using a determined first session key, where the first session key is generated based on the first public key information and second private key information included in the user terminal; After receiving the dialog request sent by the user terminal, the method further includes: Generate a second session key based on the first private key information and the second public key information; The conversation request is parsed using the second session key to obtain a parsed conversation request, wherein the parsed conversation request includes the data to be processed.
11. A data processing device, applied to a gateway system, wherein the gateway system is deployed in a trusted execution environment of a server, the device comprising: A receiving module, configured to receive a conversation request sent by a user terminal; A processing module configured to transform the data to be processed contained in the dialogue request to generate a processed dialogue request, wherein the data to be processed is data with security requirements; a sending module configured to send the processed dialogue request to a third-party server on which a language network model is deployed, and receive initial response data returned by the third-party server, wherein the initial response data is generated by the third-party server using the language network model in response to the processed dialogue request; The generating module is configured to adjust the initial response data based on the data to be processed in the dialogue request, generate target response data, and send the target response data to the user terminal.
12. A computer device comprising: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the data processing method according to any one of claims 1 to 10 are performed.
13. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the steps of the data processing method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Intranet and extranet secure transmission control method and device, computer equipment and storage medium
CN110830246A
Information processing method, electronic equipment and information processing system
CN111191019A
Data desensitization method and device, electronic equipment and readable storage medium
CN113032821A
Time series data analysis system based on block chain and trusted execution environment
CN115248823A
Text processing method and device applied to artificial intelligence generated content and medium
CN116186771A
