Disclosure of Invention
In order to solve the technical problems in the related art, the present disclosure provides an intelligent industrial gateway communication method and system.
An intelligent industrial gateway communication method, which is applied to an intelligent industrial gateway and a plurality of industrial devices which communicate with each other, the method comprising:
the intelligent industrial gateway starts a first preset thread for forwarding target service information of target industrial equipment corresponding to the information forwarding request according to the received information forwarding request, generates a state monitoring script corresponding to the target industrial equipment according to list information of the target industrial equipment when the first preset thread is started, and issues the state monitoring script to the target industrial equipment;
the target industrial equipment runs the state monitoring script to obtain a state monitoring resource packet, the state monitoring resource packet is led into a second preset thread, and running state information of the target industrial equipment is transmitted back to the intelligent industrial gateway by running the second preset thread;
the intelligent industrial gateway judges whether the first thread parameter of the first preset thread meets a set condition according to the running state information;
when the first thread parameter meets the set condition, the intelligent industrial gateway forwards the target service information according to a first information forwarding strategy corresponding to the first thread parameter;
when the first thread parameter does not accord with the set condition, the intelligent industrial gateway generates a second thread parameter according to the running state information, and adjusts the first information forwarding strategy according to the corresponding relation between the second thread parameter and the first thread parameter to obtain a second information forwarding strategy; and forwarding the target service information according to the second information forwarding strategy.
Optionally, generating a state monitoring script corresponding to the target industrial device according to the inventory information of the target industrial device includes:
listing a plurality of groups of information fields of the list information, and establishing an equipment information pool of the target industrial equipment based on the information fields; the device information pool of the target industrial device is a partitioned information pool, each region corresponds to a region identifier, each region identifier is provided with at least one group of information fields, and each region of the device information pool of the target industrial device has the information density from large to small;
extracting a request field of the information forwarding request, establishing a field conversion relation between the request field and the equipment information pool of the target industrial equipment, and generating a parameter distribution list of the target industrial equipment according to the field conversion relation; generating a parameter distribution list of the target industrial equipment according to the field conversion relation, wherein the parameter distribution list comprises: converting the request field into a plurality of preset encoding characters; respectively generating at least one coding logic matrix of each preset coding character; acquiring the coding logic matrix of the request field which is not repeated with each other to form a target matrix set; mapping each coding logic matrix in the target matrix set to an equipment information pool of the target industrial equipment to form a parameter distribution list of the target industrial equipment;
comparing a target field contained in a request field of the information forwarding request with each information field in a parameter distribution list of the target industrial equipment; in the comparison process, if all information fields of one coding logic matrix are contained in the request field of the information forwarding request, recording the coding logic matrix as a script matrix of the information forwarding request;
and generating the state monitoring script corresponding to the target industrial equipment according to each script matrix corresponding to the information forwarding request.
Optionally, the determining, by the intelligent industrial gateway, whether the first thread parameter of the first preset thread meets a set condition according to the running state information includes:
calculating a parameter index coefficient of the first thread parameter according to the running state information;
judging whether the parameter index coefficient reaches a set coefficient;
if yes, judging that the first thread parameter meets the set condition;
if not, the first thread parameter is judged not to meet the set condition.
Optionally, calculating a parameter index coefficient of the first thread parameter according to the running state information includes:
acquiring a state array in the running state information, and calculating a first data sequence corresponding to the state array; the state array is a data set stored by the target industrial equipment in the running state information in a set format, and the state dimension corresponding to each data set is unchanged;
acquiring an initial parameter sequence of the first thread parameter, and calculating a difference vector between the state array and the initial parameter sequence according to the first data sequence;
if the difference vector between the state array and the initial parameter sequence is smaller than a preset threshold value, matching the parameter log file of the first thread parameter with the first data sequence to obtain a second data sequence; converting the parameter log file into log data, and performing multi-dimensional state matching by taking the log data as reference data and the running state information as reference information to obtain first state dimension information; screening the first state dimension information according to the second data sequence to obtain second state dimension information; determining first associated information of the second state dimension information and the log data, and integrating dimension data in the first associated information and the parameter log file to obtain a state factor of the running state information;
if the difference vector between the state array and the initial parameter sequence is greater than or equal to the preset threshold, determining second associated information of the first state dimension information and the log data, and integrating dimension data in the second associated information and the parameter log file to obtain a state factor of the running state information;
and weighting the state factors according to the number of the state arrays in the running state information to obtain the parameter index coefficient of the first thread parameter.
Optionally, generating a second thread parameter according to the operating state information, and adjusting the first information forwarding policy according to a correspondence between the second thread parameter and the first thread parameter to obtain a second information forwarding policy, where the method includes:
arranging the state description values in the running state information according to the sequence of the weights from small to large to obtain a sequencing sequence of the state description values, and converting the sequencing sequence according to the thread index of the first preset thread to obtain the second thread parameter;
determining a similarity value of the second thread parameter to the first thread parameter at each parameter unit;
and sequentially adjusting the logic node information in the first information forwarding strategy according to the similarity value to obtain the second information forwarding strategy corresponding to the first information forwarding strategy.
An intelligent industrial gateway communication system comprises an intelligent industrial gateway and a plurality of industrial devices which are communicated with each other;
the intelligent industrial gateway is used for:
starting a first preset thread for forwarding target service information of target industrial equipment corresponding to the information forwarding request according to the received information forwarding request, generating a state monitoring script corresponding to the target industrial equipment according to list information of the target industrial equipment when the first preset thread is started, and issuing the state monitoring script to the target industrial equipment;
the target industrial device is to:
running the state monitoring script to obtain a state monitoring resource packet, importing the state monitoring resource packet into a second preset thread, and returning running state information of the target industrial equipment to the intelligent industrial gateway by running the second preset thread;
the intelligent industrial gateway is used for:
judging whether the first thread parameter of the first preset thread meets a set condition or not according to the running state information;
the intelligent industrial gateway is used for:
when the first thread parameter meets the set condition, forwarding the target service information according to a first information forwarding strategy corresponding to the first thread parameter; and
when the first thread parameter does not accord with the set condition, generating a second thread parameter according to the running state information, and adjusting the first information forwarding strategy according to the corresponding relation between the second thread parameter and the first thread parameter to obtain a second information forwarding strategy; and forwarding the target service information according to the second information forwarding strategy.
Optionally, the intelligent industrial gateway is configured to:
listing a plurality of groups of information fields of the list information, and establishing an equipment information pool of the target industrial equipment based on the information fields; the device information pool of the target industrial device is a partitioned information pool, each region corresponds to a region identifier, each region identifier is provided with at least one group of information fields, and each region of the device information pool of the target industrial device has the information density from large to small;
extracting a request field of the information forwarding request, establishing a field conversion relation between the request field and the equipment information pool of the target industrial equipment, and generating a parameter distribution list of the target industrial equipment according to the field conversion relation; generating a parameter distribution list of the target industrial equipment according to the field conversion relation, wherein the parameter distribution list comprises: converting the request field into a plurality of preset encoding characters; respectively generating at least one coding logic matrix of each preset coding character; acquiring the coding logic matrix of the request field which is not repeated with each other to form a target matrix set; mapping each coding logic matrix in the target matrix set to an equipment information pool of the target industrial equipment to form a parameter distribution list of the target industrial equipment;
comparing a target field contained in a request field of the information forwarding request with each information field in a parameter distribution list of the target industrial equipment; in the comparison process, if all information fields of one coding logic matrix are contained in the request field of the information forwarding request, recording the coding logic matrix as a script matrix of the information forwarding request;
and generating the state monitoring script corresponding to the target industrial equipment according to each script matrix corresponding to the information forwarding request.
Optionally, the intelligent industrial gateway is configured to:
calculating a parameter index coefficient of the first thread parameter according to the running state information;
judging whether the parameter index coefficient reaches a set coefficient;
if yes, judging that the first thread parameter meets the set condition;
if not, the first thread parameter is judged not to meet the set condition.
Optionally, the intelligent industrial gateway is configured to:
acquiring a state array in the running state information, and calculating a first data sequence corresponding to the state array; the state array is a data set stored by the target industrial equipment in the running state information in a set format, and the state dimension corresponding to each data set is unchanged;
acquiring an initial parameter sequence of the first thread parameter, and calculating a difference vector between the state array and the initial parameter sequence according to the first data sequence;
if the difference vector between the state array and the initial parameter sequence is smaller than a preset threshold value, matching the parameter log file of the first thread parameter with the first data sequence to obtain a second data sequence; converting the parameter log file into log data, and performing multi-dimensional state matching by taking the log data as reference data and the running state information as reference information to obtain first state dimension information; screening the first state dimension information according to the second data sequence to obtain second state dimension information; determining first associated information of the second state dimension information and the log data, and integrating dimension data in the first associated information and the parameter log file to obtain a state factor of the running state information;
if the difference vector between the state array and the initial parameter sequence is greater than or equal to the preset threshold, determining second associated information of the first state dimension information and the log data, and integrating dimension data in the second associated information and the parameter log file to obtain a state factor of the running state information;
and weighting the state factors according to the number of the state arrays in the running state information to obtain the parameter index coefficient of the first thread parameter.
Optionally, the intelligent industrial gateway is configured to:
arranging the state description values in the running state information according to the sequence of the weights from small to large to obtain a sequencing sequence of the state description values, and converting the sequencing sequence according to the thread index of the first preset thread to obtain the second thread parameter;
determining a similarity value of the second thread parameter to the first thread parameter at each parameter unit;
and sequentially adjusting the logic node information in the first information forwarding strategy according to the similarity value to obtain the second information forwarding strategy corresponding to the first information forwarding strategy.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects.
The intelligent industrial gateway can generate a state monitoring script corresponding to the target industrial equipment according to the list information of the target industrial equipment when the first preset thread is started and sends the state monitoring script to the target industrial equipment, so that the target industrial equipment operation state monitoring script can obtain a state monitoring resource packet and guide the state monitoring resource packet into a second preset thread, and the operation state information of the target industrial equipment is returned to the intelligent industrial gateway by operating the second preset thread. The intelligent industrial gateway can adjust the first thread parameter of the first preset thread when judging that the first thread parameter of the first preset thread does not accord with the set condition according to the running state information, so that the first information forwarding strategy is adjusted to be the second information forwarding strategy, and then the target service information is forwarded according to the second information forwarding strategy. Therefore, the intelligent industrial gateway can adaptively adjust the information forwarding strategy according to the running state of the industrial equipment so as to improve the working efficiency of the intelligent industrial gateway.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In order to solve the above problems, the present invention provides an intelligent industrial gateway communication method and system, which can enable an intelligent industrial gateway to adaptively adjust an information forwarding policy according to an operation state of an industrial device, and improve the working efficiency of the intelligent industrial gateway.
To achieve the above objective, please first refer to fig. 1, which is a schematic diagram of a communication architecture of an intelligent industrial gateway communication system 10 provided by the present invention, wherein the intelligent industrial gateway communication system 10 includes an intelligent industrial gateway 20 and a plurality of industrial devices 30. The intelligent industrial gateway 20 communicates with each industrial device 30, and is configured to forward information uploaded by each industrial device 30, and when forwarding the information, the intelligent industrial gateway 20 monitors an operation state of each industrial device 30 in real time, so as to adjust an information forwarding policy according to the operation state of each industrial device 30.
On the basis of the above, please refer to fig. 2, which provides a flowchart of an intelligent industrial gateway communication method, where the intelligent industrial gateway communication method can be applied to the intelligent industrial gateway system 10 shown in fig. 1, and specifically can include the contents described in the following steps S210 to S250.
Step S210, the intelligent industrial gateway starts a first preset thread for forwarding the target service information of the target industrial equipment corresponding to the information forwarding request according to the received information forwarding request, generates a state monitoring script corresponding to the target industrial equipment according to the list information of the target industrial equipment when the first preset thread is started, and sends the state monitoring script to the target industrial equipment.
Step S220, the target industrial equipment runs the state monitoring script to obtain a state monitoring resource packet, the state monitoring resource packet is led into a second preset thread, and running state information of the target industrial equipment is returned to the intelligent industrial gateway by running the second preset thread.
Step S230, the intelligent industrial gateway determines whether the first thread parameter of the first preset thread meets a set condition according to the running state information.
Step S240, when the first thread parameter meets the set condition, the intelligent industrial gateway forwards the target service information according to a first information forwarding policy corresponding to the first thread parameter.
Step S250, when the first thread parameter does not accord with the set condition, the intelligent industrial gateway generates a second thread parameter according to the running state information, and adjusts the first information forwarding strategy according to the corresponding relation between the second thread parameter and the first thread parameter to obtain a second information forwarding strategy; and forwarding the target service information according to the second information forwarding strategy.
The first information forwarding strategy and the second information forwarding strategy are different.
It can be understood that, through the steps S210 to S250, the intelligent industrial gateway can generate the state monitoring script corresponding to the target industrial device according to the list information of the target industrial device when the first preset thread is started, and issue the state monitoring script to the target industrial device, so that the target industrial device operation state monitoring script obtains the state monitoring resource packet and introduces the state monitoring resource packet into the second preset thread, and returns the operation state information of the target industrial device to the intelligent industrial gateway by operating the second preset thread. The intelligent industrial gateway can adjust the first thread parameter of the first preset thread when judging that the first thread parameter of the first preset thread does not accord with the set condition according to the running state information, so that the first information forwarding strategy is adjusted to be the second information forwarding strategy, and then the target service information is forwarded according to the second information forwarding strategy. Therefore, the intelligent industrial gateway can adaptively adjust the information forwarding strategy according to the running state of the industrial equipment so as to improve the working efficiency of the intelligent industrial gateway.
In a possible implementation manner, in order to ensure compatibility of the status monitoring script with the target industrial device, in step S210, the status monitoring script corresponding to the target industrial device is generated according to the inventory information of the target industrial device, and specifically may include the contents described in steps S211 to S214 below.
Step S211, listing a plurality of groups of information fields of the list information, and establishing an equipment information pool of the target industrial equipment based on the information fields; the device information pool of the target industrial device is a partitioned information pool, each region corresponds to one region identifier, each region identifier is provided with at least one group of information fields, and each region of the device information pool of the target industrial device has the information density from large to small.
Step S212, extracting a request field of the information forwarding request, establishing a field conversion relation between the request field and the equipment information pool of the target industrial equipment, and generating a parameter distribution list of the target industrial equipment according to the field conversion relation; generating a parameter distribution list of the target industrial equipment according to the field conversion relation, wherein the parameter distribution list comprises: converting the request field into a plurality of preset encoding characters; respectively generating at least one coding logic matrix of each preset coding character; acquiring the coding logic matrix of the request field which is not repeated with each other to form a target matrix set; and mapping each coding logic matrix in the target matrix set to a device information pool of the target industrial device to form a parameter distribution list of the target industrial device.
Step S213, comparing a target field included in the request field of the information forwarding request with each information field in the parameter distribution list of the target industrial device; in the comparison process, if all the information fields of one coding logic matrix are contained in the request field of the information forwarding request, the coding logic matrix is recorded as the script matrix of the information forwarding request.
Step S214, generating the state monitoring script corresponding to the target industrial equipment according to each script matrix corresponding to the information forwarding request.
It is understood that through the descriptions in step S211 to step S214, the script matrix corresponding to the information forwarding request can be determined, so as to generate the state monitoring script according to the script matrix. Therefore, the compatibility of the state monitoring script and the target industrial equipment can be ensured, and the condition monitoring script is prevented from being refused to be executed by the target industrial equipment.
In an alternative embodiment, the determining, by the intelligent industrial gateway described in step S230, whether the first thread parameter of the first preset thread meets the set condition according to the running state information may specifically include the following contents described in step S231 and step S232.
Step S231, calculating a parameter index coefficient of the first thread parameter according to the running state information.
Step S232, judging whether the parameter index coefficient reaches a set coefficient; if yes, judging that the first thread parameter meets the set condition; if not, the first thread parameter is judged not to meet the set condition.
On the basis of the above, in order to take the state information of multiple dimensions of the target industrial device into account so as to ensure the confidence of the parameter index coefficient, in the step S231, the parameter index coefficient of the first thread parameter is calculated according to the operation state information, which may specifically include the contents described in the following steps S2311 to S2315.
Step S2311, acquiring a state array in the running state information, and calculating a first data sequence corresponding to the state array; the state array is a data set stored in the running state information by the target industrial equipment in a set format, and the state dimension corresponding to each data set is unchanged.
Step S2312, an initial parameter sequence of the first thread parameter is obtained, and a difference vector between the state array and the initial parameter sequence is calculated according to the first data sequence.
Step S2313, if the difference vector between the state array and the initial parameter sequence is smaller than a preset threshold, matching the parameter log file of the first thread parameter with the first data sequence to obtain a second data sequence; converting the parameter log file into log data, and performing multi-dimensional state matching by taking the log data as reference data and the running state information as reference information to obtain first state dimension information; screening the first state dimension information according to the second data sequence to obtain second state dimension information; and determining first associated information of the second state dimension information and the log data, and integrating the dimension data in the first associated information and the parameter log file to obtain a state factor of the running state information.
Step S2314, if the difference vector between the state array and the initial parameter sequence is greater than or equal to the preset threshold, determining second associated information of the first state dimension information and the log data, and integrating the dimension data in the second associated information with the parameter log file to obtain the state factor of the operating state information.
Step S2315, weighting the state factors according to the number of state arrays in the operating state information to obtain the parameter index coefficients of the first thread parameter.
When the contents described in the above-described steps S2311 to S2315 are applied, the state information of the target industrial device in the plurality of dimensions can be taken into consideration, thereby ensuring the confidence of the parameter index coefficient.
In another alternative embodiment, the generating of the second thread parameter according to the operation state information in the above step S250, and adjusting the first information forwarding policy according to the corresponding relationship between the second thread parameter and the first thread parameter to obtain the second information forwarding policy may specifically include the contents described in the following steps S251 to S254.
Step S251, arranging the state description values in the running state information in the order from small to large according to the weights thereof to obtain an ordering sequence of the state description values, and converting the ordering sequence according to the thread index of the first preset thread to obtain the second thread parameter.
In step S252, a similarity value between the second thread parameter and the first thread parameter in each parameter unit is determined.
Step S253, sequentially adjusting the logic node information in the first information forwarding policy according to the similarity value, to obtain the second information forwarding policy corresponding to the first information forwarding policy.
It can be understood that through the contents described in the above steps S251 to S253, the adjustment of the first information forwarding policy can be implemented without splitting the logical node in the first information forwarding policy, which can reduce the time consumption of the adjustment of the information forwarding policy.
On the basis of the above, a functional description of the intelligent industrial gateway communication system is also provided, which is specifically as follows.
An intelligent industrial gateway communication system comprises an intelligent industrial gateway and a plurality of industrial devices which are communicated with each other;
the intelligent industrial gateway is used for:
starting a first preset thread for forwarding target service information of target industrial equipment corresponding to the information forwarding request according to the received information forwarding request, generating a state monitoring script corresponding to the target industrial equipment according to list information of the target industrial equipment when the first preset thread is started, and issuing the state monitoring script to the target industrial equipment;
the target industrial device is to:
running the state monitoring script to obtain a state monitoring resource packet, importing the state monitoring resource packet into a second preset thread, and returning running state information of the target industrial equipment to the intelligent industrial gateway by running the second preset thread;
the intelligent industrial gateway is used for:
judging whether the first thread parameter of the first preset thread meets a set condition or not according to the running state information;
the intelligent industrial gateway is used for:
when the first thread parameter meets the set condition, forwarding the target service information according to a first information forwarding strategy corresponding to the first thread parameter; and
when the first thread parameter does not accord with the set condition, generating a second thread parameter according to the running state information, and adjusting the first information forwarding strategy according to the corresponding relation between the second thread parameter and the first thread parameter to obtain a second information forwarding strategy; and forwarding the target service information according to the second information forwarding strategy.
Optionally, the intelligent industrial gateway is configured to:
listing a plurality of groups of information fields of the list information, and establishing an equipment information pool of the target industrial equipment based on the information fields; the device information pool of the target industrial device is a partitioned information pool, each region corresponds to a region identifier, each region identifier is provided with at least one group of information fields, and each region of the device information pool of the target industrial device has the information density from large to small;
extracting a request field of the information forwarding request, establishing a field conversion relation between the request field and the equipment information pool of the target industrial equipment, and generating a parameter distribution list of the target industrial equipment according to the field conversion relation; generating a parameter distribution list of the target industrial equipment according to the field conversion relation, wherein the parameter distribution list comprises: converting the request field into a plurality of preset encoding characters; respectively generating at least one coding logic matrix of each preset coding character; acquiring the coding logic matrix of the request field which is not repeated with each other to form a target matrix set; mapping each coding logic matrix in the target matrix set to an equipment information pool of the target industrial equipment to form a parameter distribution list of the target industrial equipment;
comparing a target field contained in a request field of the information forwarding request with each information field in a parameter distribution list of the target industrial equipment; in the comparison process, if all information fields of one coding logic matrix are contained in the request field of the information forwarding request, recording the coding logic matrix as a script matrix of the information forwarding request;
and generating the state monitoring script corresponding to the target industrial equipment according to each script matrix corresponding to the information forwarding request.
Optionally, the intelligent industrial gateway is configured to:
calculating a parameter index coefficient of the first thread parameter according to the running state information;
judging whether the parameter index coefficient reaches a set coefficient;
if yes, judging that the first thread parameter meets the set condition;
if not, the first thread parameter is judged not to meet the set condition.
Optionally, the intelligent industrial gateway is configured to:
acquiring a state array in the running state information, and calculating a first data sequence corresponding to the state array; the state array is a data set stored by the target industrial equipment in the running state information in a set format, and the state dimension corresponding to each data set is unchanged;
acquiring an initial parameter sequence of the first thread parameter, and calculating a difference vector between the state array and the initial parameter sequence according to the first data sequence;
if the difference vector between the state array and the initial parameter sequence is smaller than a preset threshold value, matching the parameter log file of the first thread parameter with the first data sequence to obtain a second data sequence; converting the parameter log file into log data, and performing multi-dimensional state matching by taking the log data as reference data and the running state information as reference information to obtain first state dimension information; screening the first state dimension information according to the second data sequence to obtain second state dimension information; determining first associated information of the second state dimension information and the log data, and integrating dimension data in the first associated information and the parameter log file to obtain a state factor of the running state information;
if the difference vector between the state array and the initial parameter sequence is greater than or equal to the preset threshold, determining second associated information of the first state dimension information and the log data, and integrating dimension data in the second associated information and the parameter log file to obtain a state factor of the running state information;
and weighting the state factors according to the number of the state arrays in the running state information to obtain the parameter index coefficient of the first thread parameter.
Optionally, the intelligent industrial gateway is configured to:
arranging the state description values in the running state information according to the sequence of the weights from small to large to obtain a sequencing sequence of the state description values, and converting the sequencing sequence according to the thread index of the first preset thread to obtain the second thread parameter;
determining a similarity value of the second thread parameter to the first thread parameter at each parameter unit;
and sequentially adjusting the logic node information in the first information forwarding strategy according to the similarity value to obtain the second information forwarding strategy corresponding to the first information forwarding strategy.
On the basis, the intelligent industrial gateway comprises a processor, a network interface and a memory, wherein the processor is connected with the memory through the network interface, the processor calls a computer program from the memory through the network interface, and relevant steps executed by the intelligent industrial gateway in the intelligent industrial gateway communication method are realized by executing the computer program.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.