CN114070829A - MQTT-based abnormal data acquisition method and system - Google Patents
MQTT-based abnormal data acquisition method and system Download PDFInfo
- Publication number
- CN114070829A CN114070829A CN202111233885.6A CN202111233885A CN114070829A CN 114070829 A CN114070829 A CN 114070829A CN 202111233885 A CN202111233885 A CN 202111233885A CN 114070829 A CN114070829 A CN 114070829A
- Authority
- CN
- China
- Prior art keywords
- mqtt
- abnormal data
- server
- subtask
- finished product
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000002159 abnormal effect Effects 0.000 title claims abstract description 181
- 238000000034 method Methods 0.000 title claims abstract description 75
- 238000004519 manufacturing process Methods 0.000 claims abstract description 94
- 238000001514 detection method Methods 0.000 claims abstract description 40
- 230000008569 process Effects 0.000 claims abstract description 33
- 238000004806 packaging method and process Methods 0.000 claims abstract description 8
- 238000004886 process control Methods 0.000 claims description 25
- 238000013480 data collection Methods 0.000 claims description 6
- 238000012856 packing Methods 0.000 claims description 6
- 238000007689 inspection Methods 0.000 claims description 5
- 238000003860 storage Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 3
- 238000009776 industrial production Methods 0.000 abstract description 7
- 230000005856 abnormality Effects 0.000 description 16
- 230000005540 biological transmission Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000011835 investigation Methods 0.000 description 4
- 238000013024 troubleshooting Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 101001045744 Sus scrofa Hepatocyte nuclear factor 1-beta Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Signal Processing (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Medical Informatics (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- General Factory Administration (AREA)
Abstract
The invention provides an abnormal data acquisition method and system based on MQTT, and relates to the technical field of industrial production. The method comprises the following steps: the MQTT client issues a production task of a target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line. And in the execution process of each subtask, detecting each finished product of the corresponding production line according to a preset detection standard. And if the difference value of any one of the data of the produced finished product and the preset detection standard is larger than the preset difference value, acquiring abnormal data of the produced finished product. And packaging the type of the abnormal data as a fixed header and the numerical value of the abnormal data as a message body to obtain an abnormal data packet. And the MQTT server sends the abnormal data packet to the MQTT user side. The method and the system avoid huge workload caused by the user to check the production process, and facilitate the user to acquire abnormal data in the production process in time.
Description
Technical Field
The invention relates to the technical field of industrial production, in particular to an abnormal data acquisition method and system based on MQTT.
Background
With the continuous development of science and technology development, the social demand is continuously increased, and the requirements of industrial production are gradually increased. In an industrial production process, it is very important to establish a good monitoring means to perform data detection on the whole production process so as to obtain good products with high quality.
However, in the production process, almost all industrial production lines may have abnormal conditions of process setting or control, so that the obtained data often has local abnormal problems. Therefore, in order to monitor the industrial production process comprehensively, each link of the industrial production line needs to be monitored, so that a great amount of manpower and financial resources are inevitably needed to monitor the production line, and the production cost is increased.
And because the production line environment is relatively complex, the process data generated in the production process is relatively various. If the abnormal reasons in the production process are manually checked one by one, all process data need to be sorted and checked, so that the workload and the calculated amount are very large, errors are easily caused in manual checking, and users cannot conveniently and accurately acquire the abnormal data in the production process in time.
Disclosure of Invention
The invention aims to provide an abnormal data acquisition method based on MQTT, which is used for solving the problems that in the prior art, due to the fact that abnormal reasons in the production process are manually checked, the workload and the calculated amount are very large, and users cannot conveniently and accurately acquire abnormal data in the production process in time.
The embodiment of the invention is realized by the following steps:
in a first aspect, an embodiment of the present application provides an MQTT-based abnormal data acquisition method, which includes the following steps: and establishing the connection between the MQTT user side and the MQTT server. The MQTT client issues a production task of a target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line. And in the execution process of each subtask, detecting each finished product of the corresponding production line according to a preset detection standard. And if the difference value of any one of the data of the produced finished product and the preset detection standard is larger than the preset difference value, acquiring abnormal data of the produced finished product. And packaging the type of the abnormal data as a fixed header and the numerical value of the abnormal data as a message body to obtain an abnormal data packet. And the MQTT server sends the abnormal data packet to the MQTT user side.
In some embodiments of the present invention, before the step of establishing a connection between the MQTT user terminal and the MQTT server, the method further includes: initializing the server and the TCP client. And establishing an MQTT thread by utilizing the TCP client to obtain the MQTT client. And establishing an MQTT thread by using the server to obtain an MQTT server.
In some embodiments of the invention, after the step of obtaining the abnormal data of the finished product if the difference between any data of the finished product and the preset detection standard is greater than the preset difference, the method further includes: and determining the source of the abnormal data according to the category of the abnormal data.
In some embodiments of the present invention, the step of determining the source of the abnormal data according to the category of the abnormal data includes: process data during the execution of each subtask is collected and key process control parameters for each process data are determined. And inquiring corresponding key process control parameters according to the types of the abnormal data, and determining the source of the abnormal data according to the key process control parameters.
In some embodiments of the present invention, the source of the abnormal data at least includes planning abnormality, supply material abnormality, production equipment abnormality, and product quality inspection abnormality.
In some embodiments of the present invention, before the step of detecting each finished product of the corresponding production line according to the preset detection standard during the execution of each subtask, the method further includes: a plurality of target products are collected in advance, and are analyzed to determine quality index data. And determining a preset detection standard according to the quality index data.
In a second aspect, an embodiment of the present application provides an MQTT-based abnormal data acquisition system, which includes: and the connection establishing module is used for establishing the connection between the MQTT user side and the MQTT server. And the subtask issuing module is used for the MQTT user side to issue the production task of the target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line. And the finished product detection module is used for detecting each finished product of the corresponding production line according to a preset detection standard in the execution process of each subtask. And the abnormal data acquisition module is used for acquiring the abnormal data of the produced finished product if the difference value between any data of the produced finished product and the preset detection standard is greater than the preset difference value. And the abnormal data packing module is used for packing the type of the abnormal data serving as a fixed head and the numerical value of the abnormal data serving as a message body to obtain an abnormal data packet. And the abnormal data packet sending module is used for the MQTT server to send the abnormal data packet to the MQTT user side.
In some embodiments of the present invention, the MQTT-based abnormal data collecting system further includes: and the port initialization module is used for initializing the server and the TCP client. And the MQTT user side obtaining module is used for establishing an MQTT thread by utilizing the TCP user side to obtain the MQTT user side. And the MQTT server obtaining module is used for establishing an MQTT thread by using the server to obtain the MQTT server.
In some embodiments of the present invention, the MQTT-based abnormal data collecting system further includes: and the abnormal data source determining module is used for determining the abnormal data source according to the type of the abnormal data.
In some embodiments of the invention, the above-mentioned abnormal data source determining module includes: and the process data collection unit is used for collecting the process data in the execution process of each subtask and determining the key process control parameters of each process data. And the key process control parameter query unit is used for querying the corresponding key process control parameters according to the types of the abnormal data and determining the sources of the abnormal data according to the key process control parameters.
In some embodiments of the present invention, the source of the abnormal data at least includes planning abnormality, supply material abnormality, production equipment abnormality, and product quality inspection abnormality.
In some embodiments of the present invention, the MQTT-based abnormal data collecting system further includes: and the quality index data determining module is used for acquiring a plurality of target products in advance, analyzing the target products and determining the quality index data. And the preset detection standard determining module is used for determining the preset detection standard according to the quality index data.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory for storing one or more programs; a processor. The program or programs, when executed by a processor, implement the method of any of the first aspects as described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method according to any one of the first aspect described above.
Compared with the prior art, the embodiment of the invention has at least the following advantages or beneficial effects:
the invention provides an abnormal data acquisition method and system based on MQTT, which comprises the following steps: and establishing the connection between the MQTT user side and the MQTT server. The MQTT client issues a production task of a target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line. And in the execution process of each subtask, detecting each finished product of the corresponding production line according to a preset detection standard. And if the difference value of any one of the data of the produced finished product and the preset detection standard is larger than the preset difference value, acquiring abnormal data of the produced finished product. And packaging the type of the abnormal data as a fixed header and the numerical value of the abnormal data as a message body to obtain an abnormal data packet. And the MQTT server sends the abnormal data packet to the MQTT user side. The method and the system establish the connection between the MQTT user side and the MQTT server so that the MQTT user side and the MQTT server can communicate in a publish/subscribe mode. The MQTT server divides the production tasks into subtasks and sends the subtasks to corresponding production lines, so that the production efficiency of products is faster. In the production process of each production line, all the produced finished products are detected, and abnormal data with difference values larger than a preset difference value are obtained. And then avoided the user to carry out the one-by-one investigation to the production process and leaded to the problem of huge work load, made things convenient for the user in time to obtain the abnormal data in the production process. And moreover, errors caused by manual troubleshooting are avoided, and the accuracy of the acquired abnormal data is ensured. And the method and the system package the type of the abnormal data as a fixed head and the numerical value of the abnormal data as a message body, and the obtained abnormal data packet can effectively reduce the size of the abnormal data. The size of the exception data is reduced due to the exception packet. The abnormal data packet is sent to the MQTT user side from the MQTT server, so that the calculation loss in the data transmission process can be effectively reduced, the transmission speed is high, and the user can obtain the abnormal data in time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a flowchart of an abnormal data collection method based on MQTT according to an embodiment of the present invention;
fig. 2 is a block diagram of an abnormal data acquisition system based on MQTT according to an embodiment of the present invention;
fig. 3 is a schematic structural block diagram of an electronic device according to an embodiment of the present invention.
Icon: 100-MQTT-based abnormal data acquisition system; 110-a connection establishment module; 120-subtask issuing module; 130-production finished product detection module; 140-abnormal data acquisition module; 150-an abnormal data packing module; 160-exception packet sending module; 101-a memory; 102-a processor; 103-communication interface.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not construed as indicating or implying relative importance.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of an element identified by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the description of the present application, it should be noted that if the terms "upper", "lower", "inner", "outer", etc. are used to indicate an orientation or positional relationship based on that shown in the drawings or that the application product is usually placed in use, the description is merely for convenience and simplicity, and it is not intended to indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore should not be construed as limiting the present application.
In the description of the present application, it should also be noted that, unless otherwise explicitly stated or limited, the terms "disposed" and "connected" should be interpreted broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the individual features of the embodiments can be combined with one another without conflict.
Examples
Referring to fig. 1, fig. 1 is a flowchart illustrating an abnormal data collection method based on MQTT according to an embodiment of the present application. An abnormal data acquisition method based on MQTT comprises the following steps:
s110: establishing the connection between the MQTT user side and the MQTT server;
specifically, an MQTT user side and an MQTT server are set up, and then the IP of client.connect in the MQTT user side is changed into the IP address of the MQTT server so as to establish the connection between the MQTT user side and the MQTT server. Based on the MQTT protocol, the MQTT user side and the MQTT server can communicate with each other in a publish/subscribe manner.
In detail, the MQTT user terminal and the MQTT server can be connected via a Broker. When the MQTT user side is a publisher, the MQTT server is a subscriber. When the MQTT server is a publisher, the MQTT user side is the publisher. The publisher publishes the message to the Broker, the Broker searches for the subscribers after receiving the message and sends the message to the subscribers, and the subscribers acquire the message from the Broker.
S120: the MQTT client issues a production task of a target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line;
specifically, the user inputs a production task of the target product, and the MQTT user side issues the production task to the MQTT server. Because the products produced by different production lines are different, the production task is divided into at least one subtask according to the products produced by each production line, and each subtask is issued to the corresponding production line, so that the faster production efficiency of the products is obtained.
Where T denotes a production Task and D denotes the content of the production Task, T ═ Task1,Task2,...,TasknAnd (5) Task represents a subtask. D ═ data1,data2,...,datanAnd the data represents the task content of the subtask.
As an implementation manner of this embodiment, the target product may be a display screen, the production task may be to produce 100 display screens, and the subtask may be to produce 100 touch panels, 100 display panels, 100 FPCBs, and 100 display panels. And then each subtask is issued to the corresponding production line.
S130: in the execution process of each subtask, detecting each finished product of the corresponding production line according to a preset detection standard;
the preset detection standard can be the length, width, height, shape, weight and the like of the target finished product. And detecting all the produced finished products of each subtask according to a preset detection standard, and if the difference between the length, the width, the height, the shape and the weight of the produced finished products and the length, the width, the height, the shape and the weight of the target finished products does not exceed the preset difference, indicating that the produced finished products are qualified products. Otherwise, the product is an unqualified product, and an unqualified finished product is found out.
S140: if the difference value between any one of the data of the produced finished products and the preset detection standard is larger than the preset difference value, acquiring abnormal data of the produced finished products;
specifically, if any difference between the length, width, height, shape, and weight of the produced finished product and the length, width, height, shape, and weight of the target finished product is greater than a preset difference, it indicates that the data of the produced finished product corresponding to the difference is abnormal data, and the abnormal data is obtained. And further, the problem of huge workload caused by one-to-one checking of the production process by a user is avoided, so that the user can conveniently and timely acquire abnormal data in the production process. And moreover, errors caused by manual troubleshooting are avoided, and the accuracy of the acquired abnormal data is ensured.
S150: packaging the type of the abnormal data as a fixed head and the numerical value of the abnormal data as a message body to obtain an abnormal data packet;
specifically, the size of the abnormal data can be effectively reduced by the abnormal data packet obtained by packaging the abnormal data.
S160: and the MQTT server sends the abnormal data packet to the MQTT user side.
Specifically, the size of the exception data is reduced due to the exception packet. The abnormal data packet is sent to the MQTT user side from the MQTT server, so that the calculation loss in the data transmission process can be effectively reduced, the transmission speed is high, and the user can obtain the abnormal data in time.
In some embodiments of this embodiment, before the step of establishing the connection between the MQTT user terminal and the MQTT server, the method further includes: initializing the server and the TCP client. And establishing an MQTT thread by utilizing the TCP client to obtain the MQTT client. And establishing an MQTT thread by using the server to obtain an MQTT server. Specifically, an MQTT thread is respectively established by using the initialized TCP client and the server, so as to obtain an MQTT client and an MQTT server which satisfy an MQTT protocol.
In some embodiments of this embodiment, after the step of obtaining the abnormal data of the finished product if the difference between any data of the finished product and the preset detection standard is greater than the preset difference, the method further includes: and determining the source of the abnormal data according to the category of the abnormal data. Specifically, the type of the abnormal data is analyzed, and the source of the abnormal data can be traced back. Further, the user is prevented from conducting one-to-one investigation on the whole production process, and the user can conveniently trace back abnormal data sources.
In detail, if the abnormal data is the abnormal shape of the finished product, it may be caused by the abnormal production equipment.
In some embodiments of this embodiment, the step of determining the source of the abnormal data according to the category of the abnormal data includes: process data during the execution of each subtask is collected and key process control parameters for each process data are determined. And inquiring corresponding key process control parameters according to the types of the abnormal data, and determining the source of the abnormal data according to the key process control parameters. Specifically, process data in the execution process of each subtask is analyzed to determine a key process control parameter. If the type of the abnormal data is consistent with a certain key process control parameter, or a certain key process control parameter determines the abnormal data, the abnormal data source of the abnormal data can be determined according to the key process control parameter.
In some embodiments of this embodiment, the source of the abnormal data at least includes a planning abnormality, a supply material abnormality, a production equipment abnormality, and a product quality inspection abnormality.
In some embodiments of this embodiment, before the step of detecting each finished product of the corresponding production line according to the preset detection standard during the execution of each subtask, the method further includes: a plurality of target products are collected in advance, and are analyzed to determine quality index data. And determining a preset detection standard according to the quality index data. Specifically, a sufficient number of target products are collected in advance, specifications of the target products are analyzed, and then quality index data are determined more accurately, so that a preset detection standard is determined more accurately according to the quality index data.
Referring to fig. 2, fig. 2 is a block diagram illustrating an abnormal data collecting system 100 based on MQTT according to an embodiment of the present invention. The embodiment of the present application provides an abnormal data acquisition system 100 based on MQTT, which includes: and the connection establishing module 110 is used for establishing the connection between the MQTT user side and the MQTT server. The subtask issuing module 120 is configured to issue a production task of a target product to the MQTT server at the MQTT user side, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line. And a finished product detection module 130, configured to detect each finished product of the corresponding production line according to a preset detection standard during execution of each sub-task. The abnormal data obtaining module 140 is configured to obtain abnormal data of the produced finished product if a difference between any one of the data of the produced finished product and the preset detection standard is greater than a preset difference. And the abnormal data packing module 150 is configured to pack the type of the abnormal data as a fixed header and the numerical value of the abnormal data as a message body to obtain an abnormal data packet. And the abnormal data packet sending module 160 is used for the MQTT server to send the abnormal data packet to the MQTT user side.
Specifically, the system establishes connection between the MQTT user side and the MQTT server, so that the MQTT user side and the MQTT server can communicate in a publish/subscribe mode. The MQTT server divides the production tasks into subtasks and sends the subtasks to corresponding production lines, so that the production efficiency of products is faster. In the production process of each production line, all the produced finished products are detected, and abnormal data with difference values larger than a preset difference value are obtained. And further, the problem of huge workload caused by one-to-one checking of the production process by a user is avoided, so that the user can conveniently and timely acquire abnormal data in the production process. And moreover, errors caused by manual troubleshooting are avoided, and the accuracy of the acquired abnormal data is ensured. And the system takes the type of the abnormal data as a fixed head and takes the numerical value of the abnormal data as a message body for packaging, and the obtained abnormal data packet can effectively reduce the size of the abnormal data. The size of the exception data is reduced due to the exception packet. The abnormal data packet is sent to the MQTT user side from the MQTT server, so that the calculation loss in the data transmission process can be effectively reduced, the transmission speed is high, and the user can obtain the abnormal data in time.
In some embodiments of this embodiment, the MQTT-based abnormal data collecting system 100 further includes: and the port initialization module is used for initializing the server and the TCP client. And the MQTT user side obtaining module is used for establishing an MQTT thread by utilizing the TCP user side to obtain the MQTT user side. And the MQTT server obtaining module is used for establishing an MQTT thread by using the server to obtain the MQTT server. Specifically, an MQTT thread is respectively established by using the initialized TCP client and the server, so as to obtain an MQTT client and an MQTT server which satisfy an MQTT protocol.
In some embodiments of this embodiment, the MQTT-based abnormal data collecting system 100 further includes: and the abnormal data source determining module is used for determining the abnormal data source according to the type of the abnormal data. Specifically, the type of the abnormal data is analyzed, and the source of the abnormal data can be traced back. Further, the user is prevented from conducting one-to-one investigation on the whole production process, and the user can conveniently trace back abnormal data sources.
In some embodiments of this embodiment, the above-mentioned abnormal data source determining module includes: and the process data collection unit is used for collecting the process data in the execution process of each subtask and determining the key process control parameters of each process data. And the key process control parameter query unit is used for querying the corresponding key process control parameters according to the types of the abnormal data and determining the sources of the abnormal data according to the key process control parameters. Specifically, process data in the execution process of each subtask is analyzed to determine a key process control parameter. If the type of the abnormal data is consistent with a certain key process control parameter, or a certain key process control parameter determines the abnormal data, the abnormal data source of the abnormal data can be determined according to the key process control parameter.
In some embodiments of this embodiment, the source of the abnormal data at least includes a planning abnormality, a supply material abnormality, a production equipment abnormality, and a product quality inspection abnormality.
In some embodiments of this embodiment, the MQTT-based abnormal data collecting system 100 further includes: and the quality index data determining module is used for acquiring a plurality of target products in advance, analyzing the target products and determining the quality index data. And the preset detection standard determining module is used for determining the preset detection standard according to the quality index data. Specifically, a sufficient number of target products are collected in advance, specifications of the target products are analyzed, and then quality index data are determined more accurately, so that a preset detection standard is determined more accurately according to the quality index data.
Referring to fig. 3, fig. 3 is a schematic structural block diagram of an electronic device according to an embodiment of the present disclosure. The electronic device comprises a memory 101, a processor 102 and a communication interface 103, wherein the memory 101, the processor 102 and the communication interface 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The memory 101 may be used for storing software programs and modules, such as program instructions/modules corresponding to the MQTT-based abnormal data acquisition system 100 provided in the embodiments of the present application, and the processor 102 executes the software programs and modules stored in the memory 101, thereby executing various functional applications and data processing. The communication interface 103 may be used for communicating signaling or data with other node devices.
The Memory 101 may be, but is not limited to, a Random Access Memory 101 (RAM), a Read Only Memory 101 (ROM), a Programmable Read Only Memory 101 (PROM), an Erasable Read Only Memory 101 (EPROM), an electrically Erasable Read Only Memory 101 (EEPROM), and the like.
The processor 102 may be an integrated circuit chip having signal processing capabilities. The Processor 102 may be a general-purpose Processor 102, including a Central Processing Unit (CPU) 102, a Network Processor 102 (NP), and the like; but may also be a Digital Signal processor 102 (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware components.
It will be appreciated that the configuration shown in fig. 3 is merely illustrative and that the electronic device may include more or fewer components than shown in fig. 3 or have a different configuration than shown in fig. 3. The components shown in fig. 3 may be implemented in hardware, software, or a combination thereof.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory 101 (ROM), a Random Access Memory 101 (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In summary, the method and system for acquiring abnormal data based on MQTT provided by the embodiments of the present application include the following steps: and establishing the connection between the MQTT user side and the MQTT server. The MQTT client issues a production task of a target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line. And in the execution process of each subtask, detecting each finished product of the corresponding production line according to a preset detection standard. And if the difference value of any one of the data of the produced finished product and the preset detection standard is larger than the preset difference value, acquiring abnormal data of the produced finished product. And packaging the type of the abnormal data as a fixed header and the numerical value of the abnormal data as a message body to obtain an abnormal data packet. And the MQTT server sends the abnormal data packet to the MQTT user side. The method and the system establish the connection between the MQTT user side and the MQTT server so that the MQTT user side and the MQTT server can communicate in a publish/subscribe mode. The MQTT server divides the production tasks into subtasks and sends the subtasks to corresponding production lines, so that the production efficiency of products is faster. In the production process of each production line, all the produced finished products are detected, and abnormal data with difference values larger than a preset difference value are obtained. And then avoided the user to carry out the one-by-one investigation to the production process and leaded to the problem of huge work load, made things convenient for the user in time to obtain the abnormal data in the production process. And moreover, errors caused by manual troubleshooting are avoided, and the accuracy of the acquired abnormal data is ensured. And the method and the system package the type of the abnormal data as a fixed head and the numerical value of the abnormal data as a message body, and the obtained abnormal data packet can effectively reduce the size of the abnormal data. The size of the exception data is reduced due to the exception packet. The abnormal data packet is sent to the MQTT user side from the MQTT server, so that the calculation loss in the data transmission process can be effectively reduced, the transmission speed is high, and the user can obtain the abnormal data in time.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Claims (10)
1. An abnormal data acquisition method based on MQTT is characterized by comprising the following steps:
establishing the connection between the MQTT user side and the MQTT server;
the MQTT client issues a production task of a target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line;
in the execution process of each subtask, detecting each finished product of the corresponding production line according to a preset detection standard;
if the difference value between any data of the produced finished products and a preset detection standard is larger than a preset difference value, acquiring abnormal data of the produced finished products;
packaging the type of the abnormal data as a fixed head and the numerical value of the abnormal data as a message body to obtain an abnormal data packet;
and the MQTT server sends the abnormal data packet to an MQTT user side.
2. The MQTT-based abnormal data acquisition method according to claim 1, wherein before the step of establishing the connection between the MQTT user side and the MQTT server, the method further comprises:
initializing a server and a TCP client;
establishing an MQTT thread by utilizing the TCP client to obtain an MQTT client;
and establishing an MQTT thread by using the server to obtain an MQTT server.
3. The MQTT-based abnormal data acquisition method according to claim 1, wherein if a difference between any data of the finished product and a preset detection standard is greater than a preset difference, the step of obtaining the abnormal data of the finished product further comprises:
and determining the source of the abnormal data according to the type of the abnormal data.
4. The MQTT-based abnormal data collection method according to claim 3, wherein the step of determining the source of abnormal data according to the category of the abnormal data comprises:
collecting process data in the execution process of each subtask, and determining key process control parameters of each process data;
and inquiring the corresponding key process control parameters according to the types of the abnormal data, and determining the source of the abnormal data according to the key process control parameters.
5. The MQTT-based anomaly data collection method according to claim 3, wherein the anomaly data sources at least include planning anomalies, supply material anomalies, production equipment anomalies, and product quality inspection anomalies.
6. The MQTT-based abnormal data acquisition method according to claim 1, wherein before the step of detecting each finished product of the corresponding production line according to a preset detection standard during the execution of each subtask, the method further comprises:
the method comprises the following steps of collecting a plurality of target products in advance, analyzing the target products and determining quality index data;
and determining a preset detection standard according to the quality index data.
7. An MQTT-based abnormal data acquisition system is characterized by comprising:
the connection establishing module is used for establishing the connection between the MQTT user side and the MQTT server;
the subtask issuing module is used for the MQTT user side to issue a production task of a target product to the MQTT server, and the MQTT server divides the production task into at least one subtask and issues each subtask to a corresponding production line;
the finished product detection module is used for detecting each finished product of the corresponding production line according to a preset detection standard in the execution process of each subtask;
the abnormal data acquisition module is used for acquiring abnormal data of the produced finished product if the difference value between any data of the produced finished product and a preset detection standard is larger than a preset difference value;
the abnormal data packing module is used for packing the type of the abnormal data serving as a fixed head and the numerical value of the abnormal data serving as a message body to obtain an abnormal data packet;
and the abnormal data packet sending module is used for the MQTT server to send the abnormal data packet to the MQTT user side.
8. The MQTT-based anomaly data acquisition system according to claim 7, further comprising:
the port initialization module is used for initializing the server and the TCP client;
the MQTT user side obtaining module is used for establishing an MQTT thread by utilizing the TCP user side to obtain an MQTT user side;
and the MQTT server obtaining module is used for establishing an MQTT thread by using the server to obtain the MQTT server.
9. An electronic device, comprising:
a memory for storing one or more programs;
a processor;
the one or more programs, when executed by the processor, implement the method of any of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111233885.6A CN114070829B (en) | 2021-10-22 | 2021-10-22 | Abnormal data acquisition method and system based on MQTT |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111233885.6A CN114070829B (en) | 2021-10-22 | 2021-10-22 | Abnormal data acquisition method and system based on MQTT |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114070829A true CN114070829A (en) | 2022-02-18 |
CN114070829B CN114070829B (en) | 2024-01-09 |
Family
ID=80235465
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111233885.6A Active CN114070829B (en) | 2021-10-22 | 2021-10-22 | Abnormal data acquisition method and system based on MQTT |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114070829B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114996195A (en) * | 2022-06-14 | 2022-09-02 | 国网浙江省电力有限公司物资分公司 | Method, system, device and medium for acquiring carbon footprint data |
Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101140455A (en) * | 2007-10-22 | 2008-03-12 | 广东工业大学 | Real time monitoring system for production processes and monitoring method |
CN104063984A (en) * | 2013-03-21 | 2014-09-24 | 英华达(南京)科技有限公司 | Automatic standard exceeding alarm method of defective product |
US20170124502A1 (en) * | 2015-11-02 | 2017-05-04 | International Business Machines Corporation | Selecting key performance indicators for anomaly detection analytics |
CN108615230A (en) * | 2018-03-16 | 2018-10-02 | 北京邮电大学 | A kind of hub surface method for detecting abnormality and system |
CN109740946A (en) * | 2019-01-08 | 2019-05-10 | 武汉益模科技股份有限公司 | A kind of factory's quality abnormal processing system and its method |
US20190257719A1 (en) * | 2018-02-19 | 2019-08-22 | Hitachi, Ltd. | Abnormal-state detection system and abnormal-state detection method |
CN110597196A (en) * | 2019-08-21 | 2019-12-20 | 格力电器(武汉)有限公司 | Data acquisition system and data acquisition method |
CN111183619A (en) * | 2017-12-28 | 2020-05-19 | 西门子股份公司 | Method, device and system for transmitting MQTT data through message queue telemetry transmission |
CN111199353A (en) * | 2019-12-31 | 2020-05-26 | Oppo(重庆)智能科技有限公司 | Test method and test system |
CN111818138A (en) * | 2020-06-28 | 2020-10-23 | 电子科技大学 | Vehicle cloud real time data communication method for intelligent vehicle |
CN112035258A (en) * | 2020-08-31 | 2020-12-04 | 中国平安财产保险股份有限公司 | Data processing method, device, electronic equipment and medium |
CN112487071A (en) * | 2020-11-17 | 2021-03-12 | 中信银行股份有限公司 | Transaction query method and device, electronic equipment and readable storage medium |
CN112732774A (en) * | 2020-12-16 | 2021-04-30 | 北京航天智造科技发展有限公司 | Intelligent production detection system and method based on edge calculation |
CN113115243A (en) * | 2021-03-24 | 2021-07-13 | 武汉天喻信息产业股份有限公司 | MQTT-based indoor positioning system |
WO2021146899A1 (en) * | 2020-01-21 | 2021-07-29 | 深圳元戎启行科技有限公司 | Data storage method and apparatus, computer device, and computer-readable storage medium |
CN113406092A (en) * | 2021-08-18 | 2021-09-17 | 阿里巴巴(中国)有限公司 | Digital production detection system, method, device, equipment and storage medium |
CN113408828A (en) * | 2021-08-06 | 2021-09-17 | 太仓韬信信息科技有限公司 | Production line optimization method and device based on intelligent manufacturing and server |
-
2021
- 2021-10-22 CN CN202111233885.6A patent/CN114070829B/en active Active
Patent Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101140455A (en) * | 2007-10-22 | 2008-03-12 | 广东工业大学 | Real time monitoring system for production processes and monitoring method |
CN104063984A (en) * | 2013-03-21 | 2014-09-24 | 英华达(南京)科技有限公司 | Automatic standard exceeding alarm method of defective product |
US20170124502A1 (en) * | 2015-11-02 | 2017-05-04 | International Business Machines Corporation | Selecting key performance indicators for anomaly detection analytics |
CN111183619A (en) * | 2017-12-28 | 2020-05-19 | 西门子股份公司 | Method, device and system for transmitting MQTT data through message queue telemetry transmission |
US20190257719A1 (en) * | 2018-02-19 | 2019-08-22 | Hitachi, Ltd. | Abnormal-state detection system and abnormal-state detection method |
CN108615230A (en) * | 2018-03-16 | 2018-10-02 | 北京邮电大学 | A kind of hub surface method for detecting abnormality and system |
CN109740946A (en) * | 2019-01-08 | 2019-05-10 | 武汉益模科技股份有限公司 | A kind of factory's quality abnormal processing system and its method |
CN110597196A (en) * | 2019-08-21 | 2019-12-20 | 格力电器(武汉)有限公司 | Data acquisition system and data acquisition method |
CN111199353A (en) * | 2019-12-31 | 2020-05-26 | Oppo(重庆)智能科技有限公司 | Test method and test system |
WO2021146899A1 (en) * | 2020-01-21 | 2021-07-29 | 深圳元戎启行科技有限公司 | Data storage method and apparatus, computer device, and computer-readable storage medium |
CN111818138A (en) * | 2020-06-28 | 2020-10-23 | 电子科技大学 | Vehicle cloud real time data communication method for intelligent vehicle |
CN112035258A (en) * | 2020-08-31 | 2020-12-04 | 中国平安财产保险股份有限公司 | Data processing method, device, electronic equipment and medium |
CN112487071A (en) * | 2020-11-17 | 2021-03-12 | 中信银行股份有限公司 | Transaction query method and device, electronic equipment and readable storage medium |
CN112732774A (en) * | 2020-12-16 | 2021-04-30 | 北京航天智造科技发展有限公司 | Intelligent production detection system and method based on edge calculation |
CN113115243A (en) * | 2021-03-24 | 2021-07-13 | 武汉天喻信息产业股份有限公司 | MQTT-based indoor positioning system |
CN113408828A (en) * | 2021-08-06 | 2021-09-17 | 太仓韬信信息科技有限公司 | Production line optimization method and device based on intelligent manufacturing and server |
CN113406092A (en) * | 2021-08-18 | 2021-09-17 | 阿里巴巴(中国)有限公司 | Digital production detection system, method, device, equipment and storage medium |
Non-Patent Citations (3)
Title |
---|
林聪伟等: "基于自动化生产线的物联网可视化监控系统", 重庆理工大学学报( 自然科学), pages 1 - 3 * |
罗成志: "基于阿里云的新能源汽车空调状况监测系统设计", 单片机与嵌入式系统应用 * |
马鑫龙;艾冬生;孙发鱼;张景鹏;: "基于MQTT的遥测数据无线传输", 探测与控制学报, no. 02 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114996195A (en) * | 2022-06-14 | 2022-09-02 | 国网浙江省电力有限公司物资分公司 | Method, system, device and medium for acquiring carbon footprint data |
CN114996195B (en) * | 2022-06-14 | 2023-12-12 | 国网浙江省电力有限公司物资分公司 | Method, system, device and medium for acquiring carbon footprint data |
Also Published As
Publication number | Publication date |
---|---|
CN114070829B (en) | 2024-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11657309B2 (en) | Behavior analysis and visualization for a computer infrastructure | |
US10380002B1 (en) | User interface for specifying data stream processing language programs for analyzing instrumented software | |
US7783744B2 (en) | Facilitating root cause analysis for abnormal behavior of systems in a networked environment | |
EP3832479B1 (en) | Production line monitoring method and apparatus, and electronic device and readable storage medium | |
US20170048120A1 (en) | Systems and Methods for WebSphere MQ Performance Metrics Analysis | |
CN111581104A (en) | DevOps research and development operation integration-based measurement method | |
JP5659108B2 (en) | Operation monitoring device, operation monitoring program, and recording medium | |
Agrawal et al. | Log-based cloud monitoring system for OpenStack | |
CN110995639A (en) | Data transmission method | |
CN114070829B (en) | Abnormal data acquisition method and system based on MQTT | |
WO2020172569A1 (en) | Method, apparatus, and computer-readable medium for maintaining visual consistency | |
US11853330B1 (en) | Data structure navigator | |
JP5268589B2 (en) | Information processing apparatus and information processing apparatus operating method | |
CN107666399A (en) | A kind of method and apparatus of monitoring data | |
KR101973328B1 (en) | Correlation analysis and visualization method of Hadoop based machine tool environmental data | |
CN113806169A (en) | Method and device for processing business exception | |
CN113504996A (en) | Load balance detection method, device, equipment and storage medium | |
CN117424850A (en) | Abnormal link aggregation method, query method, device, equipment and medium | |
US10706108B2 (en) | Field name recommendation | |
CN111176950A (en) | Method and equipment for monitoring network card of server cluster | |
US12032468B2 (en) | Method and device for displaying representation indicator of object | |
CN113535034B (en) | Method, apparatus, system and medium for fault warning | |
CN113918414A (en) | Pinpoint and prometheus-based ice monitoring method and system | |
CN108616421A (en) | A kind of condition detection method of multi-node cluster, device and equipment | |
CN114697156A (en) | Rocket bus data monitoring method, rocket bus data monitoring device, terminal equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A method and system for abnormal data collection based on MQTT Granted publication date: 20240109 Pledgee: Nantong Branch of Bank of Nanjing Co.,Ltd. Pledgor: Nantong soft cloud Intelligent Technology Co.,Ltd. Registration number: Y2024980009371 |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right |