Fault detection method, device, platform, equipment and medium
By automatically analyzing signaling service logs and network addresses in the video surveillance networking system and generating target instructions, the problem of the image not being able to display normally when the video surveillance equipment is connected is solved, and efficient fault detection and automated troubleshooting are achieved.
Patent Information
- Application Number
- CN202310797220.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-06-30
AI Technical Summary
In the existing technology, when video surveillance equipment is connected to the GB28181 platform, the image often cannot be displayed normally due to various reasons, and it needs to rely on manual troubleshooting by operation and maintenance personnel, which is inefficient and requires high professional capabilities.
A fault detection method is provided. By inputting configuration information on the terminal device, a script is used to automatically analyze the log files and network addresses of the signaling service, generate target instructions and send them to the monitoring device to be connected to the network, obtain the data packets between the device and the streaming media service, and automatically troubleshoot the fault factors.
It improves the efficiency of troubleshooting, reduces the requirements for the professional capabilities of operation and maintenance personnel, and realizes automated fault detection.
Smart Images

Figure CN119232877B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of monitoring, and in particular to a fault detection method, device, platform, equipment and medium. Background Art
[0002] Using a video surveillance networking system (such as the GB28181 platform) allows for convenient management of surveillance equipment, real-time viewing, and video playback. While surveillance equipment can be connected to the GB28181 platform through configuration, various issues often prevent the video surveillance screen from displaying properly. Related technologies typically rely on the experience of operations and maintenance personnel to troubleshoot potential causes one by one, but this approach is both inefficient and requires a high level of professional expertise from the operations and maintenance personnel. Summary of the Invention
[0003] The present invention provides a fault detection method, apparatus, platform, equipment and medium to address the deficiencies in related technologies.
[0004] According to a first aspect of an embodiment of the present invention, a fault detection method is provided, which is applied to a video surveillance network system, wherein the video surveillance network system includes a signaling server and a streaming media server, and the video surveillance network system is connected to a monitoring device to be networked and a terminal device, respectively. The method includes:
[0005] Determining configuration information based on an input operation of a user on the terminal device, the configuration information including a log file path of a signaling service and network address information of a media stream of the monitoring device to be connected to the network;
[0006] Determine the registration and authentication status of the monitoring device to be connected to the network according to the log file pointed to by the log file path;
[0007] If the registration and authentication is successful, a target instruction for acquiring the media stream of the monitoring device to be connected to the network is generated based on the network address information, and the target instruction is sent to the signaling service, so that the signaling service forwards the target instruction to the monitoring device to be connected to the network;
[0008] Acquire data packets between the monitoring device to be connected to the network and the streaming media service, and determine whether the monitoring device to be connected to the network performs a streaming operation based on the acquisition result.
[0009] In some embodiments, determining the registration authentication status of the to-be-networked monitoring device based on the log file pointed to by the log file path includes:
[0010] Searching for a first keyword in the log file pointed to by the log file path, and if the first keyword is not found, determining that the monitoring device to be connected to the network has not been registered and authenticated, the first keyword being used to represent unauthorized response information sent by the signaling service;
[0011] If the first keyword is searched, searching the log file for a second keyword, where the second keyword is used to represent the registration request received by the signaling service;
[0012] If the second keyword is not searched, it is determined that the registration and authentication of the monitoring device to be connected to the network has failed. If the second keyword is searched, it is determined that the registration and authentication of the monitoring device to be connected to the network has succeeded.
[0013] In some embodiments, the network address information includes a video real-time preview address;
[0014] The generating, based on the network address information, a target instruction for acquiring the media stream of the monitoring device to be connected to the network comprises:
[0015] Using a specified instruction to call the video real-time preview address, generating a preview instruction for previewing the media stream of the monitoring device to be networked;
[0016] After sending the target instruction to the signaling service, the method further includes:
[0017] Searching for a third keyword in the log file of the signaling service, where the third keyword is used to indicate that the signaling service has received response information from the monitoring device to be connected to the network to the preview instruction;
[0018] The response result of the monitoring device to be connected to the network to the preview instruction is determined according to the search result.
[0019] In some embodiments, the network address information includes a video playback address;
[0020] The target instruction of simulating and obtaining the media stream of the monitoring device to be connected to the network based on the network address information includes:
[0021] Using a specified instruction to call the video playback address, generating a video playback instruction for obtaining the media stream of the monitoring device to be networked;
[0022] After sending the target instruction to the signaling service, the method further includes:
[0023] Searching for a fourth keyword in the log file of the signaling service, where the fourth keyword is used to indicate that the signaling service has received response information of the monitoring device to be connected to the network to the video playback instruction;
[0024] The response result of the monitoring device to be connected to the network to the video playback instruction is determined according to the search result.
[0025] In some embodiments, the configuration information further includes a service name of the signaling service and a service name of the streaming service, and the method further includes:
[0026] Acquire process information that matches the service name of the signaling service to determine the startup state of the signaling service; acquire process information that matches the service name of the streaming service to determine the startup state of the streaming service.
[0027] In some embodiments, the configuration information further includes a port number opened by the signaling service, and the method further includes:
[0028] Detecting the open state of the port corresponding to the port number in the signaling service.
[0029] In some embodiments, the terminal device has a display screen, and the method further includes:
[0030] Sending prompt information to the terminal device so that the terminal device displays the prompt information on the display screen, wherein the prompt information is used to indicate the fault detection result.
[0031] According to a second aspect of an embodiment of the present invention, a fault detection device is provided, which is applied to a video surveillance network system, wherein the video surveillance network system includes a signaling server and a streaming media server, and the video surveillance network system is connected to a monitoring device to be networked and a terminal device, respectively. The device includes:
[0032] An acquiring unit, configured to determine configuration information based on an input operation of a user on the terminal device, the configuration information including a log file path of a signaling service and network address information of a media stream of the monitoring device to be connected to the network;
[0033] A detection unit, configured to determine the registration and authentication status of the monitoring device to be connected to the network according to the log file pointed to by the log file path;
[0034] The simulation unit is configured to generate, based on the network address information, a target instruction for acquiring the media stream of the monitoring device to be connected to the network when the registration and authentication are successful, and send the target instruction to the signaling service so that the signaling service forwards the target instruction to the monitoring device to be connected to the network;
[0035] The detection unit is further configured to obtain data packets between the monitoring device to be connected to the network and the streaming media service, and determine whether the monitoring device to be connected to the network performs a streaming operation based on the acquisition result.
[0036] According to a third aspect of an embodiment of the present invention, a fault detection platform is provided, the platform comprising a video surveillance network system, a monitoring device to be networked, and a terminal device, the video surveillance network system comprising a signaling server and a streaming media server;
[0037] The terminal device receives configuration information input by the user, wherein the configuration information includes a log file path of the signaling service and network address information for obtaining a media stream of the monitoring device to be connected to the network;
[0038] The video surveillance networking system determines the registration and authentication status of the monitoring device to be networked according to the log file pointed to by the log file path;
[0039] When the registration and authentication are successful, the video surveillance networking system generates a target instruction for acquiring the media stream of the monitoring device to be networked based on the network address information, and sends the target instruction to the signaling service, so that the signaling service forwards the target instruction to the monitoring device to be networked;
[0040] The video surveillance networking system obtains data packets between the monitoring device to be connected to the network and the streaming media service, and determines whether the monitoring device to be connected to the network performs a streaming operation based on the acquisition result.
[0041] According to a fourth aspect of an embodiment of the present invention, there is provided a computing device, including:
[0042] processor;
[0043] a memory for storing processor-executable instructions;
[0044] The processor implements any of the above methods by running the executable instructions.
[0045] According to a fifth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, any of the above methods is implemented.
[0046] According to the above embodiments, the present invention determines the log file path of the signaling service and the network address information of the media stream of the monitoring device to be connected to the network based on the user's input operation on the terminal device; determines the registration and authentication status of the monitoring device to be connected to the network based on the log file pointed to by the log file path; if the registration and authentication is successful, generates a target instruction for obtaining the media stream of the monitoring device to be connected to the network based on the network address information, and sends the target instruction to the signaling service, so that the signaling service forwards the target instruction to the monitoring device to be connected to the network, obtains the data packet between the monitoring device to be connected to the network and the streaming media service, and determines whether the monitoring device to be connected to the network performs the streaming operation based on the acquisition result. The present invention can automatically troubleshoot the fault factors after the user inputs the configuration information. Compared with the related art that relies on manual troubleshooting by operation and maintenance personnel, it can improve work efficiency and reduce the requirements for operation and maintenance personnel.
[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0049] Figure 1 1 is a schematic diagram showing an architecture of a monitoring device connected to a video monitoring network system according to an embodiment of the present invention.
[0050] Figure 2 FIG. 4 is a schematic diagram showing the interaction between a fault detection service and other devices according to an embodiment of the present invention.
[0051] Figure 3 FIG. 4 is a flow chart of a fault detection method according to an embodiment of the present invention.
[0052] Figure 4 This is an example flow chart of a fault detection method provided by an embodiment of the present invention.
[0053] Figure 5 It is a schematic diagram of a fault detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.
[0055] The present invention is applied to a video surveillance networking system. The video surveillance networking system comprises a signaling server for implementing a SIP (Session Initiation Protocol) protocol and a streaming media server for processing media streams. Figure 1 FIG. 1 is a schematic diagram showing an architecture of a monitoring device accessing a video monitoring network system according to an embodiment of the present invention. Figure 1 As shown, the video surveillance network system is connected to the monitoring equipment and the Web terminal respectively. The monitoring equipment refers to the equipment that supports the national standard protocol. For example, the monitoring equipment may include a network video recorder (NVR) and an IP camera (IPC).
[0056] The signaling server provides a proxy for communication between monitoring devices and web terminals on the network. The signaling server has a fixed IP address or domain name. After a monitoring device is registered with the signaling server, the administrator can manage the monitoring device by sending commands to the signaling server.
[0057] The streaming service provided by the streaming server acts as a proxy for video transmission. The streaming service receives media streams from monitoring devices and forwards them to the web terminal. Monitoring devices can send media streams to the streaming server using the RTP protocol. Surveillance videos connected to the streaming server can be distributed using a variety of protocols (such as RTMP, RTP, HLS, and HTTP) for video preview and integration into other business systems.
[0058] By configuring the following parameters, you can connect surveillance devices to the video surveillance network system: enable a specific protocol (such as the GB28181 protocol), enter the signaling server's ID, domain name, address, port, and the SIP user's authentication ID and password.
[0059] After a surveillance device is connected to the video surveillance network system, it interacts with the signaling server via the SIP protocol. After authorization, the video receiver's web terminal sends a command to the surveillance device. Upon receiving the command, the surveillance device pushes the audio and video data to the streaming server according to the command. After the streaming server encodes and decodes the data, it is sent to the video receiver's web terminal. In other words, since the surveillance device can include multiple network cameras, the web terminal user can issue a video viewing command for a specific network camera. The command is sent via the signaling server to the network video recorder (NVR). The NVR then pushes the video stream from the specified network camera to the streaming server. The streaming server encodes and decodes the video stream and sends it to the web terminal user for real-time video playback.
[0060] When monitoring equipment is connected to a video surveillance network system, the video surveillance footage often fails to display properly due to various reasons, such as the network camera not enabling support for the national standard GB / T28181, the signaling server's address and port being incorrectly configured, and the network firewall on which the monitoring equipment resides causing port obstruction. Related technologies rely on the experience of operations and maintenance personnel to individually troubleshoot factors that may cause the video surveillance footage to fail to display properly. This approach is not only inefficient but also requires a high level of professional expertise from the operations and maintenance personnel. For example, if the video surveillance network system is based on the GB28181 platform, fault detection requires the operations and maintenance personnel to possess professional knowledge of the GB28181 platform.
[0061] In view of this, the present invention provides a fault detection method applied to a video surveillance network system, in which the fault detection process is implemented through program code, for example, it can be implemented using a shell script, and the commands used for fault detection are written into the shell script. When the shell script is run in the video surveillance network system, a fault detection service can be provided.
[0062] Figure 2 FIG. 1 is a schematic diagram showing the interaction between the fault detection service and other devices according to an embodiment of the present invention. Figure 2 As shown, the fault detection service is connected to the signaling service for communication, and the terminal device interacts with the fault detection service through a designated interface (eg, a VGA interface).
[0063] The fault detection service receives configuration information entered by users via terminal devices, analyzes the signaling service's log files, and troubleshoots possible faults that may have occurred during the monitoring device's access to the signaling service. It then outputs a prompt indicating the fault detection results to the terminal device, allowing operations and maintenance personnel to modify the monitoring device's configuration accordingly. This method reduces the workload placed on operations and maintenance personnel by automating troubleshooting, replacing manual troubleshooting with automated detection.
[0064] In the present invention, a monitoring device that has not been successfully connected due to a fault is called a monitoring device to be connected to the network. The video monitoring networking system is connected to the monitoring device to be connected to the network and the terminal device respectively. The following embodiments will illustrate the fault detection method provided by the present invention in conjunction with the accompanying drawings.
[0065] Figure 3 FIG. 1 is a flow chart of a fault detection method according to an embodiment of the present invention. Figure 3 As shown, the fault detection method provided by the present invention may include the following steps 301 to 304.
[0066] In step 301, configuration information is determined based on an input operation of a user on the terminal device.
[0067] The configuration information includes the log file path of the signaling service and the network address information of the media stream of the monitoring device to be connected to the network. The configuration information input by the user via the terminal device is obtained.
[0068] In this embodiment, a uniform resource locator (URL) is used to represent the network address of the media stream of the monitoring device to be connected to the network.
[0069] In step 302, the registration and authentication status of the monitoring device to be connected to the network is determined according to the log file pointed to by the log file path.
[0070] According to the log file path of the signaling service, the log file generated by the process of the monitoring device to be connected to the network accessing the signaling service can be obtained, and the keywords related to registration and authentication are searched in the log file, and the registration and authentication status of the monitoring device to be connected to the network is determined according to the search results.
[0071] In step 303, if the registration authentication is successful, a target instruction for obtaining the media stream of the monitoring device to be connected to the network is generated based on the network address information, and the target instruction is sent to the signaling service, so that the signaling service forwards the target instruction to the monitoring device to be connected to the network.
[0072] If the registration and authentication are successful, the Web terminal can be simulated to send a target instruction for obtaining the media stream to the monitoring device to be connected to the network, that is, a target instruction for obtaining the media stream of the monitoring device to be connected to the network is generated according to the network address, and the generated target instruction is sent to the signaling service to detect the response status of the monitoring device to be connected to the network when the Web terminal interacts with the signaling service.
[0073] In step 304, data packets between the monitoring device to be connected to the network and the streaming media service are obtained, and it is determined based on the acquisition result whether the monitoring device to be connected to the network performs a streaming operation.
[0074] After the signaling service forwards the target instruction to the monitoring device to be connected, the monitoring device to be connected will theoretically respond to the target instruction and push the stream to the streaming service. Therefore, it is possible to determine whether the monitoring device to be connected is pushing the stream by obtaining the data packets between the monitoring device to be connected and the streaming service. If the data packets are obtained, it means that the monitoring device to be connected has executed the push operation, that is, the connection between the monitoring device to be connected and the streaming service has been successful; if the data packets are not obtained, it means that the monitoring device to be connected has not executed the push operation, that is, the connection between the monitoring device to be connected and the streaming service has failed.
[0075] For example, the tcpdump tool can be used to capture data packets between the monitoring device to be connected to the network and the streaming media service to determine whether the monitoring device to be connected to the network is pushing the stream.
[0076] The fault detection method provided by the present invention uses scripts to check the factors that cause the fault one by one. Compared with relying on manual troubleshooting by operation and maintenance personnel, it can not only improve work efficiency but also reduce the business requirements for operation and maintenance personnel.
[0077] In some embodiments, a first keyword is searched in the log file pointed to by the log file path. If the first keyword is not found, it is determined that the monitoring device to be connected to the network has not been registered and authenticated; if the first keyword is found, a second keyword is searched in the log file; if the second keyword is not found, it is determined that the registration and authentication of the monitoring device to be connected to the network has failed; if the second keyword is found, it is determined that the registration and authentication of the monitoring device to be connected to the network has succeeded.
[0078] A log file generated in real time by the signaling service is obtained according to the log file path. A first keyword and a second keyword are searched in the log file, respectively. The first keyword is used to identify unauthorized response information sent by the signaling service, and the second keyword is used to identify registration requests received by the signaling service. In the SIP protocol, the first keyword is "SIP / 2.0 401 Unauthorized" and the second keyword is "CSeq:{n}REGISTER".
[0079] Those skilled in the art should understand that the first keyword and the second keyword may be determined according to the protocol used, and the present invention is not limited thereto.
[0080] The terminal device in this embodiment has a display screen. During the fault detection process, prompt information can be sent to the terminal device so that the terminal device displays the prompt information on the display screen. The prompt information is used to indicate the fault detection result.
[0081] For example, a first keyword is searched in the log file. If the first keyword is not found, a prompt message is sent to the terminal device: the monitoring device has not sent registration information, please check the configuration information of the monitoring device!
[0082] The first keyword is searched repeatedly in the most recently acquired log file at intervals. If the first keyword is found in the log file, the second keyword is searched in the log file. If the second keyword is found, a prompt message is sent to the terminal device: the monitoring device registration and authentication is successful. If the second keyword is not found, the second keyword is searched repeatedly in the most recently acquired log file at intervals.
[0083] The video surveillance networking system in the present invention provides a variety of functions for Web terminal users, such as real-time video preview function, video playback function, video playback pause function, video playback resumption function, and video playback speed playback function. When it is detected that the registration and authentication of the monitoring device to be networked is successful, the instruction to start any of the above functions can be issued by simulating the Web terminal user to detect the response status of the monitoring device to be networked when the Web terminal interacts with the signaling service.
[0084] The following embodiment illustrates the detection process of the video real-time preview function and the video playback function among the above functions.
[0085] In some embodiments, the network address information may include a real-time video preview address. In this case, the target instruction for obtaining the media stream of the monitoring device to be connected to the network based on the network address information may include: using a specified instruction to call the real-time video preview address to generate a preview instruction for previewing the media stream of the monitoring device to be connected to the network.
[0086] After sending the target instruction to the signaling service, the method further includes: searching for a third keyword in a log file of the signaling service; and determining a response result of the monitoring device to be connected to the network to the preview instruction based on the search result.
[0087] The third keyword is used to represent that the signaling service receives the response information of the monitoring device to be connected to the network to the preview instruction. For example, the third keyword may be "CSeq:[:digit:]INVITE".
[0088] The response result of the preview command is determined based on the third keyword searched in the log file. If the device responds abnormally, a prompt message is sent to the terminal device: The video real-time preview device responds failed!
[0089] This embodiment simulates a Web terminal to issue a video real-time preview instruction, and analyzes the response result of the monitoring device to be connected to the network to determine whether the monitoring device to be connected to the network can normally execute the video real-time preview instruction.
[0090] In some embodiments, the network address information may include a video playback address; in this case, the target instruction for simulating obtaining the media stream of the monitoring device to be connected to the network based on the network address information may include: using a specified instruction to call the video playback address to generate a video playback instruction for obtaining the media stream of the monitoring device to be connected to the network.
[0091] After sending the target instruction to the signaling service, the method further includes: searching for a fourth keyword in a log file of the signaling service; and determining a response result of the monitoring device to be connected to the network to the video playback instruction based on the search result.
[0092] The fourth keyword is used to represent the response information received by the signaling service to the video playback instruction of the monitoring device to be connected to the network. For example, the fourth keyword may be "Session Name(s): Playback".
[0093] Search the signaling service log file for the fourth keyword, and determine the response of the networked monitoring device to the video playback instruction based on the response status of the fourth keyword. If the device responds abnormally, a prompt message is sent to the terminal device: The video playback device responds abnormally!
[0094] This embodiment simulates a Web terminal to issue a video playback preview instruction, and analyzes the response result of the monitoring device to be connected to the network to determine whether the monitoring device to be connected to the network can normally execute the video playback preview instruction.
[0095] Those skilled in the art should understand that the specific content of the above prompt information can be specifically set according to actual needs, and the present invention is not limited to this.
[0096] The above embodiment is used to detect whether a fault occurs on the monitoring device to be connected to the network. In some scenarios, there may be a fault on the video surveillance networking system, i.e., the service end, which causes the monitoring device to be connected to the network to be unable to successfully access. Therefore, fault detection can be performed on the signaling service and streaming media service.
[0097] In some embodiments, the configuration information may also include the service name of the signaling service and the service name of the streaming service, and the method further includes: obtaining process information that matches the service name of the signaling service to determine the startup status of the signaling service; obtaining process information that matches the service name of the streaming service to determine the startup status of the streaming service.
[0098] That is, if process information matching the service name of the signaling service is obtained, it can be determined that the signaling service is in the enabled state; if process information matching the service name of the signaling service is not obtained, it can be determined that the signaling service is in the disabled state. Similarly, if process information matching the service name of the streaming service is obtained, it can be determined that the streaming service is in the enabled state; if process information matching the service name of the streaming service is not obtained, it can be determined that the streaming service is in the disabled state.
[0099] For example, you can use the ps-ef | grep command to verify whether the signaling service and streaming service are started normally.
[0100] In some embodiments, the configuration information may further include a port number opened by the signaling service, and the method may further include: detecting an open state of a port corresponding to the port number in the signaling service.
[0101] For example, you can use the netstat command or the lsof command to check whether the port open to the outside world by the signaling service is open.
[0102] The present invention monitors the log files of signaling services and, by extracting keywords from the log files, can determine the current state of the monitoring device's access to the video surveillance network system and whether its interaction with the video surveillance network system is normal. Furthermore, information about the progress of the monitoring device's access to the video surveillance network system can be instantly output to the terminal device's display screen for troubleshooting by maintenance personnel.
[0103] Figure 4 This is an example flow chart of a fault detection method provided by an embodiment of the present invention. Figure 4 As shown, in one embodiment, the fault detection method may include the following steps 401 to 408.
[0104] In step 401, configuration information input by a user through a terminal device is received.
[0105] After the fault detection service is started, the terminal device can display on the screen: Please enter the service name of the SIP signaling service! Receive the user's input operation and store it. For example, the received input information can be stored in a variable named SIP_SERVICE_NAME.
[0106] After receiving the service name of the SIP signaling service, the terminal device displays on the screen: Please enter the streaming service name! Receive the user's input operation and store it. For example, the received input information can be stored in a variable named ZLM_SERVICE_NAME.
[0107] After receiving the streaming service name, the terminal device displays on the screen: Please enter the port that the SIP service needs to open. Multiple ports are spliced with commas! Receive user input operations and store them. For example, the received input information can be stored in a variable named PORT.
[0108] After receiving the port that needs to be opened by the SIP service, the terminal device displays on the screen: Please enter the log file path of the SIP signaling service! Receive the user's input operation and store it. For example, the received input information can be stored in a variable named SIP_LOG_PATH.
[0109] After receiving the SIP signaling service log file path, the terminal device displays on the screen: Please enter the video real-time preview address! Receive user input operations and store them. For example, the received input information can be stored in a variable named PLAY_URL.
[0110] After receiving the video real-time preview address, the terminal device displays on the screen: Please enter the video playback address! Receive the user's input operation and store it. For example, the received input information can be stored in a variable named PLAYBACK_URL.
[0111] Those skilled in the art should understand that the above configuration information can be acquired once or in multiple times, and the above example does not limit the method for acquiring the configuration information.
[0112] In step 402, it is detected whether the signaling service and the streaming service are started.
[0113] Use the command ps-ef | grep $SIP_SERVICE_NAME to verify whether the signaling service is started normally. If not, the output prompt message is: SIP service is not started normally! Otherwise, the output prompt message is: SIP signaling service is started!
[0114] If the signaling service is not started normally, execute the ps-ef | grep command again after a preset interval.
[0115] $SIP_SERVICE_NAME verifies whether the SIP service is started normally.
[0116] Run the command ps-ef | grep $ZLM_SERVICE_NAME to check whether the streaming service is started normally. If not, the system will output a prompt message: The streaming service is not started normally! Otherwise, the system will output a prompt message: The streaming service is started!
[0117] If the streaming service does not start normally, execute the ps-ef | grep command again after a preset time interval.
[0118] $ZLM_SERVICE_NAME verifies whether the streaming media service is started normally.
[0119] In step 403, it is detected whether the port of the signaling service is open.
[0120] Split the variable PORT by commas and loop through it. Use the command lsof to check whether the current port is open. If it is not open, it will output a prompt message: Local port $PORT is not open! Otherwise, it will output a prompt message: Local port $PORT is open to the outside world.
[0121] In step 404, the log file of the SIP signaling service is monitored based on the log file path.
[0122] In step 405, the registration and authentication process of the monitoring device is detected.
[0123] Search the first keyword "SIP / 2.0 401Unauthorized" in the log file. If no result is found, a prompt message will be displayed: The monitoring device did not send the registration information. Please check the configuration information of the monitoring device! Repeat the search for the first keyword after the set interval.
[0124] After searching the first keyword, search the log file for the second keyword "CSeq:{n}
[0125] REGISTER", if it is found, the prompt message will be output: the monitoring device registration and authentication is successful. Otherwise, the second keyword will be searched repeatedly after the set interval.
[0126] In step 406, the simulated video is previewed in real time.
[0127] Use the curl command to call the video real-time preview address PLAY_URL. After the command is issued, search the SIP signaling service log file for the third keyword "CSeq:[:digit:]INVITE" to obtain the response result of the preview command. If the device responds abnormally, the prompt message is output: Video real-time preview device response failed!
[0128] In step 407, it is detected whether the monitoring device is streaming.
[0129] Start the tcpdump packet capture tool. If the packet capture tool fails to start, a prompt message is output: "tcpdump startup failed!" Otherwise, a prompt message is output: "tcpdump startup successful!" After executing the video real-time preview instruction in step 406, the data packets of the monitoring device and the streaming media service are captured.
[0130] If no data packet is captured, it means that the monitoring device has not pushed the video stream. In this case, the prompt message is output: The monitoring device has not pushed the stream!
[0131] If the data packet is captured, it means that the monitoring device has pushed the video stream. In this case, the prompt message is output: The monitoring device has pushed the stream!
[0132] In step 408, video playback is simulated.
[0133] Use the curl command to call the video playback address PLAYBACK_URL. After the command is issued, search the signaling service log file for the response status of the fourth keyword "Session Name(s): Playback". If the device responds abnormally, a prompt message is output: "Video playback device responds abnormally!" Simultaneously, in conjunction with step 407, obtain the data packet when the monitoring device executes the push operation in response to the video playback command. If no data packet is obtained, it indicates that the monitoring device has not pushed the video stream. The prompt message is output: "Monitoring device has not pushed the stream!" If the data packet is obtained, it indicates that the monitoring device has pushed the video stream. The prompt message is output: "Monitoring device has pushed the stream!"
[0134] Steps 406 and 408 detect whether the monitoring device responds to the signaling service after the web terminal sends the command. Step 407 detects whether the monitoring device pushes the stream after the web terminal sends the command and the monitoring device responds to the signaling service. During the interaction between the web terminal and the signaling service, obtaining data packets can determine whether the monitoring device is not correctly responding to the live video preview command and whether there is a fault in the video playback command.
[0135] The present invention also provides a fault detection device, which is applied to a video surveillance network system, wherein the video surveillance network system includes a signaling server and a streaming media server, and the video surveillance network system is connected to a monitoring device to be networked and a terminal device respectively. Figure 5 FIG. 1 is a schematic diagram of a fault detection device provided by an embodiment of the present invention. Figure 5 As shown, the device includes:
[0136] An acquiring unit 501 is configured to determine configuration information based on an input operation of a user on the terminal device, the configuration information including a log file path of a signaling service and network address information of a media stream of the monitoring device to be connected to the network;
[0137] The detection unit 502 is configured to determine the registration and authentication status of the monitoring device to be connected to the network according to the log file pointed to by the log file path;
[0138] The simulation unit 503 is configured to generate, based on the network address information, a target instruction for acquiring the media stream of the monitoring device to be connected to the network, if the registration and authentication is successful, and send the target instruction to the signaling service so that the signaling service forwards the target instruction to the monitoring device to be connected to the network;
[0139] The detection unit 502 is further configured to obtain data packets between the monitoring device to be connected to the network and the streaming media service, and determine whether the monitoring device to be connected to the network performs a streaming operation based on the acquisition result.
[0140] In some embodiments, the detection unit 502 is specifically configured to search for a first keyword in the log file pointed to by the log file path. If the first keyword is not found, it is determined that the monitoring device to be connected to the network has not been registered and authenticated, and the first keyword is used to represent unauthorized response information sent by the signaling service;
[0141] If the first keyword is searched, searching the log file for a second keyword, where the second keyword is used to represent the registration request received by the signaling service;
[0142] If the second keyword is not searched, it is determined that the registration and authentication of the monitoring device to be connected to the network has failed. If the second keyword is searched, it is determined that the registration and authentication of the monitoring device to be connected to the network has succeeded.
[0143] In some embodiments, after sending the target instruction to the signaling service, the detection unit 502 is further configured to:
[0144] Searching for a third keyword in the log file of the signaling service, where the third keyword is used to indicate that the signaling service has received response information from the monitoring device to be connected to the network to the preview instruction;
[0145] The response result of the monitoring device to be connected to the network to the preview instruction is determined according to the search result.
[0146] In some embodiments, after sending the target instruction to the signaling service, the detection unit 502 is further configured to:
[0147] Searching for a fourth keyword in the log file of the signaling service, where the fourth keyword is used to indicate that the signaling service has received response information of the monitoring device to be connected to the network to the video playback instruction;
[0148] The response result of the monitoring device to be connected to the network to the video playback instruction is determined according to the search result.
[0149] In some embodiments, the configuration information further includes a service name of the signaling service and a service name of the streaming service, and the detection unit is further configured to:
[0150] Acquire process information that matches the service name of the signaling service to determine the startup state of the signaling service; acquire process information that matches the service name of the streaming service to determine the startup state of the streaming service.
[0151] In some embodiments, the configuration information further includes a port number opened by the signaling service, and the detection unit is further configured to detect an open state of a port corresponding to the port number in the signaling service.
[0152] It should be noted that in the accompanying drawings, the sizes of layers and regions may be exaggerated for clarity of illustration. It will also be understood that when an element or layer is referred to as being "on" another element or layer, it may be directly on the other element, or there may be an intermediate layer. In addition, it will be understood that when an element or layer is referred to as being "under" another element or layer, it may be directly under the other element, or there may be more than one intermediate layer or element. In addition, it will also be understood that when a layer or element is referred to as being "between" two layers or elements, it may be the only layer between the two layers or elements, or there may also be more than one intermediate layer or element. Similar reference numerals throughout the text indicate similar elements.
[0153] In the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "plurality" refers to two or more, unless otherwise clearly defined.
[0154] Other embodiments of the present invention will readily occur to those skilled in the art after considering the specification and practicing the disclosure herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the invention being indicated by the following claims.
[0155] It should be understood that the present invention is not limited to the exact construction described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A fault detection method, characterized in that: Applied to a video surveillance networking system, the video surveillance networking system includes a signaling server and a streaming media server, the video surveillance networking system is connected to a monitoring device to be networked and a terminal device respectively, the method includes: Determining configuration information based on an input operation of a user on the terminal device, the configuration information including a log file path of a signaling service and network address information of a media stream of the monitoring device to be connected to the network; Determining the registration and authentication status of the to-be-networked monitoring device according to the log file pointed to by the log file path includes: Searching for a first keyword in the log file pointed to by the log file path, and if the first keyword is not found, determining that the monitoring device to be connected to the network has not been registered and authenticated, the first keyword being used to represent unauthorized response information sent by the signaling service; If the first keyword is searched, searching the log file for a second keyword, where the second keyword is used to represent the registration request received by the signaling service; If the second keyword is not found in the search, it is determined that the registration and authentication of the monitoring device to be connected to the network has failed; if the second keyword is found in the search, it is determined that the registration and authentication of the monitoring device to be connected to the network has succeeded; If the registration and authentication is successful, a target instruction for acquiring the media stream of the monitoring device to be connected to the network is generated based on the network address information, and the target instruction is sent to the signaling service, so that the signaling service forwards the target instruction to the monitoring device to be connected to the network; Acquire data packets between the monitoring device to be connected to the network and the streaming media service, and determine whether the monitoring device to be connected to the network performs a streaming operation based on the acquisition result.
2. The method according to claim 1, characterized in that The network address information includes a real-time video preview address; The generating, based on the network address information, a target instruction for acquiring the media stream of the monitoring device to be connected to the network comprises: Using a specified instruction to call the video real-time preview address, generating a preview instruction for previewing the media stream of the monitoring device to be networked; After sending the target instruction to the signaling service, the method further includes: Searching for a third keyword in the log file of the signaling service, where the third keyword is used to indicate that the signaling service has received response information from the monitoring device to be connected to the network to the preview instruction; The response result of the monitoring device to be connected to the network to the preview instruction is determined according to the search result.
3. The method according to claim 1, characterized in that The network address information includes a video playback address; The target instruction of simulating and obtaining the media stream of the monitoring device to be connected to the network based on the network address information includes: Using a specified instruction to call the video playback address, generating a video playback instruction for obtaining the media stream of the monitoring device to be networked; After sending the target instruction to the signaling service, the method further includes: Searching for a fourth keyword in the log file of the signaling service, where the fourth keyword is used to indicate that the signaling service has received response information of the monitoring device to be connected to the network to the video playback instruction; The response result of the monitoring device to be connected to the network to the video playback instruction is determined according to the search result.
4. The method according to claim 1, wherein The configuration information further includes a service name of the signaling service and a service name of the streaming service, and the method further includes: Obtaining process information that matches the service name of the signaling service to determine the startup status of the signaling service; Acquire process information that matches the service name of the streaming media service to determine the startup status of the streaming media service.
5. The method according to claim 1, wherein The configuration information also includes a port number opened by the signaling service, and the method further includes: Detecting the open state of the port corresponding to the port number in the signaling service.
6. The method according to any one of claims 1 to 5, characterized in that: The terminal device has a display screen, and the method further includes: Sending prompt information to the terminal device so that the terminal device displays the prompt information on the display screen, wherein the prompt information is used to indicate the fault detection result.
7. A fault detection device, characterized in that: Applied to a video surveillance networking system, the video surveillance networking system includes a signaling server and a streaming media server, the video surveillance networking system is connected to the monitoring device to be networked and the terminal device respectively, the device includes: An acquiring unit, configured to determine configuration information based on an input operation of a user on the terminal device, the configuration information including a log file path of a signaling service and network address information of a media stream of the monitoring device to be connected to the network; a detection unit, configured to determine, based on the log file pointed to by the log file path, a registration and authentication status of the monitoring device to be connected to the network, specifically to: search for a first keyword in the log file pointed to by the log file path; if the first keyword is not found, determining that the monitoring device to be connected to the network has not been registered and authenticated, the first keyword being used to indicate unauthorized response information sent by the signaling service; If the first keyword is searched, searching the log file for a second keyword, where the second keyword is used to represent the registration request received by the signaling service; If the second keyword is not found in the search, it is determined that the registration and authentication of the monitoring device to be connected to the network has failed; if the second keyword is found in the search, it is determined that the registration and authentication of the monitoring device to be connected to the network has succeeded; The simulation unit is configured to generate, based on the network address information, a target instruction for acquiring the media stream of the monitoring device to be connected to the network when the registration and authentication are successful, and send the target instruction to the signaling service so that the signaling service forwards the target instruction to the monitoring device to be connected to the network; The detection unit is further configured to obtain data packets between the monitoring device to be connected to the network and the streaming media service, and determine whether the monitoring device to be connected to the network performs a streaming operation based on the acquisition result.
8. A fault detection platform, characterized in that: The platform includes a video surveillance networking system, monitoring equipment to be networked and terminal equipment, and the video surveillance networking system includes a signaling server and a streaming media server; The terminal device receives configuration information input by the user, wherein the configuration information includes a log file path of the signaling service and network address information for obtaining a media stream of the monitoring device to be connected to the network; The video surveillance networking system determines the registration and authentication status of the monitoring device to be networked according to the log file pointed to by the log file path, including: Searching for a first keyword in the log file pointed to by the log file path, and if the first keyword is not found, determining that the monitoring device to be connected to the network has not been registered and authenticated, the first keyword being used to represent unauthorized response information sent by the signaling service; If the first keyword is searched, searching the log file for a second keyword, where the second keyword is used to represent the registration request received by the signaling service; If the second keyword is not found in the search, it is determined that the registration and authentication of the monitoring device to be connected to the network has failed; if the second keyword is found in the search, it is determined that the registration and authentication of the monitoring device to be connected to the network has succeeded; When the registration and authentication are successful, the video surveillance networking system generates a target instruction for acquiring the media stream of the monitoring device to be networked based on the network address information, and sends the target instruction to the signaling service, so that the signaling service forwards the target instruction to the monitoring device to be networked; The video surveillance networking system obtains data packets between the monitoring device to be connected to the network and the streaming media service, and determines whether the monitoring device to be connected to the network performs a streaming operation based on the acquisition result.
9. A computing device, characterized in that include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 6 by running the executable instructions.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Malfunction elimination method and device based on video of things
CN108881895A
Controller, control program, and control method
JP2009177513A