Equipment handle management method and device, equipment and storage medium

Through quantum random number generator and asymmetric encryption algorithm, combined with blockchain technology, the problem of malicious attacks and tampering in device handle management is solved, the security and reliability of handles are improved, and the transparency and tamper-proof of transmission process are enhanced. sex.

CN119203185APending Publication Date: 2024-12-27GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411260855.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing device handle management methods lack security guarantees for malicious programs interception and tampering during transmission, resulting in risk of system damage.

Method used

The quantum random number generator is used to generate unpredictable handles and encrypt the handles through an asymmetric encryption algorithm, which is stored in the blockchain to ensure that only programs holding the correct private key can access the handles. At the same time, the new and old handles are compared in the handle recycling list. Similarity, avoid reuse.

Benefits of technology

Improve the security and reliability of device handles, prevent malicious attacks and tampering, enhance the transparency and tamper-proofness of the handle transmission process, and reduce potential security risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203185A_ABST
    Figure CN119203185A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment handle management method and device, equipment and a storage medium. Through an abstraction layer of an operating system, when an access request of a program to a kernel object is received, the kernel object is searched according to the access request, a handle generation request is sent to a quantum random number generator, and a handle associated with the kernel object is obtained; acquiring a public key generated by the program through an asymmetric encryption algorithm, encrypting the handle through the public key, so that the program decrypts and acquires the encrypted handle through a private key generated by the asymmetric encryption algorithm; and when a handle use-up signal returned by the program is received, releasing the association between the handle and the kernel object, and adding the handle to a recovery list. According to the method and the device, the device handle can be prevented from being hostile attacked in the generation, transmission and recovery processes of the abstraction layer, so that the safety of the device handle is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of device handle management, and in particular to a device handle management method, apparatus, device and storage medium. Background Art

[0002] The current device handle management mainly stems from the demand and development of operating system kernel resource management. With the continuous advancement of computer technology and the increasing complexity of applications, the operating system needs to efficiently manage kernel resources to ensure that various programs can access and use these resources safely and stably.

[0003] In this context, the device handle management method came into being. It uses the abstraction layer to uniformly manage the kernel resources in the operating system and assigns a unique handle to the program to access and operate the kernel object. This method effectively isolates the direct interaction between the application and the kernel resources, and improves the security and stability of the system.

[0004] However, the prior art often fails to consider the risk of system damage caused by malicious programs intercepting and tampering with handle information when transmitting device handles through an abstract layer. Therefore, a device handle management method is urgently needed to improve the security of the handle transmission process. Summary of the invention

[0005] The present invention provides a device handle management method, apparatus, equipment and storage medium to solve the technical problem.

[0006] In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a device handle management method, comprising:

[0007] When receiving a request for access to a kernel object from a program, searching for the kernel object according to the access request, and sending a handle generation request to a quantum random number generator to obtain a handle associated with the kernel object;

[0008] Obtaining a public key generated by the program through an asymmetric encryption algorithm, and encrypting the handle through the public key, so that the program can decrypt and obtain the encrypted handle through a private key generated by the asymmetric encryption algorithm;

[0009] When a handle usage completion signal returned by the program is received, the association between the handle and the kernel object is released, and the handle is added to a recycling list.

[0010] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: utilizing the unpredictability and randomness of the quantum state, a handle composed of random numbers is generated through a quantum random generator, thereby improving the security and reliability of the handle, thereby preventing malicious attackers from obtaining the handle through guessing or cracking; at the same time, based on an asymmetric encryption algorithm, third-party participation is avoided, thereby improving the security of the handle transmission process; at the same time, the participants generate keys themselves and obtain the handle through the keys, thereby also improving the security of the handle acquisition process.

[0011] In an embodiment of the first aspect, the vector random number generator sends a handle generation request to obtain a handle associated with the kernel object, including:

[0012] Selecting a quantum system as a source through the quantum random number generator, and initializing the quantum system to a superposition state;

[0013] Based on the quantum superposition principle and quantum entanglement characteristics, the polarization of photons in the quantum system is measured by the quantum random number generator to obtain a measurement result;

[0014] The measurement result is used as the handle associated with the kernel object.

[0015] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: through a quantum random number generator, utilizing the superposition state and quantum entanglement characteristics of a quantum system, the polarization of photons is measured to obtain a handle with high randomness, thereby enhancing the unpredictability of the handle and thus improving the reliability of the device handle.

[0016] In an embodiment of the first aspect, after encrypting the handle, the method further comprises:

[0017] The encrypted handle is stored in a blockchain, so that the program obtains the encrypted handle by querying the blockchain.

[0018] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: the encrypted handle is stored in the blockchain, so that the program can obtain the encrypted handle by querying the blockchain, which increases the transparency and traceability of handle management and improves the tamper-proofness of the device handle.

[0019] In an embodiment of the first aspect, after the program obtains the encrypted handle by querying the blockchain, it further includes:

[0020] The encrypted handle is decrypted by a private key generated by the asymmetric encryption algorithm; the private key and the public key are generated simultaneously.

[0021] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: after the program obtains the encrypted handle by querying the blockchain, it uses the private key generated by the asymmetric encryption algorithm to decrypt it, ensuring that only the program with the correct private key can access the handle, thereby enhancing the security of device handle transmission.

[0022] In an embodiment of the first aspect, after the handle is added to the recycling list, the method further comprises:

[0023] When receiving the access request of the kernel object again, comparing the regenerated first handle with each second handle in the recycling list;

[0024] When there is no second handle whose similarity with the first handle is greater than a preset threshold, the first handle is returned.

[0025] Compared with the prior art, the embodiment of the present invention has the following beneficial effects: when a kernel object access request is received again, by comparing the newly generated handle with the handles in the recycling list, the reuse of highly similar handles is avoided, thereby reducing potential security risks.

[0026] In an embodiment of the first aspect, the method for calculating the similarity between the second handle and the first handle includes:

[0027] The first handle and the second handle are traversed in sequence at the same time. When the random numbers of the first handle and the second handle at the target traversal position are the same, the similarity is increased by one.

[0028] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: by traversing the handles and comparing the sameness of random numbers to determine the similarity between handles, the efficiency of the similarity verification process is improved, thereby improving the efficiency of handle generation.

[0029] In a second aspect, an embodiment of the present invention further provides a device handle management apparatus, comprising: a handle generation module, a handle encryption module and a handle recovery module;

[0030] The handle generation module is used to, when receiving an access request from a program to a kernel object, search for the kernel object according to the access request, and send a handle generation request to the quantum random number generator to obtain a handle associated with the kernel object;

[0031] The handle encryption module is used to obtain a public key generated by the program through an asymmetric encryption algorithm, and encrypt the handle through the public key, so that the program can decrypt and obtain the encrypted handle through a private key generated by the asymmetric encryption algorithm;

[0032] The handle recycling module is used to release the association between the handle and the kernel object and add the handle to a recycling list when receiving a handle usage completion signal returned by the program.

[0033] In an embodiment of the second aspect, the handle generation module includes: a quantum system initialization unit, a quantum state measurement unit, and a handle generation unit;

[0034] The quantum system initialization unit is used to select a quantum system as a source through the quantum random number generator and initialize the quantum system to a superposition state;

[0035] The quantum state measurement unit is used to measure the polarization of photons in the quantum system through the quantum random number generator based on the quantum superposition principle and quantum entanglement characteristics to obtain a measurement result;

[0036] The handle generation unit is used to use the measurement result as the handle associated with the kernel object.

[0037] In an embodiment of the second aspect, after the handle encryption module encrypts the handle, it further includes:

[0038] The encrypted handle is stored in a blockchain, so that the program obtains the encrypted handle by querying the blockchain.

[0039] In an embodiment of the second aspect, after the program obtains the encrypted handle by querying the blockchain, it further includes:

[0040] The encrypted handle is decrypted by a private key generated by the asymmetric encryption algorithm; the private key and the public key are generated simultaneously.

[0041] In an embodiment of the second aspect, after the handle recycling module adds the handle to the recycling list, it further includes:

[0042] When receiving the access request of the kernel object again, comparing the regenerated first handle with each second handle in the recycling list;

[0043] When there is no second handle whose similarity with the first handle is greater than a preset threshold, the first handle is returned.

[0044] In an embodiment of the second aspect, the method for calculating the similarity between the second handle and the first handle includes:

[0045] The first handle and the second handle are traversed in sequence at the same time. When the random numbers of the first handle and the second handle at the target traversal position are the same, the similarity is increased by one.

[0046] In a third aspect, the present invention further provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the above-mentioned device handle management method when executing the computer program.

[0047] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned device handle management method. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of a flow chart of an embodiment of a device handle management method provided by the present invention;

[0049] Figure 2 A schematic structural diagram of an embodiment of a device handle management apparatus provided by the present invention. DETAILED DESCRIPTION

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

[0051] Embodiment 1

[0052] Please refer to Figure 1 , a device handle management method provided by an embodiment of the present invention includes S101 to S103, specifically:

[0053] S101: When receiving a request for access to a kernel object from a program, searching for the kernel object according to the access request, and sending a handle generation request to a quantum random number generator to obtain a handle associated with the kernel object.

[0054] Further, the vector random number generator sends a handle generation request to obtain a handle associated with the kernel object, including:

[0055] Selecting a quantum system as a source through the quantum random number generator, and initializing the quantum system to a superposition state;

[0056] Based on the quantum superposition principle and quantum entanglement characteristics, the polarization of photons in the quantum system is measured by the quantum random number generator to obtain a measurement result;

[0057] The measurement result is used as the handle associated with the kernel object.

[0058] Preferably, during the handle generation process, the random number generated by the quantum random number generator can also be used as a key component of the device handle, combined with other information to generate a unique device handle, specifically:

[0059] Step 1: Select a quantum random number generator: The quantum random number generator is based on the principles of quantum mechanics and can generate random numbers;

[0060] Step 2: Initialize the quantum system: The quantum random number generator selects a quantum system as a source and initializes the quantum system to a superposition state (the superposition state makes its behavior unpredictable), where the quantum system is a superconducting quantum system with two states of single photon survival and death;

[0061] Step 3: Measure the quantum system: Based on the principle of quantum superposition and quantum entanglement, measure the polarization or spin of photons in the quantum system (due to the uncertainty of the quantum state, the measurement results will be random and cannot be predicted);

[0062] Step 4: Record the measurement results: Record the measurement results in binary form. The recorded data are random numbers;

[0063] Step 5: Generate Handle: Use these random numbers as the key component of the handle. These random numbers can be combined with other information (such as timestamp, device identifier, etc.) to generate a unique handle.

[0064] In order to illustrate the above process more vividly, the following example is used to illustrate:

[0065] Assume that a 128-bit quantum random number is randomly generated by a quantum random generator: 5F 4D CC 3B5A A765D6 1D 83 27DE B8 82CF 99 (expressed in hexadecimal here, and can also be expressed in binary, octal, etc.), the current timestamp is 1652534400, and the hexadecimal form of the device identifier is 00:1A:2B:3C:4D:5E. Then, the above three parts of information are concatenated to form a unique device handle: 1652534400_001A2B3C4D5E_5F4DCC3B5AA765D61D8327DEB882CF99.

[0066] It can be seen from the above preferred embodiments that the handle obtained by measuring the polarization of photons by using the superposition state and quantum entanglement characteristics of the quantum system through a quantum random number generator has a high randomness characteristic, which enhances the unpredictability of the handle and thus improves the reliability of the device handle.

[0067] S102: Obtain a public key generated by the program through an asymmetric encryption algorithm, and encrypt the handle through the public key, so that the program can decrypt and obtain the encrypted handle through a private key generated by the asymmetric encryption algorithm.

[0068] Furthermore, after encrypting the handle, the following steps are also included:

[0069] The encrypted handle is stored in a blockchain, so that the program obtains the encrypted handle by querying the blockchain.

[0070] Furthermore, after the program obtains the encrypted handle by querying the blockchain, it also includes:

[0071] The encrypted handle is decrypted by a private key generated by the asymmetric encryption algorithm; the private key and the public key are generated simultaneously.

[0072] Since blockchain technology is tamper-proof and decentralized, it can provide strong support for secure data transmission and verification. Therefore, when the handle is generated and ready to be returned to the requester, the device handle can be encrypted to increase its security (the encryption here is to record the device handle as transaction data on the blockchain to ensure the security of the data during transmission). Then, the encrypted handle is recorded as a transaction data on the blockchain. The above steps can be implemented in the following preferred implementations:

[0073] Step 1: The program selects an asymmetric encryption algorithm and generates a pair of keys (public key and private key) for encryption and decryption. The public key is used to encrypt data and the private key is used to decrypt data.

[0074] Step 2: The program transmits the public key to the abstraction layer, which uses the public key to encrypt the handle data (the encrypted data will become unreadable, and only the correct private key can decrypt and read the original data in the handle);

[0075] Step 3: The abstraction layer records the encrypted device handle as a transaction data on the blockchain;

[0076] Step 4: When the program needs to obtain a handle, it obtains the encrypted handle data by querying the blockchain, and decrypts the encrypted data using the private key to obtain the original handle data.

[0077] The above preferred embodiment stores the encrypted handle in the blockchain, so that the program can obtain the encrypted handle by querying the blockchain, which increases the transparency and traceability of handle management and improves the tamper-proofness of the device handle. At the same time, after the program obtains the encrypted handle by querying the blockchain, it uses the private key generated by the asymmetric encryption algorithm to decrypt it, ensuring that only the program with the correct private key can access the handle, thereby enhancing the security of device handle transmission.

[0078] S103: When a handle usage completion signal returned by the program is received, the handle is disassociated from the kernel object, and the handle is added to a recycling list.

[0079] Furthermore, after the handle is added to the recycling list, it also includes:

[0080] When receiving the access request of the kernel object again, comparing the regenerated first handle with each second handle in the recycling list;

[0081] When there is no second handle whose similarity with the first handle is greater than a preset threshold, the first handle is returned.

[0082] When a request to access a kernel object is received again, the newly generated handle is compared with the handles in the recycling list to avoid repeated use of handles with high similarity, thereby reducing potential security risks.

[0083] Furthermore, the method for calculating the similarity between the second handle and the first handle includes:

[0084] The first handle and the second handle are traversed in sequence at the same time. When the random numbers of the first handle and the second handle at the target traversal position are the same, the similarity is increased by one.

[0085] By traversing the handles and comparing the sameness of random numbers to determine the similarity between handles, the efficiency of the similarity verification process is improved, thereby improving the efficiency of handle generation.

[0086] Preferably, after the device handle is recycled, the system resources related to the device handle can be recycled to reduce resource waste and improve the overall system performance, specifically:

[0087] Step 1: Establish a perfect handle release mechanism. When the program finishes using the handle, it will trigger the handle release operation. The system monitors these release events, collects and manages the released handles and their associated resources (memory, CPU time slices, disk space, etc.);

[0088] Step 2: Next, the collected resources are efficiently integrated through the resource recycling and reuse algorithm. By analyzing the type, size, frequency of use and other characteristics of the resources, similar resources are classified and merged. This can not only reduce resource fragmentation and improve the efficiency of resource management, but also facilitate subsequent reuse operations.

[0089] Among them, the resource recycling and reuse algorithm is specifically as follows:

[0090] Step 2.1: When a resource (such as a memory block, file handle, network socket, etc.) is no longer in use, the system marks it as "pending for recycling";

[0091] Step 2.2: Clean up all data structures and references associated with the resource and disconnect the resource from the outside world;

[0092] Step 2.3: Collect key information such as resource type, size, and status to prepare for subsequent resource integration and reuse;

[0093] Step 2.4: Add the recycled resources to the system’s recycling list, waiting for further integration and reuse;

[0094] Step 2.5: Classify and group the recycled resources according to their types and characteristics;

[0095] Step 2.6: For adjacent resources of the same type, try to merge them to form a larger continuous resource block;

[0096] Step 2.7: Optimize resource layout according to system usage;

[0097] Step 2.8: When the system receives a new resource request, it first checks whether there are available recycling resources;

[0098] Step 2.9: Search for matching resources from the recycling list based on the resource type and size requested. If a matching resource is found, it is allocated to the requester and the relevant status information is updated;

[0099] Step 2.10: Monitor the status of the allocated recycled resources to ensure that they remain stable and reliable during use. If abnormal conditions (such as memory leaks, resource deadlocks, etc.) are found, take timely measures to intervene and repair;

[0100] Step 2.11: Record key information during resource recovery, integration, and reuse to facilitate subsequent performance analysis and optimization;

[0101] Step 2.12: Regularly clean up discarded resources that cannot be reused to free up space. Maintain the system, fix potential bugs and performance issues, and ensure system stability and reliability.

[0102] Among them, the resource layout can be optimized through the following methods:

[0103] Step 2.7.1: Clarify the goal of local resource optimization, such as improving resource utilization efficiency, reducing waste, improving system performance, or meeting specific business needs;

[0104] Step 2.7.2: Perform usage analysis on the classified and grouped resources to more intuitively understand the usage of resources, including analysis of resource usage frequency, usage duration, concurrent usage, etc.

[0105] Step 2.7.3: Based on the results of the resource usage analysis, identify the bottleneck resources (i.e., resources that often become performance bottlenecks) and redundant resources (i.e., resources that are over-allocated or idle for a long time) in the system.

[0106] Step 2.7.4: Re-allocate resources for bottleneck resources and redundant resources to obtain optimization strategies, and start implementing local resource optimization based on the optimization strategies; specifically, migrate resources from one location or system to another to better meet demand; ensure that the load of each part of the system is relatively balanced by adjusting the allocation and use of resources to avoid overloading or idleness of some parts; promote resource sharing between different systems or departments to improve resource utilization efficiency; introduce automated tools and processes to manage resources to reduce manual intervention and errors;

[0107] Step 2.7.5: After implementing local optimization, regularly monitor and evaluate resource usage and system performance, and adjust the optimization strategy in a timely manner based on the results of monitoring and evaluation to ensure that the resource optimization effect achieves the expected goal;

[0108] Step 2.7.6: Continuously adjust and optimize the use and management of resources, and continuously optimize local resources.

[0109] In summary, the device handle management method provided by the embodiment of the present invention has the following beneficial effects compared with the prior art: utilizing the unpredictability and randomness of the quantum state, a handle composed of random numbers is generated through a quantum random generator, thereby improving the security and reliability of the handle, thereby preventing malicious attackers from obtaining the handle through guessing or cracking means; at the same time, based on an asymmetric encryption algorithm, third-party participation is avoided, thereby improving the security of the handle transmission process; at the same time, the participants generate keys themselves and obtain handles through keys, thereby also improving the security of the handle acquisition process.

[0110] Embodiment 2

[0111] The embodiment of the present invention further provides a device handle management apparatus, comprising: a handle generation module 11, a handle encryption module 12 and a handle recovery module 13; wherein the handle generation module 11 comprises: a quantum system initialization unit 111, a quantum state measurement unit 112 and a handle generation unit 113;

[0112] Furthermore, the handle generation module 11 is used to, when receiving a request for access to a kernel object from a program, search for the kernel object according to the access request, and send a handle generation request to a quantum random number generator to obtain a handle associated with the kernel object; the handle encryption module 12 is used to obtain a public key generated by the program through an asymmetric encryption algorithm, and encrypt the handle through the public key, so that the program can decrypt and obtain the encrypted handle through a private key generated by the asymmetric encryption algorithm; the handle recovery module 13 is used to, when receiving a handle usage completion signal returned by the program, disassociate the handle from the kernel object and add the handle to a recovery list.

[0113] Furthermore, the quantum system initialization unit 111 is used to select a quantum system as a source through the quantum random number generator, and initialize the quantum system to a superposition state; the quantum state measurement unit 112 is used to measure the polarization of photons in the quantum system through the quantum random number generator based on the quantum superposition principle and quantum entanglement characteristics, and obtain a measurement result; the handle generation unit 113 is used to use the measurement result as the handle associated with the kernel object.

[0114] Furthermore, after the handle encryption module 12 encrypts the handle, it also includes: storing the encrypted handle in the blockchain, so that the program obtains the encrypted handle by querying the blockchain.

[0115] Furthermore, after the program obtains the encrypted handle by querying the blockchain, it also includes: decrypting the encrypted handle by using a private key generated by the asymmetric encryption algorithm; the private key and the public key are generated simultaneously.

[0116] Furthermore, after the handle recycling module 13 adds the handle to the recycling list, it also includes: when receiving an access request to the kernel object again, comparing the regenerated first handle with each second handle in the recycling list; when there is no second handle whose similarity with the first handle is greater than a preset threshold, returning the first handle.

[0117] Furthermore, the method for calculating the similarity between the second handle and the first handle includes: traversing the first handle and the second handle in sequence simultaneously, and when the random numbers of the first handle and the second handle at the target traversal position are the same, the similarity is increased by one.

[0118] In summary, compared with the prior art, a device handle management device provided by an embodiment of the present invention has the following beneficial effects: utilizing the unpredictability and randomness of the quantum state, a handle composed of random numbers is generated through a quantum random generator, thereby improving the security and reliability of the handle, thereby preventing malicious attackers from obtaining the handle through guessing or cracking means; at the same time, based on an asymmetric encryption algorithm, third-party participation is avoided, thereby improving the security of the handle transmission process; at the same time, the participants generate keys themselves and obtain handles through keys, thereby improving the security of the handle acquisition process.

[0119] Embodiment 3

[0120] Based on the above-mentioned embodiment of the device handle management method, another embodiment of the present invention provides a device handle management terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the device handle management method of any embodiment of the present invention is implemented.

[0121] Exemplarily, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the device handle management device.

[0122] The device handle management device may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The device handle management terminal device may include, but is not limited to, a processor and a memory.

[0123] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the device handle management device, and uses various interfaces and lines to connect various parts of the entire device handle management device. The memory may be used to store the computer program and / or module, and the processor implements various functions of the device handle management device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as a hard disk, an internal memory, a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0124] Embodiment 4

[0125] Based on the above-mentioned embodiment of the device handle management method, another embodiment of the present invention provides a storage medium, wherein the storage medium includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the device handle management method of any embodiment of the present invention.

[0126] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0127] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A device handle management method, characterized in that: include: When receiving a request for access to a kernel object from a program, searching for the kernel object according to the access request, and sending a handle generation request to a quantum random number generator to obtain a handle associated with the kernel object; Obtaining a public key generated by the program through an asymmetric encryption algorithm, and encrypting the handle through the public key, so that the program can decrypt and obtain the encrypted handle through a private key generated by the asymmetric encryption algorithm; When a handle usage completion signal returned by the program is received, the association between the handle and the kernel object is released, and the handle is added to a recycling list.

2. A device handle management method as claimed in claim 1, characterized in that: The vector random number generator sends a handle generation request to obtain a handle associated with the kernel object, including: Selecting a quantum system as a source through the quantum random number generator, and initializing the quantum system to a superposition state; Based on the quantum superposition principle and quantum entanglement characteristics, the polarization of photons in the quantum system is measured by the quantum random number generator to obtain a measurement result; The measurement result is used as the handle associated with the kernel object.

3. A device handle management method as claimed in claim 1, characterized in that: After encrypting the handle, it also includes: The encrypted handle is stored in a blockchain, so that the program obtains the encrypted handle by querying the blockchain.

4. A device handle management method as claimed in claim 3, characterized in that: After the program obtains the encrypted handle by querying the blockchain, it also includes: The encrypted handle is decrypted by a private key generated by the asymmetric encryption algorithm; the private key and the public key are generated simultaneously.

5. A device handle management method as claimed in claim 1, characterized in that: When the handle is added to the recycling list, it also includes: When receiving the access request of the kernel object again, comparing the regenerated first handle with each second handle in the recycling list; When there is no second handle whose similarity with the first handle is greater than a preset threshold, the first handle is returned.

6. A device handle management method as claimed in claim 5, characterized in that: The method for calculating the similarity between the second handle and the first handle includes: The first handle and the second handle are traversed in sequence at the same time. When the random numbers of the first handle and the second handle at the target traversal position are the same, the similarity is increased by one.

7. A device handle management device, characterized in that: include: Handle generation module, handle encryption module and handle recovery module; The handle generation module is used to, when receiving an access request from a program to a kernel object, search for the kernel object according to the access request, and send a handle generation request to the quantum random number generator to obtain a handle associated with the kernel object; The handle encryption module is used to obtain a public key generated by the program through an asymmetric encryption algorithm, and encrypt the handle through the public key, so that the program can decrypt and obtain the encrypted handle through a private key generated by the asymmetric encryption algorithm; The handle recycling module is used to release the association between the handle and the kernel object and add the handle to a recycling list when receiving a handle usage completion signal returned by the program.

8. A device handle management device as claimed in claim 7, characterized in that: The handle generation module includes: a quantum system initialization unit, a quantum state measurement unit and a handle generation unit; The quantum system initialization unit is used to select a quantum system as a source through the quantum random number generator and initialize the quantum system to a superposition state; The quantum state measurement unit is used to measure the polarization of photons in the quantum system through the quantum random number generator based on the quantum superposition principle and quantum entanglement characteristics to obtain a measurement result; The handle generation unit is used to use the measurement result as the handle associated with the kernel object.

9. A device handle management device as claimed in claim 7, characterized in that: After the handle encryption module encrypts the handle, it also includes: The encrypted handle is stored in a blockchain, so that the program obtains the encrypted handle by querying the blockchain.

10. A device handle management device as claimed in claim 9, characterized in that: After the program obtains the encrypted handle by querying the blockchain, it also includes: The encrypted handle is decrypted by a private key generated by the asymmetric encryption algorithm; the private key and the public key are generated simultaneously.

11. A device handle management device as claimed in claim 7, characterized in that: After the handle recycling module adds the handle to the recycling list, it also includes: When receiving the access request of the kernel object again, comparing the regenerated first handle with each second handle in the recycling list; When there is no second handle whose similarity with the first handle is greater than a preset threshold, the first handle is returned.

12. A device handle management device as claimed in claim 11, characterized in that: The method for calculating the similarity between the second handle and the first handle includes: The first handle and the second handle are traversed in sequence at the same time. When the random numbers of the first handle and the second handle at the target traversal position are the same, the similarity is increased by one.

13. A terminal device, characterized in that: It comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements a device handle management method as described in any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute a device handle management method as described in any one of claims 1 to 6.