Key pool scheduling method, device, edge gateway, Internet of Things system and medium
By introducing a cache queue in the edge gateway, the weight value and virtual time scale are dynamically adjusted according to the security level and delay requirements of IoT application requests, the blocking problem in quantum key distribution is solved, and the utilization rate of key pools is improved. Communication efficiency.
Patent Information
- Application Number
- CN202411007780.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-07-25
AI Technical Summary
In quantum encrypted communication, the generation rate of quantum keys is low and the usage rate is high, which leads to the easy blockage of the key transmission channel, affecting the communication efficiency of the Internet of Things system.
Introduce first-in-first-out cache queues in the edge gateway, dynamically adjust the weight value and virtual time scale of the cache queue according to the security level and delay requirements of IoT application requests, ensuring that each request obtains relatively fair distribution of quantum keys, avoiding Blockage and hunger caused by massive requests.
The utilization rate of keys in the key pool is improved, ensuring that each IoT application request obtains a relatively fair opportunity for quantum key distribution, avoiding blockage and hunger caused by massive requests, and improving communication efficiency.
Smart Images

Figure CN118540060B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum encryption communication, and more specifically, to a key pool scheduling method, a key pool scheduling device, an edge gateway, an Internet of Things system, and a computer-readable storage medium. Background Art
[0002] Quantum encryption communication has become a new secure communication method due to its non-clonable and indivisible physical properties, as well as the "one-time one-pad" encryption system. It has been widely used in the Internet of Things system and has become an important link in ensuring the security of IoT data transmission. Among them, quantum keys, as a scarce resource in the quantum key distribution (QKD) network, have a low generation rate and a high utilization rate, thus becoming a key bottleneck restricting quantum communication. The Internet of Things often deploys edge gateways on the edge access side and establishes a quantum key pool management module for storing and scheduling key resources. In related technologies, the edge gateway responds passively to key requests. When faced with a large number of IoT key requests, it is easy to cause blockage of the key transmission channel. Summary of the invention
[0003] The embodiments of the present invention provide a key pool scheduling method, a key pool scheduling device, an edge gateway, an Internet of Things system and a computer-readable storage medium.
[0004] An embodiment of the present invention provides a key pool scheduling method for an edge gateway, wherein the edge gateway includes a key pool, wherein the key pool is used to store quantum keys, and the edge gateway also includes one or more first-in-first-out cache queues, wherein the cache queue is used to cache Internet of Things application requests for requesting quantum keys, and the key pool scheduling method includes: when the number of Internet of Things application requests in the cache queue changes, determining a weight value of the cache queue according to an initial weight of the cache queue and the number of Internet of Things application requests in the cache queue, wherein the initial weight of the cache queue is used to characterize the security level and delay requirement of the Internet of Things application requests in the cache queue; determining a virtual time stamp of the cache queue according to the weight value of the cache queue, wherein the virtual time stamp of the cache queue is used to characterize the event occurrence time of the cache queue; when the Internet of Things application request arrives at the cache queue, determining a virtual departure time of the Internet of Things application request according to the virtual time stamp of the cache queue; and distributing quantum keys to Internet of Things application requests with the smallest virtual departure time in all the cache queues.
[0005] In this way, the virtual time scale of the cache queue is determined according to the security level, latency requirement and number of IoT application requests in the cache queue, and the virtual departure time of the IoT application requests is determined according to the virtual time scale. Therefore, quantum keys can be distributed to IoT application requests according to the virtual departure time, ensuring that each IoT application request has a relatively fair opportunity to obtain quantum key distribution, and improving the utilization rate of keys in the key pool, avoiding congestion and starvation caused by massive IoT application requests.
[0006] In one embodiment, the key pool scheduling method further includes: when an IoT application request is received, allocating it to a corresponding cache queue according to the security level and latency requirements of the IoT request.
[0007] In this way, when an IoT application request is received, it is assigned to the corresponding cache queue according to the security level and latency requirements of the IoT request. This step classifies different IoT application requests and ensures that IoT application requests can be properly processed according to their importance and urgency.
[0008] In one embodiment, determining the weight value of the cache queue according to the initial weight of the cache queue and the number of IoT application requests in the cache queue includes: determining the weight value of the cache queue according to the initial weight, the number of IoT application requests in the cache queue, and an upper limit of the weight of the cache queue.
[0009] In this way, the weight value of the cache queue is determined by the initial weight, the number of IoT application requests in the cache queue, and the upper limit of the weight of the cache queue. When the number of IoT application requests in the cache queue changes, the method will adjust the weight value of the queue accordingly according to the change in the number of IoT application requests. The weight value increases when the number of IoT application requests increases; the weight value decreases when the number of IoT application requests decreases. By determining the weight value of the cache queue according to the initial weight, the number of IoT application requests in the cache queue, and the upper limit of the weight of the cache queue, the weight of the cache queue is dynamically adjusted, so that the system can reasonably distribute quantum keys and avoid blocking and starvation caused by massive IoT application requests.
[0010] In one embodiment, determining the virtual time scale of the cache queue according to the weight value of the cache queue includes: determining the virtual time scale of the current event of the cache queue according to the virtual time scale of the previous event of the cache queue, the distribution rate of the quantum key of the cache queue, the time interval between the current event and the previous event, and the weight value of the cache queue.
[0011] In this way, the virtual time scale of the current event of the cache queue is determined by the virtual time scale of the previous event of the cache queue, the distribution rate of the quantum key, the time interval between the current event and the previous event, and the weight value of the cache queue. The virtual time scale of the current event of the cache queue is affected by the virtual time scale of the previous event of the cache queue, which ensures the continuity of events in the same queue, avoids a certain IoT application request from not getting the key for a long time, and ensures the relative fairness of quantum key distribution. Different weight values indicate different urgency of time. The virtual time scale of the current event of the cache queue is affected by the weight value of the cache queue, which ensures that the system reasonably distributes quantum keys.
[0012] In one embodiment, determining the virtual departure time of the Internet of Things application request according to the virtual time stamp of the cache queue includes: determining the virtual start time of the current Internet of Things application request according to the virtual time stamp of the cache queue and the virtual departure time of the previous Internet of Things application request of the cache queue; determining the virtual departure time of the current Internet of Things application request according to the virtual start time of the current Internet of Things application request, the quantum key length applied for by the current Internet of Things application request, and the scheduling bandwidth of the key distribution occupied by the cache queue.
[0013] In this way, the virtual start time of the current IoT application request is first determined based on the virtual time stamp of the cache queue and the virtual leave time of the previous IoT application request of the cache queue, which ensures the order in which the IoT application requests obtain quantum keys and ensures the relative fairness of quantum key distribution; then the virtual leave time of the current IoT application request is determined based on the virtual start time of the current IoT application request, the length of the quantum key applied for by the current IoT application request and the scheduling bandwidth of the key distribution occupied by the cache queue. This method can calculate the virtual leave time of each IoT application request by comprehensively considering multiple factors, thereby reasonably allocating quantum keys and avoiding the blocking and starvation caused by massive IoT application requests.
[0014] In one implementation, the scheduling bandwidth of key distribution occupied by the cache queue is determined according to the weight value of the cache queue.
[0015] In this way, the scheduling bandwidth of key distribution occupied by the cache queue is determined according to the weight value of the cache queue. Different cache queues have different weight values. The cache queue with a high weight value occupies a higher scheduling bandwidth of key distribution, and the speed of quantum key distribution is faster. This ensures the efficiency of quantum key distribution, improves the utilization rate of keys in the key pool, and avoids blocking and starvation caused by massive IoT application requests.
[0016] In one embodiment, the key pool scheduling method further includes: querying the remainder of the quantum key in the key pool; when the remainder is greater than a first preset remainder, requesting distribution of quantum keys for an Internet of Things application; and when the remainder is less than a second preset remainder, blocking all Internet of Things application requests and sending a key supplement signal to the quantum key distribution network.
[0017] In this way, the key pool scheduling method also includes querying the quantum key surplus in the key pool; when the surplus is greater than the first preset surplus, the quantum key is distributed for the IoT application request; when the surplus is less than the second preset surplus, all IoT application requests are blocked and a key supplement signal is sent to the quantum key distribution network. In this way, the number of quantum keys in the key pool can be kept at an appropriate value, avoiding the waste of quantum keys, improving the utilization rate of the keys in the key pool, and also improving the efficiency of IoT applications requesting to obtain quantum keys.
[0018] An embodiment of the present invention provides a key pool scheduling device, which is used for an edge gateway. The edge gateway includes a key pool, which is used to store quantum keys. The edge gateway also includes one or more first-in-first-out cache queues, which are used to cache Internet of Things application requests for requesting quantum keys. The key pool scheduling device includes: a first determination module, a second determination module, a third determination module and a distribution module. The first determination module is used to determine the weight value of the cache queue according to the initial weight of the cache queue and the number of Internet of Things application requests in the cache queue when the number of Internet of Things application requests in the cache queue changes, and the initial weight of the cache queue is used to characterize the security level and delay requirements of the Internet of Things application requests in the cache queue; the second determination module is used to determine the virtual time scale of the cache queue according to the weight value of the cache queue, and the virtual time scale of the cache queue is used to characterize the event occurrence time of the cache queue; the third determination module is used to determine the virtual departure time of the Internet of Things application request according to the virtual time scale of the cache queue when the Internet of Things application request arrives at the cache queue; and the distribution module is used to distribute quantum keys to the Internet of Things application requests with the smallest virtual departure time in all the cache queues.
[0019] An embodiment of the present invention provides an edge gateway, which includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the key pool scheduling method of any of the above embodiments are implemented.
[0020] In this way, the virtual time scale of the cache queue is determined according to the security level, latency requirement and number of IoT application requests in the cache queue, and the virtual departure time of the IoT application requests is determined according to the virtual time scale. Therefore, quantum keys can be distributed to IoT application requests according to the virtual departure time, ensuring that each IoT application request has a relatively fair opportunity to obtain quantum key distribution, and improving the utilization rate of keys in the key pool, avoiding congestion and starvation caused by massive IoT application requests.
[0021] An embodiment of the present invention provides an Internet of Things system, which includes an Internet of Things terminal, and the Internet of Things terminal is used to issue an Internet of Things application request. The Internet of Things system also includes the above-mentioned key pool scheduling device or edge gateway.
[0022] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the key pool scheduling method of any of the above embodiments are implemented.
[0023] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0025] Figure 1 It is a flowchart of a key pool scheduling method according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of a key pool scheduling device according to an embodiment of the present invention;
[0027] Figure 3 It is a flowchart of a key pool scheduling method according to an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram of a key pool scheduling device according to an embodiment of the present invention;
[0029] Figure 5 It is a flowchart of a key pool scheduling method according to an embodiment of the present invention;
[0030] Figure 6 It is a flowchart of a key pool scheduling method according to an embodiment of the present invention;
[0031] Figure 7 It is a flowchart of a key pool scheduling method according to an embodiment of the present invention;
[0032] Figure 8is a schematic diagram of a third determination module of a key pool scheduling device according to an embodiment of the present invention;
[0033] Fig. 9 It is a flowchart of a key pool scheduling method according to an embodiment of the present invention;
[0034] Fig.10 is a schematic diagram of a key pool scheduling device according to an embodiment of the present invention;
[0035] Fig.11 is a schematic diagram of a processing module of a key pool scheduling device according to an embodiment of the present invention;
[0036] Fig.12 Schematic diagram of an Internet of Things system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The embodiments of the present invention are described in detail below, and the embodiments of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0038] Quantum encryption communication has become a new secure communication method due to its non-clonable and indivisible physical properties and "one-time one-pad" encryption system. It has been widely used in the Internet of Things system and has become an important link in ensuring the security of IoT data transmission. Among them, quantum keys are scarce resources in the quantum key distribution (QKD) network. Their generation rate is low, but their utilization rate is high, which has become a key bottleneck restricting quantum communication. The Internet of Things often deploys edge gateways on the edge access side to establish a quantum key pool management module for storing and scheduling key resources. In related technologies, edge gateways respond passively to key requests, without considering the different security requirements between IoT applications. When faced with a large number of IoT key requests, it is easy to cause blockage of key transmission channels, affecting the efficiency of communication. How to save the time cost of IoT terminals receiving quantum keys and ensure the smoothness of communication between terminals has become an urgent problem to be solved.
[0039] See also Figure 1 The embodiment of the present invention provides a key pool scheduling method for an edge gateway, wherein the edge gateway includes a key pool, the key pool is used to store quantum keys, the edge gateway also includes one or more first-in-first-out cache queues, the cache queues are used to cache Internet of Things application requests for requesting quantum keys, and the key pool scheduling method includes:
[0040] 011: When the number of IoT application requests in the cache queue changes, the weight value of the cache queue is determined according to the initial weight of the cache queue and the number of IoT application requests in the cache queue. The initial weight of the cache queue is used to characterize the security level and latency requirement of the IoT application requests in the cache queue.
[0041] 012: determining a virtual time stamp of the cache queue according to the weight value of the cache queue, where the virtual time stamp of the cache queue is used to represent the time when an event of the cache queue occurs;
[0042] 013: When the IoT application request arrives at the cache queue, the virtual departure time of the IoT application request is determined according to the virtual time stamp of the cache queue;
[0043] 014: Distribute quantum keys for IoT application requests with the smallest virtual departure time in all cache queues.
[0044] Specifically, see Figure 2 The key pool scheduling method of the embodiment of the present invention can be implemented by the key pool scheduling device 100 of the embodiment of the present invention. The key pool scheduling device 100 includes a first determination module 110, a second determination module 120, a third determination module 130 and a distribution module 140. The first determination module 110 is used to determine the weight value of the cache queue according to the initial weight of the cache queue and the number of the IoT application requests in the cache queue when the number of IoT application requests in the cache queue changes. The initial weight of the cache queue is used to characterize the security level and delay requirements of the IoT application requests in the cache queue; the second determination module 120 is used to determine the virtual time stamp of the cache queue according to the weight value of the cache queue, and the virtual time stamp of the cache queue is used to characterize the event occurrence time of the cache queue; the third determination module 130 is used to determine the virtual departure time of the IoT application request according to the virtual time stamp of the cache queue when the IoT application request arrives at the cache queue; the distribution module 140 is used to distribute quantum keys to the IoT application requests with the smallest virtual departure time in all cache queues.
[0045] Among them, the initial weight of the cache queue is determined according to the security level and latency requirements of the IoT application requests in the cache queue; when the number of IoT application requests changes (new IoT application requests enter the cache queue or IoT application requests obtain quantum keys and leave the cache queue), the current weight value of the cache queue is determined according to the initial weight of the cache queue and the number of IoT application requests in the cache queue; then, the virtual time scale of the cache queue is determined according to the current weight value of the cache queue (the virtual time scale is used to characterize the event occurrence time of the cache queue); then, when the IoT application request arrives at the cache queue, the virtual departure time of the IoT application request is determined according to the virtual time scale of the cache queue; finally, the quantum key is distributed to the IoT application request with the smallest virtual departure time in all cache queues. In this way, the weight of the cache queue is dynamically adjusted according to the change in the number of IoT application requests, thereby making corresponding changes to the virtual time scale, and the adjustment of the virtual time scale affects the virtual departure time. The size of the virtual departure time determines whether the application can obtain the quantum key, thus ensuring that IoT applications with high security levels and latency requirements can obtain quantum keys first. At the same time, it also takes into account the changes in the number of IoT application requests in the queue, making key distribution more flexible and efficient, ensuring that each IoT application request has a relatively fair opportunity to obtain quantum key distribution, and improving the utilization rate of keys in the key pool, avoiding congestion and starvation caused by massive IoT application requests.
[0046] See also Figure 3 In one implementation, the key pool scheduling method further includes:
[0047] 015: When receiving an IoT application request, it is assigned to the corresponding cache queue based on the security level and latency requirements of the IoT request.
[0048] Specifically, see Figure 4 Step 015 can be implemented by the allocation module 150, that is, the allocation module 150 can be used to allocate the IoT application request to the corresponding cache queue according to the security level and latency requirements of the IoT request when receiving the IoT application request.
[0049] In this way, when IoT application requests are received, they are classified into different cache queues according to the security level and latency requirements of the IoT application requests. For example, requests with high security levels and low latency requirements may be assigned to queues with higher weights. This can also make resource allocation more reasonable, ensuring that critical and urgent IoT application requests can be processed first, thereby improving overall performance and efficiency.
[0050] In one embodiment, according to the security requirements of the IoT terminal application, five types of security level Rank divisions, delay requirements and weight allocations are provided, namely, control class requests with the highest security level (Rank=0), with a delay requirement of 100ms, and the initial weight of the cache queue where the control class requests are located is 40%; audio and video live broadcast class requests with the second security level (Rank=1), with a delay requirement of 200ms, and the initial weight of the cache queue where the audio and video live broadcast class requests are located is 25%; signal class requests with the third security level (Rank=2), with a delay requirement of 300ms, and the initial weight of the cache queue where the signal class requests are located is 20%; measurement class requests with the fourth security level (Rank=3), with a delay requirement of 500ms, and the initial weight of the cache queue where the measurement class requests are located is 10%; notification class requests with the fifth security level (Rank=4), with a delay requirement of seconds, and the initial weight of the cache queue where the notification class requests are located is 5%.
[0051] See also Figure 5 In one implementation, step 011 (determining a weight value of a cache queue according to an initial weight of the cache queue and the number of IoT application requests in the cache queue) includes:
[0052] 0111: Determine the weight value of the cache queue according to the initial weight, the number of IoT application requests in the cache queue, and the weight upper limit of the cache queue.
[0053] Specifically, see Figure 2 , step 0111 can be implemented by the first determination module 110, that is, the first determination module 110 can be used to determine the weight value of the cache queue according to the initial weight, the number of IoT application requests in the cache queue, and the weight upper limit of the cache queue.
[0054] Among them, each cache queue is equipped with an initial weight and a weight upper limit, and the weight values are the same or different. Each cache queue also contains a remaining request counter, which is used to count the number of IoT application requests backlogged in the cache queue. When the number of IoT application requests in the queue is above the preset lower limit threshold of the number of IoT application requests (the preset minimum length of the cache queue), and the number of IoT application requests in the cache queue changes, the method will adjust the weight value of the queue accordingly according to the change in the number of IoT application requests. When the number of IoT application requests increases, the weight value increases to prevent excessive backlog; when the number of IoT application requests decreases, the weight value decreases to prevent waste of scheduling resources. By determining the weight value of the cache queue according to the initial weight, the number of IoT application requests in the cache queue, and the weight upper limit of the cache queue, the weight of the cache queue is dynamically adjusted, so that the system can reasonably distribute quantum keys and avoid blocking and starvation caused by massive IoT application requests.
[0055] In one embodiment, the current weight value of the cache queue is calculated as follows:
[0056] First calculate the added weight value △ , suppose there are K priority cache queues that need to increase their weights, and the weight value of the i-th cache queue is △ :
[0057] △
[0058] In the above formula, is the delay index of the i-th cache queue, is the maximum weight value of the cache queue. is the initial weight value of the cache queue. At this time, the delay index is introduced, and the ratio is used as the basis for dynamically adjusting the weight value. The delay index of the queue :
[0059] =
[0060] In the above formula, L is the number of IoT application requests. The weight value of the current cache queue :
[0061] = +△
[0062] When the number of IoT application requests in the cache queue drops to the set lower limit of the number of IoT application requests (that is, the cache queue length is reduced to the set minimum length), the weight value of the cache queue returns to the initial weight of the cache queue. .
[0063] See also Figure 6 In one implementation, step 012 (determining a virtual time stamp of a cache queue according to a weight value of the cache queue) includes:
[0064] 0121: Determine the virtual time scale of the current event of the cache queue according to the virtual time scale of the previous event of the cache queue, the distribution rate of the quantum key of the cache queue, the time interval between the current event and the previous event, and the weight value of the cache queue.
[0065] Specifically, see Figure 2 , step 0121 can be implemented by the second determination module 120, that is, the second determination module 120 can be used to determine the virtual time scale of the current event of the cache queue according to the virtual time scale of the previous event of the cache queue, the distribution rate of the quantum key of the cache queue, the time interval between the current event and the previous event, and the weight value of the cache queue.
[0066] Among them, when an event occurs in the cache queue (a new IoT application request enters the queue or an IoT application request in the queue obtains a quantum key and leaves the queue), the virtual time stamp of the current event of the cache queue is determined according to the virtual time stamp of the previous event of the cache queue, the distribution rate of the quantum key of the cache queue, the time interval between the current event and the previous event, and the weight value of the cache queue. The virtual time stamp is a timestamp. The virtual time stamp of each cache queue is calculated based on the virtual time stamp of its previous event, which helps to ensure that the order of occurrence of events is correctly represented and ensures that the application obtains the quantum key relatively fairly. The distribution rate of the quantum key of the cache queue is a preset value, which changes according to the change of the weight value. The larger the weight value, the greater the distribution rate. The longer the time interval, the later the event occurs, and the more the virtual time stamp increases. The virtual time stamp of the cache queue records the virtual time stamp of each IoT application request in the queue, and the virtual time stamp of each IoT application request will not be changed once calculated. With this method, the system can dynamically calculate the virtual time scale of each queue based on the queue's weight value, the virtual time scale of the previous event in the cached queue, the quantum key distribution rate, and the time interval between events, thereby optimizing resource allocation and improving the efficiency of quantum key distribution in the key pool.
[0067] In one embodiment, the calculation formula of the virtual time scale is as follows:
[0068]
[0069] in, Indicates the time when the jth event on the queue occurs, It represents the time interval between events j and j-1 (the arrival and departure of requests from the queue are both recorded as events). represents the weight value of queue i, r represents the distribution rate of the quantum key of the queue, B is the set of non-empty queues, and the initial value of the virtual time scale is Set to 0. This formula compares the number of quantum keys assigned to the cache queue between event j and time j-1 with the sum of the weight values of all cache queues to obtain the ratio, using the virtual time scale of the time when the previous event occurred (i.e. ) is added to the ratio as a virtual time stamp of the time when the IoT request occurs.
[0070] See also Figure 7 In one implementation, step 013 (determining a virtual departure time of an IoT application request according to a virtual time stamp of a cache queue) includes:
[0071] 0131: determine the virtual start time of the current IoT application request according to the virtual time stamp of the cache queue and the virtual leave time of the previous IoT application request of the cache queue;
[0072] 0132: Determine the virtual departure time of the current IoT application request according to the virtual start time of the current IoT application request, the quantum key length requested by the current IoT application request, and the scheduling bandwidth of the key distribution occupied by the cache queue.
[0073] Specifically, see Figure 8 The third determination module 130 includes a first determination submodule 131 and a second determination submodule 132, wherein step 0131 can be implemented by the first determination module 131, that is, the first determination submodule 131 can be used to determine the virtual start time of the current Internet of Things application request according to the virtual time stamp of the cache queue and the virtual leave time of the previous Internet of Things application request of the cache queue; step 0132 can be implemented by the second determination submodule 132, that is, the second determination submodule 132 can be used to determine the virtual leave time of the current Internet of Things application request according to the virtual start time of the current Internet of Things application request, the quantum key length applied for by the current Internet of Things application request and the scheduling bandwidth of the key distribution occupied by the cache queue.
[0074] Among them, the virtual start time of the current IoT application request is determined by the virtual time stamp of the cache queue and the virtual leave time of the previous IoT application request of the cache queue, which ensures the order of application requests and the relative fairness of quantum key distribution; the virtual leave time of the current IoT application request is determined according to the virtual start time of the current IoT application request, the quantum key length requested by the current IoT application request and the scheduling bandwidth of key distribution occupied by the cache queue. In this way, the system can dynamically calculate the virtual leave time of each IoT application request based on the virtual time stamp of the queue, the requested quantum key length and the scheduling bandwidth, thereby improving the efficiency of key pool distribution, and reasonably allocating quantum keys to avoid blocking and starvation caused by massive IoT application requests.
[0075] In one embodiment, the calculation formula of the virtual departure time currently requested by the Internet of Things application is as follows:
[0076]
[0077] in, represents the virtual start time of the kth IoT application arrival request in the ith queue, The quantum key length applied for it, The time it takes for IoT application requests to arrive at the cache queue. For its virtual departure time, is the scheduling bandwidth of key distribution occupied by the current queue. This formula selects a larger virtual time scale from the virtual time scale of the arrival time of the IoT application arrival request in the current cache queue and the virtual departure time of the previous IoT application departure request in the cache queue as the virtual start time of the IoT application arrival request; then, calculates the ratio of the applied quantum key length to the scheduling bandwidth of key distribution occupied by the current queue, and uses the sum of the virtual start time and this ratio as the virtual end time of the IoT application arrival request.
[0078] In one implementation, the scheduling bandwidth of key distribution occupied by the cache queue in the above-mentioned key pool scheduling method is determined according to the weight value of the cache queue.
[0079] Among them, an initial value is preset for the scheduling bandwidth of key distribution occupied by the current cache queue. The scheduling bandwidth is determined by the weight value of the cache queue and the sum of the weight values of all cache queues. When the weight values of other cache queues remain unchanged, the larger the weight value of the cache queue, the larger the scheduling bandwidth of key distribution it occupies, and the faster the speed of quantum key distribution. The cache queue with a high weight value occupies a larger scheduling bandwidth of key distribution, and the speed of quantum key distribution is faster. This ensures the efficiency of quantum key distribution, improves the utilization rate of keys in the key pool, and avoids blocking and starvation caused by massive IoT application requests.
[0080] In one embodiment, the scheduling bandwidth of key distribution occupied by the cache queue is calculated as follows:
[0081]
[0082] The scheduling bandwidth of key distribution occupied by the cache queue is the ratio of the weight value of the current cache queue to the sum of the weight values of all cache queues.
[0083] See also Fig. 9 In one implementation, the key pool scheduling method further includes:
[0084] 016: Query the remainder of the quantum key in the key pool;
[0085] 0171: when the margin is greater than the first preset margin, requesting distribution of quantum keys for the IoT application;
[0086] 0172: When the margin is less than the second preset margin, all IoT application requests are blocked and a key supplement signal is sent to the quantum key distribution network.
[0087] Specifically, see Fig.10The key pool scheduling device 100 further includes a query module 160 and a processing module 170. Step 016 can be implemented by the query module 160, that is, the query module 160 can be used to query the remainder of the quantum key in the key pool; see Fig.11 The processing module 170 includes a first processing submodule 171 and a second processing submodule 172. Step 0171 can be implemented by the first processing submodule 171, that is, the first processing submodule 171 can be used to distribute quantum keys for IoT application requests when the margin is greater than the first preset margin; step 0172 can be implemented by the second processing submodule 172, that is, the second processing submodule 172 can be used to block all IoT application requests and send a key supplement signal to the quantum key distribution network when the margin is less than the second preset margin.
[0088] Among them, the key pool scheduling method also includes querying the quantum key surplus in the key pool; when the surplus is greater than the first preset surplus, requesting the distribution of quantum keys for the Internet of Things application; when the surplus is less than the second preset surplus, blocking all Internet of Things application requests and sending a key supplement signal to the quantum key distribution network. When the quantum key amount in the key pool reaches the set first preset surplus, the system sends a request to suspend key supplement to the key management center platform and QKD (Quantum Key Distribution), and the key management center platform can coordinate QKD to supplement the key to the remaining edge gateways with insufficient key surplus. When the quantum key amount reaches the set second preset surplus, request QKD to supplement the key, and determine the key generation rate of the next stage according to the key surplus and key consumption rate. In this way, the number of quantum keys in the key pool can be kept at an appropriate amount, ensuring the timely distribution and supplement of quantum keys, avoiding the waste of quantum keys, improving the utilization rate of keys in the key pool, and improving the efficiency of IoT application request response.
[0089] An embodiment of the present invention provides an edge gateway, which includes one or more processors and a memory. The memory stores a computer program. When the computer program is executed by the processor, the steps of the key pool scheduling method of any of the above embodiments are implemented.
[0090] In this way, the virtual time scale of the cache queue is determined according to the security level, latency requirement and number of IoT application requests in the cache queue. Then, the virtual departure time of the IoT application request is determined according to the virtual time scale, so that quantum keys can be distributed to IoT application requests according to the virtual departure time, ensuring that each IoT application request has a relatively fair opportunity to obtain quantum key distribution, and improving the utilization rate of keys in the key pool, avoiding blocking and starvation caused by massive IoT application requests.
[0091] See also Fig.12An embodiment of the present invention provides an Internet of Things system, which includes an Internet of Things terminal, which is used to issue an Internet of Things application request. The Internet of Things system also includes the above-mentioned key pool scheduling device or edge gateway.
[0092] Specifically, when an IoT application request enters the edge gateway from an IoT terminal, the application security level is first classified, and then it enters the corresponding cache queue, and the initial weight is set; after the IoT application request classification is completed, the virtual departure time of each IoT application request is calculated based on the weight and virtual time stamp of each cache queue at this time, and the key distribution scheduler selects the IoT application request with the minimum virtual departure time to distribute the quantum key to the corresponding IoT terminal; when the quantum key distribution is completed or a new IoT application request enters the cache queue, the remaining request counter will calculate the number of remaining IoT application requests in each cache queue, and then the weight value of each queue at this time will be recalculated through the weight calculation module, and the virtual departure time of each IoT application request will be calculated based on these weight values and the virtual time stamp of each IoT application request, and the key distribution scheduler selects the IoT application request with the minimum virtual departure time to distribute the quantum key to the corresponding IoT terminal.
[0093] In this way, the virtual time scale of the cache queue is determined according to the security level, latency requirement and number of IoT application requests in the cache queue, and the virtual departure time of the IoT application requests is determined according to the virtual time scale. Therefore, quantum keys can be distributed to IoT application requests according to the virtual departure time, ensuring that each IoT application request has a relatively fair opportunity to obtain quantum key distribution, and improving the utilization rate of keys in the key pool, avoiding congestion and starvation caused by massive IoT application requests.
[0094] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the key pool scheduling method in any of the above embodiments are implemented.
[0095] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0096] In addition, the term "connection" should be understood in a broad sense, for example, it can include fixed connection, detachable connection, or integral connection; it can include direct connection, indirect connection through an intermediate medium, and internal communication between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0097] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0098] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0099] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A key pool scheduling method for an edge gateway, characterized in that: The edge gateway includes a key pool, which is used to store quantum keys. The edge gateway also includes one or more first-in-first-out cache queues, which are used to cache Internet of Things application requests for requesting quantum keys. The key pool scheduling method includes: When the number of IoT application requests in the cache queue changes, the weight value of the cache queue is determined according to the initial weight value of the cache queue, the number of IoT application requests in the cache queue, and the upper limit of the weight value of the cache queue. The initial weight value of the cache queue is used to characterize the security level and latency requirements of the IoT application requests in the cache queue. The formula for determining the weight value of the cache queue is as follows: = in, is the weight value of the cache queue, △ is the added weight value, is the initial weight value of the cache queue, is the upper limit of the weight value, is the delay index of the cache queue, is the delay index of the i-th cache queue, and L is the number of IoT application requests; Determining a virtual time scale of the cache queue according to the weight value of the cache queue, where the virtual time scale of the cache queue is used to represent the time when an event of the cache queue occurs; When the Internet of Things application request arrives at the cache queue, determining the virtual departure time of the Internet of Things application request according to the virtual time stamp of the cache queue; Distribute quantum keys for IoT application requests with the smallest virtual departure time in all cache queues.
2. The key pool scheduling method according to claim 1, characterized in that: The key pool scheduling method also includes: When an IoT application request is received, it is assigned to the corresponding cache queue based on the security level and latency requirements of the IoT request.
3. The key pool scheduling method according to claim 1, characterized in that: Determining the virtual time scale of the cache queue according to the weight value of the cache queue includes: The virtual time scale of the current event of the cache queue is determined according to the virtual time scale of the previous event of the cache queue, the distribution rate of the quantum key of the cache queue, the time interval between the current event and the previous event, and the weight value of the cache queue.
4. The key pool scheduling method according to claim 1, characterized in that: The determining the virtual departure time of the Internet of Things application request according to the virtual time stamp of the cache queue includes: Determine a virtual start time of a current Internet of Things application request according to a virtual time stamp of the cache queue and a virtual leave time of a previous Internet of Things application request of the cache queue; The virtual departure time of the current Internet of Things application request is determined according to the virtual start time of the current Internet of Things application request, the quantum key length applied for by the current Internet of Things application request, and the scheduling bandwidth of the key distribution occupied by the cache queue.
5. The key pool scheduling method according to claim 4, characterized in that: The scheduling bandwidth of key distribution occupied by the cache queue is determined according to the weight value of the cache queue.
6. The key pool scheduling method according to claim 1, characterized in that: The key pool scheduling method also includes: Querying the remainder of the quantum key in the key pool; When the margin is greater than a preset margin, requesting distribution of a quantum key for an Internet of Things application; When the margin is less than the preset margin, all IoT application requests are blocked and a key supplement signal is sent to the quantum key distribution network.
7. A key pool scheduling device, used for an edge gateway, characterized in that: The edge gateway includes a key pool, which is used to store quantum keys. The edge gateway also includes one or more first-in-first-out cache queues, which are used to cache Internet of Things application requests for requesting quantum keys. The key pool scheduling device includes: The first determination module is used to determine the weight value of the cache queue according to the initial weight value of the cache queue, the number of the IoT application requests in the cache queue, and the upper limit of the weight value of the cache queue when the number of IoT application requests in the cache queue changes. The initial weight value of the cache queue is used to characterize the security level and latency requirements of the IoT application requests in the cache queue. The formula for determining the weight value of the cache queue is as follows: = in, is the weight value of the cache queue, △ is the added weight value, is the initial weight value of the cache queue, is the upper limit of the weight value, is the delay index of the cache queue, is the delay index of the i-th cache queue, and L is the number of IoT application requests; a second determining module, the second determining module being used to determine a virtual time scale of the cache queue according to a weight value of the cache queue, the virtual time scale of the cache queue being used to characterize an event occurrence time of the cache queue; A third determination module, the third determination module is used to determine the virtual departure time of the Internet of Things application request according to the virtual time stamp of the cache queue when the Internet of Things application request arrives at the cache queue; A distribution module is used to distribute quantum keys for IoT application requests with the smallest virtual departure time in all cache queues.
8. An edge gateway, characterized in that: The edge gateway includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the key pool scheduling method according to any one of claims 1 to 6 are implemented.
9. An Internet of Things system, characterized in that: The Internet of Things system includes an Internet of Things terminal, which is used to issue an Internet of Things application request. The Internet of Things system also includes the key pool scheduling device described in claim 7 or the edge gateway described in claim 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the key pool scheduling method according to any one of claims 1 to 6 are implemented.
