Quantum device ID generation method and device, quantum device ID analysis method and device and medium
By obtaining the request for quantum device ID, coding rules are determined based on compatible mark bits, and the fifth segment encoding of quantum device ID is generated based on the counting method, the problem of subnet number exhaustion in the prior art is solved, and dynamic generation and unified management of the equipment ID of the quantum confidential communication network is realized, and management costs are reduced.
Patent Information
- Application Number
- CN202510278524.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-20
AI Technical Summary
The device ID encoding rules of existing quantum confidential communication networks cannot meet the networking needs of future quantum confidential communication networks, resulting in the risk of subnet number exhaustion.
By obtaining the request to generate the quantum device ID, the encoding rules are determined based on the compatible mark bits, and the fifth segment encoding of the quantum device ID is generated based on the counting method, and the ID is split into five segment encodings, which is clear and easy to expand, so as to dynamically generate quantum device IDs compatible with different encoding rules.
It realizes dynamic generation of quantum device IDs, supports unified equipment management and data sharing of quantum confidential communication networks, and reduces the cost and cost of unified equipment management.
Smart Images

Figure CN120186129A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of quantum communication networks, and particularly to a method and device for generating and parsing a quantum device ID, and a medium. Background Art
[0002] Currently, the first two digits of the device ID in the quantum secure communication network are used as the subnet number, and the number range is 0-99, with a total of 100 subnet numbers available. With the development of the quantum secure communication network, there is a risk that the subnet numbers will be gradually exhausted.
[0003] Analyzing the existing rules of the quantum secure communication network device ID, combined with the usage of the device ID and the characteristics of the quantum secure communication network, it cannot meet the future networking requirements of the quantum secure communication network and the needs of building a quantum network nationwide.
[0004] To completely solve the problem of "gradually exhausting subnet numbers and facing being used up", there is an urgent need for a method with a larger capacity, stability, and reliability for encoding the quantum device ID in the quantum communication network. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a method and device for generating and parsing a quantum device ID, and a medium, so as to meet the future networking requirements of the quantum secure communication network and solve the problem of insufficient existing quantum device IDs.
[0006] To solve the above technical problems, an embodiment of the present invention provides a method for generating a quantum device ID, the method including: obtaining a request for generating a quantum device ID, the request at least including a compatibility flag bit, a network domain number, a device type, and a network domain extension number; determining an encoding rule according to the compatibility flag bit; and obtaining the first four segments of the encoding of the corresponding quantum device ID according to the encoding rule, the compatibility flag bit, the network domain number, the device type, and the network domain extension number; the quantum device ID is composed of five segments of encoding; wherein, the fifth segment of the encoding of the quantum device ID is generated based on a counting method; and the five segments of the encoding of the quantum device ID are spliced in a fixed order to obtain the final quantum device ID.
[0007] An embodiment of the present invention also provides a method for parsing a quantum device ID, the parsing method including: obtaining the length of the quantum device ID, and determining a parsing rule according to the length; and parsing the quantum device ID according to the parsing rule to obtain the network domain number, the device type, and the network domain extension number.
[0008] Embodiments of the present invention also provide a device for encoding and decoding quantum device IDs, the device comprising: an acquisition module for acquiring a request for generating a quantum device ID, the request at least including a compatibility flag bit, a domain number, a device type, and a domain extension number; a first encoding module for determining an encoding rule according to the compatibility flag bit; and obtaining the first four segments of the corresponding quantum device ID according to the encoding rule, the compatibility flag bit, the domain number, the device type, and the domain extension number; the quantum device ID consists of five segments of encoding; a second encoding module for generating the fifth segment of the quantum device ID based on a counting method; and an output module for splicing the five segments of the quantum device ID in a fixed order to obtain the final quantum device ID.
[0009] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which when executed by a processor implements the above-mentioned method for generating a quantum device ID and the above-mentioned method for parsing a quantum device ID.
[0010] Compared with the prior art, embodiments of the present invention obtain a request for generating a quantum device ID, and obtain the first four segments of the corresponding quantum device ID according to the encoding rule, the compatibility flag bit, the domain number, the device type, and the domain extension number in the request, generate the fifth segment of the quantum device ID based on a counting method, flexibly adapt multiple encoding rules through the "compatibility flag bit", split the ID into five segments of encoding, with clear logic and easy to expand, realize the dynamic generation of quantum device IDs compatible with different encoding rules, and ensure its structure is extensible. The present invention facilitates batch generation of device IDs, facilitates unified management of devices in a quantum secure communication network, enables data sharing and common use, and effectively reduces the cost and cost of unified management of devices.
[0011] In addition, in some embodiments, the determining the encoding rule according to the compatibility flag bit includes: if the compatibility flag bit belongs to a first interval, the encoding rule is a first encoding rule; if the compatibility flag bit belongs to a second interval, the encoding rule is a second encoding rule.
[0012] In addition, in some embodiments, generating the fifth-segment encoding of the quantum device ID based on a counting method includes: dividing a plurality of value intervals of equal length according to the maximum and minimum values of the fifth-segment encoding; determining three fields, namely min_id, step_id, and max_id, of the value interval; where min_id and max_id respectively represent the upper and lower limits of a value interval of the fifth-segment encoding of the quantum device ID, and step_id is the value between min_id and max_id; initializing the current ID value current_id to the max_id value of the current value interval, verifying current_id based on the values of min_id, step_id, and max_id of the current value interval, and determining the fifth-segment encoding of the quantum device ID based on the verification result.
[0013] In addition, in some embodiments, the min_id of the first value interval is the default initial value of the fifth-segment encoding of the quantum device ID, and the length of the value interval is less than the maximum value of the fifth-segment encoding.
[0014] In addition, in some embodiments, verifying current_id based on the values of min_id, step_id, and max_id of the current value interval and determining the fifth-segment encoding of the quantum device ID based on the verification result includes: if current_id is within the interval [min_id, max_id], then taking current_id as the fifth-segment encoding of the quantum device ID and decrementing current_id by 1; if current_id = step_id, then taking current_id as the fifth-segment encoding of the quantum device ID, decrementing current_id by 1, and updating the values of min_id, step_id, and max_id; if current_id is not within the interval [min_id, max_id], then updating the min_id, step_id, and max_id of the current value interval. After the update, initializing the current ID value current_id to the max_id value of the current value interval and re-verifying current_id.
[0015] In addition, in some embodiments, updating the values of min_id, step_id, and max_id includes: the min_id of the updated value interval = the max_id of the previous value interval + 1; the max_id of the updated value interval = the max_id of the previous value interval + the length of the value interval; the step_id of the updated value interval = the step_id of the previous value interval + the length of the value interval.
[0016] In addition, in some embodiments, the device further includes: a parsing module, configured to obtain the length of the quantum device ID, determine a parsing rule according to the length; and parse the quantum device ID according to the parsing rule to obtain a network domain number, a device type, and a network domain extension number. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplary illustrations do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the figures do not constitute a proportional limitation.
[0018] Figure 1 is a diagram of a quantum device ID rule according to an embodiment of the present application;
[0019] Figure 2 is a flowchart of a method for generating a quantum device ID according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of an encoding rule involved in a method for generating a quantum device ID according to an embodiment of the present application Figure 1 ;
[0021] Figure 4 is a schematic diagram of an encoding rule involved in a method for generating a quantum device ID according to an embodiment of the present application Figure 2 ;
[0022] Figure 5 is a flowchart of the generation of the fifth segment of encoding involved in a method for generating a quantum device ID according to an embodiment of the present application Figure 1 ;
[0023] Figure 6 is a flowchart of the generation of the fifth segment of encoding involved in a method for generating a quantum device ID according to an embodiment of the present application Figure 2 ;
[0024] Figure 7 is a flowchart of a method for parsing a quantum device ID according to an embodiment of the present application;
[0025] Figure 8 is a schematic structural diagram of an encoding / decoding device for a quantum device ID according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will elaborate on each embodiment of the present invention in conjunction with the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of the present invention, many technical details are provided to help readers better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can still be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation to the specific implementation of the present invention. The various embodiments can be combined and cross-referenced with each other on the premise of not being contradictory.
[0027] The current quantum secure communication network uses the first two digits of the device ID as the subnet number, with the number range from 0 to 99, and a total of 100 subnet numbers available for use. The existing quantum secure communication network uses 9-digit decimal numbers to represent the ID of a device, and the rules are as Figure 1 shown.
[0028] Among them, the definitions of each field are as follows. Subnet number: occupies the first two digits, and the examples are defined as follows: Trunk subnet: 00: Network information center for the whole network; 01: Beijing trunk network; 02: Jinan trunk network; 03: Nanjing trunk network; Access / Metro subnet (according to provincial geographical coding), 11: Beijing access network; 37: Jinan access network; 32: Nanjing access network. Device type: occupies the 3rd and 4th digits, and the relevant function types are defined as follows: 0x00: Server / information center; 0x02: Optical switching; 0x09: Quantum key application device. Subnet extension number (management domain): occupies the 5th and 6th digits, and the type is defined as follows: The same network (such as the Shanghai Metro network) supports being divided into multiple smaller subnets. The smaller subnets use the same subnet number, and the smaller subnets are distinguished by the subnet extension code. Device number: occupies the last 3 digits, and the type is defined as follows: 0x000: Spare; 0x001 - 0x999: Device number.
[0029] To achieve batch generation of device IDs, unified management of devices in a quantum secure communication network, data sharing and common use, and reduce the cost and expense of unified device management, this application provides a method for generating a quantum device ID on the one hand. Among them, by obtaining the compatibility flag bit, network domain number, device type, and network domain extension number in the request for generating the quantum device ID; further determining the encoding rule according to the compatibility flag bit; and obtaining the first four segments of the corresponding quantum device ID according to the encoding rule, the compatibility flag bit, the network domain number, the device type, and the network domain extension number; and generating the fifth segment of the quantum device ID based on a counting method; splicing the five segments of the quantum device ID in a fixed order to obtain the final quantum device ID. In this way, by obtaining the request for generating the quantum device ID, and obtaining the first four segments of the corresponding quantum device ID based on the encoding rule, compatibility flag bit, network domain number, device type, and network domain extension number in the request, generating the fifth segment of the quantum device ID based on a counting method, and further flexibly adapting multiple encoding rules through the "compatibility flag bit", splitting the ID into five segments of encoding, with clear logic and easy expansion, realizing the dynamic generation of quantum device IDs compatible with different encoding rules and ensuring its structure is extensible. The present invention facilitates batch generation of device IDs, can support unified management of different version identifiers of quantum devices in a quantum secure communication network, data sharing and common use, and has good applicability and popularization.
[0030] In some embodiments, the specific process of the method for generating a quantum device ID of the present invention is as Figure 2 shown, including the following steps.
[0031] Step 201, obtain a request for generating a quantum device ID, where the request includes at least a compatibility flag bit, a network domain number, a device type, and a network domain extension number.
[0032] Step 202, determine the encoding rule according to the compatibility flag bit, and obtain the first four segments of the corresponding quantum device ID according to the encoding rule, the compatibility flag bit, the network domain number, the device type, and the network domain extension number.
[0033] Step 203, generate the fifth segment of the quantum device ID based on a counting method.
[0034] Step 204, splice the five segments of the quantum device ID in a fixed order to obtain the final quantum device ID.
[0035] In this way, by obtaining the generation request of the quantum device ID, and obtaining the first four segments of the corresponding quantum device ID based on the encoding rule, compatibility flag bit, domain number, device type, and domain extension number in the request, generating the fifth segment of the quantum device ID based on the counting method, and flexibly adapting to multiple encoding rules through the "compatibility flag bit", the ID is split into five segments of encoding. The quantum device ID generated by the present invention is stored using an unsigned 32-bit integer, has strict global uniqueness, clear logic and is easy to expand, realizes the dynamic generation of quantum device IDs compatible with different encoding rules, and ensures the extensibility of its structure. The present invention facilitates the batch generation of device IDs, facilitates the unified management of devices in the quantum secure communication network, enables data sharing and common use, and effectively reduces the cost and expense of unified device management.
[0036] Specifically, for the convenience of those skilled in the art to better understand Figure 2 the generation method of the quantum device ID shown, the following will further describe its steps.
[0037] In step 202, the correspondence between the first four segments of the quantum device ID and their specific meanings is allocated and specified according to actual requirements, and needs to be manually entered into the system. They are stored in the database table in dictionary type respectively. After receiving the request to generate the quantum device ID, the ID generation program obtains the first four segments of the corresponding quantum device ID from the database table according to the encoding rule, compatibility flag bit, domain number, device type, and domain extension number in the request.
[0038] In addition, in some embodiments, please refer to Figure 3 、 Figure 4 , for determining the encoding rule according to the compatibility flag bit in step 202, it can be implemented in the following way. If the compatibility flag bit belongs to the first interval, the encoding rule is the first encoding rule; if the compatibility flag bit belongs to the second interval, the encoding rule is the second encoding rule. Among them, as Figure 3As shown in the figure, the five - segment coding composition of the first coding rule can be: 1 bit of the coding rule number; followed by 3 - bit subnet number coding, which is based on the provincial regional coding as the subnet number. The provincial regional coding refers to the coding system used to identify each provincial administrative unit in China. Each provincial administrative unit has a unique code, which can be composed of letters or numbers; then 1 bit of device type number coding. The device types are defined by enumeration method: server 00, QKD device 01, optical switch 02, ordinary terminal 03, trusted relay node 04, access node 05, direct relay node 06, miniaturized QKD device 07, quantum key application device 08, other devices 09; 2 - bit subnet extension number coding is the extended coding of the subnet, which is exactly the same as the existing device ID rule, occupying bits 6 and 7, with a range of 0 - 99, a total of 100 subnets. Among them, the same network supports being divided into multiple smaller subnets. The smaller subnets use the same subnet number, and the smaller subnets are distinguished by the subnet extension code. Each subnet is independently managed by the quantum key management service system, and multiple quantum key management service systems are collaboratively managed by the superior quantum key collaborative management system; finally, 3 - bit device number coding. As Figure 4 As shown in the figure, the five - segment coding composition of the second coding rule can include 2 - bit coding rule number coding, 8 - bit subnet number coding, 2 - bit device type number coding, 3 - bit subnet extension number coding, and 3 - bit device number coding; the specific coding methods for each segment can refer to the content recorded above and will not be elaborated here.
[0039] In this way, the coding rule can be determined through the compatibility flag bit, and further, the rule mapping can be clarified through interval division (the first / second interval), improving the selection efficiency, so as to quickly select the coding rule according to the compatibility flag bit and avoid rule conflicts.
[0040] In some embodiments, please refer to Figure 5 、 Figure 6 , for the fifth - segment coding of generating the quantum device ID in step 203 based on the counting method, the process can be as follows.
[0041] Step 2031, divide multiple value intervals with equal lengths according to the maximum and minimum values of the fifth - segment coding.
[0042] Step 2032, determine three fields of min_id, step_id, and max_id of the value interval; where min_id and max_id respectively represent the upper and lower limits of a value interval of the fifth - segment coding of the quantum device ID, and step_id is the value between min_id and max_id.
[0043] Step 2033: Initialize the current ID value current_id to the value of the current value range max_id, verify current_id based on the values of min_id, step_id, and max_id in the current value range, and determine the fifth segment encoding of the quantum device ID based on the verification result.
[0044] Specifically, for Step 2031 and Step 2032, the length of the ID segment of the fifth segment encoding is set according to the actual usage. For example, in one embodiment, the first ID segment is set to [000, 999]. That is, initially, the minimum value of the fifth segment encoding is 000, and the maximum value is 999. Then, multiple value ranges of equal length can be divided as needed. For example, a value range with min_id of 000 and max_id of 099 is divided, and the next value range should be a value range with min_id of 100 and max_id of 199, and so on. Within any value range, three fields, min_id, step_id, and max_id, can be determined. Among them, min_id and max_id respectively represent the upper and lower limits of a value range of the fifth segment encoding of the quantum device ID (such as the value range [000, 099] mentioned above), and step_id is a value between min_id and max_id. The value of step_id should be greater than min_id and less than max_id. At the same time, the min_id of the first value range is the default initial value of the fifth segment encoding of the quantum device ID, and the length of the value range is less than the maximum value of the fifth segment encoding.
[0045] Among them, the ID values between step_id and min_id are the ID buffer segments. The role of the buffer segment is as follows: If the IDs within the currently stored ID segment range in the database are used up, the ID segment needs to be replaced, and there will be a certain time consumption during the replacement process. Therefore, before the ID segment is used up, it is necessary to trigger the ID segment replacement process in advance and update it, so as to avoid the situation that the current ID segment is consumed and the new ID segment is not yet ready, resulting in the temporary inability to provide ID generation services externally. At the same time, the min_id value of the new ID segment is old ID segment's max_id + 1. By updating step_id, min_id, and max_id, device ID duplication can be avoided.
[0046] In addition, by dividing into multiple value ranges, the problem of ID duplication caused by random generation or dynamic allocation can be avoided, making the ID unique in the global or specific network, ensuring the continuity and manageability of the ID, and preventing ID duplication or overflow. Through the decreasing generation strategy within the range (gradually decreasing from max_id) and step verification, the uniqueness of the ID value within the global scope is ensured. This method inherits the fault-tolerant mechanism of serial number hash calculation and avoids the risk of duplicate numbers in the traditional increasing mode. The range processing disassembles the global verification into local verification, reducing the number of calculation executions.
[0047] Furthermore, please refer to Figure 5 、 Figure 6 , for the values of min_id, step_id, and max_id in the current value range in step 203, verify current_id, and determine the fifth-segment encoding of the quantum device ID based on the verification result. It can be the following way:
[0048] First, load the three fields of min_id, update_id, and max_id of the ID segment into memory; the ID counting module initializes the current ID value current_id to the value of min_id of the current ID segment; the ID generation program verifies current_id: if current_id is within the range [min_id, max_id], then use current_id as the fifth-segment encoding of the quantum device ID, and decrement current_id by 1; if current_id = step_id, then use current_id as the fifth-segment encoding of the quantum device ID, and decrement current_id by 1, and update the values of min_id, step_id, and max_id; if current_id is not within the range [min_id, max_id], then update min_id, step_id, and max_id of the current value range. After the update, initialize the current ID value current_id to the value of max_id of the current value range, and verify current_id again.
[0049] Furthermore, in some embodiments, the update of the value range of the above ID segment can be achieved in the following way: the min_id of the updated value range = the max_id of the previous value range + 1; the max_id of the updated value range = the max_id of the previous value range + the length of the value range; the step_id of the updated value range = the step_id of the previous value range + the length of the value range.
[0050] Furthermore, it should be noted that when current_id = step_id, the replacement / update operation of the ID segment is triggered. The value-taking principle of step_id is determined according to actual requirements. For example, the specific value of step_id depends on the usage scenario, including two conditions: the length of the ID segment and the usage / consumption rate of the ID.
[0051] Therefore, the general update rule for step_id is: step_id of the new ID segment = step_id of the previous ID segment + the length of the ID segment; alternatively, when updating to the second value range, the value of step_id can be reset, but it should satisfy the basic principle that step_id is a value between min_id and max_id, and the value of step_id should be greater than min_id and less than max_id. In this way, through formulaic updates, it is ensured that the new range is strictly connected to the old range, maintaining the global uniqueness of the ID and avoiding range overlap or discontinuity.
[0052] Based on this, the method for generating the quantum device ID of the present invention can be implemented. In this method, by obtaining the generation request of the quantum device ID, and based on the encoding rule, compatibility flag bit, network domain number, device type, and network domain extension number in the request, the first four segments of the encoding of the corresponding quantum device ID are obtained, and the fifth segment of the encoding of the quantum device ID is generated based on the counting method. Through the "compatibility flag bit", various encoding rules can be flexibly adapted, and the ID is split into five segments of encoding. The quantum device ID generated by the present invention is stored using an unsigned 32-bit integer, has strict global uniqueness, clear logic and is easy to expand, realizes the dynamic generation of quantum device IDs compatible with different encoding rules, and ensures the expandability of its structure. The present invention facilitates the batch generation of device IDs, facilitates the unified management of devices in the quantum secure communication network, enables data sharing and common use, and effectively reduces the cost and expense of unified device management.
[0053] Another embodiment of the present invention relates to a method for parsing a quantum device ID. Please refer to Figure 7 , and this parsing method includes: obtaining the length of the quantum device ID, determining the parsing rule according to the length; parsing the quantum device ID according to the parsing rule to obtain the network domain number, device type, and network domain extension number.
[0054] Specifically, by parsing the quantum device ID, the length of the device ID is judged, the device coding rule is selected, and the coding rule of the device is verified. If the coding rule code of the device meets the preset conditions, the device subnet number, device type, and subnet extension number are respectively obtained at the ID bits of the device ID according to the coding rule. If the verification fails, an error log is recorded. In this way, the coding rule is inferred in reverse according to the ID length, so as to quickly parse the quantum device ID and obtain the original parameters (network domain number, device type, etc.). If the length of the device ID is other digits, it is parsed according to other device coding rules, or an error log is directly recorded.
[0055] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, it is within the protection scope of this patent; adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of its algorithm and process are all within the protection scope of this patent.
[0056] Another embodiment of the present invention relates to a quantum device ID encoding and decoding device, as Figure 8 shown, including: an acquisition module 310, configured to acquire a request for generating a quantum device ID, where the request includes at least a compatibility flag bit, a network domain number, a device type, and a network domain extension number; a first encoding module 320, configured to determine a coding rule according to the compatibility flag bit; and obtain the first four segments of the corresponding quantum device ID encoding according to the coding rule, the compatibility flag bit, the network domain number, the device type, and the network domain extension number; the quantum device ID is composed of five segments of encoding; a second encoding module 330, configured to generate the fifth segment of the quantum device ID encoding based on a counting method; and an output module 340, configured to splice the five segments of the quantum device ID encoding in a fixed order to obtain the final quantum device ID.
[0057] Further, in some embodiments, the device further includes a parsing module 350, configured to obtain the length of the quantum device ID, determine a parsing rule according to the length; and parse the quantum device ID according to the parsing rule to obtain the network domain number, the device type, and the network domain extension number.
[0058] In this way, by splitting the generation process into independent modules (acquisition, encoding, output), it is convenient for division of labor in development and testing. The ID generation is realized through a modular device, which improves the maintainability of the code. In addition, the device of the present invention also integrates a parsing module to realize the integrated processing of ID generation and parsing.
[0059] It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or can be implemented as a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, units not closely related to solving the technical problems proposed by the present invention are not introduced in this embodiment, but this does not mean that there are no other units in this embodiment.
[0060] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiment is implemented.
[0061] That is, those skilled in the art can understand that all or part of the steps in implementing the method of the above embodiments can be completed by a program instructing relevant hardware. The program is stored in a storage medium, including several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0062] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0063] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0064] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means embodying the functionality specified in one or more of the flow Figure 1 steps or blocks Figure 1 specified in one or more of the blocks.
[0065] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functionality specified in one or more of the flow Figure 1 steps or blocks Figure 1 specified in one or more of the blocks.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific embodiments of the present invention. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.
Claims
1. A method for generating a quantum device ID, characterized in that: The generation method comprises: Obtaining a request for generating a quantum device ID, the request including at least a compatible flag, a network domain number, a device type, and a network domain extension number; Determine the encoding rule according to the compatible flag; and obtain the first four codes of the corresponding quantum device ID according to the encoding rule, the compatible flag, the network domain number, the device type and the network domain extension number; the quantum device ID consists of five codes; wherein, Generate a fifth segment code of the quantum device ID based on the counting method; The five segments of the quantum device ID are concatenated in a fixed order to obtain a final quantum device ID.
2. The method for generating a quantum device ID according to claim 1, characterized in that: The determining of the encoding rule according to the compatible flag bit includes: If the compatible flag bit belongs to the first interval, the encoding rule is the first encoding rule; If the compatible flag bit belongs to the second interval, the encoding rule is the second encoding rule.
3. The method for generating a quantum device ID according to claim 1, characterized in that: The fifth segment code for generating the quantum device ID based on the counting method includes: Divide a plurality of value intervals of equal length according to the maximum value and the minimum value of the fifth segment code; Determine the value range of the three fields min_id, step_id and max_id; among them, min_id and max_id represent the upper and lower limits of a value range of the fifth segment of the quantum device ID code, respectively, and step_id is a value between min_id and max_id; Initialize the current ID value current_id to the value of the current value interval max_id, and verify the current_id based on the values of min_id, step_id and max_id in the current value interval, and determine the fifth segment code of the quantum device ID based on the verification result.
4. The method for generating a quantum device ID according to claim 3, characterized in that: The min_id of the first value interval is the default initial value of the fifth segment code of the quantum device ID, and the length of the value interval is less than the maximum value of the fifth segment code.
5. The method for generating a quantum device ID according to claim 3, characterized in that: The current_id is verified based on the values of min_id, step_id and max_id in the current value interval, and the fifth segment code of the quantum device ID is determined based on the verification result, including: If current_id is in the interval [min_id, max_id], then current_id is used as the fifth segment of the quantum device ID, and current_id is reduced by 1; If current_id=step_id, then current_id is used as the fifth segment of the quantum device ID, current_id is reduced by 1, and the values of min_id, step_id, and max_id are updated; If current_id is not in the interval [min_id, max_id], the min_id, step_id and max_id of the current value interval are updated. After the update, the current ID value current_id is initialized to the value of max_id in the current value interval, and current_id is re-checked.
6. A method for generating a quantum device ID according to claim 5, characterized in that: The updating of the values of min_id, step_id and max_id includes: The min_id of the updated value interval = the max_id of the previous value interval + 1; The max_id of the updated value interval = the max_id of the previous value interval + the length of the value interval; The step_id of the updated value interval = the step_id of the previous value interval + the length of the value interval.
7. A method for analyzing a quantum device ID, characterized in that: The analysis method comprises: Obtaining the length of the quantum device ID, and determining a parsing rule according to the length; The quantum device ID is parsed according to the parsing rule to obtain a network domain number, a device type, and a network domain extension number.
8. A quantum device ID encoding and decoding device, characterized in that: The device comprises: Acquisition module: used to obtain a request for generating a quantum device ID, wherein the request includes at least a compatible flag bit, a network domain number, a device type, and a network domain extension number; A first encoding module is used to determine an encoding rule according to the compatible flag bit; and to obtain the first four codes of the corresponding quantum device ID according to the encoding rule, the compatible flag bit, the network domain number, the device type and the network domain extension number; the quantum device ID is composed of five codes; A second encoding module, used to generate a fifth segment code of the quantum device ID based on a counting method; The output module is used to splice the five segments of the quantum device ID in a fixed order to obtain the final quantum device ID.
9. The encoding and decoding device of quantum device ID according to claim 8, characterized in that: The device also includes: The parsing module is used to obtain the length of the quantum device ID, determine the parsing rule according to the length; and parse the quantum device ID according to the parsing rule to obtain the network domain number, device type and network domain extension number.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for generating a quantum device ID described in any one of claims 1 to 6 and the method for analyzing a quantum device ID described in claim 7 are implemented.