Unmanned aerial vehicle key pairing method and device and storage medium thereof
By chunking the drone keys and safely expanding them when needed, the problem of excessive key storage in drone communication is solved, decentralized random pairing and communication is realized, and storage space and operations are reduced. time.
Patent Information
- Application Number
- CN202411061128.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-12
AI Technical Summary
In existing drone communications, centralized deployment methods cannot meet the random communication needs of multiple usage scenarios, especially when no central node is available, resulting in an exponential increase in the amount of key storage and occupying a large amount of storage space and resources.
The keys are divided into blocks and securely expanded when needed, establish a correspondence between the drone identity and the key block, and only key expansion is performed during communication, reducing storage requirements, and possessing decentralized random pairing capabilities.
It effectively reduces the storage space requirement, shortens the operating time of preset keys, and realizes communication between drones without a central node.
Smart Images

Figure CN118945652A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicles, and in particular to a method and device for pairing a key of an unmanned aerial vehicle and a storage medium thereof. Background Art
[0002] Currently, unmanned aerial vehicles (collectively referred to as drones) are becoming increasingly popular, from civilian equipment to military facilities. In addition to the mainstream usage scenarios of human control, it also involves mutual communication between drones and communication between two or even multiple drones (similar to multi-person group chat); therefore, the security of drone communications is very important.
[0003] At present, drone communication adopts a mature centralized deployment method, that is, the control center and all drones that can send messages have their own paired keys. When any drone needs to send a message to a certain number of other drones, the control center will decrypt the sender's ciphertext and re-encrypt it according to the number of receiver key pairs and information before sending it out. At this time, the control center completes the functions of decryption, traversal, encryption, and forwarding. The two parties in direct communication are always the control center and a single drone individual, and the control center bears the communication load pressure of the entire network.
[0004] The mature centralized deployment method cannot meet the ever-changing multi-use scenarios, because the communication between drones is random and there is a one-to-many situation, and there is often no central node available in the actual scenario. That is, when the drone is performing mission communication outside, it is impossible to forward the sent message to the control center first, and then forward it by the control center, so the drone needs to have decentralized random pairing capabilities. The most important thing in the random pairing communication of drones is the communication key pairing. If each drone has the key data of all the drones on the other end, as the number of drones increases, the storage capacity of the key will also increase exponentially, then each drone will require huge storage space, and it will also increase the time for pre-setting keys, consuming a lot of resources.
[0005] In summary, how to enable drones to achieve communication key pairing in a decentralized manner and make the communication keys occupy less storage space to ensure that storage resources are saved during normal communication is a technical issue that the industry is currently concerned about. Summary of the invention
[0006] Purpose of the invention: In order to solve the related technical problems raised in the background technology, the purpose of the present invention is to provide a drone key pairing method, device and storage medium thereof, which divides the key into blocks instead of presetting the complete body. When communication key pairing is required, the key block is securely expanded. At this time, the total storage required for the key can be greatly reduced, and the expansion is only required when it is used, and no expansion is required when it is not used.
[0007] Technical solution: The present invention provides a drone key pairing method, comprising the following steps:
[0008] (1) presetting the same key area for each drone in the drone group, and then dividing the key in the key area of each drone according to the number of drones in the drone group, to obtain multiple groups of key blocks equal to the number of drones;
[0009] (2) Each drone maps its unique identity to a set of key blocks, establishing a one-to-one correspondence between the drone's identity and the key blocks;
[0010] (3) The drone that sends the message in the drone group is set as the sending drone, and the drone that receives the message in the drone group is set as the receiving drone; the sending drone obtains the corresponding key block according to its own unique identity, compares the remaining key amount in the key block with the preset first key threshold to obtain a comparison result and generates a corresponding comparison result identifier, obtains the encryption key according to the comparison result, encrypts the message to be sent to obtain a ciphertext, and then sends the comparison result identifier, the ciphertext, the key information of the encryption key and the unique identity of the sending drone to the receiving drone;
[0011] (4) The receiving drone obtains the corresponding key block based on the sending drone’s own unique identity, and then obtains the decryption key based on the comparison result identifier and the key information of the encryption key. The ciphertext is decrypted using the decryption key to obtain the sent message.
[0012] Furthermore, each drone in the drone group is preset with the same key expansion area, and is preset with the same first expansion ratio and first expansion method.
[0013] Furthermore, the remaining key amount in the key block is compared with the preset first key threshold to obtain a comparison result and generate a corresponding comparison result identifier. The specific process of obtaining the encryption key according to the comparison result to encrypt the sent message to obtain the ciphertext is as follows:
[0014] The remaining key amount in the key block is compared with the preset first key threshold. If it exceeds the preset first key threshold, a first identifier is generated and an encryption key is obtained from the key block to encrypt the message to be sent to obtain a ciphertext, and the first identifier, ciphertext, key information of the encryption key and the sending drone's own unique identity are sent to the receiving drone; if it does not exceed the preset first key threshold, a second identifier is generated and the remaining key amount in the key block is expanded according to a preset first expansion ratio and a first expansion method, the expanded key is placed in a key file in the key expansion area, and then the encryption key is obtained from the key file to encrypt the message to be sent to obtain a ciphertext, and the second identifier, ciphertext, key information of the encryption key and the sending drone's own unique identity are sent to the receiving drone.
[0015] Furthermore, the specific process of obtaining the decryption key according to the comparison result identifier and the key information of the encryption key is:
[0016] If the receiving drone receives the first identifier, it obtains the decryption key directly from the key block corresponding to the sending drone's own unique identity identifier according to the key information of the encryption key, and decrypts the ciphertext using the decryption key to obtain the sent message; if the receiving drone receives the second identifier, it first obtains the key block corresponding to the sending drone's own unique identity identifier, and then expands the remaining key amount in the key block according to the preset first expansion ratio and the first expansion method, places the expanded key in the key file in the key expansion area, obtains the decryption key from the key file according to the key information of the encryption key, and decrypts the ciphertext using the decryption key to obtain the sent message.
[0017] Furthermore, when the sending drone generates the second identifier, the messages sent by the sending drone to the receiving drone are all encrypted by obtaining the encryption key from the key file to obtain the ciphertext; when the receiving drone receives the second identifier, the receiving drone receives the ciphertext from the sending drone by obtaining the decryption key from the key file to decrypt it.
[0018] Furthermore, the key information refers to the starting position of the key and the length of the key.
[0019] Furthermore, the specific process of obtaining the encryption key from the key file to encrypt the message sent by the sending drone to the receiving drone to obtain the ciphertext is as follows:
[0020] The remaining key amount in the key file is compared with the preset second key threshold. If it exceeds the preset second key threshold, a third identifier is generated and the encryption key is directly obtained from the key file to encrypt the message to be sent to obtain the ciphertext, and the third identifier is sent to the receiving drone along with the ciphertext; if it does not exceed the preset second key threshold, a fourth identifier is generated and the remaining key amount in the key file is expanded according to the preset second expansion ratio and second expansion method, and the encryption key is obtained from the expanded key file to encrypt the message to be sent to obtain the ciphertext, and the fourth identifier is sent to the receiving drone along with the ciphertext.
[0021] The present invention also includes a computer device, which includes at least a processor and a memory, and the processor is used to implement the drone key pairing method as described in any one of the above claims when executing a computer program stored in the memory.
[0022] The present invention also includes a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the drone key pairing method as described in any one of the above claims is implemented.
[0023] Beneficial effects: The present invention divides the key into blocks instead of presetting the complete body. When communication key pairing is required, the key block is securely expanded. At this time, the total storage required for the key can be greatly reduced, and the key only needs to be expanded when it is used. There is no need to worry about the expansion of the key when it is not used. It can be seen that the present invention not only effectively reduces the storage space when pairing the same number of drones, but also shortens the operation time of presetting the key. At the same time, due to the decentralized random pairing capability, communication between drones can also be achieved when an abnormal situation occurs due to the inability of the control center to work. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a flow chart of the drone key pairing method of the present invention;
[0025] Figure 2 It is a schematic diagram of the key area and key expansion area structure of the drone of the present invention;
[0026] Figure 3 This is a schematic diagram of the key pairing of the drone of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0028] It should be noted that, in the absence of conflicts, the embodiments of the present invention and the features in the embodiments can be combined with each other. In addition, unless there are clear provisions and limitations, the terms "connect", "connected", and "installed" appearing in the description should be understood in a broad sense. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood by specific circumstances. In addition, it should be understood in the description of the present invention that the terms "front", "rear", "left", "right", etc. that indicate orientation or reflect positional relationships are only based on the orientation or positional relationship that appears in the accompanying drawings. It is for the convenience of describing the present invention, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. The present invention is not limited to the embodiments disclosed herein.
[0029] At present, mature centralized deployment methods cannot meet the ever-changing multi-use scenarios, so drones need to have decentralized random pairing capabilities; and the most important thing in drone random pairing communication is communication key pairing. If each drone has the key data of all drones on the other end, as the number of drones increases, the storage capacity required for the key will also increase exponentially, then each drone will require a huge storage space, and it will also increase the time for presetting the key, consuming a lot of resources. The present invention is to solve this technical problem.
[0030] like Figure 1 As shown, in view of this, an embodiment of the present invention proposes a drone key pairing method, which divides the key into blocks instead of presetting the complete body. When communication key pairing is required, the key block is securely expanded. At this time, the total storage required for the key can be greatly reduced, and the key only needs to be expanded when it is used. There is no need to worry about the expansion of the key when it is not used. It can be seen that the present invention not only effectively reduces the storage space when pairing the same number of drones, but also shortens the operation time of presetting the key. The method specifically includes the following steps:
[0031] like Figure 2 As shown, first, each drone in the drone group is preset with the same key expansion area, and is preset with the same first expansion ratio and first expansion method; at the same time, each drone in the drone group is also preset with the same key area, and then the key in the key area of each drone is divided according to the number of drones in the drone group, and multiple groups of key blocks with the same number of drones are obtained; for example, assuming that there are eight drones in the drone group, then each drone is preset with the same key area, and then the key in the key area is divided to obtain eight groups of key blocks; wherein the division here can be equal division or unequal division. After the division, each drone in the drone group has the same key block composition.
[0032] Each drone maps its unique identity to a set of key blocks, establishing a one-to-one correspondence between the drone's identity and the key blocks; for example, drone No. 1 maps its unique identity P1 to the first set of key blocks, drone No. 2 maps its unique identity P2 to the second set of key blocks, and so on, thereby establishing a one-to-one correspondence between the drone's identity and the key blocks;
[0033] like Figure 3 As shown, then, the drone that sends the message in the drone group is set to be recorded as the sending drone, and the drone that receives the message in the drone group is recorded as the receiving drone; the sending drone obtains the corresponding key block according to its own unique identity, compares the remaining key amount in the key block with the preset first key threshold to obtain a comparison result and generates a corresponding comparison result identifier, obtains the encryption key according to the comparison result, encrypts the sent message to obtain a ciphertext, and then sends the comparison result identifier, the ciphertext, the key information of the encryption key and the sending drone's own unique identity to the receiving drone; for example, the sending drone is drone number one, and its corresponding key block is the first group of key blocks.
[0034] The remaining key amount in the key block is compared with the preset first key threshold to obtain a comparison result and generate a corresponding comparison result identifier. The specific process of obtaining the encryption key according to the comparison result to encrypt the sent message to obtain the ciphertext is as follows:
[0035] Because the keys in the pre-set key area are a collection of all drones, the key amount of the key block after segmentation will vary depending on the number of all drones. In extreme cases, drones are subject to dual restrictions of storage capacity and the excessive number of drones. The pre-set key amount of a single drone is set in KB or MB. During communication, the remaining key amount of the key block will be expanded. Whether the key is expanded or not is controlled according to the preset threshold of the key capacity. In the case of unequal segmentation, the key amount in each key block is also different.
[0036] The remaining key amount in the key block is compared with the preset first key threshold, for example, the first key threshold is 50MB. If it exceeds the preset first key threshold, a first identifier is generated and the encryption key is obtained from the key block to encrypt the sent message to obtain the ciphertext. The first identifier is the comparison result identifier, indicating that the remaining key amount in the key block will not be expanded. The first identifier, ciphertext, key information of the encryption key and the unique identity of the sending drone are sent to the receiving drone. The key information of the encryption key refers to the starting position of the encryption key and the length of the encryption key. If it does not exceed the preset first key threshold, a second identifier is generated. The second identifier is the comparison result identifier, indicating that The remaining key amount in the key block is expanded, that is, the remaining key amount in the key block is expanded according to the first expansion ratio and the first expansion method preset for each drone, for example, the first expansion ratio is 1:16, and the first expansion method is the existing AES expansion method; the expanded key is placed in the key file in the key expansion area, the key expansion area can be divided into multiple key files, the expanded key is placed in one of the key files, such as the first key file, and then the encryption key is obtained from the key file to encrypt the sent message to obtain the ciphertext, and the second identifier, the ciphertext, the key information of the encryption key and the sending drone's own unique identity are sent to the receiving drone.
[0037] Here, since the encryption operation can adopt a 1:1 XOR operation, the length of the message sent should be less than or equal to the first key threshold. Only in this way can it be ensured that when the remaining key amount exceeds the first key threshold, the remaining key amount is sufficient to perform the encryption operation on the sent message. If the length of the message sent is greater than the first key threshold, the message sent can be divided according to the length of the first key threshold to obtain multiple sub-messages less than or equal to the first key threshold, and then the encryption key is obtained to encrypt the sub-messages. Each encryption process of the sub-message goes through the process of comparing the remaining key amount with the preset first key threshold.
[0038] For each divided key block, the first key threshold corresponding to each key block may be the same first key threshold or different first key thresholds.
[0039] The receiving drone obtains the corresponding key block according to the unique identity of the sending drone, and then obtains the decryption key according to the comparison result and the key information of the encryption key. The ciphertext is decrypted by the decryption key to obtain the sent message. The specific process is as follows:
[0040] If the receiving drone receives the first identifier, it means that the remaining key amount in the key block is not expanded. Then, the decryption key is directly obtained from the key block corresponding to the unique identity of the sending drone according to the key information of the encryption key. For example, the unique identity of the sending drone P1 shows drone number one. Then, according to the one-to-one correspondence with the key block, the key block is also the first group of key blocks. For the receiving drone, the decryption key is obtained from the first group of key blocks according to the key information of the encryption key, and the ciphertext is decrypted by the decryption key to obtain the sent message; if the receiving drone receives the second identifier, it means that the remaining key amount in the key block needs to be expanded first. Then, the key block corresponding to the unique identity of the sending drone is first obtained. For example, according to the one-to-one correspondence between the key blocks, the first group of key blocks is displayed. The remaining key amount in the key block is expanded by the first group of key blocks according to the first expansion ratio and the first expansion method preset by the drone, and the expanded key is placed in the key file in the key expansion area. The decryption key is obtained from the key file according to the key information of the encryption key, and the ciphertext is decrypted by the decryption key to obtain the sent message.
[0041] It should be noted that when the sending drone generates the second identifier, the messages sent by the sending drone to the receiving drone after the second identifier is generated all obtain the encryption key from the key file to encrypt the sent messages to obtain the ciphertext; when the receiving drone receives the second identifier, the receiving drone receives the ciphertext from the sending drone and obtains the decryption key from the key file to decrypt it. In other words, once it is expanded into a key file, the keys required subsequently are all obtained from the key file, and there is no need to repeatedly determine whether the key block meets the threshold, thereby avoiding the situation of repeatedly establishing a key file.
[0042] Among them, the specific process of obtaining the encryption key from the key file to encrypt the message sent by the sending drone to the receiving drone to obtain the ciphertext is as follows:
[0043] The remaining key amount in the key file is compared with the preset second key threshold, for example, the second key threshold is 100MB. If it exceeds the preset second key threshold, a third identifier is generated and the encryption key is directly obtained from the key file to encrypt the message to be sent to obtain the ciphertext. The third identifier is sent to the receiving drone along with the ciphertext. The third identifier indicates that the remaining key amount in the key file is sufficient and does not need to be expanded. If it does not exceed the preset second key threshold, a fourth identifier is generated and the remaining key amount in the key file is expanded according to the preset second expansion ratio and second expansion method. The generation of the fourth identifier indicates that the remaining key amount in the key file needs to be expanded. The second expansion ratio and the second expansion method are also preset by the drone and are used to expand the remaining key amount in the key file. The encryption key is obtained from the expanded key file to encrypt the message to be sent to obtain the ciphertext. The fourth identifier is sent to the receiving drone along with the ciphertext. The subsequent decryption of the ciphertext by the receiving drone is basically the same as the encrypted message, so it will not be described again.
[0044] In summary, the drone key pairing method of the present invention has a decentralized random pairing capability, and can also achieve communication between drones when an abnormal situation occurs due to the inability of the control center to work; moreover, the present invention divides the key into blocks instead of presetting the complete body, and when communication key pairing is required, the key block is securely expanded, which can greatly reduce the total storage required for the key, and only needs to be expanded when it is used, and there is no need to worry about the expansion of the key when it is not used. It can be seen that when the present invention pairs the same number of drones, it not only effectively reduces the storage space, but also shortens the operation time of presetting the key.
[0045] An embodiment of the present invention further provides a computer device, which includes at least a processor and a memory, wherein the memory stores a computer program, and the processor is used to implement the drone key pairing method of the embodiment of the present invention when executing the computer program stored in the memory.
[0046] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the drone key pairing method of the embodiment of the present invention is implemented.
[0047] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A drone key pairing method, It is characterized in that The following steps are involved: (1) presetting the same key area for each drone in the drone group, and then dividing the key in the key area of each drone according to the number of drones in the drone group, to obtain multiple groups of key blocks equal to the number of drones; (2) Each drone maps its unique identity to a set of key blocks, establishing a one-to-one correspondence between the drone's identity and the key blocks; (3) The drone that sends the message in the drone group is set as the sending drone, and the drone that receives the message in the drone group is set as the receiving drone; the sending drone obtains the corresponding key block according to its own unique identity, compares the remaining key amount in the key block with the preset first key threshold to obtain a comparison result and generates a corresponding comparison result identifier, obtains the encryption key according to the comparison result, encrypts the message to be sent to obtain a ciphertext, and then sends the comparison result identifier, the ciphertext, the key information of the encryption key and the unique identity of the sending drone to the receiving drone; (4) The receiving drone obtains the corresponding key block based on the sending drone’s own unique identity, and then obtains the decryption key based on the comparison result identifier and the key information of the encryption key. The ciphertext is decrypted using the decryption key to obtain the sent message.
2. A drone key pairing method according to claim 1, Features: Each drone in the drone group is preset with the same key expansion area, and is preset with the same first expansion ratio and first expansion method.
3. A drone key pairing method according to claim 2, Features: The remaining key amount in the key block is compared with the preset first key threshold to obtain a comparison result and generate a corresponding comparison result identifier. The specific process of obtaining the encryption key according to the comparison result to encrypt the sent message to obtain the ciphertext is as follows: The remaining key amount in the key block is compared with a preset first key threshold. If the amount exceeds the preset first key threshold, a first identifier is generated and an encryption key is obtained from the key block to encrypt the message to be sent to obtain a ciphertext. The first identifier, the ciphertext, the key information of the encryption key and the unique identity of the sending drone are sent to the receiving drone. If the preset first key threshold is not exceeded, a second identifier is generated and the remaining key amount in the key block is expanded according to the preset first expansion ratio and the first expansion method, and the expanded key is placed in the key file in the key expansion area, and then the encryption key is obtained from the key file to encrypt the sent message to obtain a ciphertext, and the second identifier, ciphertext, key information of the encryption key and the sending drone's own unique identity are sent to the receiving drone.
4. A drone key pairing method according to claim 3, Features: The specific process of obtaining the decryption key according to the comparison result identifier and the key information of the encryption key is: If the receiving drone receives the first identifier, it obtains the decryption key directly from the key block corresponding to the sending drone's own unique identity identifier according to the key information of the encryption key, and decrypts the ciphertext using the decryption key to obtain the sent message; if the receiving drone receives the second identifier, it first obtains the key block corresponding to the sending drone's own unique identity identifier, and then expands the remaining key amount in the key block according to the preset first expansion ratio and the first expansion method, places the expanded key in the key file in the key expansion area, obtains the decryption key from the key file according to the key information of the encryption key, and decrypts the ciphertext using the decryption key to obtain the sent message.
5. A drone key pairing method according to claim 4, Features: When the sending drone generates the second identifier, the messages sent by the sending drone to the receiving drone are all encrypted using the encryption key obtained from the key file to obtain ciphertext; when the receiving drone receives the second identifier, the receiving drone receives the ciphertext from the sending drone using the decryption key obtained from the key file to decrypt it.
6. A drone key pairing method according to claim 1, Features: The key information refers to the starting position of the key and the length of the key.
7. A drone key pairing method according to claim 5, Features: The specific process of obtaining the encryption key from the key file to encrypt the message sent by the sending drone to the receiving drone to obtain the ciphertext is as follows: The remaining key amount in the key file is compared with the preset second key threshold. If it exceeds the preset second key threshold, a third identifier is generated and the encryption key is directly obtained from the key file to encrypt the sent message to obtain a ciphertext. The third identifier is sent to the receiving drone along with the ciphertext. If the preset second key threshold is not exceeded, a fourth identifier is generated and the remaining key amount in the key file is expanded according to the preset second expansion ratio and second expansion method. The encryption key is obtained from the expanded key file to encrypt the sent message to obtain a ciphertext, and the fourth identifier is sent to the receiving drone along with the ciphertext.
8. A computer device, Features: The computer device comprises at least a processor and a memory, and the processor is used to implement the drone key pairing method as described in any one of claims 1 to 7 when executing a computer program stored in the memory.
9. A computer-readable storage medium, Features: It stores a computer program, which, when executed by a processor, implements the drone key pairing method as described in any one of claims 1 to 7.
