CN112165414A - WebSocket protocol-based real-time data monitoring method and system - Google Patents
WebSocket protocol-based real-time data monitoring method and system Download PDFInfo
- Publication number
- CN112165414A CN112165414A CN202011045960.1A CN202011045960A CN112165414A CN 112165414 A CN112165414 A CN 112165414A CN 202011045960 A CN202011045960 A CN 202011045960A CN 112165414 A CN112165414 A CN 112165414A
- Authority
- CN
- China
- Prior art keywords
- monitoring
- data
- server
- websocket
- generating
- 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.)
- Pending
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 364
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000003745 diagnosis Methods 0.000 claims abstract description 40
- 230000002159 abnormal effect Effects 0.000 claims abstract description 19
- 238000004519 manufacturing process Methods 0.000 claims abstract description 6
- 238000003860 storage Methods 0.000 claims description 23
- 230000005540 biological transmission Effects 0.000 claims description 12
- 238000012545 processing Methods 0.000 claims description 7
- 238000013500 data storage Methods 0.000 claims description 3
- 238000012806 monitoring device Methods 0.000 claims description 3
- 230000002093 peripheral effect Effects 0.000 claims description 3
- 230000009286 beneficial effect Effects 0.000 abstract description 12
- 238000010923 batch production Methods 0.000 description 5
- 230000002457 bidirectional effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000002085 persistent effect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/04—Processing captured monitoring data, e.g. for logfile generation
- H04L43/045—Processing captured monitoring data, e.g. for logfile generation for graphical visualisation of monitoring data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- 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/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Environmental & Geological Engineering (AREA)
- Computer And Data Communications (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a real-time data monitoring method and system based on a WebSocket protocol. Acquiring server data of a factory assembly server, and binding the server data to a diagnostic database of a preset service system; the diagnosis database diagnoses the server data to generate a diagnosis result; constructing a WebSocket monitoring system based on a WebSocket protocol, monitoring the diagnosis result according to the WebSocket monitoring system, and determining the running state of the diagnosis result; judging whether the server data has abnormal conditions or not according to the running state, and generating a judgment result; and monitoring the data of the database in real time according to the judgment result. The invention has the beneficial effects that: the invention realizes the real-time monitoring in the production process of the server based on the WebSocket mechanism, improves the expandability, the stability and the real-time performance of the system, saves the bandwidth and improves the diagnosis automation level.
Description
Technical Field
The invention relates to the field of real-time data monitoring, in particular to a real-time data monitoring method and system based on a WebSocket protocol.
Background
Currently, in mass production of products such as PC/server, the requirements for product diagnosis automation, efficiency and coverage are extremely high. For real-time data monitoring in the server batch production process, a passive polling mechanism (for example, setting to request data once every 5 seconds) is generally adopted, which not only occupies a large amount of bandwidth to cause a plurality of invalid requests, but also causes the server to have too much pressure. The invention provides a real-time data monitoring method based on a WebSocket server, which realizes real-time data monitoring in the batch production process of the server through a WebSocket mechanism code, improves the expandability, stability and instantaneity of a monitoring system, greatly saves bandwidth and reduces expenditure.
Disclosure of Invention
The invention provides a real-time data monitoring method and system based on a WebSocket protocol, which are used for solving the problems of real-time monitoring, real-time active data transmission and updating in the batch diagnosis process of a server, comparing a polling mechanism, saving resources, avoiding frequent requests, improving the expandability, stability and instantaneity of the system, greatly saving bandwidth and reducing expenditure.
As an embodiment of the present invention, a method for real-time data monitoring based on a WebSocket protocol includes:
acquiring server data of a factory assembly server, and binding the server data to a preset storage database;
monitoring the server data according to the WebSocket monitoring system based on a WebSocket protocol of the WebSocket monitoring system, and generating a monitoring result;
judging whether the server data has abnormal conditions or not through the WebSocket monitoring system according to the monitoring result, and generating judgment data;
and determining data monitoring information according to the judgment data, generating a chart and feeding back the data monitoring information to the client.
As an embodiment of the present invention, the acquiring server data of a factory assembly server, and binding the server data to a preset storage database includes:
scanning original data by using the factory assembly server, wherein a PXE system and a diagnostic data system are preset in the factory assembly server; wherein,
the PXE system is used for acquiring the Mac address of the original data, dynamically distributing an IP address to the original data according to the Mac address and determining the IP of the original data;
the diagnostic data system is used for diagnosing the original data, determining a diagnostic stage and generating a diagnostic result;
generating server data according to the original data, the original data IP, the diagnosis stage and the diagnosis result;
and binding the server data to a preset storage database.
As an embodiment of the present invention, the WebSocket-based monitoring system is internally provided with a WebSocket protocol, and monitors the server data according to the WebSocket monitoring system to generate a monitoring result, including:
according to the WebSocket protocol, a monitoring path of the factory assembly server and the server database is established;
the server database transmits a data monitoring request to the factory assembly server, and is connected with the monitoring access according to the monitoring request;
determining a monitoring data trigger event according to the monitoring path; wherein,
when the factory assembly server receives the server data transmitted by the server database for the first time, the monitoring data trigger event is started, and a trigger mechanism is determined;
automatically transmitting the server data to the factory assembly server through the server database according to the trigger mechanism;
and monitoring the server data according to the trigger mechanism and the Websocket monitoring system to generate a monitoring result.
As an embodiment of the present invention, according to the monitoring result, determining, by the WebSocket monitoring system, whether the server data is abnormal, and generating determination data includes:
determining monitoring data according to the monitoring result, uploading the monitoring data to the storage database, and generating a monitoring database;
generating a real-time monitoring coordinate axis which takes time as a horizontal axis and the monitoring data as a vertical axis according to the monitoring database, and acquiring a real-time monitoring curve;
setting a monitoring threshold value of monitoring data according to the real-time monitoring curve;
acquiring target monitoring data, and judging whether the target monitoring data is abnormal or not according to the monitoring threshold;
if the target monitoring data curve is normal, updating the monitoring data curve to obtain a target monitoring data curve;
if the monitoring threshold value is exceeded, triggering a judgment event to generate a judgment result;
and generating judgment data according to the judgment result.
As an embodiment of the present invention, the determining data monitoring information according to the determination data, generating a chart, and feeding back the data monitoring information to a client includes:
storing the judgment data, searching the server data corresponding to the judgment data, generating a corresponding relation, and acquiring the corresponding relation;
generating data monitoring information according to the server database and the judgment data through the corresponding relation;
and generating a chart according to the data monitoring information and feeding back the data monitoring information to a client.
A real-time data monitoring system based on WebSocket protocol is characterized in that,
the method comprises the following steps:
an acquisition unit: the system comprises a server data acquisition module, a data storage module and a data processing module, wherein the server data acquisition module is used for acquiring server data of a factory assembly server and binding the server data to a preset storage database;
a monitoring unit: monitoring the server data according to the WebSocket monitoring system based on a WebSocket protocol of the WebSocket monitoring system, and generating a monitoring result;
a judging unit: according to the monitoring result, the WebSocket monitoring system judges whether the server data has abnormal conditions or not and generates judgment data;
a feedback unit: and determining data monitoring information according to the judgment data, generating a chart and feeding back the data monitoring information to the client.
As an embodiment of the present invention, the obtaining module is characterized by including:
a server unit: the system comprises a factory assembly server and a peripheral component interconnect (PXE) server, wherein the factory assembly server is used for scanning original data and is preset with the PXE system and a diagnostic data system; wherein,
the PXE system is used for acquiring the Mac address of the original data, dynamically distributing an IP address to the original data according to the Mac address and determining the IP of the original data;
the diagnostic data system is used for diagnosing the original data, determining a diagnostic stage and generating a diagnostic result;
a server data generation unit: generating server data according to the original data, the original data IP, the diagnosis stage and the diagnosis result;
a binding unit: and binding the server data to a preset storage database.
As an embodiment of the present invention, the monitoring module includes:
a listening path unit: a monitoring path used for establishing the factory assembly server and the server database according to the WebSocket protocol;
the server database transmits a data monitoring request to the factory assembly server, and is connected with the monitoring access according to the monitoring request;
a trigger event unit: the monitoring device is used for determining a monitoring data trigger event according to the monitoring access; wherein,
when the factory assembly server receives the server data transmitted by the server database for the first time, the monitoring data trigger event is started, and a trigger mechanism is determined;
a transmission unit: the server database is used for automatically transmitting the server data to the factory assembly server according to the trigger mechanism;
a monitoring result unit: and the Websocket monitoring system is used for monitoring the server data according to the trigger mechanism and the Websocket monitoring system to generate a monitoring result.
As an embodiment of the present invention, the determining module includes:
a monitoring data processing unit: the monitoring data is determined according to the monitoring result, uploaded to the storage database and generated into a monitoring database;
a monitoring curve generation unit: the real-time monitoring system is used for generating a real-time monitoring coordinate axis which takes time as a horizontal axis and the monitoring data as a vertical axis according to the monitoring database and acquiring a real-time monitoring curve;
a threshold determination unit: the monitoring threshold value is used for acquiring monitoring data according to the real-time monitoring curve and a preset monitoring constraint condition;
a threshold value judging unit: acquiring target monitoring data, and judging whether the target monitoring data is abnormal or not according to the monitoring threshold;
if the target monitoring data curve is normal, updating the monitoring data curve to obtain a target monitoring data curve;
if the monitoring threshold value is exceeded, triggering a judgment event;
a judgment result unit: the device is used for generating a judgment result according to the judgment event;
generating a data unit: and generating judgment data according to the judgment result.
As an embodiment of the present invention, the feedback module includes:
a correspondence relationship generation unit: storing the judgment data, searching the server data corresponding to the judgment data, and generating and acquiring a corresponding relation;
a chart production unit: generating data monitoring information according to the server database and the judgment data through the corresponding relation;
a feedback unit: and generating a chart according to the data monitoring information and feeding back the data monitoring information to a client.
The invention has the beneficial effects that: the invention realizes real-time monitoring and real-time active data transmission and updating in the server diagnosis process through the WebSocket mechanism, actively acquires server information in time and refreshes the state of each server in real time when the database information of each server changes, and visually presents the server information to an engineer through a chart to realize real-time monitoring of each diagnosis server.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart of a method for monitoring real-time data based on a WebSocket protocol in an embodiment of the present invention;
fig. 2 is a system composition diagram of real-time data monitoring based on a WebSocket protocol in the embodiment of the present invention;
fig. 3 is a monitoring flow chart of a WebSocket protocol-based real-time data monitoring method in the embodiment of the present invention;
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example 1:
as shown in fig. 1 and fig. 3, a flow chart of a real-time data monitoring method based on a WebSocket protocol of the present invention includes the following steps:
step 101: acquiring server data of a factory assembly server, and binding the server data to a preset storage database;
step 102: the server data monitoring method comprises the steps that a WebSocket protocol is arranged in a WebSocket monitoring system, the WebSocket monitoring system is used for monitoring server data, and monitoring results are generated;
step 103: judging whether the server data has abnormal conditions or not through the WebSocket monitoring system according to the monitoring result, and generating judgment data;
step 104: and determining data monitoring information according to the judgment data, and feeding back the data monitoring information to the client.
The principle of the invention is as follows: the method comprises the steps that a server is assembled in a factory and information is scanned into a database, the server is powered on and started, PXE starts to enter a diagnosis system, the server self-checks through the diagnosis system and reports information such as IP, a diagnosis stage and a diagnosis result to the database, the system monitors the operation condition of each server based on WebSocket mechanism codes, WebSocket enables data exchange between a client and the server to be simpler, the server is allowed to actively push data to the client, and when the database information of each server changes, the WebSocket system actively acquires the server information and refreshes the state of each server in real time, and real-time monitoring of the server is achieved.
The invention has the beneficial effects that: based on a WebSocket monitoring system, the diagnosis automation, the efficiency and the coverage rate of products are improved, when the database information of each server changes, the server information is actively acquired in time, the state of each server is refreshed in real time, and the server information is visually presented to an engineer through a chart, so that the real-time monitoring of each diagnosis server is realized.
Example 2:
as an embodiment of the present invention, the acquiring server data of a factory assembly server, and binding the server data to a preset storage database includes:
scanning original data by using the factory assembly server, wherein a PXE system and a diagnostic data system are preset in the factory assembly server; wherein,
the PXE system is used for acquiring the Mac address of the original data, dynamically distributing an IP address to the original data according to the Mac address and determining the IP of the original data;
the diagnostic data system is used for diagnosing the original data, determining a diagnostic stage and generating a diagnostic result;
generating server data according to the original data, the original data IP, the diagnosis stage and the diagnosis result;
and binding the server data to a preset storage database.
The principle of the invention is as follows: the PXE system is used for determining an original data IP (Internet protocol) by acquiring an original data Mac (machine-aided discovery) address and dynamically allocating an IP address to the original data according to the Mac address, and binding server data to a preset storage database, and the diagnosis data system is used for diagnosing the original data, determining a diagnosis stage and generating a diagnosis result to prepare for a monitoring module.
The invention has the beneficial effects that: the Mac address is the only address of the data, the IP address is allocated according to the MAC geology, the data is bound according to the IP address, the repeatability of the data is avoided, the error of the data is reduced, the fault tolerance rate is improved, the fault tolerance rate of the data is improved through the diagnosis of the data by the diagnosis system, and the expandability, stability and instantaneity of the system are improved.
Example 3:
as an embodiment of the present invention, the WebSocket-based monitoring system is internally provided with a WebSocket protocol, and monitors the server data according to the WebSocket monitoring system to generate a monitoring result, including:
according to the WebSocket protocol, a monitoring path of the factory assembly server and the server database is established;
the server database transmits a data monitoring request to the factory assembly server, and is connected with the monitoring access according to the monitoring request;
determining a monitoring data trigger event according to the monitoring path; wherein,
when the factory assembly server receives the server data transmitted by the server database for the first time, the monitoring data trigger event is started, and a trigger mechanism is determined;
automatically transmitting the server data to the factory assembly server through the server database according to the trigger mechanism;
and monitoring the server data according to the trigger mechanism and the Websocket monitoring system to generate a monitoring result.
The principle of the invention is as follows: WebSocket is a protocol for full-duplex communication on a single TCP connection, and makes data exchange between a client and a server simpler, and allows the server to actively push data to the client. In the WebSocket protocol, the browser and the server only need to complete one handshake, and persistent connection can be directly established between the browser and the server, and bidirectional data transmission is carried out.
The invention has the beneficial effects that: the method realizes real-time monitoring and real-time active data transmission and updating in the server diagnosis process through a WebSocket mechanism, saves resources compared with a polling mechanism, does not need frequent requests, improves the expandability, stability and instantaneity of the system, greatly saves bandwidth and reduces expenses.
Example 4:
as an embodiment of the present invention, according to the monitoring result, determining, by the WebSocket monitoring system, whether the server data is abnormal, and generating determination data includes:
determining monitoring data according to the monitoring result, uploading the monitoring data to the storage database, and generating a monitoring database;
generating a real-time monitoring coordinate axis which takes time as a horizontal axis and the monitoring data as a vertical axis according to the monitoring database, and acquiring a real-time monitoring curve;
setting a monitoring threshold value of monitoring data according to the real-time monitoring curve;
acquiring target monitoring data, and judging whether the target monitoring data is abnormal or not according to the monitoring threshold;
if the target monitoring data curve is normal, updating the monitoring data curve to obtain a target monitoring data curve;
if the monitoring threshold value is exceeded, triggering a judgment event to generate a judgment result;
and generating judgment data according to the judgment result.
The principle of the invention is as follows: the method comprises the steps of judging whether newly received target monitoring data are abnormal or not by setting a monitoring threshold, monitoring the operation condition of each server through codes realized by a WebSocket mechanism, actively acquiring server information in time and refreshing the state of each server in real time when database information of each server changes, triggering a judgment event if the database information of each server exceeds the monitoring threshold, generating a judgment result, generating judgment data according to the judgment result, and checking the monitoring data more observably through a monitoring data curve.
The invention has the beneficial effects that: the method for monitoring the real-time data based on the WebSocket server realizes the real-time data monitoring in the batch production process of the server through WebSocket mechanism codes, improves the expandability, the stability and the real-time performance of a monitoring system, greatly saves the bandwidth, reduces the overhead, generates judgment data according to the judgment result, and inspects the monitoring data more observably through a monitoring data curve.
Example 5:
as an embodiment of the present invention, the determining data monitoring information according to the determination data, generating a chart, and feeding back the data monitoring information to a client includes:
storing the judgment data, searching the server data corresponding to the judgment data, generating a corresponding relation, and acquiring the corresponding relation;
generating data monitoring information according to the server database and the judgment data through the corresponding relation;
and generating a chart according to the data monitoring information and feeding back the data monitoring information to a client.
The principle of the invention is as follows: the method comprises the steps of storing judgment data, searching server data corresponding to the judgment data, obtaining the corresponding relation, generating data monitoring information through the corresponding relation, generating a chart according to the data monitoring information, feeding back the data monitoring information to a client, monitoring the operation condition of each server by the system based on WebSocket mechanism codes, obtaining server information and refreshing the state of each server in real time when the database information of each server changes, and achieving real-time monitoring of the servers.
The invention has the beneficial effects that: based on a WebSocket monitoring system, the diagnosis automation, the efficiency and the coverage rate of products are improved, when the database information of each server changes, the server information is actively acquired in time, the state of each server is refreshed in real time, and the server information is visually presented to an engineer through a chart, so that the real-time monitoring of each diagnosis server is realized.
Example 6:
a real-time data monitoring system based on a WebSocket protocol is characterized by comprising:
an acquisition module: the system comprises a server data acquisition module, a data storage module and a data processing module, wherein the server data acquisition module is used for acquiring server data of a factory assembly server and binding the server data to a preset storage database;
a monitoring module: monitoring the server data according to the WebSocket monitoring system based on a WebSocket protocol of the WebSocket monitoring system, and generating a monitoring result;
a judging module: according to the monitoring result, the WebSocket monitoring system judges whether the server data has abnormal conditions or not and generates judgment data;
a feedback module: and determining data monitoring information according to the judgment data, generating a chart and feeding back the data monitoring information to the client.
The principle of the invention is as follows: the acquisition module binds the server data into a preset storage database, the monitoring module monitors the server data according to the WebSocket monitoring system and generates a monitoring result, the judgment module judges whether the server data has abnormal conditions or not and generates judgment data, the feedback module generates a chart and feeds back the data monitoring information to the client, a factory assembles the server and scans the information to the database, the server is powered on, PXE is started to enter the diagnostic system, the server self-checks and reports information such as IP, a diagnostic stage, a diagnostic result and the like to the database through the diagnostic system, the system monitors the operation condition of each server based on WebSocket mechanism codes, WebSocket enables data exchange between the client and the server to be simpler, and allows the server to actively push data to the client, when the database information of each server changes, the WebSocket system actively acquires the server information and refreshes the state of each server in real time, so that the server is monitored in real time.
The invention has the beneficial effects that: in the mass production of products such as PC/server, the requirements for the automation of diagnosis, efficiency and coverage of the products are extremely high. For real-time data monitoring in the server batch production process, a passive polling mechanism (for example, setting to request data once every 5 seconds) is generally adopted, which not only occupies a large amount of bandwidth to cause a plurality of invalid requests, but also causes the server to have too much pressure.
Example 7:
as an embodiment of the present invention, the obtaining module is characterized by including:
a server unit: the system comprises a factory assembly server and a peripheral component interconnect (PXE) server, wherein the factory assembly server is used for scanning original data and is preset with the PXE system and a diagnostic data system; wherein,
the PXE system is used for acquiring the Mac address of the original data, dynamically distributing an IP address to the original data according to the Mac address and determining the IP of the original data;
the diagnostic data system is used for diagnosing the original data, determining a diagnostic stage and generating a diagnostic result;
a server data generation unit: generating server data according to the original data, the original data IP, the diagnosis stage and the diagnosis result;
a binding unit: and binding the server data to a preset storage database.
The principle of the invention is as follows: WebSocket is a protocol for full-duplex communication on a single TCP connection, and makes data exchange between a client and a server simpler, and allows the server to actively push data to the client. In the WebSocket protocol, the browser and the server only need to complete one handshake, and persistent connection can be directly established between the browser and the server, and bidirectional data transmission is carried out.
The invention has the beneficial effects that: the method realizes real-time monitoring and real-time active data transmission and updating in the server diagnosis process through a WebSocket mechanism, saves resources compared with a polling mechanism, does not need frequent requests, improves the expandability, stability and instantaneity of the system, greatly saves bandwidth and reduces expenses.
Example 8:
as an embodiment of the present invention, the monitoring module includes:
a listening path unit: a monitoring path used for establishing the factory assembly server and the server database according to the WebSocket protocol;
the server database transmits a data monitoring request to the factory assembly server, and is connected with the monitoring access according to the monitoring request;
a trigger event unit: the monitoring device is used for determining a monitoring data trigger event according to the monitoring access; wherein,
when the factory assembly server receives the server data transmitted by the server database for the first time, the monitoring data trigger event is started, and a trigger mechanism is determined;
a transmission unit: the server database is used for automatically transmitting the server data to the factory assembly server according to the trigger mechanism;
a monitoring result unit: and the Websocket monitoring system is used for monitoring the server data according to the trigger mechanism and the Websocket monitoring system to generate a monitoring result.
The principle of the invention is as follows: the monitoring module is provided with a monitoring access unit, a trigger event unit, a transmission unit and a monitoring result unit for data monitoring, the Websocket is a protocol for full-duplex communication on a single TCP connection, the Websocket enables data exchange between the client and the server to be simpler, and the server is allowed to actively push data to the client. In the WebSocket protocol, the browser and the server only need to complete one handshake, and persistent connection can be directly established between the browser and the server, and bidirectional data transmission is carried out.
The invention has the beneficial effects that: the method realizes real-time monitoring and real-time active data transmission and updating in the server diagnosis process through a WebSocket mechanism, saves resources compared with a polling mechanism, does not need frequent requests, improves the expandability, stability and instantaneity of the system, greatly saves bandwidth and reduces expenses.
Example 9:
as an embodiment of the present invention, the determining module includes:
a monitoring data processing unit: the monitoring data is determined according to the monitoring result, uploaded to the storage database and generated into a monitoring database;
a monitoring curve generation unit: the real-time monitoring system is used for generating a real-time monitoring coordinate axis which takes time as a horizontal axis and the monitoring data as a vertical axis according to the monitoring database and acquiring a real-time monitoring curve;
a threshold determination unit: the monitoring threshold value is used for acquiring monitoring data according to the real-time monitoring curve and a preset monitoring constraint condition;
a threshold value judging unit: acquiring target monitoring data, and judging whether the target monitoring data is abnormal or not according to the monitoring threshold;
if the target monitoring data curve is normal, updating the monitoring data curve to obtain a target monitoring data curve;
if the monitoring threshold value is exceeded, triggering a judgment event;
a judgment result unit: the device is used for generating a judgment result according to the judgment event;
generating a data unit: and generating judgment data according to the judgment result.
The principle of the invention is as follows: the judging module is provided with a monitoring data processing unit, a monitoring curve generating unit, a threshold determining unit, a threshold judging unit, a judging result unit and a data generating unit, whether newly received target monitoring data are abnormal is judged according to the set monitoring threshold, the running condition of each server is monitored through codes realized by a WebSocket mechanism, when the database information of each server changes, the server information is actively acquired in time, the state of each server is refreshed in real time, if the monitoring threshold is exceeded, a judging event is triggered, a judging result is generated, judging data is generated according to the judging result, and the monitoring data is more observably checked through a monitoring data curve.
The invention has the beneficial effects that: the method for monitoring the real-time data based on the WebSocket server realizes the real-time data monitoring in the batch production process of the server through WebSocket mechanism codes, improves the expandability, the stability and the real-time performance of a monitoring system, greatly saves the bandwidth, reduces the overhead, generates judgment data according to the judgment result, and inspects the monitoring data more observably through a monitoring data curve.
Example 10:
as an embodiment of the present invention, the feedback module includes:
a correspondence relationship generation unit: storing the judgment data, searching the server data corresponding to the judgment data, and generating and acquiring a corresponding relation;
a chart production unit: generating data monitoring information according to the server database and the judgment data through the corresponding relation;
a feedback unit: and generating a chart according to the data monitoring information and feeding back the data monitoring information to a client.
The principle of the invention is as follows: the method comprises the steps of setting a corresponding relation generating unit, a chart producing unit and a feedback unit in a feedback model to store judgment data, searching server data corresponding to the judgment data, obtaining the corresponding relation, generating data monitoring information through the corresponding relation, generating a chart according to the data monitoring information, feeding back the data monitoring information to a client, monitoring the operation condition of each server by the system based on WebSocket mechanism codes, obtaining server information and refreshing the state of each server in real time when database information of each server changes, and achieving real-time monitoring of the servers.
The invention has the beneficial effects that: based on a WebSocket monitoring system, the diagnosis automation, the efficiency and the coverage rate of products are improved, when the database information of each server changes, the server information is actively acquired in time, the state of each server is refreshed in real time, and the server information is visually presented to an engineer through a chart, so that the real-time monitoring of each diagnosis server is realized.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A real-time data monitoring method based on a WebSocket protocol is characterized by comprising the following steps:
acquiring server data of a factory assembly server, and binding the server data to a preset storage database;
monitoring the server data according to the WebSocket monitoring system based on a WebSocket protocol of the WebSocket monitoring system, and generating a monitoring result;
judging whether the server data has abnormal conditions or not through the WebSocket monitoring system according to the monitoring result, and generating judgment data;
and determining data monitoring information according to the judgment data, generating a chart and feeding back the data monitoring information to the client.
2. The method for real-time data monitoring based on the WebSocket protocol as claimed in claim 1, wherein the obtaining server data of a factory assembly server and binding the server data to a preset storage database comprises:
scanning original data by using the factory assembly server, wherein a PXE system and a diagnostic data system are preset in the factory assembly server; wherein,
the PXE system is used for acquiring the Mac address of the original data, dynamically distributing an IP address to the original data according to the Mac address and determining the IP of the original data;
the diagnostic data system is used for diagnosing the original data, determining a diagnostic stage and generating a diagnostic result;
generating server data according to the original data, the original data IP, the diagnosis stage and the diagnosis result;
and binding the server data to a preset storage database.
3. The method for monitoring the real-time data based on the WebSocket protocol as claimed in claim 2, wherein the WebSocket-based monitoring system is internally provided with a WebSocket protocol, and the method for monitoring the server data and generating the monitoring result according to the WebSocket monitoring system comprises:
according to the WebSocket protocol, a monitoring path of the factory assembly server and the server database is established;
the server database transmits a data monitoring request to the factory assembly server, and is connected with the monitoring access according to the monitoring request;
determining a monitoring data trigger event according to the monitoring path; wherein,
when the factory assembly server receives the server data transmitted by the server database for the first time, the monitoring data trigger event is started, and a trigger mechanism is determined;
automatically transmitting the server data to the factory assembly server through the server database according to the trigger mechanism;
and monitoring the server data according to the trigger mechanism and the Websocket monitoring system to generate a monitoring result.
4. The method for monitoring the real-time data based on the WebSocket protocol as claimed in claim 2, wherein the step of judging whether the server data is abnormal or not through the WebSocket monitoring system according to the monitoring result to generate judgment data comprises the steps of:
determining monitoring data according to the monitoring result, uploading the monitoring data to the storage database, and generating a monitoring database;
generating a real-time monitoring coordinate axis which takes time as a horizontal axis and the monitoring data as a vertical axis according to the monitoring database, and acquiring a real-time monitoring curve;
setting a monitoring threshold value of monitoring data according to the real-time monitoring curve;
acquiring target monitoring data, and judging whether the target monitoring data is abnormal or not according to the monitoring threshold;
if the target monitoring data curve is normal, updating the monitoring data curve to obtain a target monitoring data curve;
if the monitoring threshold value is exceeded, triggering a judgment event to generate a judgment result;
and generating judgment data according to the judgment result.
5. The method for real-time data monitoring based on the WebSocket protocol as claimed in claim 1, wherein the determining data monitoring information according to the judgment data, generating a chart and feeding back the data monitoring information to a client comprises:
storing the judgment data, searching the server data corresponding to the judgment data, generating a corresponding relation, and acquiring the corresponding relation;
generating data monitoring information according to the server database and the judgment data through the corresponding relation;
and generating a chart according to the data monitoring information and feeding back the data monitoring information to a client.
6. The system for real-time data monitoring based on the WebSocket protocol as claimed in claim 1, comprising:
an acquisition unit: the system comprises a server data acquisition module, a data storage module and a data processing module, wherein the server data acquisition module is used for acquiring server data of a factory assembly server and binding the server data to a preset storage database;
a monitoring unit: monitoring the server data according to the WebSocket monitoring system based on a WebSocket protocol of the WebSocket monitoring system, and generating a monitoring result;
a judging unit: according to the monitoring result, the WebSocket monitoring system judges whether the server data has abnormal conditions or not and generates judgment data;
a feedback unit: and determining data monitoring information according to the judgment data, generating a chart and feeding back the data monitoring information to the client.
7. The system for real-time data monitoring based on the WebSocket protocol as claimed in claim 6, wherein the obtaining module comprises:
a server unit: the system comprises a factory assembly server and a peripheral component interconnect (PXE) server, wherein the factory assembly server is used for scanning original data and is preset with the PXE system and a diagnostic data system; wherein,
the PXE system is used for acquiring the Mac address of the original data, dynamically distributing an IP address to the original data according to the Mac address and determining the IP of the original data;
the diagnostic data system is used for diagnosing the original data, determining a diagnostic stage and generating a diagnostic result;
a server data generation unit: generating server data according to the original data, the original data IP, the diagnosis stage and the diagnosis result;
a binding unit: and binding the server data to a preset storage database.
8. The system of claim 6, wherein the monitoring module comprises:
a listening path unit: a monitoring path used for establishing the factory assembly server and the server database according to the WebSocket protocol;
the server database transmits a data monitoring request to the factory assembly server, and is connected with the monitoring access according to the monitoring request;
a trigger event unit: the monitoring device is used for determining a monitoring data trigger event according to the monitoring access; wherein,
when the factory assembly server receives the server data transmitted by the server database for the first time, the monitoring data trigger event is started, and a trigger mechanism is determined;
a transmission unit: the server database is used for automatically transmitting the server data to the factory assembly server according to the trigger mechanism;
a monitoring result unit: and the Websocket monitoring system is used for monitoring the server data according to the trigger mechanism and the Websocket monitoring system to generate a monitoring result.
9. The system of claim 6, wherein the determining module comprises:
a monitoring data processing unit: the monitoring data is determined according to the monitoring result, uploaded to the storage database and generated into a monitoring database;
a monitoring curve generation unit: the real-time monitoring system is used for generating a real-time monitoring coordinate axis which takes time as a horizontal axis and the monitoring data as a vertical axis according to the monitoring database and acquiring a real-time monitoring curve;
a threshold determination unit: the monitoring threshold value is used for acquiring monitoring data according to the real-time monitoring curve and a preset monitoring constraint condition;
a threshold value judging unit: acquiring target monitoring data, and judging whether the target monitoring data is abnormal or not according to the monitoring threshold;
if the target monitoring data curve is normal, updating the monitoring data curve to obtain a target monitoring data curve;
if the monitoring threshold value is exceeded, triggering a judgment event;
a judgment result unit: the device is used for generating a judgment result according to the judgment event;
generating a data unit: and generating judgment data according to the judgment result.
10. The system of claim 6, wherein the feedback module comprises:
a correspondence relationship generation unit: storing the judgment data, searching the server data corresponding to the judgment data, and generating and acquiring a corresponding relation;
a chart production unit: generating data monitoring information according to the server database and the judgment data through the corresponding relation;
a feedback unit: and generating a chart according to the data monitoring information and feeding back the data monitoring information to a client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011045960.1A CN112165414A (en) | 2020-09-28 | 2020-09-28 | WebSocket protocol-based real-time data monitoring method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011045960.1A CN112165414A (en) | 2020-09-28 | 2020-09-28 | WebSocket protocol-based real-time data monitoring method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112165414A true CN112165414A (en) | 2021-01-01 |
Family
ID=73861954
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011045960.1A Pending CN112165414A (en) | 2020-09-28 | 2020-09-28 | WebSocket protocol-based real-time data monitoring method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112165414A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050149601A1 (en) * | 2003-12-17 | 2005-07-07 | International Business Machines Corporation | Method, system and computer program product for real-time data integrity verification |
CN101453743A (en) * | 2008-10-31 | 2009-06-10 | 中国移动通信集团北京有限公司 | Real-time monitoring system, apparatus and method |
CN110636088A (en) * | 2018-06-21 | 2019-12-31 | 视联动力信息技术股份有限公司 | Data monitoring method, data transmission method, device and equipment based on video link |
-
2020
- 2020-09-28 CN CN202011045960.1A patent/CN112165414A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050149601A1 (en) * | 2003-12-17 | 2005-07-07 | International Business Machines Corporation | Method, system and computer program product for real-time data integrity verification |
CN101453743A (en) * | 2008-10-31 | 2009-06-10 | 中国移动通信集团北京有限公司 | Real-time monitoring system, apparatus and method |
CN110636088A (en) * | 2018-06-21 | 2019-12-31 | 视联动力信息技术股份有限公司 | Data monitoring method, data transmission method, device and equipment based on video link |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3229420A1 (en) | Method for establishing persistent connection between multiple smart devices and server, and smart device | |
CN110049014B (en) | OpenAPI conversion system and method based on multiple Modbus bus protocols | |
CN102385582B (en) | Production test data processing method, server and system | |
US7613801B2 (en) | System and method for monitoring server performance using a server | |
CN109561159B (en) | Data processing method and system based on Websocket long connection | |
CN112947372A (en) | Remote diagnosis method based on active reporting of fault codes | |
CN1606282A (en) | Home appliance network system and method for operating the same | |
US11063855B2 (en) | Monitoring of the data transmission in a client/server-based device access system | |
CN111711533B (en) | Fault diagnosis method, fault diagnosis device, electronic device and storage medium | |
CN117729239A (en) | Automatic equipment registration and data communication protocol for Internet of things center | |
CN114401284A (en) | Real-time data acquisition and transmission system and method for fixed pollution source control conditions | |
CN110969740A (en) | Access method of access control management system to different types of access control equipment and access control system | |
CN111427703A (en) | Industrial data real-time display method and system | |
CN112165414A (en) | WebSocket protocol-based real-time data monitoring method and system | |
CN104270432A (en) | Real-time data service system and data interaction method based on drilling industry | |
US20090238081A1 (en) | Network management system, data acquisition apparatus, and method for checking operating conditions of nodes | |
CN115242873B (en) | Message response method and device for PCB (printed circuit board) equipment, computer equipment and storage medium | |
CN117118821A (en) | Multi-data source management method based on client-server mode | |
CN111107080B (en) | Error information push method, device, device and readable storage medium | |
CN110958148B (en) | Deployment system of distributed access equipment | |
CN113645108B (en) | Intelligent household equipment monitoring system and method | |
CN110492963A (en) | A kind of wind power plant time synchronization system | |
CN114050969B (en) | Low-bandwidth remote monitoring system | |
CN110380928A (en) | A kind of the host monitoring and managing method and device of monitoring system | |
CN217900285U (en) | Freezer remote monitoring device system |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210101 |