A data ciphertext buffer invalidation handling system and method for quantum communication networks
By employing a two-level caching model and quantum key encryption in a quantum communication network, the problems of dirty reads and data security in Redis databases are solved, improving caching performance and user experience, and enabling efficient and secure data updates.
Patent Information
- Application Number
- CN202211184772.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-09-27
AI Technical Summary
In existing quantum communication networks, Redis database cached data suffers from dirty reads, phantom reads, and non-repeatable reads, and lacks highly secure encryption methods, resulting in low data security, long read latency when encrypted data becomes invalid, and reduced cache performance.
A two-level caching model is adopted, with Redis database R1 serving as the first-level cache to store hot data and Redis database R2 serving as the second-level cache to synchronize database data. Security is improved by using quantum key encryption, and the expiration time of the quantum key is used to determine data failure. A data query module, a key processing module, an update module, and a data return module are established to ensure the accuracy and security of the data.
It solves the memory overflow problem, reduces system resource consumption, improves caching performance and data security, and enhances the user experience.
Smart Images

Figure CN117235123B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum secure communication networks and data processing, specifically to a data ciphertext cache invalidation handling system and method for quantum communication networks. Background Technology
[0002] In the fields of quantum secure communication networks and data processing, caching is an important component in distributed systems. It mainly solves the problem of accessing hot data in high-concurrency and big data scenarios. In other words, caching can provide users with fast data access and retrieval.
[0003] The principle of caching is to write data to storage devices or caching middleware with faster read speeds. Commonly used caching middleware includes Redis, Varnish, Nginx, Squid, Memcache, and Ehcache, among which Redis is the most widely used storage system. Redis is an open-source, in-memory, multi-data-structure storage system that can be used as a database, cache, and message middleware. Redis supports various data structures, such as strings, hashes, lists, sets, and sorted sets.
[0004] In existing quantum communication and big data technology solutions, many vendors use Redis as a caching database. They monitor database add, modify, and delete operations using monitoring programs, and only synchronize the data to Redis's first-level cache module after the database has completed the operation and obtained the results. This single-threaded, linear task execution approach is prone to dirty reads, phantom reads, and non-repeatable reads. Furthermore, current technologies do not employ more secure encryption methods for cached data in Redis, resulting in low data security. When a piece of encrypted data becomes invalid, it is directly deleted from the cache. When a user needs to access the encrypted data, it must be retrieved from memory, leading to excessively long read paths, access latency, reduced cache performance, and a decreased user experience.
[0005] Therefore, it is necessary to improve upon the shortcomings of existing technologies and propose a data ciphertext cache invalidation handling system and method for quantum communication networks. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of existing technologies and to solve the problems of concurrent and invalidation of cached data. A data ciphertext cache invalidation processing system and method for quantum communication networks is proposed.
[0007] The method of this invention is achieved through the following technical solution:
[0008] A data ciphertext cache invalidation handling system for a quantum communication network includes a database module, a Redis database module, a client, a backend management center, and a quantum key distribution device (QKD); the Redis database module includes Redis database R1 and Redis database R2.
[0009] The client is connected to the database module, the Redis database module, and the back-end management center via classical channels, while the quantum key distribution device (QKD) and the back-end management center are connected via quantum channels.
[0010] The back-end management center includes a data query module, a key processing module, a data judgment module, an update module, and a data return module;
[0011] One end of the data query module, key processing module, judgment module, update module, and data return module is connected to the database module and the Redis database module via electrical signals, respectively, and the other end is connected to the quantum key distribution device QKD via a quantum channel; the data return module is connected to the client.
[0012] The Redis database R1 is used to store data files with a cumulative access count greater than N;
[0013] The Redis database R2 is used to retrieve and save all data from the database module.
[0014] The database module is used to store all the system's data;
[0015] The data query module is used to query data in the database module and the Redis database module according to the client's instructions, and return the data to the client through the data return module;
[0016] The judgment module is used to determine whether the quantum key is invalid;
[0017] The key processing module is used to create a queue QK for storing quantum keys;
[0018] The update module is used to add the quantum key in the queue QK created by the key processing module to the database module and the Redis database module;
[0019] The quantum key distribution device (QKD) is used to generate quantum keys.
[0020] Furthermore, the value of N is 30.
[0021] A data buffer invalidation handling system based on a quantum secure communication network, the method comprising the following steps:
[0022] Step 1: The client inputs the primary key ID of the target data into the data query module in the backend management center and starts a thread to listen for the ListenKey event;
[0023] Step 2: The data query module finds the target data based on the primary key ID;
[0024] Step 3: The determination module obtains the primary key ID of the target data and compares the expiration time of the primary key ID with the system time;
[0025] If the expiration time of the primary key ID does not exceed the system time, the data return module retrieves the target data and returns it to the client;
[0026] If the expiration time of the primary key ID exceeds the system time, the ListenKey event sends a quantum key exception message to the client and jumps to step 4;
[0027] Step 4: The key processing module creates a queue QK to store the keys distributed by the quantum key distribution device QKD, and checks whether the value of the global parameter sync of the key processing module is 1;
[0028] If the value of the global parameter sync is 1, then proceed to step 5;
[0029] If the value of the global parameter sync is 0, repeat step 4;
[0030] Step 5: After the update module obtains a quantum key qk from the queue QK, it uses the quantum key qk to encrypt the target data to obtain the encrypted target data;
[0031] Step 6: The update module stores the quantum key qk and the encrypted target data into the database module, Redis database R1, and Redis database R2;
[0032] Step 7: The data return module obtains the encrypted target data and returns it to the client. At the same time, the ListenKey event sends a notification to the client that the quantum key has been updated.
[0033] Further, step 2 includes the following steps:
[0034] Step 2-1: The data query module obtains the primary key ID of the target data;
[0035] Step 2-2: The data query module queries the Redis database R1 using the primary key ID to check if the target data exists;
[0036] If the target data exists, proceed to step 3;
[0037] If the target data does not exist, proceed to step 2-3;
[0038] Steps 2-3: The data query module searches for the target data in the Redis database R2 using the quantum key as the primary key, and then jumps to step 3.
[0039] Furthermore, the primary key ID is the quantum key qk.
[0040] The beneficial effects of this invention are as follows:
[0041] This invention employs a two-level caching model. Redis database R1 serves as the first-level cache to store frequently accessed data, while Redis database R2 serves as the second-level cache to synchronize data between the two databases. Compared to existing solutions, this not only solves the memory overflow problem but also reduces system resource consumption and improves cache performance. Furthermore, this invention uses quantum key encryption to enhance data security and determines data expiration based on the quantum key's expiration time, thereby improving the update rate, reliability, and security of cached data and enhancing the user experience. Attached Figure Description
[0042] Figure 1 This is a system schematic diagram of the present invention;
[0043] Figure 2 This is a flowchart of the method of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments. However, the scope of protection of this invention is not limited to the specific embodiments described below.
[0045] A data ciphertext cache invalidation handling system for a quantum communication network includes a database module, a Redis database module, a client, a backend management center, and a quantum key distribution device (QKD).
[0046] The client is connected to the database module, the Redis database module, and the back-end management center via classical channels, while the quantum key distribution device (QKD) and the back-end management center are connected via quantum channels.
[0047] The Redis database module includes Redis database R1 and Redis database R2. Redis database R1 is used to store data files with a cumulative access count greater than N. In this embodiment, N is 30, meaning that data files with a cumulative access count greater than 30 are stored in database R1. This indicates that data with frequent access counts are stored in database R1, which distinguishes it from data with infrequent access counts. When querying a data file, the search is prioritized in database R1, which can improve the search speed and accuracy.
[0048] Redis database R2 is used to retrieve and save all data from the database module.
[0049] Specifically, Redis database R1 is used as a first-level cache to store hot data, and Redis database R2 is used as a second-level cache to synchronize all data in the database. This multi-level caching approach solves the memory overflow problem, while also reducing system resource consumption and improving cache performance.
[0050] The back-end management center includes a data query module, a key processing module, a data judgment module, an update module, and a data return module;
[0051] One end of the data query module, key processing module, judgment module, update module, and data return module is connected to the database module and the Redis database module via electrical signals, respectively, and the other end is connected to the quantum key distribution device QKD via a quantum channel; the data return module is connected to the client.
[0052] The database module is used to store all the system's data;
[0053] The data query module is used to query data in the database module and the Redis database module according to the client's instructions, and return the data to the client through the data return module;
[0054] The judgment module is used to determine whether the quantum key is invalid;
[0055] The key processing module is used to create a queue QK for storing quantum keys;
[0056] The update module is used to add the quantum key in the queue QK created by the key processing module to the database module and the Redis database module;
[0057] The quantum key distribution device (QKD) is used to generate quantum keys.
[0058] The specific implementation methods of each module function in this system are consistent with the scheme corresponding to the data ciphertext cache invalidation handling method of a quantum communication network below, and will not be repeated here.
[0059] Specifically, the specific method scheme of this embodiment is as follows:
[0060] A method for handling data ciphertext buffer invalidation in a quantum communication network, the method comprising the following steps:
[0061] Step 1: The client inputs the primary key ID of the target data and uses the primary key ID to query the target data in the data query module of the backend management center, and starts a thread to listen for the ListenKey event;
[0062] The ListenKey event can send a notification to the client, which includes at least a notification of quantum key anomaly and a notification that the quantum key has been updated.
[0063] Step 2: The data query module finds the target data based on the primary key ID; in this embodiment, the primary key ID is the quantum key of the target file;
[0064] Specifically, step 2 includes the following steps:
[0065] Step 2-1: The data query module obtains the primary key ID of the target data;
[0066] In a database, the primary key refers to a combination of one or more columns. The primary key can uniquely identify each row in the table, and it can enforce the entity integrity of the table. That is, using a quantum key as the primary key for target data can specify unique target data, making it convenient to search.
[0067] Step 2-2: The data query module queries the Redis database R1 using the quantum key as the primary key to check if the target data exists;
[0068] If the result is TRUE, the query ends and the query result, which is the target data, is returned. Proceed to step 3.
[0069] If the returned result is FALSE, meaning the target data does not exist, then proceed to steps 2-3; if the target data does not exist in Redis database R1, it means that the target data is an infrequently accessed file, then query Redis database R2.
[0070] Steps 2-3: The data query module searches for the target data in the Redis database R2 using the quantum key as the primary key, and then jumps to step 3.
[0071] In this process, the backend management center writes data to the database and simultaneously writes data to the Redis database R2. Since the entire process is atomic, the data in the Redis database R2 is consistent with the data in the database. Therefore, when data does not exist in the Redis database R1, the data query module will forward the data query request to the Redis database R2 for processing. This means that users do not need to query data in the database, which helps improve the speed of data reading for users.
[0072] Furthermore, Redis database R2 enables data persistence. Persistence means that Redis database R2 creates a binary file named dump.rdb on the disk and stores the data in this file. The purpose of enabling persistence is that after data persistence is enabled, the data written to Redis database R2 will be persisted locally. Even if the system crashes and restarts, the data cached in Redis database R2 will not be cleared.
[0073] Step 3: The determination module obtains the primary key ID of the target data and compares the expiration time of the primary key ID with the system time;
[0074] The system time refers to the time when the operating system running this system is in operation.
[0075] If the expiration time of the primary key ID does not exceed the system time, the data return module retrieves the target data and returns it to the client;
[0076] If the expiration time of the primary key ID exceeds the system time, the ListenKey event sends a quantum key exception message to the client and jumps to step 4;
[0077] The primary key ID is the quantum key. Comparing the expiration time of the primary key ID with the system time is equivalent to comparing the expiration time of the quantum key with the system time, which helps to detect in a timely manner whether the quantum key has expired and caused data failure.
[0078] Step 4: The key processing module creates a queue QK to store the keys distributed by the quantum key distribution device QKD, and checks whether the value of the global parameter sync of the key processing module is 1;
[0079] If the value of the global parameter sync is 1, then proceed to step 5;
[0080] If the value of the global parameter sync is 0, repeat step 4;
[0081] Specifically, a global parameter `sync` is defined for the key processing module. When the value of the global parameter `sync` is 1, it indicates that the key processing module is in an idle state, and the key processing module can be successfully called and the process can jump to step 5. When the value of the global parameter `sync` is 0, it indicates that the key processing module is in a busy state, and the process needs to wait until the key processing module's process is released.
[0082] The advantage of defining a global parameter `sync` for the key processing module is that it can prevent dirty reads of the key processing module's data. A dirty read refers to reading invalid data. For example, it is not allowed for a quantum key to be read by two threads at the same time. That is, a quantum key can only participate in one process and be encrypted with one piece of data.
[0083] Step 5: After the update module obtains a quantum key qk from the queue QK, it uses the quantum key qk to encrypt the target data to obtain the encrypted target data;
[0084] Specifically, when an old quantum key becomes invalid, the data corresponding to the old quantum key also becomes invalid. Therefore, it is necessary to obtain a new quantum key in a timely manner to re-encrypt the invalid data and finally obtain new data ciphertext.
[0085] Step 6: The update module stores the quantum key qk and the encrypted target data into the database module, Redis database R1, and Redis database R2;
[0086] Specifically, the update module stores the quantum key qk and the encrypted target data in key-value pairs into the database module, Redis database R1, and Redis database R2.
[0087] In this context, the quantum key qk is the key, and the target data to be encrypted is the value.
[0088] Step 7: The data return module retrieves the encrypted target data and returns it to the client. At the same time, the ListenKey event sends a notification to the client that the quantum key has been updated, so that the client can use the new key to query the data later.
[0089] This invention establishes a Redis database R1 as a first-level cache to store hot data and a Redis database R2 as a second-level cache to synchronize data between the two databases. When a user cannot find the target file in Redis database R1, there is no need to query the database; the user can directly search in Redis database R2. By establishing a persistent Redis database R2, the speed at which users search for data can be improved. Compared with existing solutions, this invention not only solves the problem of memory overflow but also reduces the consumption of system resources and improves cache performance.
[0090] This invention prevents dirty reads of the key processing module by defining a global parameter sync for the key processing module, ensuring that a quantum key can only participate in one process and encrypt one piece of data, thus guaranteeing the accuracy of the encrypted data and the uniqueness of the key. Furthermore, it uses quantum key encryption to improve data security.
[0091] This invention also determines whether the data ciphertext has expired based on the expiration time of the quantum key and updates the key in a timely manner to update the data ciphertext, making the update of cached data more reliable and secure, thereby improving the user experience.
[0092] Based on the disclosure and teachings of the foregoing specification, those skilled in the art can make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the invention should also fall within the protection scope of the claims of the present invention. Furthermore, although some specific terms are used in this specification, these terms are only for convenience of explanation and do not constitute any limitation on the invention.
Claims
1. A data ciphertext buffer invalidation handling system for a quantum communication network, characterized in that, It includes a database module, a Redis database module, a client, a backend management center, and a quantum key distribution device (QKD); the Redis database module includes Redis database R1 and Redis database R2. The client is connected to the database module, the Redis database module, and the back-end management center via classical channels, while the quantum key distribution device (QKD) and the back-end management center are connected via quantum channels. The back-end management center includes a data query module, a key processing module, a data judgment module, an update module, and a data return module; One end of the data query module, key processing module, judgment module, update module, and data return module is connected to the database module and the Redis database module via electrical signals, respectively, and the other end is connected to the quantum key distribution device QKD via a quantum channel; the data return module is connected to the client. The Redis database R1 is used to store data files with a cumulative access count greater than N; The Redis database R2 is used to retrieve and save all data from the database module. The database module is used to store all the system's data; The data query module is used to query data in the database module and the Redis database module according to the client's instructions, and return the data to the client through the data return module; The judgment module is used to determine whether the quantum key is invalid; The key processing module is used to create a queue QK for storing quantum keys; The update module is used to add the quantum key in the queue QK created by the key processing module to the database module and the Redis database module; The quantum key distribution device (QKD) is used to generate quantum keys.
2. The data ciphertext buffer invalidation handling system for a quantum communication network as described in claim 1, characterized in that, The value of N is 30.
3. A method for handling data ciphertext buffer invalidation in a quantum communication network, characterized in that, The data ciphertext buffer invalidation handling system for a quantum communication network as described in claim 1 or 2 includes the following steps: Step 1: The client inputs the primary key ID of the target data into the data query module in the backend management center and starts a thread to listen for the ListenKey event; Step 2: The data query module finds the target data based on the primary key ID; Step 3: The determination module obtains the primary key ID of the target data and compares the expiration time of the primary key ID with the system time; If the expiration time of the primary key ID does not exceed the system time, the data return module retrieves the target data and returns it to the client; If the expiration time of the primary key ID exceeds the system time, the ListenKey event sends a quantum key exception message to the client and jumps to step 4; Step 4: The key processing module creates a queue QK to store the keys distributed by the quantum key distribution device QKD, and checks whether the value of the global parameter sync of the key processing module is 1; If the value of the global parameter sync is 1, then proceed to step 5; If the value of the global parameter sync is 0, repeat step 4; Step 5: After the update module obtains a quantum key qk from the queue QK, it uses the quantum key qk to encrypt the target data to obtain the encrypted target data; Step 6: The update module stores the quantum key qk and the encrypted target data into the database module, Redis database R1, and Redis database R2; Step 7: The data return module obtains the encrypted target data and returns it to the client. At the same time, the ListenKey event sends a notification to the client that the quantum key has been updated.
4. The method for handling data ciphertext buffer invalidation in a quantum communication network according to claim 3, characterized in that, Step 2 includes the following steps: Step 2-1: The data query module obtains the primary key ID of the target data; Step 2-2: The data query module queries the Redis database R1 using the primary key ID to check if the target data exists; If the target data exists, proceed to step 3; If the target data does not exist, proceed to step 2-3; Steps 2-3: The data query module searches for the target data in the Redis database R2 using the quantum key as the primary key, and then jumps to step 3.
5. The method for handling data ciphertext buffer invalidation in a quantum communication network according to claim 4, characterized in that, The primary key ID is the quantum key qk.
Citation Information
Patent Citations
Method suitable for secret key management and rapid synchronization of quantum secret key distribution system
CN108616357A
Quantum-based data encryption
US20190097792A1