CN115051978B - Equipment monitoring implementation method and system - Google Patents

Equipment monitoring implementation method and system Download PDF

Info

Publication number
CN115051978B
CN115051978B CN202210971143.1A CN202210971143A CN115051978B CN 115051978 B CN115051978 B CN 115051978B CN 202210971143 A CN202210971143 A CN 202210971143A CN 115051978 B CN115051978 B CN 115051978B
Authority
CN
China
Prior art keywords
node
information
target
subscription information
equipment
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.)
Active
Application number
CN202210971143.1A
Other languages
Chinese (zh)
Other versions
CN115051978A (en
Inventor
董臣臣
孙大帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Cairi Energy Technology Co ltd
Original Assignee
Guangdong Cairi Energy Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Cairi Energy Technology Co ltd filed Critical Guangdong Cairi Energy Technology Co ltd
Priority to CN202210971143.1A priority Critical patent/CN115051978B/en
Publication of CN115051978A publication Critical patent/CN115051978A/en
Application granted granted Critical
Publication of CN115051978B publication Critical patent/CN115051978B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a method and a system for realizing equipment monitoring, wherein the method comprises the following steps: distributing subscription information which is sent by a terminal and used for monitoring target equipment to a target node in a WebSocket server cluster after load balancing processing, wherein the subscription information comprises an identifier of the target equipment; after receiving the subscription information, the target node establishes communication connection with the terminal, attaches a node identifier to the subscription information and then sends the subscription information to a configuration server for associated storage; the configuration server generates a corresponding update event based on the subscription information and the node identifier and sends the update event to the target device; and the target equipment downloads subscription information and the node identification from the configuration server for local associated storage based on the received update event, then sends equipment information which is specified to be monitored in the subscription information to the target node, and the equipment information is pushed to the terminal by the target node. According to the method and the device, the monitored equipment information can be accurately pushed to the terminal in an asynchronous pushing mode of the WebSocket server, and meanwhile, the consumption of service resources is reduced.

Description

Equipment monitoring implementation method and system
Technical Field
The present application relates to the field of energy storage device technologies, and in particular, to a device monitoring implementation method and system.
Background
At present, there are two schemes for acquiring upgrade progress data of an energy storage device:
scheme 1: acquiring the progress data of equipment upgrading in a polling mode requested by Http, namely, regularly requesting to acquire the progress data of the equipment upgrading in a timed task mode;
scheme 2: the method comprises the following steps of pushing progress data of equipment upgrading by a WebSocket server cluster based on MQ or Redis subscription, wherein the specific process comprises the following steps: and the standby upgrading module sends the upgrading progress to MQ or Redis, and the MQ or Redis pushes the upgrading progress to ensure that the upgrading progress can be simultaneously received by the application service, the application service pushes the upgrading progress according to the connected terminal, meanwhile, redis middleware is used for caching the information of the terminal connected with the application service, and a message distributor is invoked for message distribution.
For the scheme 1, http polling wastes CPU resources of terminals such as mobile phone APP or PC. Under the condition that the upgrading progress is slow, the upgrading progress data is not changed, the terminal needs to send requests frequently, and the redundant requests also need to be processed for the server, so that serious resource waste is caused.
For the above scheme 2, mq or Redis needs to push messages to all application services, and services that do not need the messages originally also need to be processed, which additionally increases system consumption and reduces system performance.
Disclosure of Invention
The application aims to provide a device monitoring implementation method and system, the problem of consumption of a large number of service resources caused by polling and acquiring device information by a node Http is solved in a WebSocket asynchronous pushing mode, the device information monitored is accurately pushed to a terminal device through local cache connection information (such as the node identifier) of a target device and subscription information, and the problem of extra resource overhead caused by the fact that the device information needs to be sent to a plurality of nodes in an MQ or Redis based implementation mode is solved.
In a first aspect, an embodiment of the present application provides a method for implementing device monitoring, where the method includes: distributing subscription information which is sent by a terminal and used for monitoring target equipment to target nodes in a WebSocket server cluster after load balancing processing, wherein the subscription information comprises identification of the target equipment; after receiving the subscription information, the target node establishes communication connection with the terminal, and sends the subscription information to a configuration server for associated storage after adding a node identifier; the configuration server generates a corresponding update event based on the subscription information and the node identifier and sends the update event to the target device; the target equipment downloads subscription information and node identification from a configuration server for local association storage based on the received update event, then sends equipment information which is specified to be monitored in the subscription information to the target node, and the equipment information is pushed to the terminal by the target node; the step of distributing the subscription information, which is sent by the terminal and used for monitoring the target device, to the target node in the WebSocket server cluster after load balancing processing includes: acquiring the connection number and weight respectively corresponding to each node in the WebSocket server cluster; the weight is used for representing the physical resource capacity of the node for processing the connection request; determining the most idle node in the WebSocket server cluster according to the connection number and the weight corresponding to each node; taking the most idle node as a target node, and distributing subscription information which is sent by a terminal and used for monitoring target equipment to the target node; the method for determining the most idle node in the WebSocket server cluster according to the connection number and the weight corresponding to each node comprises the following steps: calculating the physical resource capacity ratio of each node for processing the connection request according to the following formula:
Figure M_220810174358814_814933001
k=1,2...n
wherein the content of the first and second substances,
Figure M_220810174358846_846176001
is shown as
Figure M_220810174358877_877429002
Physical resource capacity ratio of processing connection request corresponding to each node;
Figure M_220810174358908_908669003
is shown as
Figure M_220810174358924_924309004
The number of connections corresponding to each node;nrepresenting the total number of nodes in the WebSocket server cluster;
Figure M_220810174358941_941857005
denotes the first
Figure M_220810174358973_973636006
The number of connections corresponding to each node;
Figure M_220810174358989_989280007
is shown as
Figure M_220810174359020_020500008
The weight corresponding to each node;
and taking the node with the largest physical resource capacity for processing the connection request as the most idle node in the WebSocket server cluster.
In a preferred embodiment of the present application, the step of sending, by the target device, the device information specified to be monitored in the subscription information to the target node after downloading the subscription information and the node identifier from the configuration server for local associated storage based on the received update event includes: the target equipment repeatedly sends equipment information which is specified to be monitored in the subscription information to the target node according to a preset time period; or when detecting that the variation of the device information which is specified to be monitored in the subscription information reaches a specified value, the target device sends the device information to the target node.
In a preferred embodiment of the present application, the configuration server generates a corresponding update event based on the subscription information and the node identifier, and sends the update event to the target device, and meanwhile, sends the update event to the gateway.
In a preferred embodiment of the present application, the method further includes: the method comprises the steps that a configuration server receives health condition information reported by nodes in a WebSocket server cluster at intervals of designated time; and if detecting that nodes which do not report information for more than preset time exist in the WebSocket server cluster, clearing the information of the nodes, and sending node change events to the gateway and the target equipment.
In a preferred embodiment of the present application, before the step of clearing the information of the node, the method further includes: and judging whether more than a specified number of nodes without reported information exist in the WebSocket server cluster, and if not, continuing to execute the step of clearing the information of the nodes.
In a preferred embodiment of the present application, the specifying information of the device to be monitored in the subscription information includes: and equipment upgrading progress information.
In a preferred embodiment of the present application, the target device includes: light stores up all-in-one.
In a second aspect, an embodiment of the present application further provides an apparatus monitoring implementation system, where the system includes a terminal, a gateway, a WebSocket server cluster, a configuration server, and multiple apparatuses; the terminal is used for sending subscription information for monitoring the target equipment to the gateway; the subscription information includes an identification of the target device; the gateway is used for distributing the subscription information to a target node in the WebSocket server cluster after load balancing processing; the target node is used for establishing communication connection with the terminal after receiving the subscription information, and sending the subscription information to the configuration server for associated storage after adding the node identifier; the configuration server is used for generating a corresponding updating event based on the subscription information and the node identification and sending the updating event to the target equipment; the target device is used for downloading subscription information and the node identification from the configuration server for local associated storage based on the received update event, then sending device information which is specified to be monitored in the subscription information to the target node, and pushing the device information to the terminal by the target node.
In the method and system for realizing device monitoring provided by the embodiment of the application, subscription information which is sent by a terminal and used for monitoring a target device is distributed to a target node in a WebSocket server cluster after load balancing, wherein the subscription information comprises an identifier of the target device; then the target node establishes communication connection with the terminal after receiving the subscription information, and sends the subscription information with the node identification to a configuration server for associated storage; the configuration server generates a corresponding update event based on the subscription information and the node identifier and sends the update event to the target device; finally, the target device downloads subscription information and node identification from the configuration server for local associated storage based on the received update event, and then sends the device information which is specified to be monitored in the subscription information to the target node, and the device information is pushed to the terminal by the target node; the step of distributing the subscription information for monitoring the target device sent by the terminal to the target node in the WebSocket server cluster after the load balancing processing includes: acquiring the connection number and weight respectively corresponding to each node in the WebSocket server cluster; the weight is used for representing the physical resource capacity of the node for processing the connection request; determining the most idle node in the WebSocket server cluster according to the connection number and the weight corresponding to each node; taking the most idle node as a target node, and distributing subscription information which is sent by a terminal and used for monitoring target equipment to the target node; the method comprises the following steps of determining the most idle node in the WebSocket server cluster according to the connection number and the weight corresponding to each node, wherein the steps comprise: calculating the physical resource capacity ratio of each node for processing the connection request according to the following formula:
Figure M_220810174359051_051755001
k=1,2...n
wherein the content of the first and second substances,
Figure M_220810174359083_083019001
is shown as
Figure M_220810174359114_114234002
Physical resource capacity ratio of processing connection request corresponding to each node;
Figure M_220810174359131_131292003
is shown as
Figure M_220810174359147_147452004
The number of connections corresponding to each node;nrepresenting the total number of nodes in the WebSocket server cluster;
Figure M_220810174359178_178702005
is shown as
Figure M_220810174359194_194330006
The number of connections corresponding to each node;
Figure M_220810174359225_225567007
is shown as
Figure M_220810174359256_256828008
The weight corresponding to each node;
and taking the node with the largest physical resource capacity ratio for processing the connection request as the most idle node in the WebSocket server cluster. In the embodiment of the application, the problem that a large amount of service resources are consumed due to the fact that the node Http polls to acquire the device information is solved in a WebSocket asynchronous pushing mode, the device information monitored is accurately pushed to the terminal device through the local cache connection information (such as the node identifier) of the target device and the subscription information, and the problem of extra resource overhead caused by the fact that the device information needs to be sent to a plurality of nodes in an MQ or Redis based implementation mode is solved.
Drawings
In order to more clearly illustrate the detailed description of the present application or the technical solutions in the prior art, the drawings needed to be used in the detailed description of the present application or the prior art description will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a block diagram of a device monitoring implementation system according to an embodiment of the present disclosure;
fig. 2 is a flowchart of an implementation method for monitoring equipment according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a load balancing process in an apparatus monitoring implementation method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another device monitoring implementation method provided in the embodiment of the present application.
Detailed Description
The technical solutions of the present application will be described clearly and completely with reference to the following embodiments, and it should be apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In the prior art, there are two general ways for acquiring upgrade progress data of an energy storage device: (1) Acquiring progress data of equipment upgrading in a Http request polling mode; (2) And pushing the progress data of the equipment upgrading by the WebSocket server cluster based on MQ or Redis subscription.
In the first mode, the terminal requests to acquire the upgrade progress data of the device in a timing task mode, and Http polling wastes the CPU resource of the terminal. Under the condition that the upgrading progress is slow, the upgrading progress data is not changed, the terminal needs to send requests frequently, and the redundant requests also need to be processed for the server, so that serious resource waste is caused.
In the second mode, the device upgrading module sends the upgrading progress to MQ or Redis, and the MQ or Redis pushes the upgrading progress to ensure that the upgrading progress can be received by the application service at the same time, the application service pushes the upgrading progress according to the connected terminal, meanwhile, redis middleware is used for caching information of the terminal connected with the application service, and a message distributor is invoked for message distribution. Since MQ or Redis needs to be pushed to all application services, services that do not otherwise need the message also need to be processed, which additionally increases system consumption and reduces system performance.
Based on this, embodiments of the present application provide a device monitoring implementation method and system, which solve the problem of consuming a large amount of service resources caused by node Http polling to obtain device information in a WebSocket asynchronous push manner, and implement accurate push of the monitored device information to a terminal device by using local cache connection information (such as the above node identifier) of a target device and subscription information, so as to solve the problem of additional resource overhead caused by the need to send the device information to multiple nodes in an MQ or Redis-based implementation manner.
For the convenience of understanding the present embodiment, a detailed description will be first given of a device monitoring implementation system disclosed in the embodiments of the present application.
The embodiment of the application provides a system for realizing equipment monitoring, which comprises a terminal, a gateway, a WebSocket server cluster, a configuration server and equipment. The terminal can be a mobile phone, an iPad or a computer, and the number of the terminals and the number of the devices can be multiple. The device may be a light storage all-in-one machine or other device that needs to be monitored by the terminal, and the specific device information that needs to be monitored includes: device upgrade progress information or other device related information. The terminal can establish connection with a certain server in the WebSocket server cluster through the gateway, and the server can send information to the equipment through the configuration server. In a specific implementation, when a certain terminal wants to acquire device information of a certain device or certain devices, the functions of the following hardware can be matched to realize the functions.
The terminal is used for sending subscription information for monitoring the target equipment to the gateway; the subscription information includes an identification of the target device. For example, the system includes a plurality of terminals A1, A2, A3, etc.; the nodes in the WebSocket server cluster comprise a plurality of servers such as B1, B2 and B3; the equipment comprises a plurality of equipment such as C1, C2, C3 and the like; when the terminal A1 wants to monitor the device information of the devices C1 and C3, it sends a subscription information to the gateway, where the subscription information includes the identifiers of the devices C1 and C3.
The gateway is used for distributing the subscription information to a target node in the WebSocket server cluster after load balancing processing; the specific load balancing processing manner is described in the following method embodiment. For example, after the gateway performs load balancing, the gateway sends the subscription information sent by the terminal A1 to the target node B2 in the cluster.
The target node is used for establishing communication connection with the terminal after receiving the subscription information, and sending the subscription information to the configuration server for associated storage after attaching the node identifier; the target node B2 establishes communication connection with the terminal A1 after receiving the subscription information, and then sends the subscription information with node identification, such as node B2 identification, to the configuration server, and the configuration server stores the received subscription information and node identification in association.
The configuration server is used for generating a corresponding updating event based on the subscription information and the node identification and sending the updating event to the target equipment; the configuration server also generates a corresponding update event while storing the subscription information and the node identifier in association, and then sends the update event to the target device, that is, the device C1, C3 that the terminal A1 wants to monitor.
The target device is used for downloading subscription information and the node identification from the configuration server for local association storage based on the received update event, then sending the device information which is specified to be monitored in the subscription information to the target node, and pushing the device information to the terminal by the target node. After receiving the update event, the target devices C1 and C3 download the subscription information and the node B2 identifier from the configuration server, respectively send the corresponding device information to the target node B2, and then push the device information to the terminal A1 through the target node B2.
The subscription information specifies information of the device to be monitored, and may include information of upgrade progress of the device, work information of the device, and the like, which are required to be monitored by other devices; the device can be an optical storage all-in-one machine or other devices needing to be monitored by the terminal.
According to the device monitoring implementation system provided by the embodiment of the application, the target device downloads the subscription information and the node information from the configuration server, so that asynchronous and accurate pushing of the node server in the WebSocket server cluster is achieved, and the resource consumption of the system is reduced.
Based on the foregoing system embodiment, an apparatus monitoring implementation method is further provided in the embodiments of the present application, and fig. 2 is a flowchart of the apparatus monitoring implementation method provided in the embodiments of the present application, where the method specifically includes the following steps:
step S202, subscription information which is sent by the terminal and used for monitoring the target device is distributed to the target node in the WebSocket server cluster after load balancing processing, and the subscription information comprises the identification of the target device.
The step includes two actions, one is that the terminal sends subscription information to the gateway, and the other is that the gateway distributes the subscription information to a target node in the cluster after load balancing processing. The terminal sends subscription information to the gateway, if so, the gateway is requested to perform Websocket connection, the gateway performs scheduling according to the connection number of each node in the Websocket server cluster and the weight of each node, and a specific scheduling algorithm may be: and selecting the most idle node as the currently requested connecting node. For example, when the terminal A1 wants to monitor the device information of the devices C1 and C3, it sends a subscription information to the gateway, where the subscription information includes the identifiers of the devices C1 and C3. After the gateway performs load balancing processing, the gateway determines the most idle target node B2 in the cluster, and sends the subscription information sent by the terminal A1 to the target node B2 respectively.
And step S204, after receiving the subscription information, the target node establishes communication connection with the terminal, attaches the node identification to the subscription information and then sends the subscription information to the configuration server for associated storage.
Also explained by the foregoing example, the target node B2 establishes a communication connection with the terminal A1 after receiving the subscription information, and then sends the subscription information together with a node identifier, such as a node B2 identifier, to the configuration server, and the configuration server stores the received subscription information and the node identifier in association.
In step S206, the configuration server generates a corresponding update event based on the subscription information and the node identifier, and sends the update event to the target device.
The configuration server stores the subscription information and the node identifier in association with each other, and generates a corresponding update event, and then sends the update event to the target device, that is, the devices C1 and C3 that the terminal A1 wants to monitor.
Step S208, the target device downloads subscription information and node identification from the configuration server for local association storage based on the received update event, and then sends the device information specified to be monitored in the subscription information to the target node, and the device information is pushed to the terminal by the target node.
After receiving the update event, the target devices C1 and C3 download the subscription information and the node B2 identifier from the configuration server, respectively send the corresponding device information to the target node B2 based on the identifier, and then push the device information to the terminal A1 through the target node B2.
Referring to fig. 3, the node allocation process based on load balancing processing includes the following steps:
step S302, acquiring the connection number and weight respectively corresponding to each node in the WebSocket server cluster; wherein the weight is used for characterizing the physical resource capacity of the node for processing the connection request.
The upgrade progress information of the light storage and storage integrated machines is monitored as an example for explanation, and because the time for upgrading each light storage and storage integrated machine is different, the long connection duration time is also greatly different. Therefore, when load balancing is performed, the connection number and the weight respectively corresponding to each node in the cluster need to be obtained first, and the node weight can reflect the level of physical resource configuration, that is, the physical resource capability of the node for processing the connection request is represented.
And step S304, determining the most idle node in the WebSocket server cluster according to the connection number and the weight respectively corresponding to each node.
In a preferred embodiment of the present application, the process of determining the most idle node in the WebSocket server cluster according to the connection number and the weight respectively corresponding to each node includes the following steps:
(1) Calculating the physical resource capacity ratio of each node for processing the connection request according to the following formula:
Figure M_220810174359303_303703001
k=1,2...n
wherein the content of the first and second substances,
Figure M_220810174359335_335894001
is shown as
Figure M_220810174359354_354455002
Physical resource capacity ratio of processing connection request corresponding to each node;
Figure M_220810174359386_386219003
denotes the first
Figure M_220810174359401_401855004
The number of connections corresponding to each node;nrepresenting the total number of nodes in the WebSocket server cluster;
Figure M_220810174359433_433108005
is shown as
Figure M_220810174359448_448728006
The number of connections corresponding to each node;
Figure M_220810174359464_464354007
is shown as
Figure M_220810174359495_495611008
The weight corresponding to each node;
(2) And taking the node with the largest physical resource capacity for processing the connection request as the most idle node in the WebSocket server cluster.
And step S306, taking the most idle node as a target node, and distributing the subscription information which is sent by the terminal and used for monitoring the target equipment to the target node.
If following a normal scheduling algorithm, for example: algorithms such as ip _ hash, url _ hash, consistency hash, weight polling or fail all have serious distribution imbalance problems. Because the scheduling algorithms only consider that the requests are uniformly dispersed to different nodes, or only carry out distribution according to the weight of the nodes and the response time, the current resource use condition of the nodes is not considered. The scheduling algorithm in the embodiment considers the number of long connections and the height of physical resource allocation, and improves the load balancing capability of the WebSocket server cluster.
The embodiment of the application provides a method for realizing equipment monitoring, which can realize real-time updating of subscription information through event pushing and ensure accurate and timely pushing of equipment information; the problem that a large amount of service resources are consumed due to the fact that the node Http polls to acquire the device information is solved in a WebSocket asynchronous pushing mode, the device information monitored is accurately pushed to the terminal device through the target device local cache connection information (such as the node identification) and the subscription information, and the problem of extra resource overhead caused by the fact that the device information needs to be sent to a plurality of nodes in an MQ or Redis based implementation mode is solved.
The embodiment of the present application further provides an apparatus monitoring implementation method, which is implemented on the basis of the previous embodiment, and the present embodiment mainly describes an information pushing manner and a processing procedure of a node.
In a preferred embodiment of the present application, after downloading the subscription information and the node identifier from the configuration server for local association storage based on the received update event, the target device may send the device information specified to be monitored in the subscription information to the target node in the following two ways:
the first method is as follows: and the target equipment repeatedly sends the equipment information which is specified to be monitored in the subscription information to the target node according to a preset time period. For example, the device upgrade progress information of the optical storage integrated machine is sent to the target node B2 every 2 minutes.
The second method comprises the following steps: and when detecting that the variable quantity of the equipment information which needs to be monitored and is specified in the subscription information reaches a specified value, the target equipment sends the equipment information to the target node. For example, when detecting that the progress variation amount of the upgrade progress information reaches 20%, the target device transmits the upgrade progress information at this time to the target node B2.
In addition, in a preferred embodiment of the present application, the configuration server generates a corresponding update event based on the subscription information and the node identifier, and sends the update event to the gateway at the same time. Through the process, the gateway can update the relevant information of the nodes, such as connection data and weight, in real time, so that the load balancing processing can be better carried out. Through event pushing, when a node of the WebSocket server cluster is newly added, both the gateway and the target device can update the node information of the local cache in time, and dynamic capacity expansion of the WebSocket server cluster node is achieved.
In order to further improve the accuracy of the gateway load balancing processing, in the embodiment of the present application, a processing step for a node is further provided: the method comprises the steps that a configuration server receives health condition information reported by nodes in a WebSocket server cluster at intervals of designated time; and if detecting that nodes which do not report information for more than preset time exist in the WebSocket server cluster, clearing the information of the nodes, and sending node change events to the gateway and the target equipment.
For example, a node in the WebSocket server cluster reports its health status to the configuration server every 5 seconds, and if the node does not report for more than 5 minutes, the configuration server will clear the information of the node and send a node change event to the gateway and the device.
In a preferred embodiment of the present invention, before the step of clearing the information of the node, the method further includes: and judging whether more than a specified number of nodes without reported information exist in the WebSocket server cluster, and if not, continuing to execute the step of clearing the information of the nodes.
For example, if more than half of the nodes do not report their own health status, the configuration server may adopt a self-protection mechanism to determine that there is a network fault in the current environment, and no node is removed. The self-protection mechanism ensures that the upgrade progress data can be stably pushed to the terminal.
The following description is given by taking an example that a terminal acquires upgrade progress information of an optical storage all-in-one machine, and a specific information upgrade progress information pushing process is shown in fig. 4, the terminal requests a gateway to perform WebSocket connection, the gateway schedules according to the number of cluster node connections of a WebSocket server and the weight of each node, a target node connected with the terminal sends subscription information of the terminal to a configuration server, the configuration server sends an update event to an upgrade module in the gateway and the optical storage all-in-one machine, so that the optical storage all-in-one machine actively pulls the subscription information and node identifiers and updates a local cache, the upgrade module regularly pulls the upgrade progress module of the optical storage all-in-one machine, when the upgrade progress information is detected to be changed, the upgrade progress information is accurately sent to the target node in the cluster according to the subscription information cached locally, and the target node pushes the upgrade progress information to the terminal.
In the embodiment, the subscription information is cached locally, so that the data acquisition is accelerated, the pushing delay of the upgrade progress data is reduced, and the data pushing efficiency is improved. Meanwhile, the only determined node is found for pushing according to the upgrading progress data and the local cache subscription information, accurate pushing of the upgrading progress data is achieved, compared with the scheme of pushing multiple nodes, data filtering is carried out inside each node, resource consumption is obviously reduced, and pushing capacity of the upgrading progress data is improved.
It should be noted that the upgrade instruction of the device in the embodiment of the present application may be initiated by the terminal requesting monitoring, or may be initiated by another terminal, which is not specifically limited herein. And in general, who sends the upgrading instruction and who monitors the upgrading progress information.
According to the equipment monitoring implementation method provided by the embodiment of the application, the problem that a large amount of service resources are consumed when the Http polling obtains the upgrading progress is solved in a WebSocket asynchronous pushing mode; the upgrading progress data is accurately pushed to the terminal equipment through local cache connection information and subscription information, and the problem of extra resource overhead caused by the fact that upgrading information needs to be sent to a plurality of nodes in an MQ or Redis based implementation mode is solved; monitoring the change of the nodes and subscription information in real time through event monitoring, thereby ensuring the dynamic capacity expansion of the WebSocket server cluster nodes; the connection requests are dynamically scheduled according to the connection condition of each node in the WebSocket server cluster and the physical resource allocation, and the load balance is realized through the self-adaptive scheduling algorithm, so that the maximum connection number of the terminals can be ensured, and the load balance capability of the WebSocket server cluster is improved; meanwhile, the self-protection mechanism of the configuration server ensures that the upgrade progress data can be stably pushed to the terminal.
The computer program product of the device monitoring implementation method and system provided in the embodiments of the present application includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and is not described herein again.
Unless specifically stated otherwise, the relative steps, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several 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 methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", and the like indicate orientations or positional relationships based on orientations or positional relationships shown in the drawings, and are only for convenience of description and simplification of description, but do not indicate or imply that the device or element referred to must have a particular orientation, be constructed in a particular orientation, and operate, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present application and are intended to be covered by the appended claims. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. An implementation method for monitoring equipment, the method comprising:
distributing subscription information which is sent by a terminal and used for monitoring target equipment to a target node in a WebSocket server cluster after load balancing processing, wherein the subscription information comprises an identifier of the target equipment;
the target node establishes communication connection with the terminal after receiving subscription information, and sends the subscription information with a node identifier to a configuration server for associated storage;
the configuration server generates a corresponding updating event based on the subscription information and the node identification and sends the corresponding updating event to the target equipment;
the target device downloads the subscription information and the node identification from the configuration server for local associated storage based on the received update event, then sends the device information which is specified to be monitored in the subscription information to the target node, and the device information is pushed to the terminal by the target node;
the method comprises the following steps of distributing subscription information which is sent by a terminal and used for monitoring target equipment to a target node in a WebSocket server cluster after load balancing processing, wherein the steps comprise:
acquiring the connection number and weight respectively corresponding to each node in the WebSocket server cluster; wherein the weight is used for representing the physical resource capacity of the node for processing the connection request;
determining the most idle node in the WebSocket server cluster according to the connection number and the weight corresponding to each node;
taking the most idle node as a target node, and distributing subscription information which is sent by a terminal and used for monitoring target equipment to the target node;
determining the most idle node in the WebSocket server cluster according to the connection number and the weight respectively corresponding to each node, wherein the step comprises the following steps:
calculating the physical resource capacity ratio of each node for processing the connection request according to the following formula:
Figure M_220810174356325_325182001
k=1,2...n
wherein, the first and the second end of the pipe are connected with each other,
Figure M_220810174356436_436047001
is shown as
Figure M_220810174356548_548812002
Physical resource capacity ratio of processing connection request corresponding to each node;
Figure M_220810174356580_580080003
is shown as
Figure M_220810174356611_611334004
The number of connections corresponding to each node;nrepresenting the total number of nodes in the WebSocket server cluster;
Figure M_220810174356642_642583005
is shown as
Figure M_220810174356673_673829006
The number of connections corresponding to each node;
Figure M_220810174356705_705080007
is shown as
Figure M_220810174356737_737190008
The weight corresponding to each node;
and taking the node with the largest physical resource capacity ratio for processing the connection request as the most idle node in the WebSocket server cluster.
2. The method according to claim 1, wherein the step of the target device sending the device information specified in the subscription information to be monitored to the target node includes:
the target equipment repeatedly sends equipment information which is specified to be monitored in the subscription information to the target node according to a preset time period;
or when detecting that the variable quantity of the equipment information which needs to be monitored and is specified in the subscription information reaches a specified value, the target equipment sends the equipment information to the target node.
3. The method of claim 1, wherein the configuration server generates and sends a corresponding update event to the target device based on the subscription information and the node identifier, and sends the update event to a gateway.
4. The method of claim 3, further comprising:
the configuration server receives health condition information reported by nodes in the WebSocket server cluster at specified time intervals; and if detecting that nodes which do not report information for more than preset time exist in the WebSocket server cluster, clearing the information of the nodes, and sending node change events to the gateway and the target equipment.
5. The method of claim 4, further comprising, prior to the step of clearing the information of the node:
and judging whether the WebSocket server cluster contains more than a specified number of nodes without reported information, and if not, continuing to execute the step of clearing the information of the nodes.
6. The method of claim 1, wherein the specifying information of the devices to be monitored in the subscription information comprises: and equipment upgrading progress information.
7. The method according to any one of claims 1-6, wherein the target device comprises: light stores up all-in-one.
8. The equipment monitoring implementation system is characterized by comprising a terminal, a gateway, a WebSocket server cluster, a configuration server and a plurality of equipment;
the terminal is used for sending subscription information for monitoring target equipment to the gateway; the subscription information comprises an identification of the target device;
the gateway is used for distributing the subscription information to a target node in the WebSocket server cluster after load balancing processing;
the target node is used for establishing communication connection with the terminal after receiving subscription information, and sending the subscription information to a configuration server for associated storage after adding a node identifier;
the configuration server is used for generating a corresponding updating event based on the subscription information and the node identification and sending the corresponding updating event to the target equipment;
the target device is configured to download the subscription information and the node identifier from the configuration server based on the received update event, perform local association storage, send device information specified to be monitored in the subscription information to the target node, and push the device information to the terminal by the target node.
CN202210971143.1A 2022-08-15 2022-08-15 Equipment monitoring implementation method and system Active CN115051978B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210971143.1A CN115051978B (en) 2022-08-15 2022-08-15 Equipment monitoring implementation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210971143.1A CN115051978B (en) 2022-08-15 2022-08-15 Equipment monitoring implementation method and system

Publications (2)

Publication Number Publication Date
CN115051978A CN115051978A (en) 2022-09-13
CN115051978B true CN115051978B (en) 2022-11-01

Family

ID=83168019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210971143.1A Active CN115051978B (en) 2022-08-15 2022-08-15 Equipment monitoring implementation method and system

Country Status (1)

Country Link
CN (1) CN115051978B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076057B (en) * 2023-10-18 2024-01-26 成都阿加犀智能科技有限公司 AI service request scheduling method, device, equipment and medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016112978A1 (en) * 2015-01-15 2016-07-21 Nokia Solutions And Networks Oy Methods, apparatuses and computer programs for publishing updated context information pertaining to mobile terminal through publish/subscribe mechanism
CN111835717B (en) * 2020-06-04 2023-05-12 视联动力信息技术股份有限公司 Method and device for acquiring monitoring code stream and readable storage medium
CN112491066B (en) * 2020-11-13 2023-11-03 北京京东尚科信息技术有限公司 Load balancing method, device, system, target load balancing equipment and medium
CN114024972B (en) * 2021-10-28 2023-11-03 平安科技(深圳)有限公司 Long connection communication method, system, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115051978A (en) 2022-09-13

Similar Documents

Publication Publication Date Title
US8191068B2 (en) Resource management system, resource information providing method and program
CN104836821B (en) A kind of network accelerating method based on router device, device and equipment
CN100579082C (en) Information exchange system, management server, and method for reducing the network load
CN109246229A (en) A kind of method and apparatus of distribution resource acquisition request
CN108173774B (en) Client upgrading method and system
CN111367662B (en) Load balancing method, device and system
CN1901517B (en) Information exchange system and management server, terminal device and method for reducing network load
CN110519183B (en) Node speed limiting method and device, electronic equipment and storage medium
CN108737500B (en) Target resource obtaining and providing method and device, storage medium and computer equipment
CN108965461A (en) Service administering method, device and dubbo service system
CN101478553A (en) Dynamic domain name management system and method
CN115051978B (en) Equipment monitoring implementation method and system
CN105978936A (en) CDN server and data caching method thereof
US20070265976A1 (en) License distribution in a packet data network
CN102257792B (en) Method for content delivery involving a policy database
WO2003069474A1 (en) A method and apparatus for load sharing and data distribution in servers
CN110661673B (en) Heartbeat detection method and device
CN107819632A (en) A kind of dynamic load leveling group system based on performance monitoring system and Docker Swarm
CN101854287B (en) Method and device for optimizing P2P traffic
CN109194993B (en) Media file distribution method and file distribution platform
CN109413117B (en) Distributed data calculation method, device, server and computer storage medium
CN106790354B (en) Communication method and device for preventing data congestion
CN112398802B (en) Data downloading method and related equipment
JP2006146303A (en) Access management mechanism
CN114500663B (en) Scheduling method, device, equipment and storage medium of content distribution network equipment

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