Large language model reasoning method, device and equipment and readable storage medium

By constructing a target security knowledge base based on dynamic access security policies and encryption/decryption algorithms, and combining it with user trust calculation, the problem of low security in large language model reasoning is solved, achieving higher reasoning accuracy and security.

CN120893580APending Publication Date: 2025-11-04CCORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511075565.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing large language models suffer from low security during inference.

Method used

By analyzing the reasoning problem, the target reasoning scenario is determined, and a target security knowledge base is built based on dynamic access security policies and encryption/decryption algorithms. The credibility is calculated in real time based on the current user's historical operation records, thereby filtering and decrypting the reasoning dataset and using a large language model for reasoning.

Benefits of technology

It improves the security and accuracy of large language model inference, ensures the detail and credibility of the inference dataset, and prevents the leakage of privacy information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120893580A_ABST
    Figure CN120893580A_ABST
Patent Text Reader

Abstract

The invention discloses a large language model reasoning method, device and equipment and a readable storage medium, and is applied to the technical field of computers, and the method comprises the steps: analyzing a to-be-reasoned problem, and determining a target reasoning scene; determining a target safety knowledge base based on the target reasoning scene; the target security knowledge base is a knowledge base for controlling data based on a dynamic access security policy and an encryption and decryption algorithm; calculating the credibility of the current user in real time based on the historical operation record of the current user, screening encrypted data from the target security knowledge base based on the credibility and a dynamic access security policy, and decrypting the encrypted data based on an encryption and decryption algorithm to obtain a reasoning data set; and based on the reasoning data set and according to the to-be-reasoned problem, reasoning is performed by using the large language model to obtain a reasoning result. According to the method, the target safety knowledge base is set, the safe reasoning data set in the target safety knowledge base is dynamically accessed based on the credibility of the user, reasoning is performed based on the reasoning data set, and the reasoning safety is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer technology, and particularly relates to a large language model reasoning method and device, equipment and a readable storage medium. BACKGROUND

[0002] Large language models (LLM) are widely used in intelligent question answering, professional decision support and other fields. However, there are certain security issues in using knowledge bases when using large language models for reasoning. Therefore, how to improve the security of large language model reasoning is a technical problem that needs to be solved by those skilled in the art. SUMMARY

[0003] Therefore, the purpose of the present application is to provide a large language model reasoning method, device, equipment and readable storage medium, which solves the technical problem of low reasoning security in the prior art.

[0004] To solve the above technical problems, the present application provides a large language model reasoning method, comprising: analyzing a to-be-reasoned question to determine a target reasoning scenario; determining a target security knowledge base based on the target reasoning scenario; wherein the target security knowledge base is a knowledge base that controls data based on a dynamic access security policy and encryption and decryption algorithms; real-time computing the credibility of a current user based on the historical operation records of the current user, screening encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and decrypting the encrypted data based on the encryption and decryption algorithms to obtain a reasoning data set; using the large language model to reason based on the reasoning data set and the to-be-reasoned question to obtain a reasoning result.

[0005] Optionally, before determining the target security knowledge base based on the target reasoning scenario, the method further comprises: encrypting data in the knowledge base by a hardware security acceleration device based on a bus protocol to obtain a security knowledge base; binding the security knowledge base with a software and hardware environment, setting the access permission of the security knowledge base after binding the software and hardware environment, and obtaining the target security knowledge base; so that the target security knowledge base can be directly used on a system with the same software and hardware environment.

[0006] Optionally, the target security knowledge base comprises a public knowledge base and a private knowledge base; data in the public knowledge base is stored in a server local disk, and data in the private knowledge base is stored in a removable storage device held by a user.

[0007] Optionally, the trustworthiness of the current user is calculated in real time based on historical operation records of the current user, encrypted data is screened from the target security knowledge base based on the trustworthiness and the dynamic access security policy, and the encrypted data is decrypted based on the encryption and decryption algorithm to obtain a reasoning data set, including: determining a compliant access frequency, an unauthorized operation number, a high-sensitivity data contact event, and an access time distribution based on historical operation records of the current user; the compliant access frequency is the number of times that the user accesses the knowledge base within a unit time and is not marked as abnormal; the unauthorized operation number is the number of times that access to data beyond the preset permission is performed; and the high-sensitivity data contact event is the number of events of accessing data with a sensitivity level exceeding a set sensitivity level; predicting the trustworthiness of the current user based on the compliant access frequency, the unauthorized operation number, the high-sensitivity data contact event, and the access time distribution using a risk prediction model.

[0008] Optionally, the trustworthiness of the current user is calculated in real time based on historical operation records of the current user, encrypted data is screened from the target security knowledge base based on the trustworthiness and the dynamic access security policy, and the encrypted data is decrypted based on the encryption and decryption algorithm to obtain a reasoning data set, including: determining a time at which the user accesses the target security knowledge base; determining to prohibit access to the target security knowledge base when the time is greater than a set timeout time; the set timeout time is determined in real time based on the risk of the real-time running environment when accessing the target security knowledge base.

[0009] Optionally, the trustworthiness of the current user is calculated in real time based on historical operation records of the current user, encrypted data is screened from the target security knowledge base based on the trustworthiness and the dynamic access security policy, and the encrypted data is decrypted based on the encryption and decryption algorithm to obtain a reasoning data set, including: decrypting the encrypted data based on the encryption and decryption algorithm to obtain decrypted data; determining a security level corresponding to the trustworthiness; each security level corresponds to different accessible data; the security level includes a first security level, a second security level, and a third security level, the first security level is full-field access, the second security level is target sensitive field hiding, and the third security level is only accessible to public fields; selectively accessing the decrypted data based on the security level of the trustworthiness to obtain the reasoning data set.

[0010] Optionally, the to-be-reasoned question is analyzed to determine a target reasoning scenario, including: The to-be-reasoned question is analyzed, and it is determined that the target reasoning scene is a target medical scene.

[0011] The embodiment of the application further provides a large language model reasoning device, comprising: A target reasoning scene determination module is configured to analyze a to-be-reasoned question and determine a target reasoning scene. A target security knowledge base determination module is configured to determine a target security knowledge base based on the target reasoning scene, wherein the target security knowledge base is a knowledge base for controlling data based on a dynamic access security policy and encryption and decryption algorithms. A reasoning data set screening module is configured to calculate the credibility of a current user in real time based on historical operation records of the current user, screen encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and decrypt the encrypted data based on the encryption and decryption algorithms to obtain a reasoning data set. A reasoning module is configured to use the large language model to reason based on the reasoning data set and the to-be-reasoned question to obtain a reasoning result.

[0012] The embodiment of the application further provides a large language model reasoning device, comprising: A memory is configured to store a computer program. A processor is configured to execute the computer program to implement the steps of the large language model reasoning method.

[0013] The embodiment of the application further provides a readable storage medium (computer readable storage medium), wherein the readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the large language model reasoning method.

[0014] The embodiment of the application further provides a computer program product, comprising computer programs / instructions, which are executed by a processor to implement the steps of the large language model reasoning method.

[0015] It can be seen that the application determines the target reasoning scene by analyzing the problem to be reasoned, determines the target security knowledge base based on the target reasoning scene, wherein the target security knowledge base is a knowledge base for controlling data based on dynamic access security policy and encryption and decryption algorithm, calculates the credibility of the current user in real time based on the historical operation records of the current user, screens encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and decrypts the encrypted data based on the encryption and decryption algorithm to obtain a reasoning data set; and the reasoning result is obtained by reasoning based on the reasoning data set and the problem to be reasoned using a large language model. Compared with the current user who can arbitrarily obtain data in the knowledge base for reasoning, the application sets the target security knowledge base to obtain the reasoning data set from the target security knowledge base based on the credibility of the user for reasoning, and since the reasoning data set is more detailed information required for the current reasoning, the accuracy of reasoning can be improved, and since the reasoning data set is obtained from the security knowledge base based on the credibility, the security of reasoning can be improved.

[0016] In addition, the application also provides a large language model reasoning device, equipment and readable storage medium, which also have the above beneficial effects. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute the embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.

[0018] Figure 1 A flowchart of a large language model reasoning method provided by an embodiment of the application; Figure 2 A schematic diagram of generating a key through an interface provided by an embodiment of the application; Figure 3 A key usage schematic diagram provided by an embodiment of the application; Figure 4 A flowchart of public knowledge base access provided by an embodiment of the application; Figure 5 A flowchart of private knowledge base access provided by an embodiment of the application; Figure 6 A flowchart of public knowledge base unbinding software and hardware environment provided by an embodiment of the application; Figure 7 A schematic diagram of a permission management knowledge base provided by an embodiment of the application; Figure 8A structural schematic diagram of a large language model reasoning device provided by an embodiment of the present application; Figure 9 A structural schematic diagram of a large language model reasoning device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0019] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0020] Please refer to Figure 1 , Figure 1 A flowchart of a large language model reasoning method provided by an embodiment of the present application. The method can include: S101, analyzing a to-be-reasoned question to determine a target reasoning scenario.

[0021] The execution subject of this embodiment can be an electronic device. The electronic device can be a server, a portable terminal or other forms, and the electronic device has a memory bank, and the specific number is not limited. This embodiment does not limit the specific to-be-reasoned question. For example, the to-be-reasoned question of this embodiment is to generate a related suggestion report based on the past medical records of a patient in department B of hospital A; or the to-be-reasoned question in this embodiment can also be to analyze the detection results and medication scheme of patient A's XXX disease. This embodiment does not limit the specific target reasoning scenario. For example, the target scenario of this embodiment can be the scenario of disease C in department B of hospital A, that is, the target medical scenario; or the target scenario of this embodiment can be the scenario of personal information of computer A; or the target scenario of this embodiment can be a credit investigation scenario.

[0022] S102, determining a target security knowledge base based on the target reasoning scenario; wherein the target security knowledge base is a knowledge base for controlling data based on dynamic access security policies and encryption and decryption algorithms.

[0023] The embodiment determines a target safety knowledge base based on a target reasoning scenario, that is, determines a specific target safety knowledge base to be used for reasoning based on the target reasoning scenario. For example, if the target reasoning scenario is hospital A, the target safety knowledge base can be the safety knowledge base of hospital A; or if the target reasoning scenario is a user, the target safety knowledge base can be the safety knowledge base corresponding to the current user. The dynamic access security policy in this embodiment is a dynamic access security policy set for the target safety knowledge base, only users meeting the current security policy can access the target safety knowledge base. The embodiment does not limit the specific dynamic access security policy, for example, the dynamic access security policy in the embodiment can be the access permission of the access personnel in different time periods, or the dynamic access security policy in the embodiment can be to determine the access permission based on the access event of the current embodiment, for example, intern Li tries to view the report with his own account during surgery, and the recognition of Li's credibility T=65 (new account without history), the minimum threshold T=60 of the emergency scenario → access is allowed. The encryption and decryption method in the embodiment is not limited, for example, the encryption and decryption method in the embodiment can be a national encryption algorithm; or the encryption and decryption method in the embodiment can be a more secure quantum-resistant password algorithm. The target safety knowledge base in the embodiment can be a private knowledge base, which is stored in the secure storage area of the personal removable storage device, and the secure storage area is constructed by using an encryption chip based on a national encryption algorithm; identity authentication is required to access the secure storage area, and the identity authentication integrates biometric recognition (fingerprint / palm print) and password dual authentication. The private knowledge base stored on the removable storage device can be used on a PC or mobile device installed with the same management system software, which is convenient for users to access their own private knowledge base on different devices at different locations. The private knowledge base is stored in an encrypted manner on the removable device, and direct brute force reading can only obtain encrypted data. The secure storage area is invisible to unauthorized users and can only be accessed by authorized users through a specific API interface, and is transparent to users. Therefore, even if the mobile device is obtained by others, multiple protection measures ensure that the private knowledge base data is not leaked. Of course, the secure storage area can also be an encrypted area, which cannot be accessed by the system without login, and the system can access it only after login. It can be understood that the process of implementing the dynamic access security policy can include: receiving real-time credibility (based on whether the login mode is abnormal, whether the operation frequency is far beyond the historical average, whether it is accessed at non-working hours, whether it tries to perform operations beyond its regular permissions or current task scope, whether the geographic location / IP frequently or abnormally changes) and situation information (for example, whether the system is currently under attack, whether a specific area or data type is marked as high risk, whether the overall security threat level (such as from internal intelligence or external threat sources) is elevated), combined with pre-defined policy rules, dynamically calculate the access permission level of the user to the specific target data at this moment.Policy rules define access rights for different trustworthiness / posture combinations, and real-time decisions are made on which data can be decrypted (and even how, such as full data or sanitized version). The permissions are dynamically adjusted as the user's trustworthiness and system posture change.

[0024] It should be further explained that, in order to improve the accuracy of the target security knowledge base, before determining the target security knowledge base based on the target reasoning scenario, the following steps can be further included: In S1021, the hardware security acceleration device based on the bus protocol encrypts the data in the knowledge base through an encryption algorithm to obtain a security knowledge base. In S1022, the security knowledge base is bound to the software and hardware environment, and the access permission of the security knowledge base after being bound to the software and hardware environment is set to obtain a target security knowledge base; so that the target security knowledge base can be directly used on a system with the same software and hardware environment.

[0025] The hardware security acceleration device based on the bus protocol in this embodiment is a high-speed PCIe encryption and decryption device. When the security knowledge base is a public knowledge base, the high-speed PCIe encryption and decryption module can be used to encrypt and decrypt the public knowledge base data. The public knowledge base data is stored in a local disk, and the encryption key is generated and stored using an encryption card. The encryption key can be authorized to be exported after authorization. The encryption key can be bound to the software and hardware environment, such as CPU ID (Central Processing Unit Unique Identifier), etc. The administrator permission is required to switch the binding of the software and hardware environment. Once the software and hardware environment is bound, even if the PCIe encryption card and the public knowledge base are copied to other devices, the correct encryption key cannot be calculated, so it is still not possible to use. When the software and hardware environment is not bound, the internal key of the high-speed PCIe encryption and decryption module can be used to decrypt the public knowledge base. When the public knowledge base needs to be migrated, the administrator can unbind the software and hardware environment and then migrate it. It can be understood that the hardware environment can refer to the unique serial number of the hardware, such as the serial number of the CPU, network card, etc. These are unique, and the purpose is to prevent the hard disk storing the public knowledge base from being used on other devices (such as replacing the PCIe card and hard disk together to another computer, which is also a means to prevent data from being copied). If it is used on other devices, it must be unbound and migrated. The embodiment can improve the efficiency of encryption and decryption by using the hardware security acceleration device based on the bus protocol for encryption and decryption. By binding the security knowledge base to the software and hardware environment, the target security knowledge base can be directly migrated to a system with the same software and hardware environment for use.

[0026] It needs to be further explained that the above target security knowledge base includes a public knowledge base and a private knowledge base; the data in the public knowledge base is stored in the local disk of the server, and the dynamic access security policy for accessing the public knowledge base is set by the setting management user, and the data in the private knowledge base is stored in the removable storage device held by the user, and the dynamic access security policy for accessing the private knowledge base is set by the user personally. The deployment process of the public knowledge base in this embodiment can include: registering an administrator, linking a PCIe encryption card. The administrator logs in, creates a public knowledge base, and optionally binds the public knowledge base with a software and hardware environment, generates a key through an API (such as Figure 2 , Figure 2 A schematic diagram for generating a key through an interface provided by an embodiment of the present application can include: generating a random parameter, calculating a software and hardware environment variable, and generating a random encryption key, splicing a random number R and a software and hardware environment variable hash Z, calculating a composite hash, encrypting an original key K, storing R and the encapsulated key EK (in ciphertext form) in different storage sectors, and storing them to a PCIe card, importing public knowledge base data, encrypting and storing to a local disk through an API, and completing the creation of the public knowledge base. Set the timeout access time of the public knowledge base, and if it is not set, use the default setting, for example, 5 minutes. The ordinary user logs in the system (username / password), and the system automatically calculates the key through the API (R||Z||K) Figure 3 A key usage schematic diagram provided by an embodiment of the present application includes: obtaining the stored R and EK, determining the current software and hardware environment variable Z, splicing R and Z; performing hash operation on the spliced value to generate a temporary decryption key; decrypting EK with the key to obtain the original key K), obtaining public knowledge data, and being transparent to the user. The user can select the public knowledge base for push answer. When the set timeout time is exceeded without using the public knowledge base, automatic logout and cache cleaning are performed. The process of deploying the private knowledge base can include: registering a user (in the form of username / password), and accessing the public knowledge base; logging in the just registered user, and binding a removable storage, that is, simultaneously using the identity recognition of the removable storage to log in the management system to create a private knowledge base, create an encryption key, import private data, and the management system automatically completes the encryption when storing the private knowledge base data to the secure area of the removable storage using the API, and the user is transparent. Set the timeout access time of the private knowledge base, and if it is not set, use the default setting, for example, 5 minutes. Log in the management system using the removable storage (biological recognition / password), the management system obtains the private knowledge base data on the removable storage device through the API, and displays it to the user, which is transparent to the user, and the user can select the private knowledge base for push answer. Please refer to Figure 4 , Figure 4 A flowchart of public knowledge base access provided by an embodiment of the present application can include: first, identity authentication of an administrator, then calculating an encryption key based on a software and hardware environment, and finally decrypting the encrypted public knowledge base through the key. Please refer toFigure 5 , Figure 5 A flow chart of private knowledge base access provided by the embodiment of the present application, comprising: identity authentication, obtaining random number and device serial number, calculating key based on random number and device serial number, and using the key to encrypt and decrypt private knowledge base data.

[0027] It needs to be further explained that the private knowledge base can be cross-used on different devices. For example, the user deploys the private knowledge base on the A device through the embodiment 2; 2, the user directly uses the deployed private knowledge base on the B device, provided that the B device is installed with the same management system as the A device and is bound with the same large language model. 3, the user can directly add new private knowledge data to the private knowledge base after login, which can be directly used on other devices without being limited by the use device. 7, when the private knowledge base is not used for more than a set timeout, the system automatically logs out and cleans up the cache.

[0028] It needs to be further explained that the public knowledge base can be migrated, 1, if the public knowledge base is not bound with the system running environment, the PCIe card and the encrypted public knowledge base can be migrated to other devices as a whole, and then the public knowledge base can be added through the management system. 2, if the public knowledge base is bound with the system running environment, the software and hardware environment needs to be first unbound (process Figure 6 , Figure 6 The flow chart of unbinding the software and hardware environment of the public knowledge base provided by the embodiment of the present application can comprise: obtaining the current environment variable Z, taking out the previously bound storage R and EK (these are the storage in the bound state) from the storage. The original key K is solved using the bound method. A new random number R is generated. K is re-encapsulated using the new random number, the binding with the original software and hardware environment is released, the latest random number R and the key EK are updated, and then the PCIe card and the encrypted public knowledge base are migrated to other devices as a whole, and then the public knowledge base can be added through the management system. If it is not migration but copy, then the key in the PCIe card needs to be migrated to another PCIe card using additional means (not in the scope of the present application), and then the PCIe card and the encrypted public knowledge base are migrated to other devices, and then the public knowledge base can be added through the management system. It needs to be explained that when the target security knowledge base comprises the public knowledge base and the private knowledge base, the management system permission is layered, including the administrator and the ordinary user. The administrator deploys the system, binds the large language model, creates / maintains the public knowledge base, and migrates the public knowledge base. The ordinary user creates and maintains his own private knowledge base, can use the public knowledge base, can increase the public knowledge base data, and cannot delete the public knowledge base data. The corresponding framework is shown in Figure 7 , Figure 7 The schematic diagram of the knowledge base based on permission management provided by the embodiment of the present application.

[0029] S103, real-time calculation of the credibility of the current user based on the historical operation record of the current user, screening of encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and decryption of the encrypted data based on the encryption and decryption algorithm to obtain the reasoning data set.

[0030] The historical operation record of the user in this embodiment refers to the operation record of the user on the current device, from which the credibility of the user and whether there is an access risk can be determined. The historical operation record of the user in this embodiment can include an operation type, a timestamp corresponding to the operation type, a risk level of the operation, and an access time period corresponding to the timestamp. The real-time calculation of the credibility of the current user based on the historical operation record of the current user in this embodiment refers to that the credibility of the current user when accessing the target security knowledge base can be determined based on the historical operation record of the user, so that the credibility can be determined, and the data in the target security knowledge base that can be accessed can be determined. The reasoning data set in this embodiment is a data set that can realize accurate reasoning, for example, the reasoning data set is all medical record information of patient A, or the reasoning data set is the credit investigation and property situation of loan personnel B.

[0031] It needs to be further explained that based on any of the above embodiments, in order to improve the accuracy of credibility determination, the real-time calculation of the credibility of the current user based on the historical operation record of the current user, the screening of encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and the decryption of the encrypted data based on the encryption and decryption algorithm to obtain the reasoning data set can include: S1031, determining a compliant access frequency, an unauthorized operation number, a high-sensitive data contact event, and an access time distribution based on the historical operation record of the current user; the compliant access frequency is the number of times that the user accesses the knowledge base within a unit time and is not marked as abnormal; the unauthorized operation number is the number of times that access to data beyond the preset permission is performed; the high-sensitive data contact event is the number of events of accessing data with a sensitivity level exceeding a set sensitivity level; S1032, predicting the credibility of the current user based on the compliant access frequency, the unauthorized operation number, the high-sensitive data contact event, and the access time distribution using a risk prediction model.

[0032] The access time distribution in this embodiment refers to what time period the access time period is generally in, and the risk time period corresponding to the user each day can be accessed, for example, the working hours of the current user are 8-12, and when the company's system is accessed outside this time period, it can be determined that there is an access risk, that is, the access proportion of the non-safe time period is calculated. This embodiment can set weights for each parameter (compliant access frequency, unauthorized operation number, high-sensitive data contact event, and access time distribution) according to actual needs, so as to determine the credibility. This embodiment improves the accuracy of credibility determination by giving a specific credibility calculation method.

[0033] It needs to be further explained that, in order to further improve the security of accessing the target security knowledge base, the credibility of the current user is calculated in real time based on the historical operation records of the current user, the encrypted data is screened from the target security knowledge base based on the credibility and the dynamic access security policy, and the encrypted data is decrypted based on the encryption and decryption algorithm to obtain the reasoning data set, including: determining the time of the user accessing the target security knowledge base; when the time is greater than the set timeout time, it is determined that the target security knowledge base is prohibited from being accessed; the timeout time is determined in real time based on the risk of the real-time running environment when accessing the target security knowledge base. This embodiment can reduce the timeout time when the risk of the running environment being attacked is high, and the timeout time can be longer when the risk of the running environment being attacked is low. This embodiment limits the access time during the process of accessing the target security knowledge base, further improving the security of accessing the target security knowledge base.

[0034] It needs to be further explained that, in order to improve the security of obtaining the reasoning data set, the above-mentioned real-time calculation of the credibility of the current user based on the historical operation records of the current user, the screening of the encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and the decryption of the encrypted data based on the encryption and decryption algorithm to obtain the reasoning data set can include: decrypting the encrypted data based on the encryption and decryption algorithm to obtain decrypted data; determining the security level corresponding to the credibility; wherein each security level corresponds to different accessible data; wherein the security level includes a first security level, a second security level and a third security level, the first security level is full-field access, the second security level is target sensitive field hiding, and the third security level is only accessible to public fields; based on the security level of the credibility, the decrypted data is selectively accessed to obtain the reasoning data set. In this embodiment, after obtaining the corresponding encrypted data based on the credibility, the security level corresponding to the credibility is determined, thereby limiting the access range of the decrypted data, thereby preventing the private information in the reasoning data set from being leaked, and improving the security of obtaining the reasoning data set.

[0035] S104, based on the reasoning data set, using a large language model to reason according to the to-be-reasoned question, obtaining a reasoning result.

[0036] This embodiment is not limited to a specific large language model, as long as the large language model can be used for reasoning to obtain a reasoning result. The large language model can be a large language model bound to the current electronic device, and the large language model is a model pre-trained based on the current target reasoning scene.

[0037] The large language model reasoning method provided by the embodiment of the application can comprise: S101, analyzing a to-be-reasoned question, and determining a target reasoning scenario; S102, determining a target security knowledge base based on the target reasoning scenario; wherein the target security knowledge base is a knowledge base for controlling data based on a dynamic access security policy and encryption and decryption algorithms; S103, calculating the credibility of a current user in real time based on historical operation records of the current user, screening encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and decrypting the encrypted data based on the encryption and decryption algorithms to obtain a reasoning data set; and S104, reasoning based on the reasoning data set and the to-be-reasoned question by using a large language model to obtain a reasoning result. The embodiment of the application has the beneficial effect that, compared with the current user who can arbitrarily obtain data in the knowledge base for reasoning, the application sets the target security knowledge base, thereby obtaining the reasoning data set from the target security knowledge base based on the credibility of the user for reasoning. Since the reasoning data set is more detailed information required for the current reasoning, the accuracy of reasoning can be improved, and since the reasoning data set is obtained from the security knowledge base based on the credibility, the security of reasoning can be improved.

[0038] The large language model reasoning device provided by the embodiment of the application will be introduced below, and the large language model reasoning device described below can be correspondingly referred to the large language model reasoning method described above.

[0039] For details, please refer to Figure 8 , Figure 8 The structural schematic diagram of the large language model reasoning device provided by the embodiment of the application can comprise: A target reasoning scenario determination module 100 is configured to analyze a to-be-reasoned question, and determine a target reasoning scenario. A target security knowledge base determination module 200 is configured to determine a target security knowledge base based on the target reasoning scenario; wherein the target security knowledge base is a knowledge base for controlling data based on a dynamic access security policy and encryption and decryption algorithms. A reasoning data set screening module 300 is configured to calculate the credibility of a current user in real time based on historical operation records of the current user, screen encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and decrypt the encrypted data based on the encryption and decryption algorithms to obtain a reasoning data set. A reasoning module 400 is configured to reason based on the reasoning data set and the to-be-reasoned question by using a large language model to obtain a reasoning result.

[0040] It should be further noted that the large language model reasoning device described above can further comprise: A security knowledge base construction module is configured to encrypt data in the knowledge base by using the encryption algorithm to obtain a secure knowledge base. A target security knowledge base deployment module is configured to bind the secure knowledge base with a software and hardware environment, set an access permission of the secure knowledge base after the binding, and obtain the target security knowledge base, so that the target security knowledge base can be directly used on a system with the same software and hardware environment.

[0041] Further, based on any of the above embodiments, the target security knowledge base includes a public knowledge base and a private knowledge base; data in the public knowledge base is stored in a local disk of a server, and data in the private knowledge base is stored in a removable storage device held by a user.

[0042] Further, based on any of the above embodiments, the reasoning data set screening module 300 can include an operation parameter determination unit configured to determine a compliant access frequency, an unauthorized operation number, a high-sensitivity data contact event, and an access time distribution based on historical operation records of a current user; the compliant access frequency is a number of times that the user accesses the knowledge base within a unit time and is not marked as abnormal; the unauthorized operation number is a number of times that the user accesses data beyond the preset permission; and the high-sensitivity data contact event is a number of events that the user accesses data with a sensitivity level exceeding a set sensitivity level. A credibility determination unit is configured to predict a credibility of the current user by using a risk prediction model based on the compliant access frequency, the unauthorized operation number, the high-sensitivity data contact event, and the access time distribution.

[0043] Further, based on any of the above embodiments, the reasoning data set screening module 300 can include: An access time determination unit is configured to determine a time at which the user accesses the target security knowledge base. A prohibited access unit is configured to determine to prohibit the user from accessing the target security knowledge base when the time is greater than a set timeout time; the set timeout time is determined in real time based on a risk of a real-time running environment when the user accesses the target security knowledge base.

[0044] Further, based on any of the above embodiments, the reasoning data set screening module 300 can include: A decryption unit is configured to decrypt the encrypted data based on the encryption and decryption algorithm to obtain decrypted data. A security level determination unit is configured to determine a security level corresponding to the trustworthiness, wherein each security level corresponds to different accessible data, and wherein the security levels include a first security level, a second security level, and a third security level, the first security level is full-field access, the second security level is target sensitive field hiding, and the third security level is only accessible public field. A reasoning data set determination unit is configured to selectively access the decrypted data based on the security level of the trustworthiness to obtain the reasoning data set.

[0045] Further, based on any of the above embodiments, the target reasoning scenario determination module 100 can include: A target reasoning scenario determination unit is configured to analyze the to-be-reasoned question and determine that the target reasoning scenario is a target medical scenario.

[0046] It should be noted that the order of the modules and units in the large language model reasoning device described above can be changed without affecting the logic.

[0047] The large language model reasoning device provided by the embodiments of the present application can include: a target reasoning scenario determination module 100 configured to analyze a to-be-reasoned question and determine a target reasoning scenario; a target security knowledge base determination module 200 configured to determine a target security knowledge base based on the target reasoning scenario, wherein the target security knowledge base is a knowledge base for controlling data based on a dynamic access security policy and encryption and decryption algorithms; a reasoning data set screening module 300 configured to calculate a trustworthiness of a current user in real time based on historical operation records of the current user, screen encrypted data from the target security knowledge base based on the trustworthiness and the dynamic access security policy, and decrypt the encrypted data based on the encryption and decryption algorithms to obtain a reasoning data set; and a reasoning module 400 configured to reason based on the reasoning data set and the to-be-reasoned question using the large language model to obtain a reasoning result. The embodiments of the present application have the beneficial effects that, compared with the current user who can arbitrarily obtain data in the knowledge base for reasoning, the present application sets a target security knowledge base to obtain a reasoning data set from the target security knowledge base based on the trustworthiness of the user for reasoning. Since the reasoning data set is more detailed information required for the current reasoning, the accuracy of reasoning can be improved, and since the reasoning data set is obtained from the security knowledge base based on the trustworthiness, the security of reasoning can be improved.

[0048] A large language model reasoning device provided by the embodiments of the present application is described below, and the large language model reasoning device described below can be correspondingly referred to the large language model reasoning method described above.

[0049] Please refer to Figure 9 ,Figure 9 A structural schematic diagram of a large language model reasoning device provided in an embodiment of the present application can include: a memory 10 for storing a computer program; a processor 20 for executing the computer program to implement the large language model reasoning method described above.

[0050] The memory 10, the processor 20, and the communication interface 30 all complete communication with each other through a communication bus 40.

[0051] In an embodiment of the present application, the memory 10 stores one or more programs, which can include program codes including computer operation instructions. In an embodiment of the present application, the memory 10 can store programs for implementing the following functions: analyzing a problem to be reasoned to determine a target reasoning scenario; determining a target security knowledge base based on the target reasoning scenario; wherein the target security knowledge base is a knowledge base for controlling data based on a dynamic access security policy and encryption and decryption algorithms; calculating the trustworthiness of the current user in real time based on the historical operation records of the current user, filtering encrypted data from the target security knowledge base based on the trustworthiness and the dynamic access security policy, and decrypting the encrypted data based on the encryption and decryption algorithms to obtain a reasoning data set; performing reasoning based on the reasoning data set according to the problem to be reasoned, using a large language model to obtain a reasoning result.

[0052] In a possible implementation manner, the memory 10 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application program required by a function, etc.; and the data storage area can store data created in a use process.

[0053] In addition, the memory 10 can include a read-only memory and a random access memory, and provide instructions and data for the processor. A part of the memory can also include an NVRAM. The memory stores an operating system and operation instructions, executable modules or data structures, or subsets thereof, or an extended set thereof, wherein the operation instructions can include various operation instructions for implementing various operations. The operating system can include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0054] The processor 20 can be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device. The processor 20 can be a microprocessor or any conventional processor, etc. The processor 20 can call programs stored in the memory 10.

[0055] The communication interface 30 can be an interface of a communication module, used for connecting with other devices or systems.

[0056] Of course, it needs to be explained that, Figure 9 The structure shown does not constitute a limitation on the large language model inference device in the embodiments of the present application, and in actual applications, the large language model inference device can include more or fewer components than Figure 9 shown, or combine certain components.

[0057] The computer readable storage medium provided by the embodiments of the present application is introduced below, and the computer readable storage medium described below can be mutually corresponding with the large language model inference method described above.

[0058] The present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the large language model inference method described above.

[0059] The computer readable storage medium can include: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0060] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the related parts can be referred to the method part.

[0061] The skilled person can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly show the interchangeability of hardware and software, the composition and steps of each example have been described in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0062] Finally, it needs to be pointed out that, in this document, relationships such as first and second, and the like, are merely used to distinguish one entity or action from another, without necessarily requiring or implying any such actual relationship or order between such entities or actions. Also, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.

[0063] The above describes in detail a large language model reasoning method, device, equipment and readable storage medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples in this document. The above example description is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A reasoning method for large language models, characterized in that, include: Analyze the reasoning problem and determine the target reasoning scenario; A target security knowledge base is determined based on the target reasoning scenario; wherein, the target security knowledge base is a knowledge base that controls data based on dynamic access security policies and encryption / decryption algorithms; The credibility of the current user is calculated in real time based on the current user's historical operation records. Based on the credibility and the dynamic access security policy, encrypted data is filtered from the target security knowledge base, and the encrypted data is decrypted based on the encryption and decryption algorithm to obtain the inference dataset. Based on the inference dataset, the large language model is used to perform inference according to the question to be inferred, and the inference result is obtained.

2. The large language model reasoning method according to claim 1, characterized in that, Before determining the target security knowledge base based on the target reasoning scenario, the process also includes: A hardware security acceleration device based on a bus protocol encrypts data in a knowledge base using the encryption algorithm to obtain a secure knowledge base. The security knowledge base is bound to a software and hardware environment, and access permissions for the security knowledge base after binding to the software and hardware environment are set to obtain the target security knowledge base; so that the target security knowledge base can be used directly on systems with the same software and hardware environment.

3. The large language model reasoning method according to claim 2, characterized in that, The target security knowledge base includes a public knowledge base and a private knowledge base; the data in the public knowledge base is stored on the server's local disk, and the data in the private knowledge base is stored on a user-owned removable storage device.

4. The large language model reasoning method according to any one of claims 1 to 3, characterized in that, The credibility of the current user is calculated in real time based on the user's historical operation records. Based on this credibility and the dynamic access security policy, encrypted data is filtered from the target security knowledge base. The encrypted data is then decrypted using the encryption / decryption algorithm to obtain an inference dataset, including: Based on the current user's historical operation records, the following are determined: compliant access frequency, number of unauthorized operations, high-sensitivity data access events, and access time distribution. The compliant access frequency is the number of times a user accesses the knowledge base within a unit of time without being marked as abnormal. The number of unauthorized operations is the number of times a user attempts to access data beyond their preset permissions. The high-sensitivity data access events are the number of events in which a user accesses data with a sensitivity level exceeding a set sensitivity level. The credibility of the current user is predicted using a risk prediction model based on the frequency of compliant access, the number of unauthorized operations, the number of highly sensitive data access events, and the distribution of access time.

5. The large language model reasoning method according to claim 1, characterized in that, The credibility of the current user is calculated in real time based on the user's historical operation records. Based on this credibility and the dynamic access security policy, encrypted data is filtered from the target security knowledge base. The encrypted data is then decrypted using the encryption / decryption algorithm to obtain an inference dataset, including: Determine the time when the user accesses the target security knowledge base; If the time exceeds the set timeout period, access to the target security knowledge base is prohibited; the set timeout period is determined in real time based on the risk of the real-time operating environment when accessing the target security knowledge base.

6. The large language model reasoning method according to claim 1, characterized in that, The credibility of the current user is calculated in real time based on the user's historical operation records. Based on this credibility and the dynamic access security policy, encrypted data is filtered from the target security knowledge base. The encrypted data is then decrypted using the encryption / decryption algorithm to obtain an inference dataset, including: The encrypted data is decrypted based on the encryption / decryption algorithm to obtain decrypted data; Determine the security level corresponding to the trustworthiness; wherein, the accessible data corresponding to each security level is different; wherein, the security level includes a first security level, a second security level and a third security level, the first security level is full field access, the second security level is target sensitive field hiding, and the third security level is only accessible public fields; Based on the security level of the stated trustworthiness, the decrypted data is selectively accessed to obtain the inference dataset.

7. The large language model reasoning method according to claim 1, characterized in that, Analyze the reasoning problem to determine the target reasoning scenario, including: The problem to be reasoned is analyzed, and the target reasoning scenario is determined to be a target medical scenario.

8. A large language model reasoning device, characterized in that, include: The target reasoning scenario determination module is used to analyze the problem to be reasoned and determine the target reasoning scenario; The target security knowledge base determination module is used to determine the target security knowledge base based on the target reasoning scenario; wherein, the target security knowledge base is a knowledge base that controls data based on dynamic access security policies and encryption / decryption algorithms; The inference dataset filtering module is used to calculate the credibility of the current user in real time based on the current user's historical operation records, filter encrypted data from the target security knowledge base based on the credibility and the dynamic access security policy, and decrypt the encrypted data based on the encryption and decryption algorithm to obtain the inference dataset; The reasoning module is used to perform reasoning based on the reasoning dataset and the question to be reasoned, using the large language model to obtain the reasoning result.

9. A large language model reasoning device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the large language model reasoning method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the large language model reasoning method as described in any one of claims 1 to 7.