Disclosure of Invention
The application provides a method and a device for acquiring a state of a cooperative server, which are used for solving the problem that the state of the cooperative server cannot be displayed in real time by the conventional Web platform.
In order to solve the above problem, the present application discloses a method for acquiring a state of a cooperative server, including:
the method comprises the steps that an intermediate server sends a heartbeat request to a corotation server through a video networking protocol, wherein the heartbeat request comprises a main message number of the corotation server;
receiving a response message returned by the protocol conversion server;
the response message updates first time information of the protocol conversion server in the Web platform database through an Internet protocol;
and the Web platform determines whether the collaboration server is on line or not according to the first time information.
Optionally, the step of updating the first time information of the collaboration server in the Web platform database through the internet protocol according to the response message includes:
determining second time information of a response message returned by the protocol conversion server;
and updating the first time information of the protocol conversion server in the Web platform database through an Internet protocol according to the second time information.
Optionally, the step of determining, by the Web platform, whether the collaboration server is online according to the first time information includes:
acquiring third time information of the protocol conversion server in a Web platform reading database;
and determining the interval time of the first time information and the third time information, and if the interval time is less than a preset threshold value, determining that the cooperative server is online.
Optionally, the step of determining, by the Web platform, whether the collaboration server is online according to the first time information further includes:
and if the interval time is greater than a preset threshold value, determining that the cooperative server is offline.
Optionally, the step of sending, by the intermediate server, the heartbeat request to the cooperative server through the video networking protocol includes:
and the intermediate server sends a heartbeat request to the coordination server through a video networking protocol according to the set interval time.
In order to solve the above problem, the present application further discloses an apparatus for acquiring a state of a cooperative server, including:
the sending module is used for sending a heartbeat request to the corotation server through a video networking protocol, wherein the heartbeat request comprises a main message number of the corotation server;
the receiving module is used for receiving a response message returned by the protocol conversion server;
the first time module is used for updating the first time information of the protocol conversion server in the Web platform database through the response message by an Internet protocol;
and the determining module is used for determining whether the cooperative server is on line or not by the Web platform according to the first time information.
Optionally, the first time module includes:
the second time module is used for determining second time information of a response message returned by the protocol conversion server;
and the updating module is used for updating the first time information of the protocol conversion server in the Web platform database through an Internet protocol according to the second time information.
Optionally, the determining module includes:
the acquisition module is used for acquiring third time information of the cooperative conversion server in a Web platform reading database;
and the comparison module is used for determining the interval time between the first time information and the third time information, and if the interval time is smaller than a preset threshold value, the cooperative server is determined to be on line.
Optionally, the comparing module is further configured to determine that the cooperative server is offline if the interval time is greater than a preset threshold.
Optionally, the sending module is specifically configured to: and sending a heartbeat request to the coordination server through the video networking protocol according to the set interval time.
Compared with the prior art, the method has the following advantages:
the method comprises the steps that communication between a Web platform and a protocol conversion server is achieved through an intermediate server, the intermediate server sends a heartbeat request to the protocol conversion server through a video networking protocol, and the heartbeat request comprises a main message number of the protocol conversion server; receiving a response message returned by the protocol conversion server; the response message updates first time information of the protocol conversion server in the Web platform database through an Internet protocol; and the Web platform determines whether the protocol conversion server is on line according to the first time information, so that the problem that the Web platform cannot display the state of the protocol conversion server in real time is solved.
Of course, it is not necessary for any product to achieve all of the above-described advantages at the same time for practicing the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
The video network is a centralized control network structure, and the network can be a tree network, a star network, a ring network and the like, but on the basis of the centralized control node, the whole network is controlled by the centralized control node in the network.
The video networking adopts a real-time high-definition video exchange technology, can integrate required services such as dozens of services of video, voice, pictures, characters, communication, data and the like on a system platform on a network platform, such as high-definition video conference, video monitoring, intelligent monitoring analysis, emergency command, digital broadcast television, delayed television, network teaching, live broadcast, VOD on demand, television mail, Personal Video Recorder (PVR), intranet (self-office) channels, intelligent video broadcast control, information distribution and the like, and realizes high-definition quality video broadcast through a television or a computer.
The protocol conversion server is also called a monitoring access server and is responsible for accessing monitoring equipment (which can also be described as monitoring resources) of the internet into the video network, so that the monitoring equipment on the internet can be browsed and controlled in the video network.
The networking structure of the method for acquiring the state of the cooperative server comprises the following steps: the system comprises a protocol conversion server 11 … 1n, a video network server 21 … 2n, an intermediate server VmsServer31 … 3n, a Web platform database 41 … 4n and a Web platform 51 … 5n, wherein the protocol conversion server and the video network server are communicated by adopting a video network protocol, the video network server and the intermediate server are communicated by adopting the video network protocol, the intermediate server and the Web platform database are communicated by adopting the Internet protocol, the Web platform database and the Web platform are communicated by adopting the Internet protocol, and the Web platform cannot display the state of the protocol conversion server in real time due to the fact that the video network and the Internet use different communication protocols, so that the intermediate server is used as an intermediary, and communication between the Web platform and the protocol conversion server is achieved.
Example one
Referring to fig. 2, a flowchart of a method for acquiring a state of a collaboration server in an embodiment of the present application is shown, which specifically includes:
step 201: the method comprises the steps that an intermediate server sends a heartbeat request to a protocol conversion server through a video networking protocol, wherein the heartbeat request comprises a main message number of the protocol conversion server.
Specifically, the intermediate server sends a heartbeat request to the protocol conversion server through the video networking protocol, wherein the heartbeat request is sent by 8F85, 0090 protocol transmission based on the video networking protocol.
In practical application, the intermediate server sends a heartbeat request to the coordination server through a video networking protocol according to set interval time.
The setting of the interval time may be set by a person skilled in the art in any appropriate manner, for example, a threshold may be set by manual experience, or the interval time may be set according to a difference value of historical data, for example: 1 minute, 5 minutes, etc., which the present application does not limit.
Step 202: and receiving a response message returned by the protocol conversion server.
After receiving the heartbeat request sent by the intermediate server, the protocol conversion server returns response information according to the main message number of the protocol conversion server in the heartbeat request, and the response information is sent to the intermediate server through a video networking protocol.
The response information returned by the protocol conversion server is transmitted to the intermediate server based on 8785, 0091 protocol of the video network.
Step 203: and the response message updates the first time information of the protocol conversion server in the Web platform database through an Internet protocol.
In practical application, the step of updating the first time information of the protocol conversion server in the Web platform database through the internet protocol according to the response message includes:
and determining second time information of the response message returned by the protocol server.
And updating the first time information of the protocol conversion server in the Web platform database through an Internet protocol according to the second time information.
The second time information is time when the intermediate server receives the response message of the collaboration server, and is used as the second time information.
Step 204: and the Web platform determines whether the collaboration server is on line or not according to the first time information.
As one implementation manner, the step of determining, by the Web platform, whether the collaboration server is online according to the first time information includes:
acquiring third time information of the protocol conversion server in a Web platform reading database;
and determining the interval time of the first time information and the third time information, and if the interval time is less than a preset threshold value, determining that the cooperative server is online.
As another implementation manner, the step of determining, by the Web platform, whether the collaboration server is online according to the first time information further includes:
and if the interval time is greater than a preset threshold value, determining that the cooperative server is offline.
The preset threshold may be set by a person skilled in the art in any appropriate manner, for example, the threshold may be set by manual experience, or the interval time may be set according to the difference value of the historical data, for example: 1 minute, 5 minutes, etc., which the present application does not limit.
In this embodiment, the communication between the Web platform and the protocol conversion server is realized through the intermediate server, and the intermediate server sends a heartbeat request to the protocol conversion server through a video networking protocol, where the heartbeat request includes a main message number of the protocol conversion server; receiving a response message returned by the protocol conversion server; the response message updates first time information of the protocol conversion server in the Web platform database through an Internet protocol; and the Web platform determines whether the protocol conversion server is on line according to the first time information, so that the problem that the Web platform cannot display the state of the protocol conversion server in real time is solved.
It should be noted that the foregoing method embodiments are described as a series of acts or combinations for simplicity in explanation, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Based on the description of the method embodiment, the present application further provides a corresponding apparatus embodiment to implement the content described in the method embodiment.
Example two
Referring to fig. 3, a structural diagram of an apparatus for acquiring a state of a collaboration server according to the second embodiment of the present application is shown, which specifically includes:
a sending module 301, configured to send a heartbeat request to a cooperative server through a video networking protocol, where the heartbeat request includes a main message number of the cooperative server.
A receiving module 302, configured to receive a response message returned by the collaboration server.
A first time module 303, configured to update, in the response message, first time information of the collaboration server in the Web platform database through an internet protocol.
A determining module 304, configured to determine, by the Web platform, whether the collaboration server is online according to the first time information.
Optionally, the first time module includes:
the second time module is used for determining second time information of a response message returned by the protocol conversion server;
and the updating module is used for updating the first time information of the protocol conversion server in the Web platform database through an Internet protocol according to the second time information.
Optionally, the determining module includes:
the acquisition module is used for acquiring third time information of the cooperative conversion server in a Web platform reading database;
and the comparison module is used for determining the interval time between the first time information and the third time information, and if the interval time is smaller than a preset threshold value, the cooperative server is determined to be on line.
Optionally, the comparing module is further configured to determine that the cooperative server is offline if the interval time is greater than a preset threshold.
Optionally, the sending module is specifically configured to: and sending a heartbeat request to the coordination server through the video networking protocol according to the set interval time.
In this embodiment, the communication between the Web platform and the protocol conversion server is realized through the intermediate server, and the intermediate server sends a heartbeat request to the protocol conversion server through a video networking protocol, where the heartbeat request includes a main message number of the protocol conversion server; receiving a response message returned by the protocol conversion server; the response message updates the first time information of the protocol conversion server in the Web platform database through an Internet protocol; and the Web platform determines whether the protocol conversion server is on line according to the first time information, so that the problem that the Web platform cannot display the state of the protocol conversion server in real time is solved.
For the above-mentioned apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the illustrated method embodiments.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present application, but the present disclosure is not necessarily detailed herein for reasons of space.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
The method and the device for acquiring the state of the cooperative server provided by the application are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation of the application, and the description of the above embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.