A method for accessing a gateway to an industrial Internet of Things sensor

By integrating the particle swarm algorithm and optimization model in the load balancer, the problem of low efficiency of wireless sensor access and data transmission is solved, and efficient allocation and data transmission of wireless sensors and intelligent gateways are achieved.

CN118338386BActive Publication Date: 2024-09-03SHENZHEN ZHONGCHUANG XINGTONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410755002.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-03
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

When a large number of wireless sensors access or transmit data to a single smart gateway at the same time, the load on the smart gateway is excessive, resulting in low efficiency of wireless sensor access and data transmission.

Method used

Use the particle swarm algorithm to generate distribution plans through the load balancer, build graph network data and optimize the model to generate distribution plans between wireless sensors and smart gateways to achieve load balancing distribution and data transmission of wireless sensors.

Benefits of technology

It improves the accuracy and data transmission efficiency of wireless sensors accessing the smart gateway cluster, and avoids the problem of excessive load on the smart gateway.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118338386B
    Figure CN118338386B
Patent Text Reader

Abstract

The present invention relates to the field of communication technology, and discloses a method for accessing an industrial Internet of Things sensor to a gateway, comprising the following steps: step S101, a load balancer generates a first allocation scheme by using a particle swarm algorithm; step S102, constructing graph network data according to the first allocation scheme; step S103, inputting the graph network data into an optimization model, and the optimization model outputs a first adjacency matrix; step S104, generating a second allocation scheme according to the first adjacency matrix, and forwarding request messages sent by M wireless sensors to an intelligent gateway cluster composed of N intelligent gateways according to the second allocation scheme; the present invention completes automatic access of wireless sensors to an intelligent gateway cluster by integrating a particle swarm algorithm and an optimization model in a load balancer, and in addition, the optimization algorithm can improve the accuracy of wireless sensors accessing the intelligent gateway cluster, thereby improving the access efficiency of wireless sensors and data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and more specifically, to a method for accessing an industrial Internet of Things sensor to a gateway. Background Art

[0002] With the development of digital information, the Industrial Internet of Things has gradually become a key driving force for intelligent manufacturing and digital transformation. The publication number is CN117528571B, and the patent name is a Chinese patent for an automatic identification access method and system for wireless sensors on an intelligent gateway. It discloses that when wireless sensors use a standard message format to transmit data to the intelligent gateway, the intelligent gateway will convert it into a message of the MQTT protocol and send it to the data processing module. If the SN code of the message can be retrieved in the gateway database, the message will be parsed directly. Otherwise, the mapping relationship table of the device type and configuration model (used to correctly configure the sensor function) is retrieved according to the device type of the wireless sensor to complete the configuration of the newly connected sensor to ensure the correct transmission of data.

[0003] Although the above scheme realizes automatic configuration of wireless sensors, when a large number of wireless sensors are connected to a single intelligent gateway at the same time or a large number of wireless sensors transmit data to a single intelligent gateway at the same time, the load of a single intelligent gateway may be too large, resulting in low efficiency of wireless sensor access and data transmission. Summary of the invention

[0004] The present invention provides an industrial Internet of Things sensor access gateway method to solve the technical problems in the above-mentioned background technology.

[0005] The present invention provides a method for accessing an industrial Internet of Things sensor to a gateway, comprising the following steps:

[0006] Step S101, the load balancer generates a first allocation plan by using a particle swarm algorithm with a maximum number of iterations of A times;

[0007] The first allocation scheme includes: information of M wireless sensors, information of N intelligent gateways, and connection relationships between the M wireless sensors and the N intelligent gateways;

[0008] Step S102, constructing graph network data according to the first allocation scheme;

[0009] Graph network data includes: entities, initial features of entities, and edges between entities;

[0010] The entities include: a first entity and a second entity;

[0011] The first entity establishes a data connection with the wireless sensor;

[0012] The second entity establishes data connection with the intelligent gateway;

[0013] The initial features of an entity are generated based on the information that establishes data associations with it;

[0014] The edges between entities include: the existence of an edge between the first entity and the second entity indicates that the wireless sensor data-connected by the first entity is allocated to the intelligent gateway data-connected by the second entity;

[0015] Step S103, inputting the graph network data into the optimization model, and the optimization model outputs a first adjacency matrix;

[0016] The size of the first adjacency matrix is ​​M*N, and the element values ​​of the first adjacency matrix are represented by 0 or 1. If the element value of the nth column of the mth row of the first adjacency matrix is ​​1, it means that the mth wireless sensor is assigned to the nth intelligent gateway, otherwise it means that the mth wireless sensor is not assigned to the nth intelligent gateway, where 1≤m≤M, 1≤n≤N;

[0017] Step S104, generating a second allocation scheme according to the first adjacency matrix, and forwarding the request messages sent by the M wireless sensors to an intelligent gateway cluster consisting of N intelligent gateways according to the second allocation scheme;

[0018] The request message includes the information of the data contact of the first entity, the unique serial number and the device type;

[0019] Step S105: the intelligent gateway completes the access and data transmission of the wireless sensor according to the request message sent by the wireless sensor.

[0020] Furthermore, A, M and N are all custom parameters.

[0021] Furthermore, the initial features of the first entity are expressed as: ,in They respectively represent the data transmission size, data transmission frequency, remaining power, signal strength and Euclidean distance of the wireless sensor that establishes data contact with the first entity, where the value range of the remaining power is 1 to 100. When the wireless sensor is powered by a battery, the remaining power of the battery is directly obtained, otherwise the remaining power is directly set to 100. The initial characteristics of the second entity are expressed as: ,in They respectively represent the data transmission rate, signal strength, remaining storage space, CPU usage and network delay of the intelligent gateway that establishes data contact with the second entity.

[0022] Furthermore, the load balancer polls N smart gateways according to a first preset time, and stores the information of the data connection of the N second entities in the built-in database of the load balancer, caches the information of the data connection of the N second entities, and allocates a second preset time to the N cached information respectively. The cached information is cleared when the second preset time is exceeded, wherein the first preset time and the second preset time are both custom parameters, and the second preset time is greater than the first preset time.

[0023] Further, the optimization model includes: a first hidden layer, a first extraction layer, a second extraction layer, a first logic layer, a second logic layer, and a second hidden layer;

[0024] The first hidden layer inputs the graph network data and outputs the graph update matrix. A row vector of the graph update matrix represents the update feature of an entity.

[0025] The first extraction layer is used to extract the update features corresponding to the first entity in the graph update matrix;

[0026] The second extraction layer is used to extract the update features corresponding to the second entity in the graph update matrix;

[0027] The first logic layer is used to stack the updated features corresponding to the first entity extracted by the first extraction layer to obtain a first matrix, where the first matrix includes M row vectors;

[0028] The second logic layer is used to stack the updated features corresponding to the second entity extracted by the second extraction layer to obtain a second matrix, where the second matrix includes N row vectors;

[0029] The second hidden layer inputs the first matrix and the second matrix and outputs the first adjacency matrix.

[0030] Furthermore, the calculation formula of the optimization model includes:

[0031] The calculation formula of the first adjacency matrix F is as follows:

[0032] ;

[0033] in and denote the first matrix and the second matrix respectively, and They represent the third weight parameter and the fourth weight parameter respectively, T represents the transpose operation of the matrix, sigmoid represents the sigmoid activation function, and the sigmoid activation function is used to control the element value in the first adjacency matrix between 0 and 1. When the element value in the first adjacency matrix is ​​greater than or equal to 0.5, the element value is directly assigned to 1, otherwise it is assigned to 0;

[0034] Updated features of the i-th entity The calculation formula is as follows:

[0035] ;

[0036] in and Represent the initial features of the i-th entity and the j-th entity respectively, represents the set of entities that have edges with the i-th entity, , and P represent the first weight parameter, the second weight parameter and the bias parameter respectively, and MLP represents a multi-layer perceptron.

[0037] Furthermore, a first allocation scheme is generated by a particle swarm algorithm with a maximum number of iterations of B times, and then a second adjacency matrix is ​​constructed according to the connection relationship between the wireless sensors and the intelligent gateway in the first allocation scheme, and the second adjacency matrix is ​​used as the sample labels of the training samples for training the optimization model, where B is a custom parameter and B is much larger than A.

[0038] Further, generating a first allocation scheme by using a particle swarm algorithm includes the following steps:

[0039] Step S301, randomly generate a particle population that meets the constraint conditions, and define the number of the particle population as Q, where Q is a custom parameter;

[0040] The constraints include: a wireless sensor can only be assigned to one intelligent gateway; the number of wireless sensors assigned to an intelligent gateway cannot be greater than or equal to M;

[0041] A particle of the particle population is represented by a binary matrix. The size of the binary matrix is ​​M*N. The element value of the u-th row and the v-th column of the binary matrix is ​​represented by 0 or 1. If the element value of the u-th row and the v-th column of the first adjacency matrix is ​​1, it means that the u-th wireless sensor is assigned to the v-th intelligent gateway, otherwise it means that the u-th wireless sensor is not assigned to the v-th intelligent gateway, where 1≤u≤M, 1≤v≤N;

[0042] Step S302, calculating the fitness value of each particle in the particle population through the objective function model;

[0043] Step S303, updating the speed and position of each particle;

[0044] Step S304, repeating steps S302 to S303 until the iteration termination condition is met, and outputting the particle with the largest fitness value to generate the first allocation plan;

[0045] The iteration termination conditions include: the number of iterations reaches the maximum number of iterations; within K consecutive iterations, the maximum value of the fitness value is less than or equal to the fitness threshold T; K and T are both custom parameters.

[0046] Furthermore, the objective function model is constructed based on the convolutional neural network model, the sample labels of the training samples used to train the objective function model are evaluated and set by relevant technical experts, the matching value ranges from 1 to 10, and the objective function model includes M parallel modules and 1 statistical module, and one parallel module includes: a first convolution layer, a second convolution layer, a concatenation layer, and a fully connected layer;

[0047] The first convolutional layer inputs the information of a wireless sensor and outputs the first convolutional feature;

[0048] The second convolution layer inputs the information of an intelligent gateway and outputs the second convolution feature;

[0049] The concatenation layer is used to concatenate the first convolution feature and the second convolution feature to obtain a combined feature;

[0050] The fully connected layer inputs the combined features, and the output value represents the matching value between the wireless sensor and the smart gateway;

[0051] Input the information of M wireless sensors and the corresponding intelligent gateways into M parallel modules in turn, and output the matching degree values ​​between the M wireless sensors and the intelligent gateways;

[0052] The statistical module is used to accumulate the matching values ​​between M wireless sensors and the intelligent gateway to obtain the fitness value of a particle.

[0053] Furthermore, the intelligent gateway completes the access and data transmission of the wireless sensor according to the request message sent by the wireless sensor, including the following steps:

[0054] Step S501, according to the unique serial number of the wireless sensor, the corresponding record is retrieved from the built-in database of the load balancer, and the intelligent gateway directly converts the request message sent by the wireless sensor into the MQTT format to complete the data transmission, otherwise, it goes to step S502;

[0055] Step S502: if a corresponding record is retrieved from the mapping relationship table between the device type and the configuration model of the intelligent gateway according to the device type of the wireless sensor, the automatic access of the wireless sensor is completed, otherwise, the process proceeds to step S503;

[0056] Step S503: manually configure the wireless sensor to access the gateway.

[0057] The beneficial effects of the present invention are as follows: the present invention completes the automatic access of wireless sensors to the intelligent gateway cluster by integrating the particle swarm algorithm and the optimization model in the load balancer. In addition, the optimization algorithm can improve the accuracy of the wireless sensor access to the intelligent gateway cluster, thereby improving the efficiency of the wireless sensor access and data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a flow chart of a method for accessing an industrial Internet of Things sensor to a gateway of the present invention;

[0059] Figure 2 is a schematic diagram of the optimization model of the present invention;

[0060] Figure 3 is a flow chart of generating a first allocation scheme by using a particle swarm algorithm of the present invention;

[0061] Figure 4 is a schematic diagram of a parallel module of the present invention;

[0062] Figure 5 It is a flow chart of the intelligent gateway of the present invention completing the access and data transmission of the wireless sensor according to the request message sent by the wireless sensor.

[0063] In the figure: a first hidden layer 201, a first extraction layer 202, a second extraction layer 203, a first logic layer 204, a second logic layer 205, a second hidden layer 206, a first convolutional layer 401, a second convolutional layer 402, a concatenation layer 403, and a fully connected layer 404. DETAILED DESCRIPTION

[0064] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the contents of this specification. Each example may omit, replace or add various processes or components as needed. In addition, the features described relative to some examples may also be combined in other examples.

[0065] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in one or more embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0066] like Figure 1-Figure 5 As shown, a method for connecting an industrial Internet of Things sensor to a gateway includes the following steps:

[0067] Step S101, the load balancer generates a first allocation plan by using a particle swarm algorithm with a maximum number of iterations of A times;

[0068] The first allocation scheme includes: information of M wireless sensors, information of N intelligent gateways, and connection relationships between the M wireless sensors and the N intelligent gateways;

[0069] Step S102, constructing graph network data according to the first allocation scheme;

[0070] Graph network data includes: entities, initial features of entities, and edges between entities;

[0071] The entities include: a first entity and a second entity;

[0072] The first entity establishes a data connection with the wireless sensor;

[0073] The second entity establishes data connection with the intelligent gateway;

[0074] The initial features of an entity are generated based on the information that establishes data associations with it;

[0075] The edges between entities include: the existence of an edge between the first entity and the second entity indicates that the wireless sensor data-connected by the first entity is allocated to the intelligent gateway data-connected by the second entity;

[0076] Step S103, inputting the graph network data into the optimization model, and the optimization model outputs a first adjacency matrix;

[0077] The size of the first adjacency matrix is ​​M*N, and the element values ​​of the first adjacency matrix are represented by 0 or 1. If the element value of the nth column of the mth row of the first adjacency matrix is ​​1, it means that the mth wireless sensor is assigned to the nth intelligent gateway, otherwise it means that the mth wireless sensor is not assigned to the nth intelligent gateway, where 1≤m≤M, 1≤n≤N;

[0078] Step S104, generating a second allocation scheme according to the first adjacency matrix, and forwarding the request messages sent by the M wireless sensors to an intelligent gateway cluster consisting of N intelligent gateways according to the second allocation scheme;

[0079] The request message includes the information of the data contact of the first entity, the unique serial number and the device type;

[0080] Step S105: the intelligent gateway completes the access and data transmission of the wireless sensor according to the request message sent by the wireless sensor.

[0081] In one embodiment of the present invention, A, M and N are all custom parameters. Preferably, A is set to 20, and M and N are set according to the specific number of wireless sensors and intelligent gateways at the implementation site.

[0082] In one embodiment of the present invention, the initial features of the first entity are expressed as:

[0083] ,in They respectively represent the data transmission size, data transmission frequency, remaining power, signal strength and Euclidean distance to the load balancer of the wireless sensor that establishes data contact with the first entity, where the value range of the remaining power is 1 to 100. When the wireless sensor is powered by a battery, the remaining power of the battery is directly obtained, otherwise the remaining power is directly set to 100.

[0084] In one embodiment of the present invention, the initial features of the second entity are expressed as:

[0085] ,in They respectively represent the data transmission rate, signal strength, remaining storage space, CPU usage and network delay of the intelligent gateway that establishes data contact with the second entity.

[0086] In one embodiment of the present invention, the initial characteristics of the second entity may also include cumulative running time, packet loss rate, temperature, signal strength, etc.

[0087] In one embodiment of the present invention, the load balancer polls N intelligent gateways according to a first preset time, and stores the information of the data contact of the N second entities in the built-in database of the load balancer, caches the information of the data contact of the N second entities, and allocates a second preset time to the N cached information respectively. The cached information is cleared when the second preset time is exceeded, wherein the first preset time and the second preset time are both custom parameters, and the second preset time is greater than the first preset time. Preferably, the first preset time is set to 2 minutes, and the second preset time is set to 2 minutes and 30 seconds.

[0088] It should be noted that the load balancer can increase the speed of obtaining N smart gateway data through caching, thereby increasing the speed of building the second entity. In addition, the design of the cache time difference can prevent cache failure to a certain extent, avoid frequent access to the database, and reduce the burden on the load balancer.

[0089] In one embodiment of the present invention, Figure 2 As shown, the optimization model includes: a first hidden layer 201, a first extraction layer 202, a second extraction layer 203, a first logic layer 204, a second logic layer 205, and a second hidden layer 206;

[0090] The first hidden layer inputs the graph network data and outputs the graph update matrix. A row vector of the graph update matrix represents the update feature of an entity.

[0091] The first extraction layer is used to extract the update features corresponding to the first entity in the graph update matrix;

[0092] The second extraction layer is used to extract the update features corresponding to the second entity in the graph update matrix;

[0093] The first logic layer is used to stack the updated features corresponding to the first entity extracted by the first extraction layer to obtain a first matrix, where the first matrix includes M row vectors;

[0094] The second logic layer is used to stack the updated features corresponding to the second entity extracted by the second extraction layer to obtain a second matrix, where the second matrix includes N row vectors;

[0095] The second hidden layer inputs the first matrix and the second matrix and outputs the first adjacency matrix.

[0096] In one embodiment of the present invention, the calculation formula of the optimization model includes:

[0097] The calculation formula of the first adjacency matrix F is as follows:

[0098] ;

[0099] in and denote the first matrix and the second matrix respectively, and They represent the third weight parameter and the fourth weight parameter respectively, T represents the transpose operation of the matrix, sigmoid represents the sigmoid activation function, and the sigmoid activation function is used to control the element value in the first adjacency matrix between 0 and 1. When the element value in the first adjacency matrix is ​​greater than or equal to 0.5, the element value is directly assigned to 1, otherwise it is assigned to 0;

[0100] Updated features of the i-th entity The calculation formula is as follows:

[0101] ;

[0102] in and Represent the initial features of the i-th entity and the j-th entity respectively, represents the set of entities that have edges with the i-th entity, , and P represent the first weight parameter, the second weight parameter and the bias parameter respectively, and MLP represents a multi-layer perceptron.

[0103] In one embodiment of the present invention, a first allocation scheme is generated by a particle swarm algorithm with a maximum number of iterations of B times, and then a second adjacency matrix is ​​constructed according to the connection relationship between the wireless sensor and the intelligent gateway in the first allocation scheme, and the second adjacency matrix is ​​used as a sample label of a training sample for training an optimization model, wherein B is a custom parameter, and B is much larger than A. Preferably, B is set to 200.

[0104] It should be noted that the difference between the first adjacency matrix output by the optimization model and the second adjacency matrix corresponding to the sample labels of the training samples is specified as the loss function, and the gradient information is calculated by the back propagation algorithm. Then, the weight parameters and bias parameters of the optimization model are updated according to the gradient information with the help of the gradient descent algorithm to iteratively optimize the model until the loss is minimized.

[0105] It should be noted that the present invention uses an optimization model to approximate the first allocation scheme generated by the particle swarm algorithm with a smaller maximum number of iterations to the first allocation scheme generated by the particle swarm algorithm with a larger maximum number of iterations, thereby reducing the number of iterations and improving the accuracy of wireless sensors accessing the intelligent gateway cluster.

[0106] In one embodiment of the present invention, Figure 3 As shown, the first allocation scheme is generated by the particle swarm algorithm, including the following steps:

[0107] Step S301, randomly generate a particle population that meets the constraint conditions, and define the number of the particle population as Q, where Q is a custom parameter, preferably, Q is set to 20;

[0108] The constraints include: a wireless sensor can only be assigned to one intelligent gateway; the number of wireless sensors assigned to an intelligent gateway cannot be greater than or equal to M;

[0109] A particle of the particle population is represented by a binary matrix. The size of the binary matrix is ​​M*N. The element value of the u-th row and the v-th column of the binary matrix is ​​represented by 0 or 1. If the element value of the u-th row and the v-th column of the first adjacency matrix is ​​1, it means that the u-th wireless sensor is assigned to the v-th intelligent gateway, otherwise it means that the u-th wireless sensor is not assigned to the v-th intelligent gateway, where 1≤u≤M, 1≤v≤N;

[0110] Step S302, calculating the fitness value of each particle in the particle population through the objective function model;

[0111] Step S303, updating the speed and position of each particle according to the fitness value of each particle through the speed and position calculation formula;

[0112] Step S304, repeating steps S302 to S303 until the iteration termination condition is met, and outputting the particle with the largest fitness value to generate the first allocation plan.

[0113] In one embodiment of the present invention, the iteration termination conditions include: the number of iterations reaches the maximum number of iterations; within K consecutive iterations, the maximum value of the fitness value is less than or equal to the fitness threshold T; wherein K and T are both custom parameters, preferably, K is set to 3 and T is set to 0.5.

[0114] It should be noted that updating the speed and position of each particle by using the speed and position calculation formula is a conventional technical means and will not be elaborated here.

[0115] In one embodiment of the present invention, the first allocation scheme may also be generated by a heuristic algorithm such as a genetic algorithm, a grey wolf algorithm, an artificial fish swarm algorithm, etc., which will not be described in detail here.

[0116] In one embodiment of the present invention, the objective function model is constructed based on a convolutional neural network model, including M parallel modules and 1 statistical module, such as Figure 4 As shown, a parallel module includes: a first convolutional layer 401, a second convolutional layer 402, a concatenation layer 403 and a fully connected layer 404;

[0117] The first convolutional layer inputs the information of a wireless sensor and outputs the first convolutional feature;

[0118] The second convolution layer inputs the information of an intelligent gateway and outputs the second convolution feature;

[0119] The concatenation layer is used to concatenate the first convolution feature and the second convolution feature to obtain a combined feature;

[0120] The fully connected layer inputs the combined features, and the output value represents the matching value between the wireless sensor and the smart gateway;

[0121] Input the information of M wireless sensors and the corresponding intelligent gateways into M parallel modules in turn, and output the matching degree values ​​between the M wireless sensors and the intelligent gateways;

[0122] The statistical module is used to accumulate the matching values ​​between M wireless sensors and the intelligent gateway to obtain the fitness value of a particle.

[0123] In one embodiment of the present invention, the sample labels of the training samples used to train the objective function model are evaluated and set by relevant technical experts, and the training of the convolutional neural network model is a conventional technical means and will not be elaborated here.

[0124] In one embodiment of the present invention, Figure 5 As shown, the intelligent gateway completes the access and data transmission of the wireless sensor according to the request message sent by the wireless sensor, including the following steps:

[0125] Step S501, according to the unique serial number of the wireless sensor, the corresponding record is retrieved from the built-in database of the load balancer, and the intelligent gateway directly converts the request message sent by the wireless sensor into the MQTT format to complete the data transmission, otherwise, it goes to step S502;

[0126] Step S502: if a corresponding record is retrieved from the mapping relationship table between the device type and the configuration model of the intelligent gateway according to the device type of the wireless sensor, the automatic access of the wireless sensor is completed, otherwise, the process proceeds to step S503;

[0127] Step S503: manually configure the wireless sensor to access the gateway.

[0128] It should be noted that manually configuring the wireless sensor access gateway includes entering the unique serial number of the sensor in the gateway interface and setting the sensor data reporting rules, such as the sending time interval, target server address, port, protocol, etc. Manually configuring the wireless sensor access gateway is a conventional technical means and will not be elaborated here.

[0129] The above describes an embodiment of the present embodiment, but the present embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present embodiment, ordinary technicians in this field can also make many forms, all of which are protected by the present embodiment.

Claims

1. A method for accessing an industrial Internet of Things sensor to a gateway, characterized in that: The following steps are involved: Step S101, the load balancer generates a first allocation plan by using a particle swarm algorithm with a maximum number of iterations of A times; The first allocation scheme includes: information of M wireless sensors, information of N intelligent gateways, and connection relationships between the M wireless sensors and the N intelligent gateways; Step S102, constructing graph network data according to the first allocation scheme; Graph network data includes: entities, initial features of entities, and edges between entities; The entities include: a first entity and a second entity; The first entity establishes a data connection with the wireless sensor; The second entity establishes data connection with the intelligent gateway; The initial features of an entity are generated based on the information that establishes data associations with it; The edges between entities include: the existence of an edge between the first entity and the second entity indicates that the wireless sensor data-connected by the first entity is allocated to the intelligent gateway data-connected by the second entity; Step S103, inputting the graph network data into the optimization model, and the optimization model outputs a first adjacency matrix; The size of the first adjacency matrix is ​​M*N, and the element values ​​of the first adjacency matrix are represented by 0 or 1. If the element value of the nth column of the mth row of the first adjacency matrix is ​​1, it means that the mth wireless sensor is assigned to the nth intelligent gateway, otherwise it means that the mth wireless sensor is not assigned to the nth intelligent gateway, where 1≤m≤M, 1≤n≤N; Step S104, generating a second allocation scheme according to the first adjacency matrix, and forwarding the request messages sent by the M wireless sensors to an intelligent gateway cluster consisting of N intelligent gateways according to the second allocation scheme; The request message includes the information of the data contact of the first entity, the unique serial number and the device type; Step S105, the intelligent gateway completes the access and data transmission of the wireless sensor according to the request message sent by the wireless sensor; The initial feature representation of the first entity is: ,in They respectively represent the data transmission size, data transmission frequency, remaining power, signal strength and Euclidean distance of the wireless sensor that establishes data contact with the first entity, where the value range of the remaining power is 1 to 100. When the wireless sensor is powered by a battery, the remaining power of the battery is directly obtained, otherwise the remaining power is directly set to 100. The initial characteristics of the second entity are expressed as: ,in They respectively represent the data transmission rate, signal strength, remaining storage space, CPU usage and network delay of the intelligent gateway that establishes data contact with the second entity.

2. According to claim 1, a method for accessing an industrial Internet of Things sensor to a gateway is characterized in that: A, M and N are all custom parameters.

3. The method for accessing an industrial Internet of Things sensor to a gateway according to claim 1, characterized in that: The load balancer polls N smart gateways according to a first preset time, and stores the information of the data contact of the N second entities in the built-in database of the load balancer, caches the information of the data contact of the N second entities, and allocates a second preset time to the N cached information respectively. The cached information is cleared when the second preset time is exceeded, wherein the first preset time and the second preset time are both custom parameters, and the second preset time is greater than the first preset time.

4. The method for accessing an industrial Internet of Things sensor to a gateway according to claim 1, characterized in that: The optimization model includes: a first hidden layer, a first extraction layer, a second extraction layer, a first logic layer, a second logic layer, and a second hidden layer; The first hidden layer inputs the graph network data and outputs the graph update matrix. A row vector of the graph update matrix represents the update feature of an entity. The first extraction layer is used to extract the update features corresponding to the first entity in the graph update matrix; The second extraction layer is used to extract the update features corresponding to the second entity in the graph update matrix; The first logic layer is used to stack the updated features corresponding to the first entity extracted by the first extraction layer to obtain a first matrix, where the first matrix includes M row vectors; The second logic layer is used to stack the updated features corresponding to the second entity extracted by the second extraction layer to obtain a second matrix, where the second matrix includes N row vectors; The second hidden layer inputs the first matrix and the second matrix and outputs the first adjacency matrix.

5. The method for accessing an industrial Internet of Things sensor to a gateway according to claim 4, characterized in that: The calculation formula of the optimization model includes: The calculation formula of the first adjacency matrix F is as follows: ; in and denote the first matrix and the second matrix respectively, and They represent the third weight parameter and the fourth weight parameter respectively, T represents the transpose operation of the matrix, sigmoid represents the sigmoid activation function, and the sigmoid activation function is used to control the element value in the first adjacency matrix between 0 and 1. When the element value in the first adjacency matrix is ​​greater than or equal to 0.5, the element value is directly assigned to 1, otherwise it is assigned to 0; Updated features of the i-th entity The calculation formula is as follows: ; in and Represent the initial features of the i-th entity and the j-th entity respectively, represents the set of entities that have edges with the i-th entity, , and P represent the first weight parameter, the second weight parameter and the bias parameter respectively, and MLP represents a multi-layer perceptron.

6. The method for accessing an industrial Internet of Things sensor to a gateway according to claim 1, characterized in that: A first allocation scheme is generated by a particle swarm algorithm with a maximum number of iterations of B times, and then a second adjacency matrix is ​​constructed according to the connection relationship between the wireless sensors and the intelligent gateway in the first allocation scheme. The second adjacency matrix is ​​used as the sample labels of the training samples for training the optimization model, where B is a custom parameter and B is much larger than A.

7. The method for accessing an industrial Internet of Things sensor to a gateway according to claim 1, characterized in that: The first allocation scheme is generated by the particle swarm algorithm, including the following steps: Step S301, randomly generate a particle population that meets the constraint conditions, and define the number of the particle population as Q, where Q is a custom parameter; The constraints include: a wireless sensor can only be assigned to one intelligent gateway; the number of wireless sensors assigned to an intelligent gateway cannot be greater than or equal to M; A particle of the particle population is represented by a binary matrix. The size of the binary matrix is ​​M*N. The element value of the u-th row and the v-th column of the binary matrix is ​​represented by 0 or 1. If the element value of the u-th row and the v-th column of the first adjacency matrix is ​​1, it means that the u-th wireless sensor is assigned to the v-th intelligent gateway, otherwise it means that the u-th wireless sensor is not assigned to the v-th intelligent gateway, where 1≤u≤M, 1≤v≤N; Step S302, calculating the fitness value of each particle in the particle population through the objective function model; Step S303, updating the speed and position of each particle; Step S304, repeating steps S302 to S303 until the iteration termination condition is met, and outputting the particle with the largest fitness value to generate the first allocation plan; The iteration termination conditions include: the number of iterations reaches the maximum number of iterations; within K consecutive iterations, the maximum value of the fitness value is less than or equal to the fitness threshold T; K and T are both custom parameters.

8. The method for accessing an industrial Internet of Things sensor to a gateway according to claim 7, characterized in that: The objective function model is constructed based on the convolutional neural network model. The sample labels of the training samples used to train the objective function model are evaluated and set by relevant technical experts. The matching value ranges from 1 to 10. The objective function model includes M parallel modules and 1 statistical module. One parallel module includes: the first convolution layer, the second convolution layer, the concatenation layer and the fully connected layer. The first convolutional layer inputs the information of a wireless sensor and outputs the first convolutional feature; The second convolution layer inputs the information of an intelligent gateway and outputs the second convolution feature; The concatenation layer is used to concatenate the first convolution feature and the second convolution feature to obtain a combined feature; The fully connected layer inputs the combined features, and the output value represents the matching value between the wireless sensor and the smart gateway; Input the information of M wireless sensors and the corresponding intelligent gateways into M parallel modules in turn, and output the matching degree values ​​between the M wireless sensors and the intelligent gateways; The statistical module is used to accumulate the matching values ​​between M wireless sensors and the intelligent gateway to obtain the fitness value of a particle.

9. The method for accessing an industrial Internet of Things sensor to a gateway according to claim 1, characterized in that: The intelligent gateway completes the access and data transmission of the wireless sensor according to the request message sent by the wireless sensor, including the following steps: Step S501, according to the unique serial number of the wireless sensor, the corresponding record is retrieved from the built-in database of the load balancer, and the intelligent gateway directly converts the request message sent by the wireless sensor into the MQTT format to complete the data transmission, otherwise, it goes to step S502; Step S502: if a corresponding record is retrieved from the mapping relationship table between the device type and the configuration model of the intelligent gateway according to the device type of the wireless sensor, the automatic access of the wireless sensor is completed, otherwise, the process proceeds to step S503; Step S503: manually configure the wireless sensor to access the gateway.