Mesh gateway deployment optimization method
By building a letter sequence library and encrypting verification information sequence, the problem of easy intercepting of clear text verification information of mesh gateway devices is solved, and the secure deployment optimization and efficient verification of mesh network devices are realized.
Patent Information
- Application Number
- CN202411007259.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-12-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing mesh gateway deployment optimization method, the mesh gateway device sends verification information sequence to the cloud in plain text, which is easily intercepted by attackers, causing rogue devices to access the mesh network Internet of Things and leak important information and data.
By building a letter sequence library, assigning keys to mesh gateway device, and data processing and encryption of broadcast information sequences are generated to ensure that the plaintext sequence and key combination of each mesh gateway device is unique and resisting statistical analysis attacks.
Effectively resist the risk of attackers intercepting verification information, ensure that only legitimate devices are connected to the mesh network, improve verification efficiency and security, and prevent rogue devices from being accessed.
Smart Images

Figure CN119183126A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of device access security detection, and in particular to a mesh gateway deployment optimization method. Background Art
[0002] A wireless mesh network is a topology network for many-to-many device communication. Therefore, a wireless mesh network has a multi-gateway feature. In order to improve the service quality of the entire wireless mesh network, it is necessary to deploy and optimize multiple mesh gateway devices to build a mesh network Internet of Things.
[0003] When optimizing mesh gateway deployment, it is necessary to first establish communication between multiple mesh gateway devices and the cloud. During the communication process, other mesh gateway devices that do not belong to the wireless mesh network to be built will cause interference. In order to ensure the privacy and security of communication, each mesh gateway device is required to send verification information to the cloud when establishing communication with the cloud.
[0004] In conventional mesh gateway deployment optimization methods, the mesh gateway device sends a verification information sequence to the cloud in plain text, which can be easily intercepted by an attacker, and the attacker attempts to connect a rogue device to the mesh network IoT based on the intercepted verification information sequence. Once the attacker's rogue device successfully connects, the subsequent attacker can obtain important information and data transmitted in the mesh network IoT. In order to avoid the access of the attacker's rogue device, the present invention processes and encrypts the verification information sequence sent by the mesh gateway device to the cloud, so that even if the attacker intercepts the verification information sequence, the attacker cannot connect the rogue device to the mesh network IoT based on the verification information sequence. Summary of the invention
[0005] The present invention provides a mesh gateway deployment optimization method to solve the existing problems.
[0006] A mesh gateway deployment optimization method of the present invention adopts the following technical solution:
[0007] An embodiment of the present invention provides a mesh gateway deployment optimization method, the method comprising the following steps:
[0008] A letter sequence library is constructed according to the number of mesh gateway devices in the mesh network IoT, and letter sequences in the letter sequence library are distributed to all mesh gateway devices;
[0009] Construct all length types, and obtain the key of each mesh gateway device based on all length types and the letter sequence of each mesh gateway device;
[0010] Build the broadcast information sequence of the mesh network IoT and send the broadcast information sequence to all mesh gateway devices through the cloud;
[0011] The broadcast information sequence is processed according to the letter sequence of the mesh gateway device to obtain the plaintext sequence of the mesh gateway device, including:
[0012] S1, record the sequence composed of the letter sequence of the mesh gateway device and the broadcast information sequence as the sequence to be processed;
[0013] S2, obtain the search area and the area to be processed;
[0014] S3, searching in the search area to obtain the maximum matching string in the area to be processed, and obtaining the plaintext and translation amount according to the maximum matching string;
[0015] S4, obtaining a new search area and a new area to be processed according to the translation amount;
[0016] S5, re-execute from S3 according to the new search area and the new to-be-processed area, until the new to-be-processed area is empty; record the sequence of all the plaintexts obtained in order as the plaintext sequence of the mesh gateway device, and the plaintext sequence includes letters, position quantities and matching lengths;
[0017] Obtaining length type sequences corresponding to all position quantities and matching lengths in the plaintext sequence of the mesh gateway device according to all length types, replacing all position quantities and matching lengths in the plaintext sequence with corresponding length type sequences, and recording the replaced sequences as the sequence to be encrypted of the mesh gateway device; encrypting the sequence to be encrypted of the mesh gateway device according to the key of the mesh gateway device to obtain the verification information sequence of the mesh gateway device;
[0018] According to the received verification information sequence, each mesh gateway device is initially verified to obtain all suspicious devices, and the suspicious devices are secondary verified to obtain all normal devices; all normal devices are connected to the mesh network Internet of Things, and communication between multiple mesh gateway devices and the cloud is established to optimize the deployment of mesh gateway devices.
[0019] Furthermore, the letter sequence library is constructed according to the number of mesh gateway devices in the mesh network Internet of Things, and the specific steps include the following:
[0020] Construct an empty sequence of length s, randomly fill all kinds of English letters in the empty sequence, each kind of English letter appears only once in the sequence, and obtain the filled sequence, where s = 26, which represents the number of kinds of English letters;
[0021] Obtain s! sequences that meet the conditions, where ! represents factorial; randomly select w sequences from all sequences as letter sequences to form a letter sequence library, and w represents the number of mesh gateway devices in the mesh network Internet of Things.
[0022] Furthermore, the step of obtaining the key of each mesh gateway device according to all length types and the letter sequence of each mesh gateway device includes the following specific steps:
[0023] Assign a 5-bit binary number to each English letter and each length type in the letter sequence of the mesh gateway device without duplication. Each English letter corresponds to a unique 5-bit binary number, each length type corresponds to a unique 5-bit binary number, and each 5-bit binary number corresponds to a unique English letter or length type.
[0024] The corresponding relationship between all kinds of English letters in the letter sequence of the mesh gateway device and all kinds of length types and 5-bit binary numbers is used as the key of the mesh gateway device to obtain the keys of all mesh gateway devices.
[0025] Furthermore, the broadcast information sequence of constructing the mesh network Internet of Things includes the following specific steps:
[0026] In the cloud of the mesh network Internet of Things, a sequence with a length equal to a first preset length is randomly generated based on all types of English letters. The number of types of English letters contained in the sequence is arbitrary, and the frequency of each English letter is also arbitrary; the obtained sequence is recorded as the broadcast information sequence of the mesh network Internet of Things.
[0027] Furthermore, the obtaining of the search area and the area to be processed includes the following specific steps:
[0028] A sequence consisting of all letters between the 1st letter to the sth letter in the sequence to be processed is used as the search area; a sequence consisting of all letters between the s+1th letter to the s+zth letter in the sequence to be processed is used as the area to be processed, where z represents the second preset length.
[0029] Furthermore, the step of searching in the search area to obtain the maximum matching string in the area to be processed and obtaining the plaintext and the translation amount according to the maximum matching string includes the following specific steps:
[0030] Determine whether the search area contains the first letter m in the area to be processed 1 There are two cases for the same letters:
[0031] Case 1: The search area does not contain the first letter m in the area to be processed 1 If the letters are the same, the first letter m in the area to be processed1 As the maximum matching string, the maximum matching string is used as plain text, and the translation amount k=1;
[0032] Case 2: The first letter m in the search area exists in the area to be processed 1 The same letter as the letter m is obtained in the search area 1 Same letter n i , where n i represents the i-th letter in the search area; if there exists an integer t that satisfies t≤min(si,z-1) and makes the i-th letter n in the search area i To the i+tth letter n i+t All letters between and the first letter m in the area to be processed 1 To the 1st + tth letter m 1+t If all the letters between are exactly the same, the first letter m in the area to be processed 1 To the 1st + tth letter m 1+t The sequence of all letters between is recorded as the maximum matching string; 1 Same letter n i The serial number i is recorded as the position quantity p, that is, p=i, and the integer t is taken as the matching length c, that is, c=t; the data pair (p,c) consisting of the position quantity p and the matching length c is taken as plain text; the matching length is taken as the translation amount, that is, the translation amount k=c, wherein s represents the length of the search area, and z represents the second preset length.
[0033] Furthermore, the step of obtaining a new search area and a new area to be processed according to the translation amount includes the following specific steps:
[0034] A sequence consisting of all letters between the 1+kth letter and the s+kth letter in the sequence to be processed is taken as a new search area; a sequence consisting of all letters between the s+1+kth letter and the s+z+kth letter in the sequence to be processed is taken as a new area to be processed, wherein k represents the translation amount, s represents the length of the search area, and z represents the second preset length.
[0035] Furthermore, the method of obtaining all position quantities and length type sequences corresponding to the matching lengths in the plaintext sequence of the mesh gateway device according to all length types includes the following specific steps:
[0036] For any position quantity in the plaintext sequence, a length type sequence corresponding to the position quantity is obtained according to all length types, specifically: the position quantity is taken as the dividend, and the dividend is divided according to the divisor to obtain the quotient h and remainder r of the position quantity, and the length type sequence corresponding to the position quantity is obtained according to the quotient and remainder of the position quantity, specifically: if the remainder of the position quantity is 0, a sequence consisting of h-1 sixth length types and 1 fifth length type is recorded as the length type sequence of the position quantity; if the remainder of the position quantity is not 0, the length type corresponding to the remainder r of the position quantity is obtained, and a sequence consisting of h sixth length types and the length type corresponding to the remainder is recorded as the length type sequence of the position quantity;
[0037] For any matching length in the plaintext sequence, a length type sequence corresponding to the matching length is obtained according to all length types, specifically: the matching length is taken as the dividend, and the dividend is divided according to the divisor to obtain the quotient h and remainder r of the matching length; and the length type sequence corresponding to the matching length is obtained according to the quotient and remainder of the matching length, specifically: if the remainder of the matching length is 0, a sequence consisting of h-1 sixth length types and 1 fifth length type is recorded as the length type sequence of the matching length; if the remainder of the matching length is not 0, the length type corresponding to the remainder r of the matching length is obtained, and a sequence consisting of h sixth length types and the length type corresponding to the remainder is recorded as the length type sequence of the matching length.
[0038] Furthermore, the initial verification of each mesh gateway device according to the received verification information sequence to obtain all suspicious devices includes the following specific steps:
[0039] According to the key and letter sequence of the mesh gateway device, the verification information sequence is decrypted and reversed to obtain the verification sequence; the Hamming distance between the verification sequence and the broadcast information sequence is calculated, and if the Hamming distance is less than δ×y, it means that the mesh gateway device may be a rogue device and is used as a suspicious device network, where y represents the first preset length and δ represents the coefficient; otherwise, the mesh gateway device passes the verification and is recorded as a normal device.
[0040] Furthermore, the second verification of the suspicious device to obtain all normal devices includes the following specific steps:
[0041] The cloud of the mesh network IoT sends a new broadcast information sequence to all suspicious devices in turn. Each suspicious device processes and encrypts the new broadcast information sequence obtained according to its own key, obtains its own verification information sequence, and sends the verification information sequence to the cloud. For any suspicious device, when the cloud of the mesh network IoT does not receive the verification information sequence sent by the suspicious device, or after the received verification information sequence is reversed and decrypted, the Hamming distance between the obtained verification sequence and the broadcast information sequence is less than δ×y, it means that the mesh gateway device is a rogue device, and all suspicious devices that are not rogue devices are recorded as normal devices, where y represents the first preset length and δ represents the coefficient.
[0042] The beneficial effects of the technical solution of the present invention are:
[0043] 1. The present invention sends the same broadcast information sequence to all mesh gateway devices through the cloud of the mesh network Internet of Things. Each mesh gateway device processes and encrypts the broadcast information sequence according to its own letter sequence and key, obtains the verification information sequence of each mesh gateway device and sends it to the cloud. The cloud performs reverse data processing and decryption on the received verification information sequence to obtain the verification sequence of each mesh gateway device. According to the verification sequence of each mesh gateway device, the initial verification of each mesh gateway device is completed to obtain all suspicious devices, and all suspicious devices are secondary verified to obtain all normal devices; all normal devices are connected to the mesh network Internet of Things, and communication between multiple mesh gateway devices and the cloud is established to achieve deployment optimization of each mesh gateway device. At the same time, the verification method has a high verification efficiency.
[0044] 2. The present invention processes the received broadcast information sequence according to the letter sequence of each mesh gateway device. Since the processing area and the search area are dynamically changed during the data processing, even the same letters in the broadcast information sequence will result in different plaintexts after data processing, so that the statistical characteristics of the plaintext sequence of each mesh gateway device are completely different from the statistical characteristics of the broadcast information sequence. After the plaintext sequence of the mesh gateway device is encrypted according to the key of each mesh gateway device, the statistical characteristics of the verification information sequence of each mesh gateway device are different, which ensures that the verification information sequence can resist the statistical analysis attack during the transmission process and improves the encryption effect of the verification information sequence. Even if the attacker intercepts the verification information, the rogue device cannot be connected to the mesh network Internet of Things based on the intercepted verification information, which ensures the deployment optimization of the mesh gateway devices in the mesh network Internet of Things. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flowchart of the steps of a mesh gateway deployment optimization method of the present invention;
[0047] Figure 2 A key for a mesh gateway provided by the present invention;
[0048] Figure 3 A flow chart of performing data processing on a broadcast information sequence to obtain a plaintext sequence provided by the present invention. DETAILED DESCRIPTION
[0049] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a mesh gateway deployment optimization method proposed by the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0050] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0051] The following describes in detail a specific scheme of a mesh gateway deployment optimization method provided by the present invention in conjunction with the accompanying drawings.
[0052] See also Figure 1 , which shows a flow chart of a mesh gateway deployment optimization method provided by an embodiment of the present invention, the method comprising the following steps:
[0053] S001. Build a letter sequence library according to the number of mesh gateway devices in the mesh network Internet of Things, and distribute the letter sequences in the letter sequence library to all mesh gateway devices.
[0054] 1. Build a letter sequence library based on the number of mesh gateway devices in the mesh network IoT.
[0055] It should be noted that in order to verify the mesh gateway device and prevent rogue devices from accessing the mesh network IoT, each mesh gateway device needs to process the received broadcast information sequence according to the letter sequence to obtain a plaintext sequence, and then encrypt the plaintext sequence according to the key to obtain a verification information sequence, so that even if the attacker intercepts the verification information sequence, he cannot connect the rogue device to the mesh network IoT based on the verification information sequence; therefore, it is necessary to first construct the letter sequence corresponding to each mesh gateway device.
[0056] In this embodiment, an empty sequence with a length of s is constructed, and all kinds of English letters are randomly filled into the empty sequence. Each kind of English letter appears only once in the sequence to obtain a filled sequence, where s represents the number of types of English letters. Since there are 26 kinds of English letters in total, s=26.
[0057] Obtain s! sequences that meet the conditions, where ! represents factorial; randomly select w sequences from all sequences as letter sequences to form a letter sequence library, and w represents the number of mesh gateway devices in the mesh network Internet of Things.
[0058] 2. Assign the letter sequences in the letter sequence library to all mesh gateway devices.
[0059] Each letter sequence in the letter sequence library is assigned to each mesh gateway device in the mesh network Internet of Things, so that a mesh gateway device in the mesh network Internet of Things corresponds to a unique letter sequence, and a letter sequence in the letter sequence library corresponds to a unique mesh gateway device; the correspondence between all mesh gateway devices in the mesh network Internet of Things and the letter sequences is stored on the cloud of the mesh network Internet of Things.
[0060] For example, the letter sequence of a mesh gateway device in the mesh network IoT is {u,p,z,j,t,v,e,s,o,x,c,h,r,d,f,a,l,b,g,i,m,k,n,q,w,y}.
[0061] S002. Construct a length type, and obtain a key for each mesh gateway device according to all length types and the letter sequence of each mesh gateway device.
[0062] It should be noted that for all mesh gateway devices in the mesh network Internet of Things, the steps for constructing the key of the mesh gateway device are the same. Therefore, this embodiment takes the construction of the key of any mesh gateway device as an example for explanation. The specific steps are:
[0063] 1. Build length type.
[0064] Six length types are constructed, namely: the first length type, the second length type, the third length type, the fourth length type, the fifth length type and the sixth length type; length d=1 is recorded as the first length type, length d=2 is recorded as the second length type, length d=3 is recorded as the third length type, length d=4 is recorded as the fourth length type, length d=5 is recorded as the fifth length type, and length d>5 is recorded as the sixth length type.
[0065] 2. Obtain the key of the mesh gateway device based on all length types and letter sequences of the mesh gateway device.
[0066] It should be noted that there are 26 kinds of English letters in the letter sequence corresponding to the mesh gateway device. The above step 1 constructs 6 length types. At the same time, there are 32 kinds of 5-bit binary numbers. Therefore, all 5-bit binary numbers can be used to represent all kinds of English letters in the letter sequence and all length types.
[0067] In this embodiment, a 5-bit binary number is randomly assigned to each English letter and each length type in the letter sequence of the mesh gateway device without duplication. Then, each English letter corresponds to a unique 5-bit binary number, each length type corresponds to a unique 5-bit binary number, and each 5-bit binary number corresponds to a unique English letter or length type.
[0068] The correspondence between all kinds of English letters in the letter sequence of the mesh gateway device and all kinds of length types and 5-bit binary numbers is used as the key of the mesh gateway device.
[0069] For example, Figure 2 Shown is the key for a mesh gateway device.
[0070] 3. Obtain the keys of all mesh gateway devices, and store the keys of all mesh gateway devices in the mesh network IoT on the cloud of the mesh network IoT; at the same time, store the keys of all mesh gateway devices in the mesh network IoT on an offline device such as a USB flash drive, and distribute the offline device with the keys of the mesh gateway devices to the administrators of the corresponding mesh gateway devices to ensure that only the mesh gateway devices can obtain the corresponding keys, thereby ensuring the security of the keys.
[0071] S003. Build a broadcast information sequence for the mesh network IoT, and send the broadcast information sequence to all mesh gateway devices through the cloud.
[0072] In the cloud of the mesh network Internet of Things, a sequence with a length equal to a first preset length is randomly generated based on all types of English letters. The number of types of English letters contained in the sequence is arbitrary, and the frequency of each English letter is also arbitrary; the obtained sequence is recorded as the broadcast information sequence of the mesh network Internet of Things.
[0073] In order to improve the verification efficiency, the broadcast information sequence is sent to all mesh gateway devices through the cloud, that is, the broadcast information sequence received by all mesh gateway devices is the same.
[0074] In this embodiment, the first preset length y=100. In other embodiments, the implementer may set the first preset length y according to needs.
[0075] For example, when the first preset length is 20, this embodiment randomly generates a sequence {f, k, t, b, a, x, m, t, d, j, p, k, c, w, q, s, d, z, a, r} with a length of 20 based on all kinds of English letters, and records the obtained sequence as the broadcast information sequence of the mesh network Internet of Things.
[0076] S004. Perform data processing on the broadcast information sequence according to the letter sequence of each mesh gateway device to obtain the plaintext sequence of each mesh gateway device.
[0077] It should be noted that for all mesh gateway devices in the mesh network Internet of Things, the steps of performing data processing on the broadcast information sequence according to the letter sequence of the mesh gateway device and obtaining the plaintext sequence of the mesh gateway device are the same. Therefore, this embodiment takes obtaining the plaintext sequence of any mesh gateway device as an example for explanation, and the specific steps are:
[0078] 1. The sequence composed of the letter sequence of the mesh gateway device and the broadcast information sequence is recorded as the sequence to be processed. The sequence to be processed consists of s+y letters, where s represents the length of the letter sequence, that is, the number of types of English letters, and y represents the length of the broadcast information sequence, that is, the first preset length.
[0079] 2. The sequence consisting of all letters between the 1st letter to the sth letter in the sequence to be processed is used as the search area; the sequence consisting of all letters between the s+1th letter to the s+zth letter in the sequence to be processed is used as the processing area, where z represents the second preset length; in this embodiment, the second preset length z=10, and in other embodiments, the implementer can use the second preset length z as needed.
[0080] 3. Search the search area to obtain the maximum matching string in the area to be processed, and obtain the plaintext and translation amount based on the maximum matching string. Specifically: determine whether the search area exists with the first letter m in the area to be processed 1 There are two cases for the same letters:
[0081] Case 1: The search area does not contain the first letter m in the area to be processed 1 If the letters are the same, the first letter m in the area to be processed 1 As the maximum matching string, the maximum matching string is used as plain text, and the shift amount k=1.
[0082] Case 2: The first letter m in the search area exists in the area to be processed 1 Same letters.
[0083] (1) Get the letters m in the search area 1 Same letter n i , where n i represents the i-th letter in the search area; if there exists an integer t that satisfies t≤min(si,z-1) and makes the i-th letter n in the search area i To the i+tth letter n i+t All letters between and the first letter m in the area to be processed 1 To the 1st + tth letter m 1+t If all the letters between are exactly the same, the first letter m in the area to be processed 1 To the 1st + tth letter m 1+t The sequence of all letters between is recorded as the maximum matching string.
[0084] (2) Search the area with the letter m 1 Same letter n i The serial number i is recorded as the position quantity p, that is, p=i, and the integer t is taken as the matching length c, that is, c=t; the data pair (p, c) consisting of the position quantity p and the matching length c is taken as plain text.
[0085] (3) The matching length is used as the translation amount, that is, the translation amount k = c.
[0086] 4. Obtain a new search area and a new area to be processed according to the translation amount, including: taking a sequence consisting of all letters from the 1+kth letter to the s+kth letter in the sequence to be processed as a new search area; taking a sequence consisting of all letters from the s+1+kth letter to the s+z+kth letter in the sequence to be processed as a new area to be processed, where k represents the translation amount.
[0087] 5. Restart from step 3 based on the new search area and the new area to be processed.
[0088] Repeat steps 1 to 5 above until the new area to be processed is empty; record the sequence of all the plaintexts obtained in order as the plaintext sequence of the mesh gateway device.
[0089] Obtain the plaintext sequences of all mesh gateway devices according to the above method.
[0090] For example, according to the letter sequence {u,p,z,j,t,v,e,s,o,x,c,h,r,d,f,a,l,b,g,i,m,k,n,q,w,y} of the mesh gateway device, the broadcast information sequence {f,k,t,v,e,a,l,m,k,n,q,w,y,c,w,y,s,d,z,a} is processed. The specific process is as follows: Figure 3 As shown, the plaintext sequence of the mesh gateway device is {15,1,22,1,3,3,11,2,14,6,c,11,2,s,d,z,13,1}.
[0091] S005. Encrypt the plaintext sequence of each mesh gateway device according to the key of each mesh gateway device to obtain the verification information sequence of each mesh gateway device.
[0092] It should be noted that for all mesh gateway devices in the mesh network Internet of Things, the steps of encrypting the plaintext sequence of the mesh gateway device according to the key of the mesh gateway device and obtaining the verification information sequence of the mesh gateway device are the same. Therefore, this embodiment takes obtaining the verification information sequence of any mesh gateway device as an example for explanation, and the specific steps are:
[0093] 1. According to all length types, obtain the length type sequence corresponding to all position quantities and matching lengths in the plaintext sequence of the mesh gateway device, and then obtain the sequence to be encrypted of the mesh gateway device.
[0094] In step S002, 6 length types are constructed, specifically: length d=1 is recorded as the first length type, length d=2 is recorded as the second length type, length d=3 is recorded as the third length type, length d=4 is recorded as the fourth length type, length d=5 is recorded as the fifth length type, and length d>5 is recorded as the sixth length type.
[0095] For any position quantity in the plaintext sequence, the length type sequence corresponding to the position quantity is obtained according to all the length types. Specifically, the position quantity is taken as the dividend and the integer 5 is taken as the divisor. The division operation is performed to obtain the quotient h and remainder r of the position quantity. The length type sequence corresponding to the position quantity is obtained according to the quotient and remainder of the position quantity, which is specifically:
[0096] (1) If the remainder of the position quantity is 0, a sequence consisting of h-1 sixth length types and 1 fifth length type is recorded as a length type sequence of the position quantity, so as to ensure that the position quantity can be obtained according to the length type sequence later.
[0097] (2) If the remainder of the position quantity is not 0, the length type corresponding to the remainder r of the position quantity is obtained, and the sequence consisting of h sixth length types and the length type corresponding to the remainder is recorded as the length type sequence of the position quantity, so as to ensure that the position quantity can be obtained according to the length type sequence later.
[0098] For any matching length in the plaintext sequence, the length type sequence corresponding to the matching length is obtained according to all length types, specifically: the matching length is used as the dividend, and the dividend is divided according to the divisor to obtain the quotient h and remainder r of the matching length, where the divisor is 5; the length type sequence corresponding to the matching length is obtained according to the quotient and remainder of the matching length, specifically:
[0099] (1) If the remainder of the matching length is 0, a sequence consisting of h-1 sixth length types and 1 fifth length type is recorded as a length type sequence of the matching length, so as to ensure that the matching length can be obtained according to the length type sequence later.
[0100] (2) If the remainder of the matching length is not 0, the length type corresponding to the remainder r of the matching length is obtained, and a sequence consisting of h sixth length types and the length type corresponding to the remainder is recorded as a length type sequence of the matching length, so as to ensure that the matching length can be obtained according to the length type sequence later.
[0101] All position quantities and matching lengths in the plaintext sequence of the mesh gateway device are replaced with corresponding length type sequences, and the replaced sequence is recorded as the sequence to be encrypted of the mesh gateway device.
[0102] For example, for the plaintext sequence of the mesh gateway device {15,1,22,1,3,3,11,2,14,6,c,11,2,s,d,z,13,1}, where all position quantities are 15,22,3,11,14,11,13, and all matching lengths are 1,1,3,2,6,2,1; according to all the length types, the length type sequences corresponding to all position quantities in the plaintext sequence of the mesh gateway device are obtained, which are {six, six, five}, {six, six, six, six, two}, {three}, {six, six, one}, {six, six, four}, {six, six, one}, {six, six, three}. type, and obtain the length type sequences corresponding to all matching lengths in the plaintext sequence of the mesh gateway device, which are {one}, {one}, {three}, {two}, {six,one}, {two}, {one}, and then the sequence to be encrypted is {six, six, five, one, six, six, six, six, two, one, three, three, six, six, one, two, six, six, four, six, one, c, six, six, one, two, s, d, z, six, six, three, one}, where "one", "two", "three", "four", "five", and "six" represent the first length type, the second length type, the third length type, the fourth length type, the fifth length type, and the sixth length type, respectively.
[0103] 2. Encrypt the sequence to be encrypted of each mesh gateway device according to the key of each mesh gateway device to obtain the verification information sequence of each mesh gateway device.
[0104] In order to ensure the security of the key, this embodiment stores the key of the mesh gateway device on an offline device, and distributes the offline device containing the key to the corresponding administrators. When encrypting the sequence to be encrypted of each mesh gateway device according to the key of each mesh gateway device, the administrator of each mesh gateway device is required to insert the offline device containing the key into the mesh gateway device to obtain the key.
[0105] The key of the mesh gateway device is the correspondence between all kinds of English letters and all kinds of length types and 5-bit binary numbers. Therefore, the 5-bit binary number corresponding to each letter and length type in the sequence to be encrypted of the mesh gateway device is obtained according to the key of the mesh gateway device, and the sequence composed of the 5-bit binary numbers corresponding to all letters and length types in the sequence to be encrypted is recorded as the verification information sequence of the mesh gateway device.
[0106] For example, if the encryption sequence {six, six, five, one, six, six, six, six, two, one, three, three, six, six, one, two, six, six, four, six, one, c, six, six, one, two, s, d, z, six, six, three, one} is encrypted, the verification information sequence obtained is {1101011010111011100111010101101011011 01000010110011000110001110101101010110010001011010101010010001101010101010100100100111000011000011101010101000111001}.
[0107] This embodiment performs data processing on the received broadcast information sequence according to the letter sequence of each mesh gateway device. Since the processing area and the search area are dynamically changed during the data processing, even if the letters in the broadcast information sequence are the same, the plaintext obtained after data processing is different, so that the statistical characteristics of the plaintext sequence of each mesh gateway device are completely different from the statistical characteristics of the broadcast information sequence. After the plaintext sequence of the mesh gateway device is encrypted according to the respective keys of each mesh gateway device, the statistical characteristics of the verification information sequence obtained for each mesh gateway device are different, which ensures that the verification information sequence can resist the statistical analysis attack during the transmission process and improves the encryption effect of the verification information sequence; even if the attacker intercepts the verification information, the rogue device cannot be connected to the mesh network Internet of Things based on the intercepted verification information, which ensures the deployment optimization of the mesh gateway devices in the mesh network Internet of Things.
[0108] S006. Perform initial verification on each mesh gateway device according to the received verification information sequence to obtain all suspicious devices, and perform secondary verification on the suspicious devices to obtain all normal devices; connect all normal devices to the mesh network Internet of Things to optimize the deployment of mesh gateway devices.
[0109] 1. Decrypt and reverse the verification information sequence according to the key and letter sequence of the mesh gateway device to obtain the verification sequence.
[0110] It should be noted that, in order to improve the verification efficiency, the cloud sends the same broadcast information sequence to all mesh gateway devices, and each mesh gateway device processes and encrypts the broadcast information sequence according to its own key to obtain its own verification information sequence; each mesh gateway device sends its own verification information sequence to the cloud for verification; for all mesh gateway devices in the mesh network Internet of Things, the steps of decrypting the verification information sequence according to the key of the mesh gateway device to obtain the verification sequence are the same. Therefore, this embodiment takes the decryption of the verification information sequence according to the key of any mesh gateway device to obtain the verification sequence as an example for explanation, and the specific steps are:
[0111] (1) Divide the verification information sequence into multiple subsequences of length 5, each subsequence is a 5-bit binary number, and obtain the letter or length type corresponding to each subsequence according to the key of the mesh gateway device.
[0112] (2) Convert all length types into corresponding position quantities and matching lengths in order, specifically: for the jth length type: if the jth length type is not the sixth length type, directly obtain the length d according to the length type, and the lengths corresponding to the first length type, the second length type, the third length type, the fourth length type and the fifth length type are 1, 2, 3, 4 and 5 respectively; if the jth length type is the sixth length type, obtain a positive integer g such that the jth length type to the j+g-1th length type are all the sixth length type, and the j+gth length type is not the sixth length type, then the jth length type to the j+gth length type corresponds to a length of d=5×g+d j+g , where d j+g The length corresponding to the j+gth length type; obtain the lengths corresponding to all length types, record every two lengths as a length pair from left to right, use the first length in each length pair as the position quantity, and use the second length in each length pair as the matching length.
[0113] (3) All length types in the verification information sequence are replaced with corresponding position quantities and matching lengths, and the sequence obtained after the replacement is recorded as the restored sequence.
[0114] (4) The restored sequence is processed in reverse order from left to right to obtain the verification sequence, specifically: the letter sequence of the mesh gateway device is used as the verification sequence. For the vth data in the restored sequence, if the vth data is an English letter, the English letter is directly filled at the end of the verification sequence; if the vth data is a length pair consisting of a position quantity p and a matching length c, then the string consisting of the a-s+1th letter to the ath letter in the verification sequence is filled at the end of the verification sequence, where a represents the length of the verification sequence.
[0115] 2. Perform initial verification on each mesh gateway device according to the verification sequence to obtain all suspicious devices.
[0116] The verification sequence is obtained by decrypting the verification information sequence of each mesh gateway device according to the key of each mesh gateway device stored in the cloud, and the Hamming distance between the verification sequence and the broadcast information sequence is calculated. If the Hamming distance between the verification sequence and the broadcast information sequence of the mesh gateway device is less than δ×y, it means that the mesh gateway device may be a rogue device and is used as a suspicious device network, where y represents the first preset length, δ represents the coefficient, and the empirical value of the coefficient is 0.95; otherwise, the mesh gateway device passes the verification and is recorded as a normal device, and is allowed to access the mesh network Internet of Things.
[0117] 3. Perform secondary verification on suspicious devices to obtain all normal devices; connect all normal devices to the mesh network Internet of Things to optimize the deployment of mesh gateway devices.
[0118] For all suspicious devices, the cloud of the mesh network IoT sends new broadcast information sequences to all suspicious devices in turn. It should be noted that the new broadcast information sequences received by all suspicious devices are different; each suspicious device processes and encrypts the new broadcast information sequence obtained according to its own key to obtain its own verification information sequence. Since the rogue device does not have a key, when performing secondary verification, the suspicious device that is a rogue device cannot process and encrypt the received new broadcast information sequence, and thus cannot obtain the verification information sequence. Therefore, for any suspicious device, when the cloud of the mesh network IoT does not receive the verification information sequence sent by the suspicious device, or after the received verification information sequence is reversed and decrypted, the Hamming distance between the verification sequence and the broadcast information sequence is less than δ×y, it means that the suspicious device is a rogue device.
[0119] All mesh gateway devices that are not rogue devices are recorded as normal devices, all normal devices are connected to the mesh network Internet of Things, and communication between multiple mesh gateway devices and the cloud is established to optimize the deployment of mesh gateway devices.
[0120] In this embodiment, the same broadcast information sequence is sent to all mesh gateway devices through the cloud of the mesh network Internet of Things. Each mesh gateway device processes and encrypts the broadcast information sequence according to its own letter sequence and key, obtains the verification information sequence of each mesh gateway device and sends it to the cloud. The cloud performs reverse data processing and decryption on the received verification information sequence to obtain the verification sequence of each mesh gateway device. According to the verification sequence of each mesh gateway device, the initial verification of each mesh gateway device is completed to obtain all suspicious devices, and all suspicious devices are secondary verified to obtain all normal devices; all normal devices are connected to the mesh network Internet of Things, and communication between multiple mesh gateway devices and the cloud is established to achieve deployment optimization of each mesh gateway device. At the same time, the verification method has a high verification efficiency.
[0121] The present invention sends the same broadcast information sequence to all mesh gateway devices through the cloud of the mesh network Internet of Things. Each mesh gateway device performs data processing and encryption on the broadcast information sequence according to its own letter sequence and key, obtains the verification information sequence of each mesh gateway device and sends it to the cloud. The cloud performs reverse data processing and decryption on the received verification information sequence to obtain the verification sequence of each mesh gateway device. According to the verification sequence of each mesh gateway device, the initial verification of each mesh gateway device is completed to obtain all suspicious devices, and all suspicious devices are secondary verified to obtain all normal devices; all normal devices are connected to the mesh network Internet of Things, and communication between multiple mesh gateway devices and the cloud is established to achieve deployment optimization of each mesh gateway device. At the same time, the verification method has high verification efficiency. The received broadcast information sequence is processed according to the letter sequence of each mesh gateway device. Since the processing area and the search area are dynamically changed during the data processing, even the same letters in the broadcast information sequence will result in different plaintexts after data processing, making the statistical characteristics of the plaintext sequence of each mesh gateway device completely different from those of the broadcast information sequence. After the plaintext sequence of the mesh gateway device is encrypted according to the key of each mesh gateway device, the statistical characteristics of the verification information sequence of each mesh gateway device are different, ensuring that the verification information sequence can resist statistical analysis attacks during transmission and improving the encryption effect of the verification information sequence. Even if the attacker intercepts the verification information, the rogue device cannot be connected to the mesh network Internet of Things based on the intercepted verification information, ensuring the deployment optimization of the mesh gateway devices in the mesh network Internet of Things.
[0122] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0123] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A mesh gateway deployment optimization method, characterized in that: The method comprises the following steps: A letter sequence library is constructed according to the number of mesh gateway devices in the mesh network IoT, and letter sequences in the letter sequence library are distributed to all mesh gateway devices; Construct all length types, and obtain the key of each mesh gateway device based on all length types and the letter sequence of each mesh gateway device; Build the broadcast information sequence of the mesh network IoT and send the broadcast information sequence to all mesh gateway devices through the cloud; The broadcast information sequence is processed according to the letter sequence of the mesh gateway device to obtain the plaintext sequence of the mesh gateway device, including: S1, record the sequence composed of the letter sequence of the mesh gateway device and the broadcast information sequence as the sequence to be processed; S2, obtain the search area and the area to be processed; S3, searching in the search area to obtain the maximum matching string in the area to be processed, and obtaining the plaintext and translation amount according to the maximum matching string; S4, obtaining a new search area and a new area to be processed according to the translation amount; S5, re-execute from S3 according to the new search area and the new to-be-processed area, until the new to-be-processed area is empty; record the sequence of all the plaintexts obtained in order as the plaintext sequence of the mesh gateway device, and the plaintext sequence includes letters, position quantities and matching lengths; Obtaining length type sequences corresponding to all position quantities and matching lengths in the plaintext sequence of the mesh gateway device according to all length types, replacing all position quantities and matching lengths in the plaintext sequence with corresponding length type sequences, and recording the replaced sequences as the sequence to be encrypted of the mesh gateway device; encrypting the sequence to be encrypted of the mesh gateway device according to the key of the mesh gateway device to obtain the verification information sequence of the mesh gateway device; According to the received verification information sequence, each mesh gateway device is initially verified to obtain all suspicious devices, and the suspicious devices are secondary verified to obtain all normal devices; all normal devices are connected to the mesh network Internet of Things, and communication between multiple mesh gateway devices and the cloud is established to optimize the deployment of mesh gateway devices.
2. A mesh gateway deployment optimization method according to claim 1, characterized in that: According to the mesh The number of mesh gateway devices in the network IoT is used to build a letter sequence library, including the following specific steps: Construct an empty sequence of length s, randomly fill all kinds of English letters in the empty sequence, each kind of English letter appears only once in the sequence, and obtain the filled sequence, where s = 26, which represents the number of kinds of English letters; Obtain s! sequences that meet the conditions, where ! represents factorial; randomly select w sequences from all sequences as letter sequences to form a letter sequence library, and w represents the number of mesh gateway devices in the mesh network Internet of Things.
3. A mesh gateway deployment optimization method according to claim 1, characterized in that: The specific steps of obtaining the key of each mesh gateway device according to all length types and the letter sequence of each mesh gateway device are as follows: Assign a 5-bit binary number to each English letter and each length type in the letter sequence of the mesh gateway device without duplication. Each English letter corresponds to a unique 5-bit binary number, each length type corresponds to a unique 5-bit binary number, and each 5-bit binary number corresponds to a unique English letter or length type. The corresponding relationship between all kinds of English letters in the letter sequence of the mesh gateway device and all kinds of length types and 5-bit binary numbers is used as the key of the mesh gateway device to obtain the keys of all mesh gateway devices.
4. A mesh gateway deployment optimization method according to claim 1, characterized in that: The construction of mesh The broadcast information sequence of the network Internet of Things includes the following specific steps: In the cloud of the mesh network Internet of Things, a sequence with a length equal to a first preset length is randomly generated based on all types of English letters. The number of types of English letters contained in the sequence is arbitrary, and the frequency of each English letter is also arbitrary; the obtained sequence is recorded as the broadcast information sequence of the mesh network Internet of Things.
5. A mesh gateway deployment optimization method according to claim 1, characterized in that: The specific steps of obtaining the search area and the area to be processed are as follows: A sequence consisting of all letters between the 1st letter to the sth letter in the sequence to be processed is used as the search area; a sequence consisting of all letters between the s+1th letter to the s+zth letter in the sequence to be processed is used as the area to be processed, where z represents the second preset length.
6. A mesh gateway deployment optimization method according to claim 1, characterized in that: The specific steps of searching in the search area to obtain the maximum matching string in the to-be-processed area and obtaining the plaintext and translation amount according to the maximum matching string are as follows: Determine whether there is a letter in the search area that is the same as the first letter m1 in the area to be processed. There are two cases: Case 1: If there is no letter in the search area that is the same as the first letter m1 in the area to be processed, then the first letter m1 in the area to be processed is used as the maximum matching string, the maximum matching string is used as the plain text, and the translation amount k=1; Case 2: If there is a letter in the search area that is the same as the first letter m1 in the area to be processed, then the letter n in the search area that is the same as the letter m1 is obtained. i , where n i represents the i-th letter in the search area; if there exists an integer t that satisfies t≤min(si,z-1) and makes the i-th letter n in the search area i To the i+tth letter n i+t All the letters between the first letter m1 to the first + t letters m in the area to be processed 1+t If all the letters between are exactly the same, the first letter m1 to the first + t letters m in the area to be processed are 1+t The sequence of all letters between is recorded as the maximum matching string; the letter n in the search area that is the same as the letter m1 i The serial number i is recorded as the position quantity p, that is, p=i, and the integer t is taken as the matching length c, that is, c=t; the data pair (p,c) consisting of the position quantity p and the matching length c is taken as plain text; the matching length is taken as the translation amount, that is, the translation amount k=c, wherein s represents the length of the search area, and z represents the second preset length.
7. A mesh gateway deployment optimization method according to claim 1, characterized in that: The specific steps of obtaining a new search area and a new area to be processed according to the translation amount are as follows: A sequence consisting of all letters between the 1+kth letter and the s+kth letter in the sequence to be processed is taken as a new search area; a sequence consisting of all letters between the s+1+kth letter and the s+z+kth letter in the sequence to be processed is taken as a new area to be processed, wherein k represents the translation amount, s represents the length of the search area, and z represents the second preset length.
8. A mesh gateway deployment optimization method according to claim 1, characterized in that: The specific steps of obtaining the length type sequence corresponding to all position quantities and matching lengths in the plaintext sequence of the mesh gateway device according to all length types are as follows: For any position quantity in the plaintext sequence, a length type sequence corresponding to the position quantity is obtained according to all length types, specifically: the position quantity is taken as the dividend, and the dividend is divided according to the divisor to obtain the quotient h and remainder r of the position quantity, and the length type sequence corresponding to the position quantity is obtained according to the quotient and remainder of the position quantity, specifically: if the remainder of the position quantity is 0, a sequence consisting of h-1 sixth length types and 1 fifth length type is recorded as the length type sequence of the position quantity; if the remainder of the position quantity is not 0, the length type corresponding to the remainder r of the position quantity is obtained, and a sequence consisting of h sixth length types and the length type corresponding to the remainder is recorded as the length type sequence of the position quantity; For any matching length in the plaintext sequence, a length type sequence corresponding to the matching length is obtained according to all length types, specifically: the matching length is taken as the dividend, and the dividend is divided according to the divisor to obtain the quotient h and remainder r of the matching length; and the length type sequence corresponding to the matching length is obtained according to the quotient and remainder of the matching length, specifically: if the remainder of the matching length is 0, a sequence consisting of h-1 sixth length types and 1 fifth length type is recorded as the length type sequence of the matching length; if the remainder of the matching length is not 0, the length type corresponding to the remainder r of the matching length is obtained, and a sequence consisting of h sixth length types and the length type corresponding to the remainder is recorded as the length type sequence of the matching length.
9. A mesh gateway deployment optimization method according to claim 1, characterized in that: The specific steps of performing initial verification on each mesh gateway device according to the received verification information sequence to obtain all suspicious devices are as follows: According to the key and letter sequence of the mesh gateway device, the verification information sequence is decrypted and reversed to obtain the verification sequence; the Hamming distance between the verification sequence and the broadcast information sequence is calculated, and if the Hamming distance is less than δ×y, it means that the mesh gateway device may be a rogue device and is used as a suspicious device network, where y represents the first preset length and δ represents the coefficient; otherwise, the mesh gateway device passes the verification and is recorded as a normal device.
10. A mesh gateway deployment optimization method according to claim 1, characterized in that: The specific steps of performing secondary verification on suspicious devices to obtain all normal devices are as follows: The cloud of the mesh network IoT sends a new broadcast information sequence to all suspicious devices in turn. Each suspicious device processes and encrypts the new broadcast information sequence obtained according to its own key, obtains its own verification information sequence, and sends the verification information sequence to the cloud. For any suspicious device, when the cloud of the mesh network IoT does not receive the verification information sequence sent by the suspicious device, or after the received verification information sequence is reversed and decrypted, the Hamming distance between the obtained verification sequence and the broadcast information sequence is less than δ×y, it means that the mesh gateway device is a rogue device, and all suspicious devices that are not rogue devices are recorded as normal devices, where y represents the first preset length and δ represents the coefficient.
