A cryptographic machine distribution method, gateway device, electronic device and storage medium

Through the weight-based consistency hashing algorithm and Bloom filtering method, the problem of password machine allocation for massive terminal devices is solved, ensuring that the correspondence between the terminal and password machine remains unchanged when adding a new password, and achieving the effect of successful terminal sign-in.

CN119766430APending Publication Date: 2025-04-04BEIJING JN TASS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411900646.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

As the number of urban terminal equipment increases, the number of terminals that can be served by provincial-level password machines has reached the upper limit, resulting in the problem of terminal sign-in failure after the password machine is expanded.

Method used

By obtaining the available key capacity weights of each password machine, establishing a consistent hash ring and virtual node distribution status, updating the password machine virtual node corresponding to the terminal, and using Bloom filter to verify the terminal check-in information, ensuring that the corresponding relationship between the terminal and the password machine remains unchanged when adding a password machine.

Benefits of technology

When adding a new password machine, keeping the corresponding relationship between the existing terminal and the password machine unchanged, and at the same time, allocating the new terminal to the new password machine, solving the problem of terminal sign-in failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766430A_ABST
    Figure CN119766430A_ABST
Patent Text Reader

Abstract

The present application provides a cryptographic machine allocation method, a gateway device, an electronic device and a storage medium, the method comprising: obtaining the available key capacity of each cryptographic machine to form the total available key capacity, and obtaining the available key capacity weight of each cryptographic machine; obtaining a consistent hash ring and the number of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight; obtaining the virtual node of the cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating the Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal; when adding a cryptographic machine, updating the number and distribution status of the virtual nodes; obtaining the terminal sign-in information, filtering and verifying the terminal in turn through the Bloom filter of the virtual node of each cryptographic machine before the newly added cryptographic machine, and obtaining the terminal attributes and the allocation relationship between the terminal and the cryptographic machine according to the filtering and verification results. The present invention can be used to solve the cryptographic machine allocation of massive terminals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of encrypted communications, and in particular to a cryptographic machine distribution method, a gateway device, an electronic device and a storage medium. Background Art

[0002] Massive terminals are linked to multiple gateway devices, and gateway devices are connected to multiple cryptographic machines. The terminal needs to sign in every day, and the cryptographic machine needs to assign a new key to the terminal when signing in. The number of terminals that each cryptographic machine can serve is limited. The correspondence between terminals and gateways is basically fixed. Each city will deploy a gateway to serve all terminal devices in the city (such as all cameras in the city). Cryptographic machines are deployed at the provincial level (for example, in the provincial capital), and the gateways of all cities in each province will be connected to all cryptographic machines at the provincial level.

[0003] As the number of terminal devices in cities gradually increases, the number of terminals that can be served by the provincial-level cipher machines will gradually reach the upper limit, and the cipher machines need to be expanded (increased in number). However, as the cipher machines are expanded, the corresponding relationship between the cipher machines and the terminals they serve will change, resulting in the lack of the terminal's key in the cipher machines, causing the terminal to fail to sign in. Summary of the invention

[0004] In order to solve one of the above-mentioned technical defects, a cipher machine allocation method, a gateway device, an electronic device and a storage medium are provided in an embodiment of the present application.

[0005] A first aspect of an embodiment of the present application provides a method for allocating a cipher machine, the method comprising:

[0006] Obtain the available key capacity of each cipher machine to form the total available key capacity, and obtain the available key capacity weight of each cipher machine;

[0007] Obtaining a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight;

[0008] Obtaining a terminal serial number, obtaining a virtual node of a cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating a Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal;

[0009] When a new cipher machine is added, the number and distribution status of the virtual nodes are updated;

[0010] The terminal sign-in information is obtained, and the terminal is filtered and verified in turn by Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and the terminal attributes and the allocation relationship between the terminal and the cipher machine are obtained according to the filtering and verification results.

[0011] Preferably, the process of obtaining the available key capacity of each cryptographic machine to constitute the total available key capacity and obtaining the available key capacity weight of each cryptographic machine includes:

[0012] Obtain the available key capacity R of each cipher machine;

[0013] Add the available key capacity R of each cipher machine to obtain the total available key capacity Rt;

[0014] The available key capacity weight of each cipher machine is obtained according to the proportion of the available key capacity R of each cipher machine in the total available key capacity Rt.

[0015] Preferably, the process of obtaining the consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight includes:

[0016] Arranging the available key capacity weights of each cipher machine into a weight value array Q;

[0017] Select a consistent hash algorithm, and perform a consistent hash algorithm operation on the weight value array Q to obtain a consistent hash ring C;

[0018] The number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring C are calculated according to the available key capacity weight Q of each cryptographic machine.

[0019] Preferably, the process of obtaining the terminal serial number, obtaining the virtual node of the cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating the Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal includes:

[0020] Get the terminal serial number S;

[0021] Calculate the hash value Z of the terminal according to the consistent hash ring C and the terminal serial number S;

[0022] Obtaining a virtual node H of a cryptographic machine corresponding to the terminal according to a hash value Z of the terminal;

[0023] Update the Bloom filter L of the virtual node H of the cryptographic machine corresponding to the terminal.

[0024] Preferably, the process of updating the number and distribution status of the virtual nodes after adding a new cryptographic machine includes:

[0025] Obtain the available key capacity R' of each cipher machine after adding the cipher machine;

[0026] Add the available key capacity R' of each cipher machine to obtain the total available key capacity Rt';

[0027] Obtaining the available key capacity weight of each cipher machine according to the proportion of the available key capacity R' of each cipher machine in the total available key capacity Rt';

[0028] Arrange the available key capacity weights of each cipher machine into a weight value array Q';

[0029] Select a consistent hashing algorithm, and perform a consistent hashing algorithm operation on the weight value array Q' to obtain a consistent hashing ring C';

[0030] The number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring C' are calculated according to the available key capacity weight Q' of each cryptographic machine.

[0031] Preferably, the process of obtaining the terminal sign-in information, filtering and verifying the terminal in turn by Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and obtaining the terminal attributes and the allocation relationship between the terminal and the cipher machine according to the filtering and verification result includes:

[0032] Acquire terminal sign-in information, where the terminal is an existing terminal or a newly added terminal;

[0033] The terminal is filtered and verified in turn by using the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine;

[0034] When the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine fails to filter and verify the terminal, the terminal sending the sign-in information is the newly added terminal, and the virtual node of the cipher machine updated after the first newly added cipher machine is used to serve the newly added terminal, and the Bloom filter of the virtual node of the cipher machine serving the newly added terminal is updated.

[0035] Preferably, the process of filtering and verifying the terminal in sequence through the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine includes:

[0036] The terminal is filtered and verified by using a Bloom filter L of a virtual node of a first cipher machine before the newly added cipher machine, where the first cipher machine is any one of all cipher machines before the newly added cipher machine;

[0037] When the Bloom filter L of the virtual node of the first cipher machine fails to filter and verify the terminal, the filtering is postponed to the virtual node of the next cipher machine until the Bloom filter L of the virtual node of a cipher machine succeeds in filtering and verifying the terminal, or the Bloom filter L of the virtual node of each cipher machine fails in filtering and verifying the terminal.

[0038] A second aspect of an embodiment of the present application provides a gateway device, the gateway device comprising:

[0039] A weight calculation module, used for obtaining the available key capacity of each cipher machine to form the total available key capacity, and obtaining the available key capacity weight of each cipher machine;

[0040] A virtual node calculation module, used to obtain a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight;

[0041] A virtual node corresponding module, used to obtain a terminal serial number, obtain a virtual node of a cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and update a Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal;

[0042] An update module, used to update the number and distribution status of the virtual nodes when a new cipher machine is added;

[0043] The filtering and verification module is used to obtain the terminal sign-in information, filter and verify the terminals in turn through the Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and obtain the terminal attributes and the allocation relationship between the terminal and the cipher machine according to the filtering and verification results.

[0044] A third aspect of the embodiments of the present application provides an electronic device, including: a processor and a memory;

[0045] Among them, one or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device executes the method described in the first aspect of the embodiment of the present application.

[0046] A fourth aspect of an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect of the embodiment of the present application.

[0047] The cipher machine allocation method provided in the embodiment of the present application can be used to solve the cipher machine allocation of a large number of terminals. By combining the weight-based consistent hashing algorithm and the Bloom filtering method, when adding a new cipher machine, the corresponding relationship between the existing terminal and the cipher machine remains unchanged, and the new terminal is allocated to the new cipher machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0049] Figure 1 This is a flow chart of a cryptographic machine allocation method described in Example 1 of the present application;

[0050] Figure 2 This is a schematic diagram of the principle of a gateway device described in Example 2 of the present application. DETAILED DESCRIPTION

[0051] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0052] Example 1

[0053] like Figure 1 As shown, this embodiment proposes a method for allocating cipher machines, which specifically includes:

[0054] S101. Obtain the available key capacity of each cryptographic machine to form the total available key capacity, and obtain the available key capacity weight of each cryptographic machine.

[0055] Specifically, the cipher machine allocation method proposed in this embodiment can be configured in a gateway device. The gateway device is a proxy device used to manage terminal devices, including operations such as registration and deletion of terminal devices, and providing business processes such as check-in and signaling forwarding for terminal devices by connecting to the back-end cipher machine. When the gateway device is initialized, the available key capacity R of all the back-end cipher machines will be obtained. Then the available key capacity R of each cipher machine is added to obtain a total key capacity, that is, the total available key capacity Rt. Then, the available key capacity weight of each cipher machine is obtained according to the proportion of the available key capacity R of each cipher machine in the total available key capacity Rt. For this embodiment, the more available key capacity R of the cipher machine, the greater the available key capacity weight of the cipher machine. In addition, other weight calculation methods can be selected for obtaining the weight according to actual conditions.

[0056] S102: Obtain a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight.

[0057] Specifically, after obtaining the available key capacity weight of each cipher machine in S101, the available key capacity weight of each cipher machine is sorted into a weight value array Q. Using the selected consistent hash algorithm, the weight value array Q is subjected to a consistent hash algorithm operation to obtain a consistent hash ring C. Among them, the consistent hash algorithm in this embodiment can select any calculation method that can implement the consistent hash ring C in this embodiment, and this embodiment does not make any special limitation.

[0058] After obtaining the consistent hash ring C, the number and distribution status of virtual nodes of each cipher machine on the consistent hash ring C are calculated according to the available key capacity weight Q of each cipher machine. Generally speaking, the available key capacity weight value of the cipher machine is positively correlated with the number of virtual nodes and the density of distribution. That is, the higher the available key capacity weight value of the cipher machine, the more corresponding virtual nodes there are, and the denser the distribution on the consistent hash ring.

[0059] S103, obtaining the terminal serial number, obtaining the virtual node of the cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating the Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal.

[0060] Specifically, when the terminal signs in to the gateway device, the gateway device will obtain the serial number S of the terminal. The hash value Z of the sign-in terminal can be calculated based on the consistent hash ring C and the terminal serial number S. Then, the virtual node H of the cryptographic machine corresponding to the sign-in terminal is obtained based on the hash value Z of the sign-in terminal, and the Bloom filter L of the virtual node H of the cryptographic machine corresponding to the sign-in terminal is updated.

[0061] S104: When a new cipher machine is added, the number and distribution status of the virtual nodes are updated.

[0062] Specifically, when a new cipher machine is added to the scale of the original cipher machine, the process from S101 to S102 will be repeated to update the number and distribution status of the virtual nodes of all cipher machines. The number of newly added cipher machines is not specifically limited in this embodiment, and the method proposed in this embodiment can be applied to adding one cipher machine or adding multiple cipher machines at the same time.

[0063] More specifically, obtain the available key capacity R' of each cryptographic machine after the new cryptographic machine is added. Add the available key capacity R' of each cryptographic machine to obtain the total available key capacity Rt'. Obtain the available key capacity weight of each cryptographic machine based on the proportion of the available key capacity R' of each cryptographic machine in the total available key capacity Rt'. Arrange the available key capacity weight of each cryptographic machine into a weight value array Q'. Select a consistent hashing algorithm, and perform a consistent hashing algorithm operation on the weight value array Q' to obtain a consistent hash ring C'. Calculate the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring C' based on the available key capacity weight Q' of each cryptographic machine.

[0064] S105, obtaining the terminal sign-in information, filtering and verifying the terminal in turn through the Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and obtaining the terminal attributes and the allocation relationship between the terminal and the cipher machine according to the filtering and verification result.

[0065] Specifically, after a new cipher machine is added, when any subsequent terminal machine signs in, it is necessary to filter and verify the terminal machine in turn through the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine. The arbitrary terminal machine can be an existing terminal machine or a newly added terminal machine. When the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine fails to filter and verify the signed-in terminal machine, the terminal sending the sign-in information is the newly added terminal machine, and the virtual node of the cipher machine updated after the first newly added cipher machine is used to serve the newly added terminal machine, and the Bloom filter of the virtual node of the cipher machine serving the newly added terminal machine is updated. When the Bloom filter L of the virtual node of the cipher machine before any newly added cipher machine successfully filters and verifies the signed-in terminal machine, communication between the terminal machine and the cipher machine can be attempted.

[0066] In this embodiment, when any terminal machine signs in, the terminal machine may first be filtered and verified by the Bloom filter L of the virtual node of the first cipher machine before the newly added cipher machine. The first cipher machine is any one of all the cipher machines before the newly added cipher machine. When the Bloom filter L of the virtual node of the first cipher machine fails to filter and verify the terminal machine, the Bloom filter L of the virtual node of the next cipher machine is postponed until the Bloom filter L of the virtual node of a cipher machine successfully filters and verifies the terminal machine, or the Bloom filter L of the virtual node of each cipher machine fails to filter and verify the terminal machine.

[0067] The cipher machine allocation method provided in this embodiment can be used to solve the cipher machine allocation of massive terminals. By combining the weight-based consistent hashing algorithm and the Bloom filtering method, when adding a new cipher machine, the corresponding relationship between the existing terminal and the cipher machine remains unchanged, and the new terminal is allocated to the new cipher machine.

[0068] Example 2

[0069] like Figure 2 As shown, this embodiment provides a gateway device, which includes:

[0070] A weight calculation module, used for obtaining the available key capacity of each cipher machine to form the total available key capacity, and obtaining the available key capacity weight of each cipher machine;

[0071] A virtual node calculation module, used to obtain a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight;

[0072] A virtual node corresponding module, used to obtain a terminal serial number, obtain a virtual node of a cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and update a Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal;

[0073] An update module, used to update the number and distribution status of the virtual nodes when a new cipher machine is added;

[0074] The filtering and verification module is used to obtain the terminal sign-in information, filter and verify the terminal in turn through the Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and obtain the terminal attributes and the allocation relationship between the terminal and the cipher machine according to the filtering and verification results.

[0075] Among them, the specific working principle of the gateway device can refer to the content recorded in Example 1, and will not be repeated in this embodiment.

[0076] In this embodiment, by combining the weight-based consistent hashing algorithm and the Bloom filtering method, when a new cipher machine is added, the corresponding relationship between the existing terminal machines and the cipher machines remains unchanged, and the new terminal machines are allocated to the new cipher machines.

[0077] Example 3

[0078] This embodiment provides an electronic device, including: a processor and a memory;

[0079] Wherein, one or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device performs the following method:

[0080] Obtain the available key capacity of each cipher machine to form the total available key capacity, and obtain the available key capacity weight of each cipher machine;

[0081] Obtaining a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight;

[0082] Obtaining a terminal serial number, obtaining a virtual node of a cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating a Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal;

[0083] When a new cipher machine is added, the number and distribution status of the virtual nodes are updated;

[0084] The terminal sign-in information is obtained, and the terminal is filtered and verified in turn by Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and the terminal attributes and the allocation relationship between the terminal and the cipher machine are obtained according to the filtering and verification results.

[0085] The specific process of the method can refer to the contents described in Example 1, and will not be described in detail in this example.

[0086] In this embodiment, by combining the weight-based consistent hashing algorithm and the Bloom filtering method, when a new cipher machine is added, the corresponding relationship between the existing terminal machines and the cipher machines remains unchanged, and the new terminal machines are allocated to the new cipher machines.

[0087] Example 4

[0088] This embodiment provides a computer storage medium including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the following method:

[0089] Obtain the available key capacity of each cipher machine to form the total available key capacity, and obtain the available key capacity weight of each cipher machine;

[0090] Obtaining a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight;

[0091] Obtaining a terminal serial number, obtaining a virtual node of a cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating a Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal;

[0092] When a new cipher machine is added, the number and distribution status of the virtual nodes are updated;

[0093] The terminal sign-in information is obtained, and the terminal is filtered and verified in turn by Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and the terminal attributes and the allocation relationship between the terminal and the cipher machine are obtained according to the filtering and verification results.

[0094] The specific process of the method can refer to the contents described in Example 1, and will not be described in detail in this example.

[0095] In this embodiment, by combining the weight-based consistent hashing algorithm and the Bloom filtering method, when a new cipher machine is added, the corresponding relationship between the existing terminal machines and the cipher machines remains unchanged, and the new terminal machines are allocated to the new cipher machines.

[0096] In this application, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or can communicate with each other; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0097] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0098] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for allocating a cipher machine, characterized in that: The method comprises: Obtain the available key capacity of each cipher machine to form the total available key capacity, and obtain the available key capacity weight of each cipher machine; Obtaining a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight; Obtaining a terminal serial number, obtaining a virtual node of a cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating a Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal; When a new cipher machine is added, the number and distribution status of the virtual nodes are updated; The terminal sign-in information is obtained, and the terminal is filtered and verified in turn by Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and the terminal attributes and the allocation relationship between the terminal and the cipher machine are obtained according to the filtering and verification results.

2. The method according to claim 1, characterized in that The process of obtaining the available key capacity of each cryptographic machine to constitute the total available key capacity and obtaining the available key capacity weight of each cryptographic machine includes: Obtain the available key capacity R of each cipher machine; Add the available key capacity R of each cipher machine to obtain the total available key capacity Rt; The available key capacity weight of each cipher machine is obtained according to the proportion of the available key capacity R of each cipher machine in the total available key capacity Rt.

3. The method according to claim 2, characterized in that The process of obtaining the consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight includes: Arranging the available key capacity weights of each cipher machine into a weight value array Q; Select a consistent hash algorithm, and perform a consistent hash algorithm operation on the weight value array Q to obtain a consistent hash ring C; The number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring C are calculated according to the available key capacity weight Q of each cryptographic machine.

4. The method according to claim 3, characterized in that The process of obtaining the terminal serial number, obtaining the virtual node of the cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and updating the Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal includes: Get the terminal serial number S; Calculate the hash value Z of the terminal according to the consistent hash ring C and the terminal serial number S; Obtaining a virtual node H of a cryptographic machine corresponding to the terminal according to a hash value Z of the terminal; Update the Bloom filter L of the virtual node H of the cryptographic machine corresponding to the terminal.

5. The method according to claim 4, characterized in that The process of updating the number and distribution status of the virtual nodes after adding a new cryptographic machine includes: Obtain the available key capacity R' of each cipher machine after adding the cipher machine; Add the available key capacity R' of each cipher machine to obtain the total available key capacity Rt'; Obtaining the available key capacity weight of each cipher machine according to the proportion of the available key capacity R' of each cipher machine in the total available key capacity Rt'; Arrange the available key capacity weights of each cipher machine into a weight value array Q'; Select a consistent hashing algorithm, and perform a consistent hashing algorithm operation on the weight value array Q' to obtain a consistent hashing ring C'; The number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring C' are calculated according to the available key capacity weight Q' of each cryptographic machine.

6. The method according to claim 5, characterized in that The process of obtaining the terminal sign-in information, filtering and verifying the terminal in turn by Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and obtaining the terminal attributes and the allocation relationship between the terminal and the cipher machine according to the filtering and verification result includes: Acquire terminal sign-in information, where the terminal is an existing terminal or a newly added terminal; The terminal is filtered and verified in turn by using the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine; When the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine fails to filter and verify the terminal, the terminal sending the sign-in information is the newly added terminal, and the virtual node of the cipher machine updated after the first newly added cipher machine is used to serve the newly added terminal, and the Bloom filter of the virtual node of the cipher machine serving the newly added terminal is updated.

7. The method according to claim 6, characterized in that The process of filtering and verifying the terminal in turn by using the Bloom filter L of the virtual node of each cipher machine before the newly added cipher machine includes: The terminal is filtered and verified by using a Bloom filter L of a virtual node of a first cipher machine before the newly added cipher machine, where the first cipher machine is any one of all cipher machines before the newly added cipher machine; When the Bloom filter L of the virtual node of the first cipher machine fails to filter and verify the terminal, the filtering is postponed to the virtual node of the next cipher machine until the Bloom filter L of the virtual node of a cipher machine succeeds in filtering and verifying the terminal, or the Bloom filter L of the virtual node of each cipher machine fails in filtering and verifying the terminal.

8. A gateway device, characterized in that: The gateway device comprises: A weight calculation module, used for obtaining the available key capacity of each cipher machine to form the total available key capacity, and obtaining the available key capacity weight of each cipher machine; A virtual node calculation module, used to obtain a consistent hash ring and the number and distribution status of virtual nodes of each cryptographic machine on the consistent hash ring according to the available key capacity weight; A virtual node corresponding module, used to obtain a terminal serial number, obtain a virtual node of a cryptographic machine corresponding to the terminal according to the consistent hash ring and the terminal serial number, and update a Bloom filter of the virtual node of the cryptographic machine corresponding to the terminal; An update module, used to update the number and distribution status of the virtual nodes when a new cipher machine is added; The filtering and verification module is used to obtain the terminal sign-in information, filter and verify the terminals in turn through the Bloom filtering of the virtual node of each cipher machine before the newly added cipher machine, and obtain the terminal attributes and the allocation relationship between the terminal and the cipher machine according to the filtering and verification results.

9. An electronic device, characterized in that: include: Processor and memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device executes the method as claimed in any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The method comprises computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 7.