Cipher equipment cluster management method and device, equipment and storage medium

By determining candidate cryptographic devices in a distributed cryptographic device cluster and performing elections, the communication performance problems caused by equipment disconnection or network delay are solved, and communication connections are quickly established and communication efficiency is improved.

CN118944883AInactive Publication Date: 2024-11-12GUANGDONG ELECTRONIC CERTIFICATION AUTHORITY CO LTD

Patent Information

Application Number
CN202411265374.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The distributed cryptographic device cluster architecture has poor communication performance due to equipment disconnection or network delay.

Method used

By detecting that the host password device meets the preset conditions, the candidate password device is determined, and the candidate password device is driven to send an election request to the slave password device, and the target host password device is determined based on the election results, thereby quickly establishing a communication connection between the password device clusters. .

Benefits of technology

It improves the communication efficiency of password management equipment, avoids poor communication performance caused by equipment disconnection or network delay, and ensures the stable operation of distributed password equipment clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944883A_ABST
    Figure CN118944883A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information security, in particular to a password device cluster management method and device, equipment and a storage medium, and the method comprises the steps: determining candidate password devices in slave password devices when a host password device meets a preset condition, and driving the candidate password devices to send election requests to the slave password devices, and determining a new target host cryptographic device in the candidate cryptographic devices according to the election result, thereby quickly establishing communication connection between cryptographic device clusters, improving the communication efficiency of the cryptographic management device, and avoiding the problem that in the prior art, a distributed cryptographic device cluster architecture may be influenced by factors such as device offline or network delay. And the communication performance is poor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a cryptographic device cluster management method, device, equipment and storage medium. Background Art

[0002] In the distributed management architecture of cryptographic devices, in order to facilitate device management, a central device node is generally set up, and a global service instance list is registered in the central device node, so as to improve the management performance of the distributed architecture. However, it is precisely because of the existence of the central device node that the communication performance of the distributed architecture is poor when the network is delayed or the central device node is offline.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a cryptographic device cluster management method, apparatus, equipment and storage medium, aiming to solve the technical problem in the prior art that the distributed cryptographic device cluster architecture may have poor communication performance due to factors such as device disconnection or network delay.

[0005] To achieve the above object, the present invention provides a cryptographic device cluster management method, the method comprising the following steps:

[0006] When it is detected that the master cryptographic device meets a preset condition, determining a candidate cryptographic device, wherein the candidate cryptographic device is converted from at least one slave cryptographic device;

[0007] Driving the candidate cryptographic device to send an election request to each slave cryptographic device;

[0008] A target host cryptographic device is determined according to the election result, and the target host cryptographic device is obtained by transforming the candidate cryptographic device.

[0009] In one embodiment, determining a candidate cryptographic device includes:

[0010] Obtain the last communication time between each slave cryptographic device and the master cryptographic device;

[0011] Determine a target slave cryptographic device according to the last communication time, the target slave cryptographic device being a slave cryptographic device with the smallest time difference between the last communication time and the current time;

[0012] The target slave cryptographic device is marked as a candidate cryptographic device.

[0013] In one embodiment, the step of driving the candidate cryptographic device to send an election request to each slave cryptographic device includes:

[0014] When the number of the candidate cryptographic devices is at least two, driving each candidate cryptographic device to broadcast a voting request to each slave cryptographic device respectively, and receiving a voting response fed back by each slave cryptographic device based on the voting request;

[0015] The votes of each candidate cryptographic device are counted according to the response information.

[0016] In one embodiment, determining the target host cryptographic device according to the election result includes:

[0017] Determine the target candidate cryptographic device having the most votes among the candidate cryptographic devices;

[0018] driving the target candidate cryptographic device to send a master promotion request to each slave cryptographic device;

[0019] When receiving slave responses fed back by each slave cryptographic device based on the master promotion request, the target candidate cryptographic device is marked as a target master cryptographic device.

[0020] In one embodiment, after determining the target candidate cryptographic device having the most votes among the candidate cryptographic devices, the method further includes:

[0021] When the votes of the candidate cryptographic devices are the same, determining the historical host response time of each candidate cryptographic device;

[0022] A target candidate cryptographic device is determined based on the historical host response time.

[0023] In one embodiment, when it is detected that the host cryptographic device meets the preset condition, determining the candidate cryptographic device, before the candidate cryptographic device is converted from at least one slave cryptographic device, further includes:

[0024] When the host cryptographic device receives a registration request from the cryptographic device to be added, a session key is generated;

[0025] Establishing a communication connection between the host cryptographic device and the to-be-joined cryptographic device based on the session key;

[0026] The password device to be added is marked as a slave password device.

[0027] In one embodiment, generating a session key includes:

[0028] Driving the host cryptographic device to generate a first random number;

[0029] Encrypting the first random number by using a preset public key, and sending the encrypted first random number to the cryptographic device to be added;

[0030] Driving the cryptographic device to be added to generate a second random number;

[0031] encrypting the first random number and the second random number, and sending the encrypted first random number and the encrypted second random number to the host cryptographic device;

[0032] driving the host cryptographic device to verify the first random number;

[0033] After the verification is successful, the host cryptographic device and the to-be-joined cryptographic device are driven to generate a session key based on the first random number and the second random number.

[0034] In addition, to achieve the above-mentioned purpose, the present invention also proposes a cryptographic device cluster management device, the cryptographic device cluster management device comprising:

[0035] A detection module, configured to determine a candidate cryptographic device when it is detected that the host cryptographic device meets a preset condition, wherein the candidate cryptographic device is converted from at least one slave cryptographic device;

[0036] An election module, used to drive the candidate cryptographic device to send an election request to each slave cryptographic device;

[0037] The determination module is used to determine the target host cryptographic device according to the election result, and the target host cryptographic device is obtained by converting the candidate cryptographic device.

[0038] In addition, to achieve the above-mentioned purpose, the present invention also proposes a cryptographic device cluster management device, which includes: a memory, a processor, and a cryptographic device cluster management program stored in the memory and executable on the processor, and the cryptographic device cluster management program is configured to implement the steps of the cryptographic device cluster management method described above.

[0039] In addition, to achieve the above purpose, the present invention also proposes a storage medium, on which a cryptographic device cluster management program is stored, and when the cryptographic device cluster management program is executed by a processor, the steps of the cryptographic device cluster management method described above are implemented.

[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the cryptographic device cluster management method as described above are implemented.

[0041] One or more technical solutions proposed in the present application have at least the following technical effects: The present application discloses a cryptographic device cluster management method, which is applied to a server, wherein the server includes a cryptographic device cluster consisting of a host cryptographic device and multiple slave cryptographic devices; the cryptographic device cluster management method includes: when it is detected that the host cryptographic device meets a preset condition, determining a candidate cryptographic device, wherein the candidate cryptographic device is converted from at least one slave cryptographic device; driving the candidate cryptographic device to send an election request to each slave cryptographic device; determining a target host cryptographic device according to the election result, wherein the target host cryptographic device is converted from the candidate cryptographic device. Compared with the prior art, the present application determines a candidate cryptographic device in a slave cryptographic device when the host cryptographic device meets the preset condition, and drives the candidate cryptographic device to send an election request to each slave cryptographic device, and then determines a new target host cryptographic device in the candidate cryptographic device according to the election result, thereby quickly establishing a communication connection between cryptographic device clusters, improving the communication efficiency of the cryptographic management device, and avoiding the technical problem that the distributed cryptographic device cluster architecture in the prior art may be affected by factors such as device disconnection or network delay, resulting in poor communication performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1 It is a flowchart of the first embodiment of the cryptographic device cluster management method of the present invention;

[0045] Figure 2 A schematic diagram of a cryptographic device cluster architecture according to an embodiment of a cryptographic device cluster management method of the present invention;

[0046] Figure 3 It is a flowchart of the second embodiment of the cryptographic device cluster management method of the present invention;

[0047] Figure 4 It is a flowchart of the third embodiment of the cryptographic device cluster management method of the present invention;

[0048] Figure 5 A schematic diagram of the timing of generating a session key in an embodiment of a cryptographic device cluster management method of the present invention;

[0049] Figure 6 A schematic diagram of message synchronization timing of an embodiment of a cryptographic device cluster management method of the present invention;

[0050] Figure 7 It is a structural block diagram of the first embodiment of the cryptographic device cluster management device of the present invention.

[0051] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0054] Based on this, the embodiment of the present invention provides a cryptographic device cluster management method, referring to Figure 1 , Figure 1 The figure is a flow chart of a first embodiment of a cryptographic device cluster management method of the present invention.

[0055] In this embodiment, the cryptographic device cluster management method includes:

[0056] Step S10: when it is detected that the host cryptographic device meets a preset condition, a candidate cryptographic device is determined, where the candidate cryptographic device is converted from at least one slave cryptographic device.

[0057] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a server device, etc. that can realize the above functions. This embodiment and the following embodiments are described by taking a server device as an example.

[0058] It should be noted that the server in this embodiment is a distributed architecture. Figure 2, which consists of a master cryptographic device and multiple slave cryptographic devices, and when the master cryptographic device meets the preset conditions, there may be at least one candidate cryptographic device, wherein the master cryptographic device is used to manage the information forwarding, external interaction, etc. of the entire cryptographic device cluster. In the distributed architecture, in order to improve the communication and interaction performance between one partition and another partition, the two partitions generally communicate through the master cryptographic device, and if the slave cryptographic devices in the two partitions want to establish communication, they generally need to first send a message to the master cryptographic device of the corresponding partition, and then interact through the communication channel between the two host cryptographic devices. Therefore, in this embodiment, the slave cryptographic device is responsible only for the account password management of different users in the partition.

[0059] Due to the particularity of the distributed architecture, the master password device is essentially the same as the slave password device, but the master password device has the authority to communicate with the outside and manage other password devices. If the master password device is offline or fails, other slave password devices can take over the authority, so that the entire cluster will not be paralyzed due to the offline or failure of a certain device, and it has extremely high anti-interference ability.

[0060] In the process of other slave password devices taking over permissions, candidate password devices will temporarily appear. Candidate password devices are converted from slave password devices. After a candidate password device obtains management permissions, other candidate password devices will be reset to slave password devices, and the candidate password device that obtains management permissions will be marked as a master password device, which is responsible for managing the currently online slave password devices and communicating with the outside world.

[0061] It can be understood that the preset condition means that the host device loses communication connection with other slave cryptographic devices due to disconnection, offline, failure or network fluctuation. If the host cryptographic device meets the above conditions, it means that the network partition where the host cryptographic device is located may have information that cannot be transmitted in time, and it is necessary to reselect the host cryptographic device to ensure smooth communication of the cryptographic device cluster.

[0062] It should be noted that since the slave cryptographic devices do not communicate with the master cryptographic device at exactly the same time, in the process of interaction between the slave cryptographic devices and the master cryptographic devices, there may be a communication failure between a slave and the master cryptographic device, resulting in a misjudgment. Therefore, in order to avoid the above situation, when it is detected that the master cryptographic device meets the preset conditions, before determining the candidate cryptographic device, it also includes:

[0063] Detecting the communication connection status between the master cryptographic device and each slave cryptographic device;

[0064] When a communication connection abnormality occurs between the master cryptographic device and each slave cryptographic device, it is determined that the master cryptographic device meets a preset condition.

[0065] Specifically, detecting the communication connection status means driving the host cryptographic device to broadcast a detection request to each slave cryptographic device respectively, and detecting whether a detection response based on the feedback of the detection request from each slave cryptographic device is received, and detecting whether the interval from issuing the detection request to receiving the detection response is less than a preset time threshold, thereby determining whether a communication connection abnormality occurs between the host cryptographic device and each slave cryptographic device.

[0066] Further, the determining of the candidate cryptographic devices includes:

[0067] Obtain the last communication time between each slave cryptographic device and the master cryptographic device;

[0068] Determine a target slave cryptographic device according to the last communication time, the target slave cryptographic device being a slave cryptographic device with the smallest time difference between the last communication time and the current time;

[0069] The target slave cryptographic device is marked as a candidate cryptographic device.

[0070] In a specific implementation, if it is detected that the master cryptographic device meets the preset conditions, since there is a time difference in communication between each slave cryptographic device and the master cryptographic device, in order to shorten the duration of the abnormal state of the cryptographic device cluster, in this embodiment, the slave cryptographic device that last communicated with the master cryptographic device will be determined, that is, the slave cryptographic device with the smallest time difference between the last communication time and the current time as the target slave cryptographic device, thereby marking it as a candidate cryptographic device to facilitate election and host authority transfer in the shortest time.

[0071] Step S20: driving the candidate cryptographic device to send an election request to each slave cryptographic device.

[0072] It should be noted that, since the target slave cryptographic device has been marked as a candidate cryptographic device, at this time, when the candidate cryptographic device sends an election request to each slave cryptographic device, it does not need to send an election request to itself, but sends an election request to the remaining slave cryptographic devices.

[0073] Further, the step of driving the candidate cryptographic device to send an election request to each slave cryptographic device includes:

[0074] When the number of the candidate cryptographic devices is at least two, driving each candidate cryptographic device to broadcast a voting request to each slave cryptographic device respectively, and receiving a voting response fed back by each slave cryptographic device based on the voting request;

[0075] The votes of each candidate cryptographic device are counted according to the response information.

[0076] Specifically, if the number of candidate cryptographic devices is one, there is no need to conduct an election, and the candidate cryptographic device can be directly marked as a host cryptographic device, and the relevant host authority can be transferred.

[0077] The voting request at least includes the response time of the candidate cryptographic device, and the response time represents the time interval from the cryptographic device receiving the message to generating the corresponding response information.

[0078] If the number of candidate cryptographic devices is at least two, each candidate cryptographic device may be driven to broadcast a voting request to each slave cryptographic device. After receiving the voting request, each slave cryptographic device may vote based on the response time of each candidate cryptographic device.

[0079] It should be noted that due to the differences in distance and transmission conditions between the cryptographic devices, even if the candidate cryptographic devices broadcast voting requests at the same time, there will be differences in the time when the slave cryptographic devices receive the voting requests. In this embodiment, during the voting process of the slave cryptographic devices, if a slave cryptographic device has not voted for any candidate cryptographic device before receiving the voting request, it will directly feedback the voting response to the candidate cryptographic device that issued the voting request. If a slave cryptographic device has already fed back a voting response to another candidate cryptographic device before receiving the voting request, it can choose whether to vote for the candidate cryptographic device corresponding to the currently received voting request based on the response time of the candidate cryptographic device in the received voting request and the length of the response time.

[0080] Specifically, taking cryptographic devices A, B, and C as examples, A and B are candidate cryptographic devices, and C is a slave cryptographic device. When A and B send voting requests at the same time, due to network delays and other reasons, C first receives the voting request from A. At this time, C will respond to A's voting request and feedback the corresponding voting response to A, and then receive the voting request from B. At this time, since the slave cryptographic device C has already voted, the response time carried by the candidate cryptographic devices A and B when sending the voting requests will be compared. If B's ​​response time is less than or equal to A's response time, it will respond to B's voting request and feedback the corresponding voting response to B. In this case, A and B each have one vote; if B's ​​response time is greater than A's response time, it will not respond to B's voting request. In this case, A has one vote and B has no vote.

[0081] Furthermore, due to the distance between different cryptographic devices, network delays and other reasons, different slave cryptographic devices may give inconsistent voting results to the candidate cryptographic devices. Therefore, the master cryptographic device needs to be determined based on the final number of votes of the candidate cryptographic devices.

[0082] Step S30: determining a target host cryptographic device according to the election result, wherein the target host cryptographic device is obtained by transforming the candidate cryptographic device.

[0083] It is understandable that after determining the target master cryptographic device from the candidate cryptographic devices, the candidate cryptographic device can be marked as a master cryptographic device and the corresponding communication authority can be transferred. Other candidate cryptographic devices also need to be reset to slave cryptographic devices.

[0084] This embodiment determines a candidate cryptographic device in the slave cryptographic device when the master cryptographic device meets the preset conditions, and drives the candidate cryptographic device to send an election request to each slave cryptographic device, and then determines a new target master cryptographic device in the candidate cryptographic device according to the election result, thereby quickly establishing a communication connection between cryptographic device clusters, improving the communication efficiency of the cryptographic management device, and avoiding the technical problem in the prior art that the distributed cryptographic device cluster architecture may have poor communication performance due to factors such as device disconnection or network delay.

[0085] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S30, comprising:

[0086] Step S301: Determine the target candidate cryptographic device having the most votes among the candidate cryptographic devices.

[0087] Step S302: driving the target candidate cryptographic device to send a master promotion request to each slave cryptographic device.

[0088] Step S303: upon receiving slave responses from the slave cryptographic devices based on the master promotion request, converting the target candidate cryptographic device into a target master cryptographic device.

[0089] It should be noted that due to the distance between different cryptographic devices, network delay and other reasons, different slave cryptographic devices may give inconsistent voting results to each candidate cryptographic device, and it may happen that multiple candidate cryptographic devices have the same number of votes.

[0090] Furthermore, after determining the target candidate cryptographic device with the most votes among the candidate cryptographic devices, the method further includes:

[0091] When the votes of the candidate cryptographic devices are the same, determining the historical host response time of each candidate cryptographic device;

[0092] A target candidate cryptographic device is determined based on the historical host response time.

[0093] At this time, when determining the final target candidate cryptographic device, the final target candidate cryptographic device may be determined according to the response time of the candidate cryptographic device with the most votes and the same number.

[0094] After determining the target candidate cryptographic device, in order to rebuild the central management node of the distributed cryptographic device cluster and transfer authority, in this embodiment, the target candidate cryptographic device can be driven to send a master promotion request to each slave cryptographic device. After receiving the master promotion request, if each slave cryptographic device feeds back a slave response, it means that the slave cryptographic device recognizes the candidate cryptographic device as the master cryptographic device, and thus it is used as the master cryptographic device in subsequent external communications and information transmission processes.

[0095] This embodiment determines the target candidate cryptographic device with the most votes among all the candidate cryptographic devices; drives the target candidate cryptographic device to send a master promotion request to each slave cryptographic device; upon receiving a slave response fed back by each slave cryptographic device based on the master promotion request, converts the target candidate cryptographic device into a target master cryptographic device, and by establishing a communication connection between the target candidate cryptographic device and each slave cryptographic device, it is possible to re-establish a distributed cryptographic device cluster architecture and screen out some slave cryptographic devices that may have faults.

[0096] Based on the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 4 , before step S10, further comprising:

[0097] Step S01: When the host cryptographic device receives a registration request from a cryptographic device to be added, a session key is generated.

[0098] Step S02: establishing a communication connection between the host cryptographic device and the cryptographic device to be added based on the session key.

[0099] Step S03: Mark the password device to be added as a slave password device.

[0100] It should be noted that when a new cryptographic device joins the distributed cryptographic device cluster architecture, in order to successfully establish a communication connection between the cryptographic device to be added and each cryptographic device in the cryptographic device cluster, in this embodiment, when the host cryptographic device receives a registration request from the cryptographic device to be added, a session key is generated between the host cryptographic device and the cryptographic device to be added, and a communication connection is established between the host cryptographic device and the cryptographic device to be added based on the session key, so that the cryptographic device to be added can communicate with the cryptographic device cluster to achieve partitioning, and the newly added cryptographic device is used as a slave cryptographic device, which has minimal impact on the original cryptographic device cluster architecture and will not affect the normal operation of the original architecture.

[0101] Further, generating a session key includes:

[0102] Driving the host cryptographic device to generate a first random number;

[0103] Encrypting the first random number by using a preset public key, and sending the encrypted first random number to the cryptographic device to be added;

[0104] Driving the cryptographic device to be added to generate a second random number;

[0105] encrypting the first random number and the second random number, and sending the encrypted first random number and the encrypted second random number to the host cryptographic device;

[0106] driving the host cryptographic device to verify the first random number;

[0107] After the verification is successful, the host cryptographic device and the to-be-joined cryptographic device are driven to generate a session key based on the first random number and the second random number.

[0108] In the specific implementation, refer to Figure 5 and Figure 6The specific process of generating a session key is that the host cryptographic device generates a random number randomA, uses the public key of the slave cryptographic device to perform SM2 encryption protection on randomA, and then sends it to the slave cryptographic device; after receiving the encrypted randomA, the slave cryptographic device decrypts it to obtain the plaintext content of randomA and saves it; the slave cryptographic device generates randomB based on the plaintext content of randomA, and then uses the public key of the host cryptographic device to perform SM2 encryption protection on randomA and randomB and sends it to the host cryptographic device; the host cryptographic device decrypts and obtains the plaintext content of randomA and randomB. and compares whether randomA is consistent with the random number sent by itself; when generating the session key, both the host cryptographic device and the slave cryptographic device can perform an XOR operation on randomA and randomB to obtain the session key required for information synchronization between the host cryptographic device and the slave cryptographic device, and can also drive the host cryptographic device and the slave cryptographic device to use the first random number as the first half of the session key and the second random number as the second half of the session key, thereby obtaining the same session key, which is convenient for subsequent establishment of a communication connection. It can also be other ways to establish a common session key between the host cryptographic device and the slave cryptographic device, and this embodiment does not impose specific restrictions on this.

[0109] In addition, in order to establish a communication connection between the cryptographic device to be added and other slave cryptographic devices, in the present embodiment, a communication channel between the cryptographic device to be added and other slave cryptographic devices can also be established based on the session key, so as to realize message synchronization. Specifically, the host cryptographic device queries the session key of the slave cryptographic device to be currently synchronized with the message. If the session key does not exist or expires, the session key is renegotiated. When the session key is valid, the synchronization message is symmetrically encrypted and protected by using the session key to transmit, so as to realize message synchronization between the host cryptographic device, the cryptographic device to be added and each slave cryptographic device.

[0110] In this embodiment, when the host cryptographic device receives a registration request from the cryptographic device to be added, a session key is generated; a communication connection between the host cryptographic device and the cryptographic device to be added is established based on the session key; the cryptographic device to be added is marked as a slave cryptographic device, and a session key between the host device and the cryptographic device to be added is pre-established, and then a communication connection between the host device and the cryptographic device to be added is established based on the session key, so that the cryptographic device to be added is incorporated into the cryptographic device cluster and message synchronization is completed.

[0111] This application also provides a cryptographic device cluster management device, please refer to Figure 7 , the cryptographic device cluster management device comprises:

[0112] The detection module 10 is used to determine a candidate cryptographic device when it is detected that the host cryptographic device meets a preset condition, wherein the candidate cryptographic device is converted from at least one slave cryptographic device.

[0113] The election module 20 is used to drive the candidate cryptographic device to send an election request to each slave cryptographic device.

[0114] The determination module 30 is used to determine a target host cryptographic device according to the election result, wherein the target host cryptographic device is obtained by transforming the candidate cryptographic device.

[0115] This embodiment determines a candidate cryptographic device in the slave cryptographic device when the master cryptographic device meets the preset conditions, and drives the candidate cryptographic device to send an election request to each slave cryptographic device, and then determines a new target master cryptographic device in the candidate cryptographic device according to the election result, thereby quickly establishing a communication connection between cryptographic device clusters, improving the communication efficiency of the cryptographic management device, and avoiding the technical problem in the prior art that the distributed cryptographic device cluster architecture may have poor communication performance due to factors such as device disconnection or network delay.

[0116] In one embodiment, the detection module 10 is also used to obtain the last communication time between each slave cryptographic device and the master cryptographic device; determine the target slave cryptographic device based on the last communication time, and the target slave cryptographic device is the slave cryptographic device with the smallest time difference between the last communication time and the current time; and convert the target slave cryptographic device into a candidate cryptographic device.

[0117] In one embodiment, the election module 20 is further used to drive each candidate cryptographic device to broadcast a voting request to each slave cryptographic device respectively when the number of the candidate cryptographic devices is at least two, and receive response information fed back by each slave cryptographic device based on the voting request; and count the votes of each candidate cryptographic device according to the response information.

[0118] In one embodiment, the determination module 30 is also used to determine the target candidate cryptographic device with the most votes among all the candidate cryptographic devices; drive the target candidate cryptographic device to send a master promotion request to each slave cryptographic device; and upon receiving a slave response fed back by each slave cryptographic device based on the master promotion request, convert the target candidate cryptographic device into a target master cryptographic device.

[0119] In one embodiment, the determination module 30 is further configured to determine the historical host response time of each candidate cryptographic device when the votes of each candidate cryptographic device are the same; and determine the target candidate cryptographic device according to the historical host response time.

[0120] In one embodiment, the detection module 10 is also used to generate a session key when the host cryptographic device receives a registration request from the cryptographic device to be added; establish a communication connection between the host cryptographic device and the cryptographic device to be added based on the session key; and mark the cryptographic device to be added as a slave cryptographic device.

[0121] In one embodiment, the detection module 10 is also used to drive the host cryptographic device to generate a first random number; encrypt the first random number by a preset public key, and send the encrypted first random number to the cryptographic device to be added; drive the cryptographic device to be added to generate a second random number; encrypt the first random number and the second random number, and send the encrypted first random number and the encrypted second random number to the host cryptographic device; drive the host cryptographic device to verify the first random number; after successful verification, drive the host cryptographic device and the cryptographic device to be added to generate a session key based on the first random number and the second random number.

[0122] The present application provides a cryptographic device cluster management device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cryptographic device cluster management method in the above-mentioned embodiment one.

[0123] The cryptographic device cluster management device provided by the present application adopts the cryptographic device cluster management method in the above embodiment, which can solve the technical problems of cryptographic device cluster management. Compared with the prior art, the beneficial effects of the cryptographic device cluster management device provided by the present application are the same as the beneficial effects of the cryptographic device cluster management method provided by the above embodiment, and the other technical features in the cryptographic device cluster management device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0124] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0125] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0126] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the cryptographic device cluster management method in the above-mentioned embodiment.

[0127] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0128] The computer-readable storage medium may be included in the cryptographic device cluster management device; or may exist independently without being assembled into the cryptographic device cluster management device.

[0129] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the cryptographic device cluster management device, the cryptographic device cluster management device performs cryptographic device cluster management.

[0130] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0131] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0133] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned cryptographic device cluster management method, and can solve the technical problems of cryptographic device cluster management. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the cryptographic device cluster management method provided in the above-mentioned embodiment, and will not be repeated here.

[0134] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned cryptographic device cluster management method when executed by a processor.

[0135] The computer program product provided by this application can solve the technical problem of cryptographic device cluster management. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the cryptographic device cluster management method provided by the above embodiment, which will not be repeated here.

[0136] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A cryptographic device cluster management method, characterized in that: The cryptographic device cluster management method is applied to a server, wherein the server includes a master cryptographic device and a cryptographic device cluster composed of a plurality of slave cryptographic devices; The cryptographic device cluster management method comprises: When it is detected that the master cryptographic device meets a preset condition, determining a candidate cryptographic device, wherein the candidate cryptographic device is converted from at least one slave cryptographic device; Driving the candidate cryptographic device to send an election request to each slave cryptographic device; A target host cryptographic device is determined according to the election result, and the target host cryptographic device is obtained by transforming the candidate cryptographic device.

2. The method according to claim 1, characterized in that The step of determining a candidate cryptographic device comprises: Obtain the last communication time between each slave cryptographic device and the master cryptographic device; Determine a target slave cryptographic device according to the last communication time, the target slave cryptographic device being a slave cryptographic device with the smallest time difference between the last communication time and the current time; The target slave cryptographic device is marked as a candidate cryptographic device.

3. The method according to claim 1, characterized in that The step of driving the candidate cryptographic device to send an election request to each slave cryptographic device includes: When the number of the candidate cryptographic devices is at least two, driving each candidate cryptographic device to broadcast a voting request to each slave cryptographic device respectively, and receiving a voting response fed back by each slave cryptographic device based on the voting request; The votes of each candidate cryptographic device are counted according to the response information.

4. The method according to claim 1, characterized in that The step of determining the target host cryptographic device according to the election result includes: Determine the target candidate cryptographic device having the most votes among the candidate cryptographic devices; driving the target candidate cryptographic device to send a master promotion request to each slave cryptographic device; When receiving slave responses fed back by each slave cryptographic device based on the master promotion request, the target candidate cryptographic device is marked as a target master cryptographic device.

5. The method according to claim 4, characterized in that After determining the target candidate cryptographic device with the most votes from each candidate cryptographic device, the method further includes: When the votes of the candidate cryptographic devices are the same, determining the historical host response time of each candidate cryptographic device; A target candidate cryptographic device is determined based on the historical host response time.

6. The method according to claim 1, characterized in that The method further comprises: determining a candidate cryptographic device when detecting that the host cryptographic device meets a preset condition, wherein the candidate cryptographic device is obtained by converting at least one slave cryptographic device; When the host cryptographic device receives a registration request from the cryptographic device to be added, a session key is generated; Establishing a communication connection between the host cryptographic device and the to-be-joined cryptographic device based on the session key; The password device to be added is marked as a slave password device.

7. The method according to claim 6, characterized in that The generating of the session key comprises: Driving the host cryptographic device to generate a first random number; Encrypting the first random number by using a preset public key, and sending the encrypted first random number to the cryptographic device to be added; Driving the cryptographic device to be added to generate a second random number; encrypting the first random number and the second random number, and sending the encrypted first random number and the encrypted second random number to the host cryptographic device; driving the host cryptographic device to verify the first random number; After the verification is successful, the host cryptographic device and the to-be-joined cryptographic device are driven to generate a session key based on the first random number and the second random number.

8. A cryptographic device cluster management device, characterized in that: The cryptographic device cluster management device comprises: A detection module, configured to determine a candidate cryptographic device when it is detected that the host cryptographic device meets a preset condition, wherein the candidate cryptographic device is converted from at least one slave cryptographic device; An election module, used to drive the candidate cryptographic device to send an election request to each slave cryptographic device; The determination module is used to determine the target host cryptographic device according to the election result, and the target host cryptographic device is obtained by converting the candidate cryptographic device.

9. A cryptographic device cluster management device, characterized in that: The cryptographic device cluster management device comprises: a memory, a processor, and a cryptographic device cluster management program stored in the memory and executable on the processor, wherein the cryptographic device cluster management program is configured to implement the steps of the cryptographic device cluster management method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores a cryptographic device cluster management program, and when the cryptographic device cluster management program is executed by the processor, the steps of the cryptographic device cluster management method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method and device for sending information and computing cluster

    CN109951331A

  • Equipment switching method and device, electronic equipment and computer readable storage medium

    CN113505028A

  • Master server node selection method and device of distributed component, equipment and medium

    CN117041182A

  • Data processing method and device, equipment and storage medium

    CN118337790A

  • Node election method and apparatus, and storage medium and electronic device

    WO2024027548A1

Cited By

  • Management method and system for cryptographic machine cluster of server

    CN121690616A

  • A method and system for managing a cluster of server cryptomachines

    CN121690616B